Upravit

Sdílet prostřednictvím


Enumerating Receive Filters on a Virtual Port

After a virtual port (VPort) is created on the NIC switch of the network adapter, overlying drivers and user applications can do the following:

For more information on how to create a VPort, see Creating a Virtual Port.

Enumerating Receive Filters

To obtain a list of all receive filters that are set on a virtual port (VPort) of a NIC switch, overlying drivers and applications can issue object identifier (OID) method requests of OID_RECEIVE_FILTER_ENUM_FILTERS.

The InformationBuffer member of the NDIS_OID_REQUEST structure initially contains a pointer to an NDIS_RECEIVE_FILTER_INFO_ARRAY structure.

Before the overlying driver or user application issues this OID method request, it must initialize an NDIS_RECEIVE_FILTER_INFO_ARRAY structure and set the members of this structure in the following way:

  • The QueueId member must be set to NDIS_DEFAULT_RECEIVE_QUEUE_ID.

  • The VPortId member must be set to the identifier associated with the VPort. The overlying driver obtains the VPort identifier through one of the following ways:

    Note  This member is only valid if the driver or application sets the NDIS_RECEIVE_FILTER_INFO_ARRAY_VPORT_ID_SPECIFIED flag in the Flags member. If this flag is not set, receive filters are returned that were set on every VPort on the NIC switch.

After a successful return from the OID method request of OID_RECEIVE_FILTER_ENUM_FILTERS, the InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to an updated NDIS_RECEIVE_FILTER_INFO_ARRAY structure that is followed by one or more NDIS_RECEIVE_FILTER_INFO structures. Each NDIS_RECEIVE_FILTER_INFO structure specifies the unique identifier for the receive filter that is set on the specified VPort.

Querying a Specific Receive Filter

Overlying drivers or applications can issue an OID method request of OID_RECEIVE_FILTER_PARAMETERS to obtain the parameters of a specific filter on a VPort.

The InformationBuffer member of the NDIS_OID_REQUEST structure initially contains a pointer to an NDIS_RECEIVE_FILTER_PARAMETERS structure.

Before the overlying driver or user application issues this OID method request, it must initialize an NDIS_RECEIVE_FILTER_PARAMETERS structure and set the members of this structure in the following way:

  • The FilterId member must be set to the nonzero identifier value of the filter whose parameters are to be returned.

    Note  The overlying driver obtained the filter identifier from an earlier OID method request of OID_RECEIVE_FILTER_SET_FILTER or OID_RECEIVE_FILTER_ENUM_FILTERS. The application can obtain the filter identifier only from an earlier OID method request of OID_RECEIVE_FILTER_ENUM_FILTERS.

  • The QueueId member must be set to NDIS_DEFAULT_RECEIVE_QUEUE_ID.

  • The VPortId member must be set to the identifier associated with the VPort. The overlying driver obtains the VPort identifier through one of the following ways:

NDIS handles the OID_RECEIVE_FILTER_ENUM_FILTERS and OID_RECEIVE_FILTER_PARAMETERS method OID requests for miniport drivers. NDIS obtained the information from an internal cache of the data that it received from the OID_RECEIVE_FILTER_SET_FILTER OID request.