RttcpipAddInterfaceAddress

RttcpipAddInterfaceAddress adds an IPv4 address to a network interface.

Syntax

Copy
BOOL RttcpipAddInterfaceAddress(
    [in]    NET_IFINDEX InterfaceIndex, 
    [in]    RTTCPIPV4ADDRESS *pIpv4Address
);

Parameters

[in] InterfaceIndex

The local index for a network interface. Use function if_nametoindex to get the index from the interface name.

[in] pIpv4Address

A pointer to an RTTCPIPV4ADDRESS that describes the IPv4 interface address to add.

Return Value

If this function succeeds, it returns TRUE. If this function fails, it returns FALSE. To get more information, call the GetLastError function.

Possible error codes:

Error code

Meaning

ERROR_NOT_ENOUGH_MEMORY

The interface already has MAX_IPS_PER_INTERFACE assigned IPv4 addresses.

WSAEINVAL

One of these conditions occurred:

  • Parameter InterfaceIndex doesn’t correspond to any existing interface.
  • Parameter pIpv4Address is NULL.
  • Parameter pIpv4Address is not valid.

WSAEADDRINUSE

The IPv4 address specified by parameter pIpv4Address already exists in the list of IPv4 addresses for the interface.

WSASYSNOTREADY

The TCP/IP Stack is not running.

Remarks

MAX_IPS_PER_INTERFACE is the maximum number of Ipv4 addresses allowed per physical interface.

Calling this function may disrupt IP traffic on any of the IP addresses used by the interface.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

RttcpipApi.h

RtTcpipApi.lib

See also: