Поделиться через


NDIS_TCP_IP_CHECKSUM_PACKET_INFO (Compact 2013)

3/26/2014

This structure contains information that is used in offloading checksum tasks from the TCP/IP transport to a network adapter. The NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure is part of the per-packet information (extended out-of-band data) associated with a packet descriptor.

Syntax

typedef struct _NDIS_TCP_IP_CHECKSUM_PACKET_INFO {
union {
  struct { 
    ULONG NdisPacketChecksumV4:1;
    ULONG NdisPacketChecksumV6:1;
    ULONG NdisPacketTcpChecksum:1;
    ULONG NdisPacketUdpChecksum:1;
    ULONG NdisPacketIpChecksum:1;
  } Transmit;
  struct {
    ULONG NdisPacketTcpChecksumFailed:1;
    ULONG NdisPacketUdpChecksumFailed:1;
    ULONG NdisPacketIpChecksumFailed:1;
    ULONG NdisPacketTcpChecksumSucceeded:1;
    ULONG NdisPacketUdpChecksumSucceeded:1;
    ULONG NdisPacketIpChecksumSucceeded:1;
    ULONG NdisPacketLoopback:1;
  } Receive;
  ULONG Value;
};
} NDIS_TCP_IP_CHECKSUM_PACKET_INFO, *PNDIS_TCP_IP_CHECKSUM_PACKET_INFO;

Members

  • NdisPacketChecksumV4:1
    Set by the TCP/IP transport to indicate that the send packet contains IPv4 addresses. If the transport does not set NdisPacketChecksumV4, the miniport should not perform checksum tasks on the packet.
  • NdisPacketChecksumV6:1
    Set by the TCP/IP transport to indicate that the send packet contains IPv6 addresses.
  • NdisPacketTcpChecksum:1
    Set by the TCP/IP transport to indicate that the NETWORK ADAPTER should calculate the packet's TCP checksum.
  • NdisPacketUdpChecksum:1
    Set by the TCP/IP transport to indicate that the network adapter should calculate the packet's UDP checksum.
  • NdisPacketIpChecksum:1
    Set by the TCP/IP transport to indicate that the network adapter should calculate the IP checksum for the first IP header in the packet. If the packet contains both a tunnel IP header and a transport IP header, the network adapter should calculate the checksum for the tunnel IP header. The TCP/IP transport calculates the checksum for the transport IP header of such a packet.
  • NdisPacketTcpChecksumFailed:1
    Set by the miniport to indicate that the TCP checksum calculated by its network adapter did not match the checksum in the receive packet's TCP header.
  • NdisPacketUdpChecksumFailed:1
    Set by the miniport to indicate that the UDP checksum calculated by its network adapter did not match the checksum in the receive packet's UDP header.
  • NdisPacketIpChecksumFailed:1
    Set by the miniport to indicate that the IP checksum calculated by its network adapter did not match the checksum in the receive packet's first IP header. If the receive packet contains both a tunnel IP header and a transport IP header, the network adapter validates only the checksum for the tunnel IP header. The TCP/IP transport validates the checksum for the transport IP header of such a packet.
  • NdisPacketTcpChecksumSucceeded:1
    Set by the miniport to indicate that the TCP checksum calculated by its network adapter matched the checksum in the receive packet's TCP header.
  • NdisPacketUdpChecksumSucceeded:1
    Set by the miniport to indicate that the UDP checksum calculated by its network adapter matched the checksum in the receive packet's UDP header.
  • NdisPacketIpChecksumSucceeded:1
    Set by the miniport to indicate that the IP checksum calculated by its network adapter matched the checksum in the receive packet's first IP header. If the receive packet contains both a tunnel IP header and a transport IP header, the network adapter validates only the checksum for the tunnel IP header. The TCP/IP transport validates the checksum for the transport IP header of such a packet.
  • NdisPacketLoopback:1
    Set by the miniport to indicate that the receive packet is a loopback packet that NDIS has handled. The miniport, in this case, sets all the NdisPacketXXXChecksumSucceeded flags.
  • Value
    Checksum value

Remarks

The NDIS**_TCP_IP_CHECKSUM_PACKET_INFO** structure specifies information that is used in offloading checksum tasks from the TCP/IP transport to a network adapter. The NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure is part of the per-packet information (extended out-of-band data) associated with a packet descriptor.

Before the TCP/IP transport passes to the miniport a packet on which the miniport will perform checksum tasks, the TCP/IP transport updates the NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure associated with the packet descriptor. Specifically, the TCP/IP transport sets the NdisPacketChecksumV4 flag to indicate that the send packet contains IPv4 addresses. If the TCP/IP transport does not set this flag, the miniport should not perform checksum tasks on the packet. If the TCP/IP transport sets NdisPacketChecksumV4 flag, it also sets NdisPacketTcpChecksum and NdisPacketIpChecksum to indicate which checksums the miniport should calculate for the packet.

Before it indicates a receive packet on which it performs checksum tasks, a miniport sets the appropriate NdisPackeXXXChecksumFailed and NdisPacketXXXChecksumSucceeded flags in the NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure. If the packet is a loopback packet, the miniport sets the NdisPacketLoopback flag and all the NdisPacketXXXChecksumSucceeded flags.

To obtain a pointer to the NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure, a driver calls the NDIS_PER_PACKET_INFO_FROM_PACKET macro with an InfoType of TcpIpCheckSumPacketInfo. Or, a driver 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. The miniport can then use the TcpIpCheckSumPacketInfo array index to obtain a pointer to the NDIS_TCP_IP_CHECKSUM_PACKET_INFO structure.

Requirements

Header

ndis.h

See Also

Reference

NDIS 5.x Legacy Structures
NDIS_PER_PACKET_INFO_FROM_PACKET
NDIS_PACKET_EXTENSION_FROM_PACKET
NDIS_PACKET_EXTENSION