NET_PACKET_LAYOUT structure (packet.h)

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

Syntax

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

Members

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.

Layer2Type

An enumeration that specifies a flag from NET_PACKET_LAYER2_TYPE.

typedef enum _NET_PACKET_LAYER2_TYPE
{
    NetPacketLayer2TypeUnspecified,
    NetPacketLayer2TypeNull,
    NetPacketLayer2TypeEthernet,
} NET_PACKET_LAYER2_TYPE;

Layer3Type

An enumeration that specifies a flag from NET_PACKET_LAYER3_TYPE.

typedef enum _NET_PACKET_LAYER3_TYPE
{
    NetPacketLayer3TypeUnspecified,
    NetPacketLayer3TypeIPv4UnspecifiedOptions,
    NetPacketLayer3TypeIPv4WithOptions,
    NetPacketLayer3TypeIPv4NoOptions,
    NetPacketLayer3TypeIPv6UnspecifiedExtensions,
    NetPacketLayer3TypeIPv6WithExtensions,
    NetPacketLayer3TypeIPv6NoExtensions,
} NET_PACKET_LAYER3_TYPE;

Layer4Type

An enumeration that specifies a flag from NET_PACKET_LAYER4_TYPE.

typedef enum _NET_PACKET_LAYER4_TYPE
{
    NetPacketLayer4TypeUnspecified,
    NetPacketLayer4TypeTcp,
    NetPacketLayer4TypeUdp,
    NetPacketLayer4TypeIPFragment,
    NetPacketLayer4TypeIPNotFragment,
} NET_PACKET_LAYER4_TYPE;

Reserved0

Reserved for system use.

Remarks

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

Requirements

Requirement Value
Minimum KMDF version 1.29
Minimum UMDF version 2.33
Header packet.h