RtNalSetReceiveFilterEntryEthertype

RtNalSetReceiveFilterEntryEthertype sets a receive filter to the NIC driver to allow the network queue to receive Ethernet frames of the specified Ethernet type.

Syntax

BOOL RtNalSetReceiveFilterEntryEthertype(
	RTNAL_QUEUE_HANDLE queueHandle,
	ULONG filterIndex,
	USHORT etherType,
	BOOL bAddTimeStamp,
	BOOL bLowLatencyInterrupt
);

Parameters

queueHandle

The receive queue handle returned by RtNalAcquireQueue.

filterIndex

Indicates which entry in the filter should be set with the match pattern of etherType. The range of filter indexes is device-specific. For the RtNalIGB and RtNalI10GB drivers, this value is a number between 0-7.

etherType

A two-octet field in an Ethernet frame. It is used to indicate which protocol is encapsulated in the payload of an Ethernet Frame. Ethernet frames with a matching etherType are enabled for receive on the driver queue.

bAddTimeStamp

If bAddTimeStamp is TRUE, all packets with matching etherType will be timestamped.

bLowLatencyInterrupt

When set, packets that match this filter generate a low latency interrupt.

Return Value

Returns TRUE if the function succeeds. Otherwise it returns FALSE. Call GetLastError to obtain an error code. The possible error codes are listed below:

Error Code Meaning
ERROR_ALREADY_ASSIGNED This Ethernet type is assigned to another filter entry.
ERROR_INVALID_HANDLE Invalid queue handle.
ERROR_INVALID_INDEX Invalid filter entry index.
ERROR_INVALID_PARAMETER queueHandle is a NULL pointer or etherType is less than 1536.
ERROR_NOT_OWNER This filter entry is used by another receive queue.
ERROR_NOT_READY RtNalInit has not completed successfully.
ERROR_NOT_SUPPORTED

The queue is not a receive queue.

ERROR_DEVICE_FEATURE_NOT_SUPPORTED The driver does not support receive Ethernet type filtering.

Remarks

For a list of supported functions for specific drivers, see Matrix of Supported Real-Time NAL Functions by NIC Driver.

All received frames of this Ethernet type are filtered by NIC device to this queue. The default queue receives all packets which are not filtered to other receive queues.

Multiple filters can run on one receive queue.

The device driver must support RTNAL_IOCTL_SET_RX_ETHERTYPE_FILTER IOCTL for this function to succeed.

All receive Ethernet type filters are cleared when the queue is released.

The RtNalIPCH and RtNalE1000 drivers do not support receive filtering.

Requirements

Minimum Supported Version RTX64 4.0
Header rtnapi.h, RtNalApi.h
Library RtNal.lib

See Also: