RtfwModifyNetworkInterface

RtfwModifyNetworkInterface modifies the configuration of an existing real-time network interface in the RT-TCP/IP Stack.

Syntax

bool RtfwModifyNetworkInterface(
    const TCHAR * friendlyName,
    const RTFW_NETWORK_INTERFACE * pInterface,
    unsigned int reserved
);

Parameters

friendlyName

A pointer to the friendly name in structure RTFW_NETWORK_INTERFACE of the network interface to be modified. This value is not case-sensitive.

pInterface

A pointer to a structure that contains the new configuration parameters for the network interface. If member FriendlyName in this structure differs from the current friendly name of the network interface, the friendly name is changed to the one specified via this parameter. The Size member must be set to sizeof(RTFW_NETWORK_INTERFACE), otherwise this function's behavior is undefined.

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_REGISTRY_MISSING A registry key or value is missing.
RT_ERROR_RESTART_NETWORK

The RT-TCP/IP Stack was running when this function succeeded. 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.

RT_ERROR_STRUCTURE_TOO_SMALL The Size member of a structure is too small.
RT_ERROR_IPV6_ADDRESS_INVALID The specified IPv6 address is invalid. See Remarks for a list of valid and invalid IPv6 addresses.
RT_ERROR_IPV4_ADDRESS_INVALID The specified IPv4 address is invalid. See Remarks for a list of valid and invalid IPv4 addresses.

Remarks

See Device-Specific Interface Values for device-specific defaults and value ranges.

If the RT-TCP/IP Stack is running when the RtfwModifyNetworkInterface API is called, the values set will not take effect until the stack is restarted.

Certain properties in structure RTFW_NETWORK_INTERFACE should not be modified if the interface belongs to the Virtual Network. See RTFW_NETWORK_INTERFACE for more information.

IPv4 addresses must adhere to the following rules to be considered valid and accepted:

  • There must be exactly 4 groups of decimal digits (called “octets”) separated by a period (‘.’).
    • Examples violating this rule: 10.0.8.5.9, 192.168.3
  • No octet has a ‘0’ digit immediately to the left of another digit.
    • Examples violating this rule: 10.1.02.5, 192.167.00.1
  • Every octet must be between 0 and 255 (inclusive).
    • Examples violating this rule: 10.300.2.3, 704.111.201.99
  • The first octet is between 0 and 223.
    • Examples violating this rule: 250.1.2.3, 224.111.201.99

The following IPv6 addresses are valid and will be accepted:

The following IPv6 addresses are invalid and will not be accepted:

Any pathname passed to this function must not be a network pathname. This includes:

Requirements

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

See Also:

RTFW_NETWORK_INTERFACE

RtfwCreateNetworkInterface

RtfwDeleteNetworkInterface