1IF_NAMEINDEX(P) POSIX Programmer's Manual IF_NAMEINDEX(P)
2
3
4
6 if_nameindex - return all network interface names and indexes
7
9 #include <net/if.h>
10
11 struct if_nameindex *if_nameindex(void);
12
13
15 The if_nameindex() function shall return an array of if_nameindex
16 structures, one structure per interface. The end of the array is indi‐
17 cated by a structure with an if_index field of zero and an if_name
18 field of NULL.
19
20 Applications should call if_freenameindex() to release the memory that
21 may be dynamically allocated by this function, after they have finished
22 using it.
23
25 An array of structures identifying local interfaces. A NULL pointer is
26 returned upon an error, with errno set to indicate the error.
27
29 The if_nameindex() function may fail if:
30
31 ENOBUFS
32 Insufficient resources are available to complete the function.
33
34
35 The following sections are informative.
36
38 None.
39
41 None.
42
44 None.
45
47 None.
48
50 getsockopt() , if_freenameindex() , if_indextoname() , if_nametoindex()
51 , setsockopt() , the Base Definitions volume of IEEE Std 1003.1-2001,
52 <net/if.h>
53
55 Portions of this text are reprinted and reproduced in electronic form
56 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
57 -- Portable Operating System Interface (POSIX), The Open Group Base
58 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
59 Electrical and Electronics Engineers, Inc and The Open Group. In the
60 event of any discrepancy between this version and the original IEEE and
61 The Open Group Standard, the original IEEE and The Open Group Standard
62 is the referee document. The original Standard can be obtained online
63 at http://www.opengroup.org/unix/online.html .
64
65
66
67IEEE/The Open Group 2003 IF_NAMEINDEX(P)