/******************************************************************************
-Author: Samuel Jero
+Utility to convert a DCCP flow to a TCP flow for DCCP analysis via
+ tcptrace. Encapsulation Functions for DCCP conversion to TCP.
-Date: 11/2012
+Copyright (C) 2012 Samuel Jero <sj323707@ohio.edu>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
-Description: Encapsulation Functions for DCCP conversion to TCP
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+Author: Samuel Jero <sj323707@ohio.edu>
+Date: 11/2012
******************************************************************************/
#include "dccp2tcp.h"
#include "encap.h"
+#include "checksums.h"
#include <pcap/sll.h>
#include <netinet/ip6.h>
}
/*Adjust IPv6 header to account for packet's total length*/
- iph->ip6_ctlun.ip6_un1.ip6_un1_plen=htons(new->length);
+ iph->ip6_ctlun.ip6_un1.ip6_un1_plen=htons(nnew.length);
/*Adjust length*/
new->length=nnew.length + sizeof(struct ip6_hdr);
/*Adjust IPv4 header to account for packet's total length*/
iph->tot_len=htons(new->length);
+ /*Compute IPv4 Checksum*/
+ iph->check=0;
+ iph->check=ipv4_chksum(new->data,iph->ihl*4);
+
/*Cleanup*/
free(nnew.src_id);
free(nnew.dest_id);