00001 struct tcp_s { 00002 u_int16_t th_sport; /* source port number */ 00003 u_int16_t th_dport; /* dest port num */ 00004 u_int32_t th_seq; /* sequence number */ 00005 u_int32_t th_ack; /* acknowledgement number */ 00006 u_int8_t th_hlen_reserved; /* combined header len & reserved bits*/ 00007 u_int8_t th_flag; /* flags */ 00008 u_int16_t th_win; /* window size */ 00009 u_int16_t th_chksum; /* checksum */ 00010 u_int16_t th_urgptr; /* urgent pointer */ 00011 }; 00012 00013 //TCP Flags 00014 #define TCP_FIN 0x01 00015 #define TCP_SYN 0x02 00016 #define TCP_RST 0x04 00017 #define TCP_PUSH 0x08 00018 #define TCP_ACK 0x10 00019 #define TCP_URG 0x20