RtNalTransmit

RtNalTransmit transmits an Ethernet packet.

Syntax

BOOL RtNalTransmit(
	RTNAL_QUEUE_HANDLE queueHandle,
	PVOID pPacketHandle
);

Parameters

queueHandle

Network queue handle returned by RtNalAcquireQueue.

pPacketHandle

Pointer to an application-defined network packet.

Return Value

Returns TRUE if the Ethernet packet data was copied to the driver’s DMA buffer to transmit. Otherwise it returns FALSE. Call GetLastError to obtain an error code. The possible error codes are listed below:

Error Code Meaning
ERROR_DEVICE_NO_RESOURCES No available DMA buffers.
ERROR_INCORRECT_SIZE The packet size is either 0 or greater than the maximum configured by the driver.
ERROR_INVALID_ADDRESS Packet data pointer is NULL. It is provided by RTN_FN_DECODEPACKET callback.
ERROR_INVALID_PARAMETER queueHandle or pPacketHandle is a NULL pointer.
ERROR_NOT_SUPPORTED Called for a receive queue or the driver does not support RtndTransmit or the application has not supplied RTN_FN_DECODE_PACKET callback in RtNalConfigureQueue.
ERROR_NOT_READY RtNalConfigureQueue has not completed successfully.
ERROR_IO_DEVICE The Ethernet link is down.
ERROR_INVALID_HANDLE queueHandle is invalid. This might occur if the queue was released in another thread or on process exit, as if by RtssKill.

Remarks

This function uses the function RtndTransmit in the device driver. RTN_FN_DECODEPACKET callback must be supplied in RtNalConfigure function.

The user-provided RTN_FN_DECODEPACKET callback provides the pointer to the packet data buffer, packet length, and application context pointer from the application-defined network packet.

The RtndTransmit driver function copies data from the packet data pointer to the driver’s buffer. The application can reuse the packet argument after RtNalTransmit returns.

Requirements

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

See Also: