NDIS_SWITCH_SET_NET_BUFFER_LIST_SOURCE callback function (ndis.h)
The SetNetBufferListSource function sets the Hyper-V extensible switch source port identifier and network adapter index for a packet that is specified by a NET_BUFFER_LIST structure.
Syntax
NDIS_SWITCH_SET_NET_BUFFER_LIST_SOURCE NdisSwitchSetNetBufferListSource;
NDIS_STATUS NdisSwitchSetNetBufferListSource(
[in] NDIS_SWITCH_CONTEXT NdisSwitchContext,
PNET_BUFFER_LIST NetBufferList,
[in] NDIS_SWITCH_PORT_ID PortId,
[in] NDIS_SWITCH_NIC_INDEX NicIndex
)
{...}
Parameters
[in] NdisSwitchContext
An NDIS_SWITCH_CONTEXT value that contains the handle of the extensible switch module to which the Hyper-V extensible switch extension is attached. When the extension calls NdisFGetOptionalSwitchHandlers, this handle is returned through the NdisSwitchContext parameter.
NetBufferList
A pointer to a NET_BUFFER_LIST structure for a single packet.
[in] PortId
An NDIS_SWITCH_PORT_ID value that specifies the unique identifier of the source port on the extensible switch.
[in] NicIndex
An NDIS_SWITCH_NIC_INDEX value that specifies the index of the network adapter that is connected to the extensible switch port specified by the PortId parameter.
For more information on NDIS_SWITCH_NIC_INDEX values, see Network Adapter Index Values.
Return value
If the call succeeds, the function returns NDIS_STATUS_SUCCESS. Otherwise, it returns an NDIS_STATUS_Xxx error code that is defined in Ndis.h.
Remarks
The extensible switch extension calls the SetNetBufferListSource function to set the source port identifier and network adapter index in a packet's NET_BUFFER_LIST structure. The extension does this for the following types of packets:
-
A new packet that the extension has allocated for send or receive operations.
Note Before the extension calls SetNetBufferListSource for an allocated packet, it must call AllocateNetBufferListForwardingContext.
- A duplicated packet that the extension had cloned from an original packet that it was filtering. The extension duplicates a packet by calling NdisAllocateCloneNetBufferList.
For example, a packet that has a source port identifier of NDIS_SWITCH_DEFAULT_PORT_ID is trusted and bypasses many extensible switch port policies. These policies include access control lists (ACLs) and quality of service (QoS). If the extension specifies a non-default source port for the packet, this allows the policies for that port to be applied to the packet.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.30 and later. |
Target Platform | Desktop |
Header | ndis.h (include Ndis.h) |
IRQL | <= DISPATCH_LEVEL |
See also
AllocateNetBufferListForwardingContext