-/*sequence number structure--one per side of the connection */
-struct seq_num{
- int cur; /*current sequence number */
- __be16 addr; /*connection half id---source port */
- struct tbl *table; /*sequence number table */
- int size; /*sequence number table size */
+
+/*Packet structure*/
+struct packet{
+ struct pcap_pkthdr *h; /*libpcap header*/
+ u_char *data; /*Packet Data*/
+ int length; /*Packet length*/
+ uint32_t src_id; /*Source ID of packet*/
+ uint32_t dest_id; /*Destination ID of packet*/
+};
+
+/*Constant Packet structure*/
+struct const_packet{
+ const struct pcap_pkthdr *h; /*libpcap header*/
+ const u_char *data; /*Packet Data*/
+ int length; /*Packet length*/
+ uint32_t src_id; /*Source ID of packet*/
+ uint32_t dest_id;/*Destination ID of packet*/
+};
+
+/*Connection states*/
+enum con_state{
+ INIT,
+ OPEN,
+ CLOSE,
+};
+
+/*Host---half of a connection*/
+struct host{
+ uint32_t id; /*Host ID*/
+ __be16 port; /*Host DCCP port*/
+ struct tbl *table; /*Host Sequence Number Table*/
+ int size; /*Size of Sequence Number Table*/
+ int cur; /*Current TCP Sequence Number*/
+ enum con_state state; /*Connection state*/
+};
+
+/*Connection structure*/
+struct connection{
+ struct connection *next; /*List pointer*/
+ struct host A; /*Host A*/
+ struct host B; /*Host B*/