1IF_NAMEINDEX(3P) POSIX Programmer's Manual IF_NAMEINDEX(3P)
2
3
4
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
12 if_nameindex - return all network interface names and indexes
13
15 #include <net/if.h>
16
17 struct if_nameindex *if_nameindex(void);
18
19
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
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
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
44 None.
45
47 None.
48
50 None.
51
53 None.
54
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)