RtfwCreateNetworkInterface
RtfwCreateNetworkInterface creates a new RTX64 network interface to be used by the RT-TCP/IP Stack.
Syntax
bool RtfwCreateNetworkInterface( const RTFW_NETWORK_INTERFACE * pInterface, unsigned int reserved );
Parameters
pInterface
A pointer to a RTFW_NETWORK_INTERFACE structure that contains the initial configuration of the new network interface. The Size member needs to be filled in with sizeof(RTFW_NETWORK_INTERFACE), otherwise this function fails and sets the last error value to RT_ERROR_STRUCTURE_TOO_SMALL.
reserved
This parameter must always be set to zero.
Return Value
The function returns true if it succeeds. Otherwise, it returns false. 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
If the RT-TCP/IP Stack is running when this function succeeds, it sets the last error value to RT_ERROR_RESTART_NETWORK. RtfwRestartRequired will report that the RT-TCP/IP Stack must be restarted.
NOTE: The RT-TCP/IP Stack must be restarted for the change to take effect.
The RTX64 Native library does not check for duplicate IPv6 addresses on the local system during configuration of network interfaces. It does check for duplicate IPv4 addresses in RtfwCreateNetworkInterface and RtfwModifyNetworkInterface. Both functions will fail with custom error RT_ERROR_IPV4_ADDRESS_INVALID when a duplicate IPv4 address is detected.
Any pathname passed to this function must not be a network pathname. This includes:
- A pathname with a drive letter that specifies a mapped file share.
- A UNC path: a pathname that starts with \\servername.
Requirements
Minimum Required Version | RTX64 3.4 |
Header | RtfwAPI.h |
Library | RtfwAPI.lib |
See Also: