Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

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
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
char *if_indextoname(
unsigned int ifindex,
char *ifname
);
PARAMETERS
ifindex Species the index to be mapped to an interface name
ifname Species the buffer to receive the mapped name; the buffer must be at least
IF_NAMESIZE bytes long (IF_NAMESIZE is dened in the header le in.h)
DESCRIPTION
When an interface (subnet) is created, it is assigned a unique number called an interface index.
The interface index identies 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 specied for a parameter is not recognized or inapplicable.
[ENOMEM] Either no memory is available to complete the request or a system error
occurred.
48 Hewlett-Packard Company 527187-004