TCP/IP Programming Manual
#include <netdb.h>
void if_freenameindex (struct if_nameindex *ptr);
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
if_freenameindex(ptr);
INT .EXT ptr;
ptr
input value; specifies the address pointer returned by the if_nameindex function for which
storage should be returned to the system.
Errors
This function does not return a value. Upon successful completion, all dynamic storage associated
with the interface index has been returned to the system.
Usage Guidelines
When an interface (subnet) is created, that interface 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_freenameindex function is one of four functions used to manage interface indexes.
Examples
The end of the array of structures is indicated by a structure that has an if_index of 0 and an
if_name of NULL. The memory used for this array of structures along with the interface names
pointed to by the if_name members is obtained dynamically using the if_nameindex function
as follows:
ifnameindex = if_nameindex();
if ( ifnameindex == NULL) {
perror("if_nameindex");
}
freep = ifnameindex;
while (ifnameindex->if_index) {
printf("if_nameindex: index, name: %i, %s\n",
ifnameindex->if_index, ifnameindex >if_name);
ifnameindex++;
}
if_freenameindex(freep);
if_indextoname
The if_indextoname function maps an interface index to its corresponding name. (This function
is supported for Parallel Library TCP/IP only.)
NOTE: The C synopsis is given in ANSI C format rather than the pre-ANSI C formats of the other
library routines because the only NonStop servers you can use these routines on all support ANSI
C. (ANSI C format defines the function and the arguments in the same line rather than using an
assign statement and defining the arguments underneath.)
C Synopsis
#include <netdb.h>
char *if_indextoname(unsigned int ifindex, char *ifname);
if_indextoname 131