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