RttcpipUpdateInterfaceAddress

RttcpipUpdateInterfaceAddress updates one of the IP addresses of a network interface.

Syntax

Copy
INT RttcpipUpdateInterfaceAddress(
  [in]               NET_IFINDEX InterfaceIndex, 
  [in, optional]     RTTCPIPADAPTERADDRESS *pAddress, 
  [in]               RTTCPIPADAPTERADDRESS *pNewAddress
);

Parameters

[in] InterfaceIndex

The local index for a network interface.

[in, optional] pAddress

A pointer to an RTTCPIPADAPTERADDRESS that describes interface address to be updated. This value can be NULL.

[in] pNewAddress

A pointer to an RTTCPIPADAPTERADDRESS that describes the new interface address.

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

WSAADDRINUSE

Parameter pAddress is not NULL and the IPv4 address specified by pAddress exists in the list of IPv4 addresses assigned to the interface, but the IPv4 address specified by pNewAddress also exists in the list.

WSAEADDRNOTAVAIL

Parameter pAddress is not NULL and the IPv4 address specified by pAddress doesn’t exist in the list of IPv4 addresses assigned to the interface.

WSAEINVAL

One of these conditions occurred:

  • Parameter InterfaceIndex doesn’t correspond to any existing interface.
  • Parameter pAddress is not NULL and not an IPv4 address.
  • Parameter pAddress is not NULL and parameter pNewAddress is not an IPv4 address.
  • Parameter pAddress is not NULL and its content is not valid.
  • Parameter pNewAddress is NULL.
  • Parameter pNewAddress is not valid.

WSASYSNOTREADY

The TCP/IP Stack is not running.

Remarks

If parameter pAddress is NULL, the function updates the first IP address for the AF_INET address family or assigns a global IPv6 address for the AF_INET6 address family specified in parameter pNewAddress. If pAddress is not NULL, the function queries and updates the IP address for the AF_INET address family specified in parameter pNewAddress.

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: