1IF_NAMEINDEX(3P)           POSIX Programmer's Manual          IF_NAMEINDEX(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       if_nameindex - return all network interface names and indexes
13

SYNOPSIS

15       #include <net/if.h>
16
17       struct if_nameindex *if_nameindex(void);
18
19

DESCRIPTION

21       The if_nameindex() function  shall  return  an  array  of  if_nameindex
22       structures,  one structure per interface. The end of the array is indi‐
23       cated by a structure with an if_index field  of  zero  and  an  if_name
24       field of NULL.
25
26       Applications  should call if_freenameindex() to release the memory that
27       may be dynamically allocated by this function, after they have finished
28       using it.
29

RETURN VALUE

31       An  array of structures identifying local interfaces. A NULL pointer is
32       returned upon an error, with errno set to indicate the error.
33

ERRORS

35       The if_nameindex() function may fail if:
36
37       ENOBUFS
38              Insufficient resources are available to complete the function.
39
40
41       The following sections are informative.
42

EXAMPLES

44       None.
45

APPLICATION USAGE

47       None.
48

RATIONALE

50       None.
51

FUTURE DIRECTIONS

53       None.
54

SEE ALSO

56       getsockopt(), if_freenameindex(),  if_indextoname(),  if_nametoindex(),
57       setsockopt(),  the  Base  Definitions  volume  of IEEE Std 1003.1-2001,
58       <net/if.h>
59
61       Portions of this text are reprinted and reproduced in  electronic  form
62       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
63       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
64       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
65       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
66       event of any discrepancy between this version and the original IEEE and
67       The Open Group Standard, the original IEEE and The Open Group  Standard
68       is  the  referee document. The original Standard can be obtained online
69       at http://www.opengroup.org/unix/online.html .
70
71
72
73IEEE/The Open Group                  2003                     IF_NAMEINDEX(3P)
Impressum