阅读:1768回复:1
PtReceivePacket 问题,高手请进!
需要在PtReceivePacket 对接收的数据包进行重新处理,是在passthru架构下处理的!但是在PtreceivePacket中 针对 NDIS51如何对数据包进行处理呢? 也就是针对下面一块如何处理呢? ...
#ifdef NDIS51 // // Check if we can reuse the same packet for indicating up. // See also: PtReceive(). // (VOID)NdisIMGetCurrentPacketStack(Packet, &Remaining); if (Remaining) { // // We can reuse "Packet". Indicate it up and be done with it. // Status = NDIS_GET_PACKET_STATUS(Packet); NdisMIndicateReceivePacket(pAdapt->MiniportHandle, &Packet, 1); return((Status != NDIS_STATUS_RESOURCES) ? 1 : 0); } #endif // NDIS51 |
|
沙发#
发布于:2010-03-08 23:14
PNDIS_BUFFER PNdisBuf;
PETHER_HEADER PEtherHeader; //自己定义的结构 PVOID Buffer; UINT BufLen; PNdisBuf = MyPacket->Private.Head; NdisQueryBufferSafe(PNdisBuf, &Buffer, &BufLen, 16); PEtherHeader = (PETHER_HEADER)Buffer; switch(ntohs(PEtherHeader->Type)) { case 0x0806: //ARP DbgPrint("ARP: "); break; case 0x0800: //IP DbgPrint("IP: "); break; } DbgPrint("Packet len: %d.\n", BufLen); DbgPrint("%02X-%02X-%02X-%02X-%02X-%02X -> %02X-%02X-%02X-%02X-%02X-%02X\n", PEtherHeader->SrcMAC[0], PEtherHeader->SrcMAC[1], PEtherHeader->SrcMAC[2], PEtherHeader->SrcMAC[3], PEtherHeader->SrcMAC[4], PEtherHeader->SrcMAC[5], PEtherHeader->DstMAC[0], PEtherHeader->DstMAC[1], PEtherHeader->DstMAC[2], PEtherHeader->DstMAC[3], PEtherHeader->DstMAC[4], PEtherHeader->DstMAC[5]); |
|