// TCP IP header // Chaitanya Belwal struct IP_HEADER { u_char ip_hl; // Header Length -> Bytes = 1 u_char ip_v; // Version -> Bytes = 1 u_char ip_tos; // Type of service -> Bytes = 1 short ip_len; // Total length -> Bytes = 2 u_short ip_id; // Identification -> Bytes = 1 short ip_off; // Fragment Offset -> Bytes = 2 u_char ip_ttl; // Time to live -> Bytes = 1 u_char ip_p; // Protocol -> Bytes = 1 u_short ip_cksum; // Checksum -> Bytes = 2 struct in_addr ip_src; // Source Address -> Bytes = 4 struct in_addr ip_dst; // Destination Address -> Bytes = 4 }; struct TCP_HEADER { u_char tcp_sp; // SOURCE PORT -> Bytes = 2 u_char tcp_dp; // DESTINATION PORT -> Bytes = 2 u_char tcp_sn; // SEQUENCE NUMBER -> Bytes = 4 short tcp_an; // ACKNOWLEDGEMENT NUMBER -> Bytes = 4 u_short tcp_hl; // HEADER LENGTH -> Bytes = 1 short tcp_off; // FLAGS -> Bytes = 1 u_char tcp_win; // WINDOW -> Bytes = 2 u_char tcp_cksum; // CHECKSUM -> Bytes = 2 u_short tcp_up; // URGENT POINTER -> Bytes = 2 };