NET_PACKET_LAYOUT structure

Warning

Some information in this topic relates to prereleased product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

NetAdapterCx is preview only in Windows 10, version 1903.

A NET_PACKET_LAYOUT structure describes the start of each protocol header in a NET_PACKET.

Syntax

typedef struct _NET_PACKET_LAYOUT {
  UINT8  Layer2Type : 4;
  UINT8  Layer3Type : 4;
  UINT8  Layer4Type : 4;
  UINT16 Layer2HeaderLength : 7;
  UINT16 Layer3HeaderLength : 9;
  UINT8  Layer4HeaderLength : 8;
  UINT8  Reserved0 : 4;
} NET_PACKET_LAYOUT;

Members

Layer2Type

An enumeration that specifies a flag from NET_PACKET_LAYER2_TYPE.

typedef enum _NET_PACKET_LAYER2_TYPE
{
    NET_PACKET_LAYER2_TYPE_UNSPECIFIED                  = 0,
    NET_PACKET_LAYER2_TYPE_NULL                         = 1,
    NET_PACKET_LAYER2_TYPE_ETHERNET                     = 2,
} NET_PACKET_LAYER2_TYPE;

Layer3Type

An enumeration that specifies a flag from NET_PACKET_LAYER3_TYPE.

typedef enum _NET_PACKET_LAYER3_TYPE
{
    NET_PACKET_LAYER3_TYPE_UNSPECIFIED                  = 0,
    NET_PACKET_LAYER3_TYPE_IPV4_UNSPECIFIED_OPTIONS     = 1,
    NET_PACKET_LAYER3_TYPE_IPV4_WITH_OPTIONS            = 2,
    NET_PACKET_LAYER3_TYPE_IPV4_NO_OPTIONS              = 3,
    NET_PACKET_LAYER3_TYPE_IPV6_UNSPECIFIED_EXTENSIONS  = 4,
    NET_PACKET_LAYER3_TYPE_IPV6_WITH_EXTENSIONS         = 5,
    NET_PACKET_LAYER3_TYPE_IPV6_NO_EXTENSIONS           = 6,
} NET_PACKET_LAYER3_TYPE;

Layer4Type

An enumeration that specifies a flag from NET_PACKET_LAYER4_TYPE.

typedef enum _NET_PACKET_LAYER4_TYPE
{
    NET_PACKET_LAYER4_TYPE_UNSPECIFIED                  = 0,
    NET_PACKET_LAYER4_TYPE_TCP                          = 1,
    NET_PACKET_LAYER4_TYPE_UDP                          = 2,
    NET_PACKET_LAYER4_TYPE_IP_NOT_FRAGMENTED            = 3,
    NET_PACKET_LAYER4_TYPE_IP_FRAGMENT                  = 4,
} NET_PACKET_LAYER4_TYPE;

Layer2HeaderLength

The length in bytes of the Layer 2 header, or zero if the Layer 2 length is unknown.

Layer3HeaderLength

The length in bytes of the Layer 3 header, or zero if the Layer 3 length is unknown.

Layer4HeaderLength

The length of the Layer 4 header, or zero if the Layer 4 length is unknown.

Reserved0

Reserved for system use.

Remarks

For more info about using this structure, see the Layout member of NET_PACKET.

Requirements

   
Minimum KMDF version 1.29
Header packet.h