include/linux/ip.h里的结构注释
1、ip头部
struct iphdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 ihl:4, // 报头长度
version:4; //版本
#elif defined (__BIG_ENDIAN_BITFIELD)
__u8 version:4, //版本
ihl:4; //报头长度
#else
#error "Please fix <asm/byteorder.h>"
#endif
__u8 tos; //服务类型
__be16 tot_len; //总长度
__be16 id; //标识符
__be16 frag_off; //段移位
__u8 ttl; //生存时间
__u8 protocol; //上层使用的协议
__u16 check; //校验和
__be32 saddr; //源ip地址
__be32 daddr; //目的ip地址
/*The options start here. */
};