Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

if_nameindex(3n) [hpux man page]

if_nameindex(3N)														  if_nameindex(3N)

NAME
if_nameindex(), if_nametoindex(), if_indextoname(), if_freenameindex() - functions that map between an interface name and index value SYNOPSIS
DESCRIPTION
Interfaces are normally known by names such as "lan0" and "vlan200." The index is a unique positive integer value assigned to an inter- face. Index values start at 1, and 0 is not a valid index. This function maps an interface name into its corresponding index. If the specified interface name does not exist, the return value is set to 0 and is set to If there is a system error, the return value is 0, and is set to the appropriate value. For example, if the system is running out of memory, will be set to This function maps an interface index into its corresponding name. The ifname argument must point to a buffer of at least bytes into which the interface name corresponding to the specified index is returned. This pointer is also the return value of the function. is defined in and its value includes a terminating null byte at the end of the interface name. If there is no interface corresponding to the specified index, NULL is returned and is set to If there is a system error, the return value is 0, and is set to the appropriate value. This function returns all interface names and indexes as an array of structures, one structure per interface. The structure is defined in struct if_nameindex { unsigned int if_index; /* 1, 2, ... */ char *if_name; /* null terminated name: "lan0" */ }; The end of the array of structures is indicated by a structure with an if_index of 0, and an if_name of NULL. The function returns a NULL pointer upon an error, and would set to the appropriate value. The memory used for this array of structures along with the interface names pointed to by the if_name members is obtained dynami- cally. This memory is freed by the next function. This function frees the dynamic memory allocated by The argument to this function must be a pointer that was returned by CHANGE HISTORY
The function prototypes and were defined in prior to HP-UX 11i v3. They are now defined in Beginning with HP-UX 11i v3, these functions may pass on both IPv4 and IPv6 interfaces, and they no longer reside in the IPv6 library. They currently reside in the C library. Therefore, applications using these functions no longer need to link with Applications using other IPv6 interfaces that reside in IPv6 library will need to continue to link with AUTHOR
and were developed by HP, IETF, and X/Open Company Limited. ERRORS
When or fails, the following error message is set in The specified interface or index does not exist. SEE ALSO
ndp(1M), inet6_opt_init(3N), inet6_rth_space(3N), ip6(7P), ndp(7P). RFC 3493 Basic Socket Interface Extensions for IPv6. STANDARDS CONFORMANCE
if_nameindex(3N)

Check Out this Related Man Page

if_nameindex(3N)														  if_nameindex(3N)

NAME
if_nameindex(), if_nametoindex(), if_indextoname(), if_freenameindex() - functions that map between an interface name and index value SYNOPSIS
DESCRIPTION
Interfaces are normally known by names such as "lan0" and "vlan200." The index is a unique positive integer value assigned to an inter- face. Index values start at 1, and 0 is not a valid index. This function maps an interface name into its corresponding index. If the specified interface name does not exist, the return value is set to 0 and is set to If there is a system error, the return value is 0, and is set to the appropriate value. For example, if the system is running out of memory, will be set to This function maps an interface index into its corresponding name. The ifname argument must point to a buffer of at least bytes into which the interface name corresponding to the specified index is returned. This pointer is also the return value of the function. is defined in and its value includes a terminating null byte at the end of the interface name. If there is no interface corresponding to the specified index, NULL is returned and is set to If there is a system error, the return value is 0, and is set to the appropriate value. This function returns all interface names and indexes as an array of structures, one structure per interface. The structure is defined in struct if_nameindex { unsigned int if_index; /* 1, 2, ... */ char *if_name; /* null terminated name: "lan0" */ }; The end of the array of structures is indicated by a structure with an if_index of 0, and an if_name of NULL. The function returns a NULL pointer upon an error, and would set to the appropriate value. The memory used for this array of structures along with the interface names pointed to by the if_name members is obtained dynami- cally. This memory is freed by the next function. This function frees the dynamic memory allocated by The argument to this function must be a pointer that was returned by CHANGE HISTORY
The function prototypes and were defined in prior to HP-UX 11i v3. They are now defined in Beginning with HP-UX 11i v3, these functions may pass on both IPv4 and IPv6 interfaces, and they no longer reside in the IPv6 library. They currently reside in the C library. Therefore, applications using these functions no longer need to link with Applications using other IPv6 interfaces that reside in IPv6 library will need to continue to link with AUTHOR
and were developed by HP, IETF, and X/Open Company Limited. ERRORS
When or fails, the following error message is set in The specified interface or index does not exist. SEE ALSO
ndp(1M), inet6_opt_init(3N), inet6_rth_space(3N), ip6(7P), ndp(7P). RFC 3493 Basic Socket Interface Extensions for IPv6. STANDARDS CONFORMANCE
if_nameindex(3N)
Man Page