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

Technical Reference: Communications, Volume 2

if_nametoindex Subroutine

Purpose

Maps an interface name to its corresponding index.

Library

Standard C Library (libc.a)

Syntax

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

Description

If the ifname parameter is the name of an interface, the if_nametoindex subroutine returns the interface index corresponding to the ifname name. If the ifname parameter is not the name of an interface, the if_nametoindex subroutine returns a 0 and the errno global variable is set to the appropriate value.

Parameters

ifname Possible name of an interface.

Related Information

if_indextoname Subroutine, if_nameindex Subroutine, and if_freenameindex Subroutine.

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

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