summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/if_indextoname.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/if_indextoname.3')
-rw-r--r--src/lib/libc/net/if_indextoname.337
1 files changed, 17 insertions, 20 deletions
diff --git a/src/lib/libc/net/if_indextoname.3 b/src/lib/libc/net/if_indextoname.3
index eb33c94254..604ac7412f 100644
--- a/src/lib/libc/net/if_indextoname.3
+++ b/src/lib/libc/net/if_indextoname.3
@@ -30,11 +30,11 @@
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93 32.\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93
33.\" $Id: if_indextoname.3,v 1.2 1999/07/03 21:43:12 deraadt Exp $ 33.\" $Id: if_indextoname.3,v 1.3 1999/07/05 04:40:59 aaron Exp $
34.\" 34.\"
35.Dd May 21, 1998 35.Dd May 21, 1998
36.Dt IF_NAMETOINDEX 3 36.Dt IF_NAMETOINDEX 3
37.Os KAME 37.Os
38.Sh NAME 38.Sh NAME
39.Nm if_nametoindex , 39.Nm if_nametoindex ,
40.Nm if_indextoname , 40.Nm if_indextoname ,
@@ -52,33 +52,32 @@
52.Ft "void" 52.Ft "void"
53.Fn if_freenameindex "struct if_nameindex *ptr" 53.Fn if_freenameindex "struct if_nameindex *ptr"
54.Sh DESCRIPTION 54.Sh DESCRIPTION
55The functions map interface index to readable interface name 55These functions map interface indexes to interface names (such as
56.Po 56.Dq lo0 ) ,
57such as 57and vice versa.
58.Li ``lo0''
59.Pc
60, and vice versa.
61.Pp 58.Pp
59The
62.Fn if_nametoindex 60.Fn if_nametoindex
63converts readable interface name to interface index 61function converts an interface name specified by the
64.Pp positive integer value . 62.Fa ifname
63argument to an interface index (positive integer value).
65If the specified interface does not exist, 0 will be returned. 64If the specified interface does not exist, 0 will be returned.
66.Pp 65.Pp
67.Fn if_indextoname 66.Fn if_indextoname
68converts interface index to readable interface name. 67converts an interface index specified by the
68.Fa ifindex
69argument to an interface name.
69The 70The
70.Fa ifname 71.Fa ifname
71argument must point to a buffer of at least 72argument must point to a buffer of at least
72.Dv IF_NAMESIZE 73.Dv IF_NAMESIZE
73bytes into which the interface name corresponding to the specified index is 74bytes into which the interface name corresponding to the specified index is
74returned. 75returned.
75.Po 76.Pf ( Dv IF_NAMESIZE
76.Dv IF_NAMESIZE
77is also defined in 77is also defined in
78.Li <net/if.h> 78.Aq Pa net/if.h
79and its value includes a terminating null byte at the end of the 79and its value includes a terminating null byte at the end of the
80interface name. 80interface name.)
81.Pc
82This pointer is also the return value of the function. 81This pointer is also the return value of the function.
83If there is no interface corresponding to the specified index, 82If there is no interface corresponding to the specified index,
84.Dv NULL 83.Dv NULL
@@ -90,7 +89,7 @@ returns an array of
90structures. 89structures.
91.Fa if_nametoindex 90.Fa if_nametoindex
92is also defined in 91is also defined in
93.Li <net/if.h> , 92.Aq Pa net/if.h ,
94and is as follows: 93and is as follows:
95.Bd -literal -offset 94.Bd -literal -offset
96struct if_nameindex { 95struct if_nameindex {
@@ -106,9 +105,7 @@ of 0 and an
106.Fa if_name 105.Fa if_name
107of 106of
108.Dv NULL . 107.Dv NULL .
109The function returns a 108The function returns a null pointer on error.
110.Dv NULL
111pointer upon an error.
112The memory used for this array of structures along with the interface 109The memory used for this array of structures along with the interface
113names pointed to by the 110names pointed to by the
114.Fa if_name 111.Fa if_name