次の方法で共有


NDIS_PER_PACKET_INFO_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_PER_PACKET_INFO_FROM_PACKET returns a pointer to a specific type of per-packet information associated with a packet descriptor.

Syntax

PVOID NDIS_PER_PACKET_INFO_FROM_PACKET(
  _Inout_ PNDIS_PACKET         Packet,
  _In_    NDIS_PER_PACKET_INFO InfoType
);

Parameters

  • Packet [in, out]
    Pointer to a packet descriptor.

  • InfoType [in]
    Specifies, as one of the following values, the specific type of per-packet information to which this macro returns a pointer:

    • TcpIpChecksumPacketInfo
      Specifies checksum information used in offloading checksum tasks from the TCP/IP transport to a miniport driver. When this InfoType value is specified, the macro returns a NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure. This structure contains a union that allows the checksum information to be accessed as a single ULONG value or as bit fields.

    • IpSecPacketInfo
      Specifies Internet Protocol security (IPsec) information used in offloading IPsec tasks from the TCP/IP transport to a miniport driver. When this InfoType value is specified, the macro returns a pointer to an NDIS_IPSEC_PACKET_INFO structure.

    • TcpLargeSendPacketInfo
      Specifies information used in offloading the segmentation of a large TCP packet from the TCP/IP transport to a miniport driver. When this InfoType is specified, the macro returns 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
      Specifies information used in a DMA operation. When this InfoType is specified, the macro returns a pointer to a SCATTER_GATHER_LIST structure. This structure 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
      Specifies 802.1Q information about a packet. When this InfoType is specified, the macro returns the Value member of an NDIS_PACKET_8021Q_INFO structure. This structure can specify 802.1p priority and VLAN identifier information. 802.1p priority information is used to establish packet priority in shared-media 802 networks. A driver can use NDIS_PER_PACKET_INFO_FROM_PACKET with this InfoType value to either retrieve 802.1Q information from the packet descriptor or insert 802.1Q information into the packet descriptor. For more information, see Packet Support for 802.1Q.

    • OriginalPacketInfo
      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. If this InfoType value is specified, the macro returns a pointer to an NDIS_PACKET structure. A driver uses NDIS_PER_PACKET_INFO_FROM_PACKET with this InfoType value to either retrieve or insert this original-packet information. Using this method of inserting or retrieving, each driver in a layered stack of NDIS drivers 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.

    • NextPacketInfo
      Specifies a pointer to an NDIS_PACKET structure. This structure is the packet descriptor of the next packet in a linked list of packets. A value of NULL indicates that there is no next packet in the linked list.

Return value

NDIS_PER_PACKET_INFO_FROM_PACKET returns a pointer to the per-packet information specified by InfoType, or it returns NULL if there is no such per-packet information for the packet.

Remarks

A protocol or miniport driver should call this macro when it needs to examine and/or set only a single type of per-packet information--such as checksum information or IPsec information--for a packet. If the driver needs to access more than one type of per-packet information for a packet, it can call NDIS_PER_PACKET_INFO_FROM_PACKET once for each type of data it needs to access. Alternatively, drivers can call the NDIS_PACKET_EXTENSION_FROM_PACKET macro to obtain a pointer to the NDIS_PACKET_EXTENSION structure associated with a given packet descriptor.

Requirements

Target platform

Desktop

Header

Ndis.h (include Ndis.h)

IRQL

Any level

See also

NDIS_IPSEC_PACKET_INFO

NdisMInitializeScatterGatherDma

NDIS_PACKET_8021Q_INFO

NDIS_PACKET_EXTENSION

NDIS_PACKET_EXTENSION_FROM_PACKET

NDIS_TCP_IP_CHECKSUM_PACKET_INFO

SCATTER_GATHER_LIST

 

 

Send comments about this topic to Microsoft