Querying a Packet's Extensible Switch Destination Port Data

Each Hyper-V extensible switch destination port is specified by an NDIS_SWITCH_PORT_DESTINATION element within the NDIS_SWITCH_FORWARDING_DESTINATION_ARRAY structure. This array is contained in the out-of-band (OOB) forwarding context of the packet's NET_BUFFER_LIST structure. For more information on this context, see Hyper-V Extensible Switch Forwarding Context.

The extensible switch extension calls the GetNetBufferListDestinations function to obtain a pointer to the NDIS_SWITCH_FORWARDING_DESTINATION_ARRAY structure within a packet's NET_BUFFER_LIST structure. Individual NDIS_SWITCH_PORT_DESTINATION elements within this structure can be accessed by using the NDIS_SWITCH_PORT_DESTINATION_AT_ARRAY_INDEX macro.

To improve performance, a forwarding extension can call the GrowNetBufferListDestinations function instead of GetNetBufferListDestinations to obtain a pointer to the NDIS_SWITCH_FORWARDING_DESTINATION_ARRAY structure. The extension does this if it determines that it needs additional array elements in the packet's OOB data for destination ports. For more information, see Adding Extensible Switch Destination Port Data to a Packet.

Note  Only packets obtained from the extensible switch egress data path will contain destination port information. For more information, see Hyper-V Extensible Switch Data Path.