Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (i - m) if_freenameindex(3)
NAME
if_freenameindex - Frees dynamic memory allocated by the if_nameindex() function
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
void if_freenameindex(
struct if_nameindex *ptr);
PARAMETERS
ptr Specifies the address pointer returned by the if_nameindex( ) function for which
storage should be returned to the system.
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_freenameindex( ) function is one of four functions used to manage interface indexes.
EXAMPLES
In the following example, the end of the array of structures is indicated by a structure with an
if_index of 0 (zero) 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, 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);
RETURN VALUES
This function does not return a value. Upon successful completion, all dynamic storage associ-
ated with the interface index has been returned to the system.
ERRORS
This function does not set errno.
RELATED INFORMATION
Functions: freeaddrinfo(3), gai_strerror(3), getaddrinfo(3), getnameinfo(3),
if_indextoname(3), if_nameindex(3), if_nametoindex(3), inet_pton(3), inet_ntop(3).
STANDARDS CONFORMANCE
This function is an extension to the XPG4 specification.
527187-017 Hewlett-Packard Company 4−7