1IF_NAMETOINDEX(P) POSIX Programmer's Manual IF_NAMETOINDEX(P)
2
3
4
6 if_nametoindex - map a network interface name to its corresponding
7 index
8
10 #include <net/if.h>
11
12 unsigned if_nametoindex(const char *ifname);
13
14
16 The if_nametoindex() function shall return the interface index corre‐
17 sponding to name ifname.
18
20 The corresponding index if ifname is the name of an interface; other‐
21 wise, zero.
22
24 No errors are defined.
25
26 The following sections are informative.
27
29 None.
30
32 None.
33
35 None.
36
38 None.
39
41 getsockopt() , if_freenameindex() , if_indextoname() , if_nameindex() ,
42 setsockopt() , the Base Definitions volume of IEEE Std 1003.1-2001,
43 <net/if.h>
44
46 Portions of this text are reprinted and reproduced in electronic form
47 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
48 -- Portable Operating System Interface (POSIX), The Open Group Base
49 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
50 Electrical and Electronics Engineers, Inc and The Open Group. In the
51 event of any discrepancy between this version and the original IEEE and
52 The Open Group Standard, the original IEEE and The Open Group Standard
53 is the referee document. The original Standard can be obtained online
54 at http://www.opengroup.org/unix/online.html .
55
56
57
58IEEE/The Open Group 2003 IF_NAMETOINDEX(P)