1 /* ICMP for IP v4 and v6 */
4 /* Packet Types, icmp v4 (rfc 792) */
22 /* packet types, icmp v6 (rfc 2463) */
30 /* informational messages (rfc 2461 also) */
44 typedef struct Ip4hdr Ip4hdr;
47 uchar vihl; /* Version and header length */
48 uchar tos; /* Type of service */
49 uchar length[2]; /* packet length */
50 uchar id[2]; /* Identification */
51 uchar frag[2]; /* Fragment information */
52 uchar ttl; /* Time to live */
53 uchar proto; /* Protocol */
54 uchar ipcksum[2]; /* Header checksum */
55 uchar src[4]; /* Ipv4 source */
56 uchar dst[4]; /* Ipv4 destination */
61 // #define IP4HDRSZ offsetof(Ip4hdr, data[0])
63 /* the icmp payload has the same format in v4 and v6 */
64 typedef struct Icmphdr Icmphdr;
74 // #define ICMPHDRSZ offsetof(Icmphdr, data[0])