Previous section.

Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group

NAME

net/if.h - sockets local interfaces

SYNOPSIS


#include <net/if.h>


DESCRIPTION

The <net/if.h> header defines the if_nameindex structure that includes at least the following members:

Member Type Value
if_index unsigned int numeric index of the interface
if_name char * null-terminated name of the interface

The <net/if.h> header defines the following macro for the length of a buffer containing an interface name (including the terminating NULL character):


IF_NAMESIZE interface name length

The following are declared as functions, and may also be defined as macros:


unsigned int if_nametoindex(const char *ifname); char *if_indextoname(unsigned int ifindex, char *ifname); struct if_nameindex *if_nameindex(void); void if_freenameindex (struct if_nameindex *ptr);

SEE ALSO

if_freenameindex(), if_indextoname(), if_nameindex(), if_nametoindex().

CHANGE HISTORY

First released in Issue 5.2.

Contents Next section Index