[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, 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 subroutine, if_nameindex subroutine, and if_freenameindex subroutine.

Subroutines Overview in AIX Version 4 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]