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.313
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/libc/net/if_indextoname.3 b/src/lib/libc/net/if_indextoname.3
index c8bb212536..eb33c94254 100644
--- a/src/lib/libc/net/if_indextoname.3
+++ b/src/lib/libc/net/if_indextoname.3
@@ -30,7 +30,7 @@
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.1 1999/07/03 20:22:21 deraadt Exp $ 33.\" $Id: if_indextoname.3,v 1.2 1999/07/03 21:43:12 deraadt Exp $
34.\" 34.\"
35.Dd May 21, 1998 35.Dd May 21, 1998
36.Dt IF_NAMETOINDEX 3 36.Dt IF_NAMETOINDEX 3
@@ -39,6 +39,7 @@
39.Nm if_nametoindex , 39.Nm if_nametoindex ,
40.Nm if_indextoname , 40.Nm if_indextoname ,
41.Nm if_nameindex , 41.Nm if_nameindex ,
42.Nm if_freenameindex
42.Nd convert interface index to name, and vice versa 43.Nd convert interface index to name, and vice versa
43.Sh SYNOPSIS 44.Sh SYNOPSIS
44.Fd #include <net/if.h> 45.Fd #include <net/if.h>
@@ -49,6 +50,7 @@
49.Ft "struct if_nameindex *" 50.Ft "struct if_nameindex *"
50.Fn if_nameindex "void" 51.Fn if_nameindex "void"
51.Ft "void" 52.Ft "void"
53.Fn if_freenameindex "struct if_nameindex *ptr"
52.Sh DESCRIPTION 54.Sh DESCRIPTION
53The functions map interface index to readable interface name 55The functions map interface index to readable interface name
54.Po 56.Po
@@ -112,8 +114,15 @@ names pointed to by the
112.Fa if_name 114.Fa if_name
113members is obtained dynamically. 115members is obtained dynamically.
114This memory is freed by the 116This memory is freed by the
115.Xr free 3 117.Fn if_freenameindex
116function. 118function.
119.Pp
120.Fn if_freenameindex
121takes a pointer that was returned by
122.Fn if_nameindex
123as argument
124.Pq Fa ptr ,
125and it reclaims the region allocated.
117.Sh DIAGNOSTICS 126.Sh DIAGNOSTICS
118.Fn if_nametoindex 127.Fn if_nametoindex
119returns 0 on error, positive integer on success. 128returns 0 on error, positive integer on success.