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
11
13 if_nameindex — return all network interface names and indexes
14
16 #include <net/if.h>
17
18 struct if_nameindex *if_nameindex(void);
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 The following sections are informative.
41
43 None.
44
46 None.
47
49 None.
50
52 None.
53
55 getsockopt(), if_freenameindex(), if_indextoname(), if_nametoindex(),
56 setsockopt()
57
58 The Base Definitions volume of POSIX.1‐2008, <net_if.h>
59
61 Portions of this text are reprinted and reproduced in electronic form
62 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
63 -- Portable Operating System Interface (POSIX), The Open Group Base
64 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
65 cal and Electronics Engineers, Inc and The Open Group. (This is
66 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
67 event of any discrepancy between this version and the original IEEE and
68 The Open Group Standard, the original IEEE and The Open Group Standard
69 is the referee document. The original Standard can be obtained online
70 at http://www.unix.org/online.html .
71
72 Any typographical or formatting errors that appear in this page are
73 most likely to have been introduced during the conversion of the source
74 files to man page format. To report such errors, see https://www.ker‐
75 nel.org/doc/man-pages/reporting_bugs.html .
76
77
78
79IEEE/The Open Group 2013 IF_NAMEINDEX(3P)