NDIS_SWITCH_OPTIONAL_HANDLERS structure (ndis.h)

The NDIS_SWITCH_OPTIONAL_HANDLERS structure specifies the pointers to the Hyper-V extensible switch handler functions. These functions can be called by an extensible switch extension.

Syntax

typedef struct _NDIS_SWITCH_OPTIONAL_HANDLERS {
  NDIS_OBJECT_HEADER                                              Header;
  NDIS_SWITCH_ALLOCATE_NET_BUFFER_LIST_FORWARDING_CONTEXT_HANDLER AllocateNetBufferListForwardingContext;
  NDIS_SWITCH_FREE_NET_BUFFER_LIST_FORWARDING_CONTEXT_HANDLER     FreeNetBufferListForwardingContext;
  NDIS_SWITCH_SET_NET_BUFFER_LIST_SOURCE_HANDLER                  SetNetBufferListSource;
  NDIS_SWITCH_ADD_NET_BUFFER_LIST_DESTINATION_HANDLER             AddNetBufferListDestination;
  NDIS_SWITCH_GROW_NET_BUFFER_LIST_DESTINATIONS_HANDLER           GrowNetBufferListDestinations;
  NDIS_SWITCH_GET_NET_BUFFER_LIST_DESTINATIONS_HANDLER            GetNetBufferListDestinations;
  NDIS_SWITCH_UPDATE_NET_BUFFER_LIST_DESTINATIONS_HANDLER         UpdateNetBufferListDestinations;
  NDIS_SWITCH_COPY_NET_BUFFER_LIST_INFO_HANDLER                   CopyNetBufferListInfo;
  NDIS_SWITCH_REFERENCE_SWITCH_NIC_HANDLER                        ReferenceSwitchNic;
  NDIS_SWITCH_DEREFERENCE_SWITCH_NIC_HANDLER                      DereferenceSwitchNic;
  NDIS_SWITCH_REFERENCE_SWITCH_PORT_HANDLER                       ReferenceSwitchPort;
  NDIS_SWITCH_DEREFERENCE_SWITCH_PORT_HANDLER                     DereferenceSwitchPort;
  NDIS_SWITCH_REPORT_FILTERED_NET_BUFFER_LISTS_HANDLER            ReportFilteredNetBufferLists;
  NDIS_SWITCH_SET_NET_BUFFER_LIST_SWITCH_CONTEXT_HANDLER          SetNetBufferListSwitchContext;
  NDIS_SWITCH_GET_NET_BUFFER_LIST_SWITCH_CONTEXT_HANDLER          GetNetBufferListSwitchContext;
  PVOID                                                           SwitchPDReserved[NDIS_SWITCH_OPTIONAL_HANDLERS_PD_RESERVED_SIZE];
} NDIS_SWITCH_OPTIONAL_HANDLERS, *PNDIS_SWITCH_OPTIONAL_HANDLERS;

Members

Header

The type, revision, and size of the NDIS_SWITCH_OPTIONAL_HANDLERS structure. This member is formatted as an NDIS_OBJECT_HEADER structure.

The Type member of Header must be set to NDIS_OBJECT_TYPE_DEFAULT. To specify the version of the NDIS_SWITCH_OPTIONAL_HANDLERS structure, the Revision member of Header must be set to the following value:

NDIS_SWITCH_OPTIONAL_HANDLERS_REVISION_1

Original version for NDIS 6.30 and later.

Set the Size member to NDIS_SIZEOF_NDIS_SWITCH_NIC_ARRAY_REVISION_1.

AllocateNetBufferListForwardingContext

A pointer to the AllocateNetBufferListForwardingContext function.

FreeNetBufferListForwardingContext

A pointer to the FreeNetBufferListForwardingContext function.

SetNetBufferListSource

A pointer to the SetNetBufferListSource function.

AddNetBufferListDestination

A pointer to the AddNetBufferListDestination function.

GrowNetBufferListDestinations

A pointer to the GrowNetBufferListDestinations function.

GetNetBufferListDestinations

A pointer to the GetNetBufferListDestinations function.

UpdateNetBufferListDestinations

A pointer to the UpdateNetBufferListDestinations function.

CopyNetBufferListInfo

A pointer to the CopyNetBufferListInfo function.

ReferenceSwitchNic

A pointer to the ReferenceSwitchNic function.

DereferenceSwitchNic

A pointer to the DereferenceSwitchNic function.

ReferenceSwitchPort

A pointer to the ReferenceSwitchPort function.

DereferenceSwitchPort

A pointer to the DereferenceSwitchPort function.

ReportFilteredNetBufferLists

A pointer to the ReportFilteredNetBufferLists function.

SetNetBufferListSwitchContext

GetNetBufferListSwitchContext

SwitchPDReserved[NDIS_SWITCH_OPTIONAL_HANDLERS_PD_RESERVED_SIZE]

Remarks

The extensible switch handler functions provide support for filtering and forwarding actions that are performed by an extensible switch extension. These actions include the following:

  • Allocate or free the forwarding context. This data is stored in the out-of-band (OOB) data of a packet's NET_BUFFER_LIST structure. For more information about the forwarding context, see Hyper-V Extensible Switch Forwarding Context.
  • Get or set the destination ports that are contained in a packet's forwarding context.
  • Add destination ports to a packet's forwarding context.

When the extensible switch extension calls NdisFGetOptionalSwitchHandlers, the NdisSwitchHandlers parameter contains a pointer to an NDIS_SWITCH_OPTIONAL_HANDLERS structure. An extensible switch extension typically calls NdisFGetOptionalSwitchHandlers from its FilterAttach function.

Requirements

Requirement Value
Minimum supported client Supported in NDIS 6.30 and later.
Header ndis.h (include Ndis.h)

See also

AddNetBufferListDestination

AllocateNetBufferListForwardingContext

CopyNetBufferListInfo

DereferenceSwitchNic

DereferenceSwitchPort

FilterAttach

FreeNetBufferListForwardingContext

GrowNetBufferListDestinations

NDIS_OBJECT_HEADER

NET_BUFFER_LIST

NdisFGetOptionalSwitchHandlers

ReferenceSwitchNic

ReferenceSwitchPort

ReportFilteredNetBufferLists

SetNetBufferListSource

UpdateNetBufferListDestinations