RtNalIoctl

RtNalIoctl is called when an application requires that the driver configures certain NIC modes or characteristics.

Syntax

BOOL RtNalIoctl(
	RTNAL_QUEUE_HANDLE queueHandle,
	INT cmd,
	PVOID buffer
);

Parameters

queueHandle

Network queue handle returned by RtNalAcquireQueue.

cmd

Control code to execute. The following commands are supported:

Command Description
ENIOCPROMISC (Optional) Turn on promiscuous mode
ENIOCALL (Optional) Receive good and bad frames. Non-promiscuous.
ENIOCNORMAL (Optional) Receive only good frames. Default mode.
ENIOADDMULTI (Required) Add multicast route to this NIC (required command, should be implemented). The addr parameter points to an Ethernet address byte string (6 bytes), which indicates the multicast group Ethernet address.
ENIODELMULTI (Required) Delete multicast route from this NIC (required command, should be implemented). The addr parameter points to an Ethernet address byte string (6 bytes), which indicates the multicast group Ethernet address.
ENIOLINKSTATUS (Optional) Get link status of this NIC.

When the ENIOADDMULTI or ENIODELMULTI commands are received in RtNalIoctl the driver can call RtnGetMcastCount to determine how many multicast addresses have been added to the NIC. If RtnGetMcastCount returns 0 during the processing of a ENIOADDMULTI command, then it is the first multicast address being added to the NIC. If RtnGetMcastCount returns 0 during the processing of ENIODELMULTI , then it is the last address being deleted from the NIC. In other words, RtnGetMcastCount returns a pre-increment/post-decrement counter of the number of addresses added to the NIC

*buffer

Pointer to a data buffer for passing information to/from the driver. It can be NULL for control codes which don't require an information buffer.

Return Value

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

Error Code Meaning
ERROR_INVALID_PARAMETER

Indicates one of the following:

  • queueHandle is NULL
  • Buffer is NULL for the cmd that returns the information
  • the command is invalid
  • the information passed for a particular command was invalid
ERROR_INVALID_HANDLE queueHandle is invalid. This might be occur if the queue was released in another thread or on process exit, as if by RtssKill.
ERROR_NOT_READY RtNalInit has not completed successfully.
ERROR_DEVICE_FEATURE_NOT_SUPPORTED The driver does not support the specified control code cmd.

Requirements

Minimum Supported Version (NAL) RTX64 Network Abstraction Layer 2.0
Minimum Supported Version (RTX64) RTX64 3.4
Header rtnapi.h, RtNalApi.h
Library RtNal.lib

See Also: