diff options
Diffstat (limited to 'src/lib/libc/net/if_indextoname.3')
-rw-r--r-- | src/lib/libc/net/if_indextoname.3 | 37 |
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 |
55 | The functions map interface index to readable interface name | 55 | These functions map interface indexes to interface names (such as |
56 | .Po | 56 | .Dq lo0 ) , |
57 | such as | 57 | and vice versa. |
58 | .Li ``lo0'' | ||
59 | .Pc | ||
60 | , and vice versa. | ||
61 | .Pp | 58 | .Pp |
59 | The | ||
62 | .Fn if_nametoindex | 60 | .Fn if_nametoindex |
63 | converts readable interface name to interface index | 61 | function converts an interface name specified by the |
64 | .Pp positive integer value . | 62 | .Fa ifname |
63 | argument to an interface index (positive integer value). | ||
65 | If the specified interface does not exist, 0 will be returned. | 64 | If the specified interface does not exist, 0 will be returned. |
66 | .Pp | 65 | .Pp |
67 | .Fn if_indextoname | 66 | .Fn if_indextoname |
68 | converts interface index to readable interface name. | 67 | converts an interface index specified by the |
68 | .Fa ifindex | ||
69 | argument to an interface name. | ||
69 | The | 70 | The |
70 | .Fa ifname | 71 | .Fa ifname |
71 | argument must point to a buffer of at least | 72 | argument must point to a buffer of at least |
72 | .Dv IF_NAMESIZE | 73 | .Dv IF_NAMESIZE |
73 | bytes into which the interface name corresponding to the specified index is | 74 | bytes into which the interface name corresponding to the specified index is |
74 | returned. | 75 | returned. |
75 | .Po | 76 | .Pf ( Dv IF_NAMESIZE |
76 | .Dv IF_NAMESIZE | ||
77 | is also defined in | 77 | is also defined in |
78 | .Li <net/if.h> | 78 | .Aq Pa net/if.h |
79 | and its value includes a terminating null byte at the end of the | 79 | and its value includes a terminating null byte at the end of the |
80 | interface name. | 80 | interface name.) |
81 | .Pc | ||
82 | This pointer is also the return value of the function. | 81 | This pointer is also the return value of the function. |
83 | If there is no interface corresponding to the specified index, | 82 | If there is no interface corresponding to the specified index, |
84 | .Dv NULL | 83 | .Dv NULL |
@@ -90,7 +89,7 @@ returns an array of | |||
90 | structures. | 89 | structures. |
91 | .Fa if_nametoindex | 90 | .Fa if_nametoindex |
92 | is also defined in | 91 | is also defined in |
93 | .Li <net/if.h> , | 92 | .Aq Pa net/if.h , |
94 | and is as follows: | 93 | and is as follows: |
95 | .Bd -literal -offset | 94 | .Bd -literal -offset |
96 | struct if_nameindex { | 95 | struct if_nameindex { |
@@ -106,9 +105,7 @@ of 0 and an | |||
106 | .Fa if_name | 105 | .Fa if_name |
107 | of | 106 | of |
108 | .Dv NULL . | 107 | .Dv NULL . |
109 | The function returns a | 108 | The function returns a null pointer on error. |
110 | .Dv NULL | ||
111 | pointer upon an error. | ||
112 | The memory used for this array of structures along with the interface | 109 | The memory used for this array of structures along with the interface |
113 | names pointed to by the | 110 | names pointed to by the |
114 | .Fa if_name | 111 | .Fa if_name |