Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
if_indextoname(3) OSS Library Calls Reference Manual
NAME
if_indextoname - Maps an interface index to its corresponding name
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
#include <netdb.h>
char *if_indextoname(
unsigned int ifindex,
char *ifname);
PARAMETERS
ifindex Specifies the index to be mapped to an interface name
ifname Specifies the buffer to receive the mapped name; the buffer must be at least
IF_NAMESIZE bytes long (IF_NAMESIZE is defined in the header file in.h)
DESCRIPTION
When an interface (subnet) is created, it is assigned a unique number called an interface index.
The interface index identifies the interface used to send or receive multicast datagrams.
Interface index numbers start with 1.
The if_indextoname( ) function is one of four functions used to manage interface indexes.
EXAMPLES
.
.
.
cp = if_indextoname(if_index, sn);
if (cp==NULL){
perror("No interface name matching interface index");
exit(1);
}
.
.
.
RETURN VALUES
Upon successful completion, this function returns a pointer to the character string buffer contain-
ing the mapped name. Otherwise, this function returns NULL and errno is set to indicate the
error.
ERRORS
If any of these conditions occurs, the function sets errno to the corresponding value:
[EINVAL] A value specified for a parameter is not recognized or inapplicable.
[ENOMEM] Either no memory is available to complete the request or a system error
occurred.
4−8 Hewlett-Packard Company 527187-017