以下结构载自:linux-2.6.20.4\linux-2.6.20.4\include\linux\tcp.h
struct tcphdr {
__be16 source;
__be16 dest;
__be32 seq;
__be32 ack_seq;
#if defined(__LITTLE_ENDIAN_BITFIELD) /*小端模式*/
__u16 res1:4, /*对一个大小为16位单元,即两个字节的细致定义*/
doff:4, /*小端则数据的高位存储在内存的低位,每一位(bit)都是如此*/
fin:1,
syn:1,
rst:1,
psh:1,
ack:1,
urg:1,
ece:1,
cwr:1;
#elif defined(__BIG_ENDIAN_BITFIELD) /*大端模式*/
__u16 doff:4,
res1:4,
cwr:1,
ece:1,
urg:1,
ack:1,
psh:1,
rst:1,
syn:1,
fin:1;
#else
#error "Adjust your
defines"
#endif
__be16 window;
__sum16 check;
__be16 urg_ptr;
};
阅读(2354) | 评论(0) | 转发(0) |