_NDIS_SWITCH_OPTIONAL_HANDLERS structure

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_OPTIONAL_HANDLERS, *PNDIS_SWITCH_OPTIONAL_HANDLERS;

Members

        `AddNetBufferListDestination`

        A pointer to the <a href="https://msdn.microsoft.com/6B8CD868-D2F4-4892-BF6D-DFD7A3984320">AddNetBufferListDestination</a> function.

        `AllocateNetBufferListForwardingContext`

        A pointer to the <a href="https://msdn.microsoft.com/C8A80DB2-4273-4FBA-82D4-4E8146812B16">AllocateNetBufferListForwardingContext</a> function.

        `CopyNetBufferListInfo`

        A pointer to the <a href="https://msdn.microsoft.com/5CC345FA-C3EF-4122-8E9C-6EA27B20DD5A">CopyNetBufferListInfo</a> function.

        `DereferenceSwitchNic`

        A pointer to the <a href="https://msdn.microsoft.com/58C72F81-07B9-45FE-A8BA-0405DBE4CA20">DereferenceSwitchNic</a> function.

        `DereferenceSwitchPort`

        A pointer to the <a href="https://msdn.microsoft.com/976D3A69-C539-4C8E-9664-F85717E5F712">DereferenceSwitchPort</a> function.

        `FreeNetBufferListForwardingContext`

        A pointer to the <a href="https://msdn.microsoft.com/08AE3160-276F-4D1F-9D02-AD5AF38CDED2">FreeNetBufferListForwardingContext</a> function.

        `GetNetBufferListDestinations`

        A pointer to the <a href="https://msdn.microsoft.com/55B5C0B4-5359-410B-9110-79EDDBA3010C">GetNetBufferListDestinations</a> function.

        `GrowNetBufferListDestinations`

        A pointer to the <a href="..\ndis\nc-ndis-ndis_switch_grow_net_buffer_list_destinations.md">GrowNetBufferListDestinations</a> function.

        `Header`

        The type, revision, and size of the <b>NDIS_SWITCH_OPTIONAL_HANDLERS</b> structure. This member is formatted as an <a href="..\ntddndis\ns-ntddndis-_ndis_object_header.md">NDIS_OBJECT_HEADER</a> 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:

        `ReferenceSwitchNic`

        A pointer to the <a href="https://msdn.microsoft.com/8F4C76FA-A386-4A3D-8C9F-3CFF69382702">ReferenceSwitchNic</a> function.

        `ReferenceSwitchPort`

        A pointer to the <a href="https://msdn.microsoft.com/5FD2E931-AC9F-4157-9C45-F93261FC834D">ReferenceSwitchPort</a> function.

        `ReportFilteredNetBufferLists`

        A pointer to the <a href="..\ndis\nc-ndis-ndis_switch_report_filtered_net_buffer_lists.md">ReportFilteredNetBufferLists</a> function.

        `SetNetBufferListSource`

        A pointer to the <a href="..\ndis\nc-ndis-ndis_switch_set_net_buffer_list_source.md">SetNetBufferListSource</a> function.

        `UpdateNetBufferListDestinations`

        A pointer to the <a href="https://msdn.microsoft.com/9A740524-0FC1-4585-8059-F678D4777F66">UpdateNetBufferListDestinations</a> function.

## 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.

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

   
Windows Driver kit version
Minimum KMDF version
Minimum UMDF version
Header ndis.h (include Ndis.h)
## See Also

    <dl>

AddNetBufferListDestination
AllocateNetBufferListForwardingContext
CopyNetBufferListInfo
DereferenceSwitchNic
DereferenceSwitchPort
FilterAttach
FreeNetBufferListForwardingContext
GrowNetBufferListDestinations
NDIS_OBJECT_HEADER
NdisFGetOptionalSwitchHandlers
NET_BUFFER_LIST
ReferenceSwitchNic
ReferenceSwitchPort
ReportFilteredNetBufferLists
SetNetBufferListSource
UpdateNetBufferListDestinations

Send comments about this topic to Microsoft