阅读:1606回复:2
得到了IP头,得到了源和目的地址,却得不到协议类型
void GetPacketContent(PVOID pvBuffer)
{ PIPHeader pIPHd; PETHeader pETHd; pETHd = (PETHeader)pvBuffer; pIPHd = (PIPHeader)((PCHAR)pvBuffer + sizeof(ETHeader)); if(pETHd->type==0x8)) { DBGPRINT(("TCP packet%c",pIPHd->ipProtocol)); DBGPRINT(("Packet Source Address:%d.%d.%d.%d\n",pIPHd->ipSource<<24>>24,pIPHd->ipSource<<16>>24,\ pIPHd->ipSource<<8>>24,pIPHd->ipSource>>24)); DBGPRINT(("Packet Destination Address:%d.%d.%d.%d\n",pIPHd->ipDestination<<24>>24,pIPHd->ipDestination<<16>>24,\ pIPHd->ipDestination<<8>>24,pIPHd->ipDestination>>24)); } } 第一句得到的结果是0x11,正确的应该是0x6,下面的都是正确的 |
|
|
沙发#
发布于:2008-06-12 21:13
原来是udp,谢谢楼上的
|
|
|
板凳#
发布于:2008-06-11 21:40
0x11是UDP,不行吗?
|
|