1IF_NAMEINDEX(P)            POSIX Programmer's Manual           IF_NAMEINDEX(P)
2
3
4

NAME

6       if_nameindex - return all network interface names and indexes
7

SYNOPSIS

9       #include <net/if.h>
10
11       struct if_nameindex *if_nameindex(void);
12
13

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

38       None.
39

APPLICATION USAGE

41       None.
42

RATIONALE

44       None.
45

FUTURE DIRECTIONS

47       None.
48

SEE ALSO

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)
Impressum