]> sjero.net Git - dccp2tcp/blobdiff - dccp2tcp.h
Split out the Ethernet/IPv4 encapsulation
[dccp2tcp] / dccp2tcp.h
index 6c08d2839d51372711a5f544cb8039066a898811..3395339bb82e0371a25cadf79eca2e2eed77e02c 100644 (file)
@@ -1,13 +1,13 @@
 /******************************************************************************
 Author: Samuel Jero
 
-Date: 2/2011
+Date: 4/2011
 
 Description: Header file for program to convert a DCCP flow to a TCP flow for DCCP
                 analysis via tcptrace.
 
 Notes:
-       1)Supports only a single DCCP contection per capture
+       1)Supports only a single DCCP connection per capture
        2)Source Port!=Destination Port
        3)DCCP MUST use 48 bit sequence numbers
        4)Checksums are not computed (they are zeroed)
@@ -44,7 +44,7 @@ Notes:
 
 
 #define MAX_PACKET     1600    /*Maximum size of TCP packet */
-#define        TBL_SZ          10000   /*Size of Sequence Number Table*/
+#define        TBL_SZ          40000   /*Size of Sequence Number Table*/
 
 
 
@@ -58,15 +58,15 @@ struct seq_num{
 
 /*sequence number table structure */
 struct tbl{
-       __be32          old;    /*DCCP sequence number */
-       u_int32_t       new;    /*TCP sequence number */
-       int             size;           /*packet size*/
-       enum dccp_pkt_type type; /*packet type*/
+       __be32                          old;    /*DCCP sequence number */
+       u_int32_t                       new;    /*TCP sequence number */
+       int                                     size;   /*packet size*/
+       enum dccp_pkt_type      type;   /*packet type*/
 };
 
 /*Option flags*/
 extern int debug;              /*set to 1 to turn on debugging information*/
-extern int yellow;     /*tcptrace yellow line as currently acked packet*/
+extern int yellow;             /*tcptrace yellow line as currently acked packet*/
 extern int green;              /*tcptrace green line as currently acked packet*/
 extern int sack;               /*add TCP SACKS*/
 
@@ -83,5 +83,11 @@ extern struct seq_num        *s2;    /*sequence number structure for side two of connectio
  */
 void dbgprintf(int level, const char *fmt, ...);
 
+/* Encapsulation functions*/
+int eth_ip_encap_pre(struct pcap_pkthdr *h, u_char **nptr, int *nlength, const u_char **optr, int *length);
+int eth_ip_encap_post(struct pcap_pkthdr *h, u_char** nptr, int *nlength);
+
+/*The Conversion Function*/
+void convert_packet(struct pcap_pkthdr *h, u_char **ndata, int *nlength, const u_char **odata, int *length);
 
 #endif