TCPIP_STACK_NetAliasNameGet Function

C

int TCPIP_STACK_NetAliasNameGet(
    TCPIP_NET_HANDLE netH, 
    char* nameBuffer, 
    int buffSize
);

Description

This function returns the alias name associated with the interface handle.

Preconditions

The TCP/IP stack should have been initialized by TCPIP_STACK_Initialize() and the TCPIP_STACK_Status() returned SYS_STATUS_READY.

Parameters

ParametersDescription
netHInterface handle name to obtain.
nameBufferBuffer to receive the name. Could be 0 if only name size is needed.
buffSizeSize of the provided buffer.

Returns

  • The number of characters of the interface alias name.

  • 0 if no such interface exists.

Remarks

The aliases names are:

  • "eth0", "eth1", etc. for Ethernet interfaces

  • "wlan0", "wlan1", etc. for Wi-Fi interfaces

  • For alias interfaces, names will have an appended ':n', i.e.: "eth0:0", "eth0:1", wlan0:0", etc.

See the TCPIP_STACK_IF_NAME_ALIAS_ETH, TCPIP_STACK_IF_NAME_ALIAS_WLAN in tcpip.h for the aliases names. Alias interface names are at most 8 characters long.

Example

TCPIP_NET_HANDLE netH = TCPIP_STACK_IndexToNet(0);
char ifName[8];
TCPIP_STACK_NetAliasNameGet(netH, ifName, sizeof(ifName));