[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


if_nametoindex Subroutine

Purpose

Retrieves the interface index associated with a particular interface name. The first of four functions, if_nametoindex maps an interface name into its corresponding index.

Library

Library (libinet.a)

Syntax

#include <net/if.h>
unsigned int
if_nametoindex (ifname)
const char *ifname

Description

The first of four functions for Interface Identification. The argument is a null-terminated interface name (for example, en0, tr1, ....).

Return Values

If successful, if_nametoindex returns the interface index associated with the name. If unsuccessful, 0 (zero) is returned.

Related Information

The if_indextoname (if_indextoname Subroutine) subroutine, if_nameindex subroutine, and if_freenameindex subroutine.

Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]