1IF_INDEXTONAME(P) POSIX Programmer's Manual IF_INDEXTONAME(P)
2
3
4
6 if_indextoname - map a network interface index to its corresponding
7 name
8
10 #include <net/if.h>
11
12 char *if_indextoname(unsigned ifindex, char *ifname);
13
14
16 The if_indextoname() function shall map an interface index to its cor‐
17 responding name.
18
19 When this function is called, ifname shall point to a buffer of at
20 least {IF_NAMESIZE} bytes. The function shall place in this buffer the
21 name of the interface with index ifindex.
22
24 If ifindex is an interface index, then the function shall return the
25 value supplied in ifname, which points to a buffer now containing the
26 interface name. Otherwise, the function shall return a NULL pointer and
27 set errno to indicate the error.
28
30 The if_indextoname() function shall fail if:
31
32 ENXIO The interface does not exist.
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_nameindex() , 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_INDEXTONAME(P)