NDIS_GET_PACKET_HEADER_SIZE

UINT
   NDIS_GET_PACKET_HEADER_SIZE(
       IN PNDIS_PACKET Packet
       );

NDIS_GET_PACKET_HEADER_SIZE returns the HeaderSize value from the out-of-band data block associated with a given packet descriptor.

Parameters

Packet

Points to a packet descriptor.

Return Value

NDIS_GET_PACKET_HEADER_SIZE returns the value set in the HeaderSize member of the NDIS_PACKET_OOB_DATA block associated with the given packet descriptor.

Comments

The HeaderSize specifies the number of bytes of medium-specific header mapped by the initial buffer descriptor chained to the packet descriptor. A NIC driver sets this value with NDIS_SET_PACKET_HEADER_SIZE in the out-of-band data block for the receive packets it will indicate with NdisMIndicateReceivePacket. Typically, a NIC miniport sets the HeaderSize once in each packet descriptor it allocates with NdisAllocatePacket for subsequent receive indications, and the value it sets depends on the medium it selected during initialization.

An NDIS intermediate driver that translates indicated packets to another medium for still higher level protocols would use NDIS_SET_PACKET_HEADER to set the header size to a value appropriate to its own medium as it translates incoming receives.

Callers of NDIS_GET_PACKET_HEADER_SIZE run at IRQL <= DISPATCH_LEVEL.

See Also

MiniportInitialize, NdisAllocatePacket, NdisMIndicateReceivePacket, NDIS_OOB_DATA_FROM_PACKET, NDIS_PACKET_OOB_DATA, NdisSend, NdisSendPackets, NDIS_SET_PACKET_HEADER_SIZE