NDIS_PACKET_EXTENSION_FROM_PACKET function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NDIS_PACKET_EXTENSION_FROM_PACKET returns a pointer to the NDIS_PACKET_EXTENSION structure associated with a packet descriptor.

Syntax

PNDIS_PACKET_EXTENSION NDIS_PACKET_EXTENSION_FROM_PACKET(
  _In_ PNDIS_PACKET Packet
);

Parameters

  • Packet [in]
    Pointer to a packet descriptor.

Return value

NDIS_PACKET_EXTENSION_FROM_PACKET returns a pointer to the NDIS_PACKET_EXTENSION structure associated with the given packet descriptor..

Remarks

The NDIS_PACKET_EXTENSION structure contains an array of PVOIDS, each of which either points to or contains a specific type of per-packet information. After obtaining the pointer to the NDIS_PACKET_EXTENSION structure, the driver can use the appropriate array index to access a particular type of per-packet information.

A protocol or miniport driver should call this macro when it needs to read and/or write more than one type of per-packet information associated with a packet descriptor. If the driver needs to access just one type of per-packet information, it should call the NDIS_PER_PACKET_INFO_FROM_PACKET macro.

After obtaining the pointer to the NDIS_PACKET_EXTENSION structure returned by NDIS_PACKET_EXTENSION_FROM_PACKET, a driver can use one of the following array indexes to access a particular type of per-packet information:

TcpIpChecksumPacketInfo

Indexes an NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure (not a pointer to the structure). This structure specifies per-packet information for checksum operations offloaded to a miniport driver.

IpSecPacketInfo

Indexes a pointer to an NDIS_IPSEC_PACKET_INFO structure. This structure specifies per-packet information for Internet Protocol security operations offloaded to a miniport driver.

TcpLargeSendPacketInfo

Indexes a ULONG value (not a pointer to the ULONG value). Before passing a large TCP packet to a miniport driver for segmentation, the TCP/IP transport writes this value with the maximum segment size (MSS), which is the current maximum transmission unit (MTU). Before completing the send of a large TCP packet that it has segmented into smaller packets, a miniport driver writes this value with the total number of user data bytes that it sent in the packets segmented from the large TCP packet.

ClassificationHandlePacketInfo

This is reserved.

ScatterGatherListPacketInfo

Indexes a pointer to a SCATTER_GATHER_LIST structure, which specifies the mapped logical address ranges of buffers containing DMA data for a packet. A miniport driver that reserves system resources for DMA operations by calling NdisMInitializeScatterGatherDma supplies the obtained logical address ranges to its NIC so that the NIC can perform a DMA transfer.

Ieee8021QInfo

Indexes the Value member of an NDIS_PACKET_8021Q_INFO structure, which specifies 802.1p priority and VLAN identifier information. 802.1p priority information is used to establish packet priority in shared-media 802 networks. VLAN identifier information identifies the VLAN to which a packet belongs.

For more information, see 802.1Q Packet Information.

OriginalPacketInfo

Indexes a pointer to a NDIS_PACKET structure. This structure specifies a packet descriptor that contains original information that was previously received over the network and indicated up by the lowest-level driver in a stack of NDIS drivers. Each driver in the layered stack can access the out-of-band (OOB) data block that is associated with the packet that is received from the network without requiring that the packet be copied to each layer.

Requirements

Target platform

Desktop

Header

Ndis.h (include Ndis.h)

IRQL

Any level

See also

NdisMInitializeScatterGatherDma

NDIS_PACKET_8021Q_INFO

NDIS_PACKET_EXTENSION

NDIS_PER_PACKET_INFO_FROM_PACKET

NDIS_IPSEC_PACKET_INFO

NDIS_TCP_IP_CHECKSUM_PACKET_INFO

SCATTER_GATHER_LIST

 

 

Send comments about this topic to Microsoft