阅读:1185回复:0
很奇怪的现象,大家看看!
在中间层这样定义:
#define k_ntohs(a) (((a)>>8)&0xff)|(((a)<<8)&0xff00) #define k_htons(a) k_ntohs(a) tcplen = k_htons(pIPHeader->ip_totallength) - iphdrlen;这样出来的结果(tcplen==FFEC)是错误的。 但是这样 tcplen = k_htons(pIPHeader->ip_totallength); tcplen = tcplen - iphdrlen;结果(tcplen==0x14)是正确的,为什么? 其中pIPHeader>ip_totallength = 0x2800; iphdrlen =0x14; 而且在协议层分别执行的话结果都是对的。??? |
|
|