tcp/ip协议编写本帖最后由 aoqqq 于 2013-08-23 17:54:35 编辑 看别人写的,在Ether结构体中的协议类型,为什么要经过下面转换呢,不可以直接赋给他吗?
#define swapB2(a) ((a << 8 & 0xff00) \ |(a >> 8 & 0x00ff))#define IP 0x0800 //代表是上层是ipUint16 EtherPro;EtherPro=swapB2(IP);