RtfwGetAllNetworkInterfaces

RtfwGetAllNetworkInterfaces returns the configurations of all RTX64 RT-TCP/IP Stack network interfaces.

Syntax

bool RtfwGetAllNetworkInterfaces(
    RTFW_NETWORK_INTERFACE * pInterfaces,
    size_t * pCountNetworkInterfaces,
    unsigned int reserved
);

Parameters

pInterfaces

A pointer to an array of RTFW_NETWORK_INTERFACE structures to be filled in with configuration data for network interfaces. If this parameter is NULL, the required number of array element is written to the value pointed to by pCountNetworkInterfaces. Every instance of structure RTFW_NETWORK_INTERFACE in this array must have member Size set to sizeof(RTFW_NETWORK_INTERFACE), otherwise this function fails and sets the last error value to RT_ERROR_STRUCTURE_TOO_SMALL.

pCountNetworkInterfaces

A pointer to the number of elements in the array pointed to by pInterfaces. If the array is not large enough or if pInterfaces is NULL, this function fails, sets the last error value to ERROR_INSUFFICIENT_BUFFER, and this value is set to the required number of array elements at the time this function was called. This parameter cannot be NULL.

reserved

This parameter must always be set to zero.

Return Value

The function returns true if it succeeds. Otherwise, it returns false, sets the last error value, and leaves the array referenced by pInterfaces with invalid data. Call GetLastError for additional error information.

Possible error codes:

Error Code Meaning
RT_ERROR_NETWORK_NOT_INSTALLED The RT-TCP/IP Stack is not installed.
RT_ERROR_STRUCTURE_TOO_SMALL The Size member of a structure is too small.

Remarks

After this function succeeds, the value pointed to by pCountNetworkInterfaces is set to the number of array elements that contain valid configuration information, which is also the number of configured network interfaces.

If the Subsystem is running when RtfwCreateNetworkInterface is called, the values returned by this function may differ from the values currently in use by the Subsystem.

If you call RtfwGetAllNetworkInterfaces with parameter pCountNetworkInterfaces set to a value less than (<) the total number of interfaces (but not 0), the function will return the number of interfaces requested, but will reset the count to the total number of interfaces and return success. This results in a mismatch between the count and the number of returned interfaces.

If the Subsystem is running when the RtfwGetLocalMemoryConfiguration API is called, the values returned by this function may differ from the values currently in use by the Subsystem.

Requirements

Minimum Required Version RTX64 3.4
Header RtfwAPI.h
Library RtfwAPI.lib

See Also:

RTFW_NETWORK_INTERFACE

RtfwGetNetworkInterfaceByName