My Project
ip_hdr.h
1 #ifndef IP_HDR_H
2 #define IP_HDR_H
3 
4 /* IP header */
8 struct sniff_ip {
9  u_char ip_vhl;
10  u_char ip_tos;
11  u_short ip_len;
12  u_short ip_id;
13  u_short ip_off;
14  #define IP_RF 0x8000
15  #define IP_DF 0x4000
16  #define IP_MF 0x2000
17  #define IP_OFFMASK 0x1fff
18  u_char ip_ttl;
19  u_char ip_p;
20  u_short ip_sum;
21  struct in_addr ip_src,ip_dst;
22 };
23 #define IP_HL(ip) (((ip)->ip_vhl) & 0x0f)
24 #define IP_V(ip) (((ip)->ip_vhl) >> 4)
25 
26 #endif // IP_HDR_H
u_char ip_vhl
Definition: ip_hdr.h:9
u_short ip_off
Definition: ip_hdr.h:13
u_short ip_len
Definition: ip_hdr.h:11
u_char ip_tos
Definition: ip_hdr.h:10
u_short ip_id
Definition: ip_hdr.h:12
The sniff_ip struct defines the packet header of a tcp internet packet. Used to extract IP layer info...
Definition: ip_hdr.h:8