summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaredy <>2005-07-22 04:50:51 +0000
committerjaredy <>2005-07-22 04:50:51 +0000
commit3553ae132550867ea92f1c819130713a94c9aa57 (patch)
tree0fcccaffb7fe67c8d9c1f46e9831c994ceadc81a
parentfca3e187a867f51bfd0b46cc4d3f49175ffddef6 (diff)
downloadopenbsd-3553ae132550867ea92f1c819130713a94c9aa57.tar.gz
openbsd-3553ae132550867ea92f1c819130713a94c9aa57.tar.bz2
openbsd-3553ae132550867ea92f1c819130713a94c9aa57.zip
- sync prototypes and header file excerpts
- typos/spelling, punctuation, rewording, macro, and layout fixes. help & ok jmc
-rw-r--r--src/lib/libc/net/byteorder.36
-rw-r--r--src/lib/libc/net/ethers.35
-rw-r--r--src/lib/libc/net/gethostbyname.321
-rw-r--r--src/lib/libc/net/getifaddrs.38
-rw-r--r--src/lib/libc/net/getnetent.34
-rw-r--r--src/lib/libc/net/getprotoent.314
-rw-r--r--src/lib/libc/net/getrrsetbyname.353
-rw-r--r--src/lib/libc/net/getservent.310
-rw-r--r--src/lib/libc/net/if_indextoname.325
-rw-r--r--src/lib/libc/net/inet.312
-rw-r--r--src/lib/libc/net/inet_net.323
-rw-r--r--src/lib/libc/net/link_addr.35
-rw-r--r--src/lib/libc/net/resolver.332
13 files changed, 116 insertions, 102 deletions
diff --git a/src/lib/libc/net/byteorder.3 b/src/lib/libc/net/byteorder.3
index 54123455c6..e548958617 100644
--- a/src/lib/libc/net/byteorder.3
+++ b/src/lib/libc/net/byteorder.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: byteorder.3,v 1.13 2003/09/26 17:06:50 fgsch Exp $ 1.\" $OpenBSD: byteorder.3,v 1.14 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -97,7 +97,7 @@ byte orderings.
97The 97The
98.Dq swap 98.Dq swap
99functions reverse the byte ordering of 99functions reverse the byte ordering of
100the given quantity, the others converts either from/to the native 100the given quantity; the others convert either from/to the native
101byte order used by the host to/from either little- or big-endian (a.k.a 101byte order used by the host to/from either little- or big-endian (a.k.a
102network) order. 102network) order.
103.Pp 103.Pp
@@ -165,7 +165,7 @@ The functions involving either
165or 165or
166.Dq swap 166.Dq swap
167use the numbers 167use the numbers
16816, 32 and 64 for specifying the bitwidth of the quantities they operate on. 16816, 32, or 64 for specifying the bitwidth of the quantities they operate on.
169Currently all supported architectures are either big- or little-endian 169Currently all supported architectures are either big- or little-endian
170so either the 170so either the
171.Dq be 171.Dq be
diff --git a/src/lib/libc/net/ethers.3 b/src/lib/libc/net/ethers.3
index 72ea79bb2c..febd62392e 100644
--- a/src/lib/libc/net/ethers.3
+++ b/src/lib/libc/net/ethers.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ethers.3,v 1.15 2005/03/28 06:21:48 tedu Exp $ 1.\" $OpenBSD: ethers.3,v 1.16 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Written by roland@frob.com. Public domain. 3.\" Written by roland@frob.com. Public domain.
4.\" 4.\"
@@ -14,6 +14,9 @@
14.Nm ether_line 14.Nm ether_line
15.Nd get ethers entry 15.Nd get ethers entry
16.Sh SYNOPSIS 16.Sh SYNOPSIS
17.Fd #include <sys/socket.h>
18.Fd #include <net/if.h>
19.Fd #include <netinet/in.h>
17.Fd #include <netinet/if_ether.h> 20.Fd #include <netinet/if_ether.h>
18.Ft char * 21.Ft char *
19.Fn ether_ntoa "struct ether_addr *e" 22.Fn ether_ntoa "struct ether_addr *e"
diff --git a/src/lib/libc/net/gethostbyname.3 b/src/lib/libc/net/gethostbyname.3
index c2db100c9b..f3f3ea580f 100644
--- a/src/lib/libc/net/gethostbyname.3
+++ b/src/lib/libc/net/gethostbyname.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: gethostbyname.3,v 1.23 2005/06/08 18:32:34 millert Exp $ 1.\" $OpenBSD: gethostbyname.3,v 1.24 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1987, 1991, 1993 3.\" Copyright (c) 1983, 1987, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -42,7 +42,7 @@
42.Nd get network host entry 42.Nd get network host entry
43.Sh SYNOPSIS 43.Sh SYNOPSIS
44.Fd #include <netdb.h> 44.Fd #include <netdb.h>
45.Fd extern int h_errno; 45.Vt extern int h_errno ;
46.Ft struct hostent * 46.Ft struct hostent *
47.Fn gethostbyname "const char *name" 47.Fn gethostbyname "const char *name"
48.Ft struct hostent * 48.Ft struct hostent *
@@ -62,11 +62,11 @@
62.Sh DESCRIPTION 62.Sh DESCRIPTION
63The 63The
64.Fn gethostbyname , 64.Fn gethostbyname ,
65.Fn gethostbyname2 65.Fn gethostbyname2 ,
66and 66and
67.Fn gethostbyaddr 67.Fn gethostbyaddr
68functions each return a pointer to an object with the following structure 68functions each return a pointer to an object with the following structure
69describing an internet host referenced by name or by address, respectively. 69describing an Internet host referenced by name or by address, respectively.
70This structure contains either information obtained from the name server (i.e., 70This structure contains either information obtained from the name server (i.e.,
71.Xr resolver 3 71.Xr resolver 3
72and 72and
@@ -78,15 +78,15 @@ or database entries supplied by the
78system. 78system.
79.Xr resolv.conf 5 79.Xr resolv.conf 5
80describes how the particular database is chosen. 80describes how the particular database is chosen.
81.Bd -literal 81.Bd -literal -offset indent
82struct hostent { 82struct hostent {
83 char *h_name; /* official name of host */ 83 char *h_name; /* official name of host */
84 char **h_aliases; /* alias list */ 84 char **h_aliases; /* alias list */
85 int h_addrtype; /* host address type */ 85 int h_addrtype; /* host address type */
86 int h_length; /* length of address */ 86 int h_length; /* length of address */
87 char **h_addr_list; /* list of addresses from name server */ 87 char **h_addr_list; /* list of returned addresses */
88}; 88};
89#define h_addr h_addr_list[0] /* address, for backward compatibility */ 89#define h_addr h_addr_list[0] /* address, for backward compat */
90.Ed 90.Ed
91.Pp 91.Pp
92The members of this structure are: 92The members of this structure are:
@@ -94,13 +94,13 @@ The members of this structure are:
94.It Fa h_name 94.It Fa h_name
95Official name of the host. 95Official name of the host.
96.It Fa h_aliases 96.It Fa h_aliases
97A NULL-terminated array of alternate names for the host. 97A null-terminated array of alternate names for the host.
98.It Fa h_addrtype 98.It Fa h_addrtype
99The type of address being returned. 99The type of address being returned.
100.It Fa h_length 100.It Fa h_length
101The length, in bytes, of the address. 101The length, in bytes, of the address.
102.It Fa h_addr_list 102.It Fa h_addr_list
103A zero-terminated array of network addresses for the host. 103A null-terminated array of network addresses for the host.
104Host addresses are returned in network byte order. 104Host addresses are returned in network byte order.
105.It Fa h_addr 105.It Fa h_addr
106The first address in 106The first address in
@@ -227,7 +227,7 @@ will result in an answer;
227for example, a mail-forwarder may be registered for this domain. 227for example, a mail-forwarder may be registered for this domain.
228.It Dv NETDB_INTERNAL 228.It Dv NETDB_INTERNAL
229An internal error occurred. 229An internal error occurred.
230This may occurs when an address family other than 230This may occur when an address family other than
231.Dv AF_INET 231.Dv AF_INET
232or 232or
233.Dv AF_INET6 233.Dv AF_INET6
@@ -287,6 +287,7 @@ function closes the file.
287These functions use static data storage; 287These functions use static data storage;
288if the data is needed for future use, it should be 288if the data is needed for future use, it should be
289copied before any subsequent calls overwrite it. 289copied before any subsequent calls overwrite it.
290.Pp
290Only the Internet 291Only the Internet
291address formats are currently understood. 292address formats are currently understood.
292.Pp 293.Pp
diff --git a/src/lib/libc/net/getifaddrs.3 b/src/lib/libc/net/getifaddrs.3
index ffbdf4da41..e6380be4b7 100644
--- a/src/lib/libc/net/getifaddrs.3
+++ b/src/lib/libc/net/getifaddrs.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getifaddrs.3,v 1.11 2004/04/16 10:48:39 jmc Exp $ 1.\" $OpenBSD: getifaddrs.3,v 1.12 2005/07/22 04:50:51 jaredy Exp $
2.\" BSDI getifaddrs.3,v 2.5 2000/02/23 14:51:59 dab Exp 2.\" BSDI getifaddrs.3,v 2.5 2000/02/23 14:51:59 dab Exp
3.\" 3.\"
4.\" Copyright (c) 1995, 1999 4.\" Copyright (c) 1995, 1999
@@ -58,12 +58,12 @@ structure contains at least the following entries:
58 struct sockaddr *ifa_dstaddr; /* P2P interface destination */ 58 struct sockaddr *ifa_dstaddr; /* P2P interface destination */
59 void *ifa_data; /* Address specific data */ 59 void *ifa_data; /* Address specific data */
60.Ed 60.Ed
61.Bl -tag -width Ds 61.Bl -tag -width ifa_broadaddr
62.It Fa ifa_next 62.It Fa ifa_next
63Contains a pointer to the next structure on the list. 63Contains a pointer to the next structure on the list.
64This field is set to 64This field is set to
65.Dv NULL 65.Dv NULL
66in last structure on the list. 66in the last structure on the list.
67.It Fa ifa_name 67.It Fa ifa_name
68Contains the interface name. 68Contains the interface name.
69.It Fa ifa_flags 69.It Fa ifa_flags
@@ -142,7 +142,7 @@ or
142The 142The
143.Fn getifaddrs 143.Fn getifaddrs
144function first appeared in BSDI BSD/OS. 144function first appeared in BSDI BSD/OS.
145The function is supplied on 145The function has been available on
146.Ox 146.Ox
147since 147since
148.Ox 2.7 . 148.Ox 2.7 .
diff --git a/src/lib/libc/net/getnetent.3 b/src/lib/libc/net/getnetent.3
index 40b50a8c3f..b337c8c02d 100644
--- a/src/lib/libc/net/getnetent.3
+++ b/src/lib/libc/net/getnetent.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getnetent.3,v 1.13 2004/02/01 19:45:00 nordin Exp $ 1.\" $OpenBSD: getnetent.3,v 1.14 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -72,7 +72,7 @@ The members of this structure are:
72.It Fa n_name 72.It Fa n_name
73The official name of the network. 73The official name of the network.
74.It Fa n_aliases 74.It Fa n_aliases
75A zero-terminated list of alternate names for the network. 75A null-terminated list of alternate names for the network.
76.It Fa n_addrtype 76.It Fa n_addrtype
77The type of the network number returned; currently only 77The type of the network number returned; currently only
78.Dv AF_INET . 78.Dv AF_INET .
diff --git a/src/lib/libc/net/getprotoent.3 b/src/lib/libc/net/getprotoent.3
index 7b50952362..ea3644f6c9 100644
--- a/src/lib/libc/net/getprotoent.3
+++ b/src/lib/libc/net/getprotoent.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getprotoent.3,v 1.15 2005/06/05 19:40:21 jmc Exp $ 1.\" $OpenBSD: getprotoent.3,v 1.16 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -87,7 +87,7 @@ The members of this structure are:
87.It Fa p_name 87.It Fa p_name
88The official name of the protocol. 88The official name of the protocol.
89.It Fa p_aliases 89.It Fa p_aliases
90A zero-terminated list of alternate names for the protocol. 90A null-terminated list of alternate names for the protocol.
91.It Fa p_proto 91.It Fa p_proto
92The protocol number. 92The protocol number.
93.El 93.El
@@ -102,7 +102,7 @@ function opens and rewinds the file.
102If the 102If the
103.Fa stayopen 103.Fa stayopen
104flag is non-zero, 104flag is non-zero,
105the net database will not be closed after each call to 105the protocol database will not be closed after each call to
106.Fn getprotobyname 106.Fn getprotobyname
107or 107or
108.Fn getprotobynumber . 108.Fn getprotobynumber .
@@ -129,7 +129,7 @@ and
129.Fn endprotoent_r 129.Fn endprotoent_r
130functions are reentrant versions of the above functions that take a 130functions are reentrant versions of the above functions that take a
131pointer to a 131pointer to a
132.Fa protoent_data 132.Vt protoent_data
133structure which is used to store state information. 133structure which is used to store state information.
134The structure must be zero-filled before it is used 134The structure must be zero-filled before it is used
135and should be considered opaque for the sake of portability. 135and should be considered opaque for the sake of portability.
@@ -141,7 +141,7 @@ and
141.Fn getprotobyname_r 141.Fn getprotobyname_r
142functions 142functions
143also take a pointer to a 143also take a pointer to a
144.Fa protoent 144.Vt protoent
145structure which is used to store the results of the database lookup. 145structure which is used to store the results of the database lookup.
146.Sh RETURN VALUES 146.Sh RETURN VALUES
147The 147The
@@ -150,7 +150,7 @@ The
150and 150and
151.Fn getprotobyname 151.Fn getprotobyname
152functions return a pointer to a 152functions return a pointer to a
153.Fa servent 153.Vt protoent
154structure on success or a null pointer if end-of-file 154structure on success or a null pointer if end-of-file
155is reached or an error occurs. 155is reached or an error occurs.
156.Pp 156.Pp
@@ -186,7 +186,7 @@ The
186and 186and
187.Fn endprotoent_r 187.Fn endprotoent_r
188functions are not currently standardized. 188functions are not currently standardized.
189This implementation follows the API used by HP, IBM and Digital. 189This implementation follows the API used by HP, IBM, and Digital.
190.Sh HISTORY 190.Sh HISTORY
191The 191The
192.Fn getprotoent , 192.Fn getprotoent ,
diff --git a/src/lib/libc/net/getrrsetbyname.3 b/src/lib/libc/net/getrrsetbyname.3
index 621ff31b81..c951f905ab 100644
--- a/src/lib/libc/net/getrrsetbyname.3
+++ b/src/lib/libc/net/getrrsetbyname.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getrrsetbyname.3,v 1.13 2005/02/25 03:12:43 cloder Exp $ 1.\" $OpenBSD: getrrsetbyname.3,v 1.14 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (C) 2000, 2001 Internet Software Consortium. 3.\" Copyright (C) 2000, 2001 Internet Software Consortium.
4.\" 4.\"
@@ -19,6 +19,7 @@
19.Dt GETRRSETBYNAME 3 19.Dt GETRRSETBYNAME 3
20.Os 20.Os
21.Sh NAME 21.Sh NAME
22.Nm freerrset ,
22.Nm getrrsetbyname 23.Nm getrrsetbyname
23.Nd retrieve DNS records 24.Nd retrieve DNS records
24.Sh SYNOPSIS 25.Sh SYNOPSIS
@@ -32,7 +33,7 @@
32.Fn getrrsetbyname 33.Fn getrrsetbyname
33gets a set of resource records associated with a 34gets a set of resource records associated with a
34.Fa hostname , 35.Fa hostname ,
35.Fa rdclass 36.Fa rdclass ,
36and 37and
37.Fa rdtype . 38.Fa rdtype .
38.Fa hostname 39.Fa hostname
@@ -74,22 +75,22 @@ bit is set, the data has been DNSSEC
74validated and the signatures verified. 75validated and the signatures verified.
75.Pp 76.Pp
76The following structures are used: 77The following structures are used:
77.Bd -literal -offset 78.Bd -literal -offset indent
78struct rdatainfo { 79struct rdatainfo {
79 unsigned int rdi_length; /* length of data */ 80 unsigned int rdi_length; /* length of data */
80 unsigned char *rdi_data; /* record data */ 81 unsigned char *rdi_data; /* record data */
81}; 82};
82 83
83struct rrsetinfo { 84struct rrsetinfo {
84 unsigned int rri_flags; /* RRSET_VALIDATED ... */ 85 unsigned int rri_flags; /* RRSET_VALIDATED ... */
85 unsigned int rri_rdclass; /* class number */ 86 unsigned int rri_rdclass; /* class number */
86 unsigned int rri_rdtype; /* RR type number */ 87 unsigned int rri_rdtype; /* RR type number */
87 unsigned int rri_ttl; /* time to live */ 88 unsigned int rri_ttl; /* time to live */
88 unsigned int rri_nrdatas; /* size of rdatas array */ 89 unsigned int rri_nrdatas; /* size of rdatas array */
89 unsigned int rri_nsigs; /* size of sigs array */ 90 unsigned int rri_nsigs; /* size of sigs array */
90 char *rri_name; /* canonical name */ 91 char *rri_name; /* canonical name */
91 struct rdatainfo *rri_rdatas; /* individual records */ 92 struct rdatainfo *rri_rdatas; /* individual records */
92 struct rdatainfo *rri_sigs; /* individual signatures */ 93 struct rdatainfo *rri_sigs; /* individual signatures */
93}; 94};
94.Ed 95.Ed
95.Pp 96.Pp
@@ -110,7 +111,7 @@ is released by
110.Fn freerrset . 111.Fn freerrset .
111.Li rrset 112.Li rrset
112is a pointer to a 113is a pointer to a
113.Li struct rrset 114.Li struct rrsetinfo
114created by a call to 115created by a call to
115.Fn getrrsetbyname . 116.Fn getrrsetbyname .
116.Pp 117.Pp
@@ -123,17 +124,17 @@ will request DNSSEC authentication using the EDNS0 DNSSEC OK (DO) bit.
123returns zero on success, and one of the following error 124returns zero on success, and one of the following error
124codes if an error occurred: 125codes if an error occurred:
125.Pp 126.Pp
126.Bl -tag -width ERRSET_NOMEMORY -compact 127.Bl -tag -width ERRSET_NOMEMORY
127.It Dv ERRSET_NONAME 128.It Bq Er ERRSET_NONAME
128the name does not exist 129The name does not exist.
129.It Dv ERRSET_NODATA 130.It Bq Er ERRSET_NODATA
130the name exists, but does not have data of the desired type 131The name exists, but does not have data of the desired type.
131.It Dv ERRSET_NOMEMORY 132.It Bq Er ERRSET_NOMEMORY
132memory could not be allocated 133Memory could not be allocated.
133.It Dv ERRSET_INVAL 134.It Bq Er ERRSET_INVAL
134a parameter is invalid 135A parameter is invalid.
135.It Dv ERRSET_FAIL 136.It Bq Er ERRSET_FAIL
136other failure 137Other failure.
137.El 138.El
138.Sh SEE ALSO 139.Sh SEE ALSO
139.Xr resolver 3 , 140.Xr resolver 3 ,
diff --git a/src/lib/libc/net/getservent.3 b/src/lib/libc/net/getservent.3
index aa24aab13a..839d89de6c 100644
--- a/src/lib/libc/net/getservent.3
+++ b/src/lib/libc/net/getservent.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getservent.3,v 1.18 2005/06/05 19:44:16 jmc Exp $ 1.\" $OpenBSD: getservent.3,v 1.19 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -87,7 +87,7 @@ The members of this structure are:
87.It Fa s_name 87.It Fa s_name
88The official name of the service. 88The official name of the service.
89.It Fa s_aliases 89.It Fa s_aliases
90A zero-terminated list of alternate names for the service. 90A null-terminated list of alternate names for the service.
91.It Fa s_port 91.It Fa s_port
92The port number at which the service resides. 92The port number at which the service resides.
93Port numbers are returned in network byte order. 93Port numbers are returned in network byte order.
@@ -105,7 +105,7 @@ function opens and rewinds the file.
105If the 105If the
106.Fa stayopen 106.Fa stayopen
107flag is non-zero, 107flag is non-zero,
108the net database will not be closed after each call to 108the services database will not be closed after each call to
109.Fn getservbyname 109.Fn getservbyname
110or 110or
111.Fn getservbyport . 111.Fn getservbyport .
@@ -193,7 +193,7 @@ The
193and 193and
194.Fn endservent_r 194.Fn endservent_r
195functions are not currently standardized. 195functions are not currently standardized.
196This implementation follows the API used by HP, IBM and Digital. 196This implementation follows the API used by HP, IBM, and Digital.
197.Sh HISTORY 197.Sh HISTORY
198The 198The
199.Fn getservent , 199.Fn getservent ,
@@ -203,8 +203,8 @@ The
203and 203and
204.Fn endservent 204.Fn endservent
205functions appeared in 205functions appeared in
206.Pp
207.Bx 4.2 . 206.Bx 4.2 .
207.Pp
208The 208The
209.Fn getservent_r , 209.Fn getservent_r ,
210.Fn getservbyport_r , 210.Fn getservbyport_r ,
diff --git a/src/lib/libc/net/if_indextoname.3 b/src/lib/libc/net/if_indextoname.3
index e7bfde4900..b0545a5060 100644
--- a/src/lib/libc/net/if_indextoname.3
+++ b/src/lib/libc/net/if_indextoname.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: if_indextoname.3,v 1.8 2005/02/25 03:12:43 cloder Exp $ 1.\" $OpenBSD: if_indextoname.3,v 1.9 2005/07/22 04:50:51 jaredy Exp $
2.\" Copyright (c) 1983, 1991, 1993 2.\" Copyright (c) 1983, 1991, 1993
3.\" The Regents of the University of California. All rights reserved. 3.\" The Regents of the University of California. All rights reserved.
4.\" 4.\"
@@ -38,6 +38,7 @@
38.Nm if_freenameindex 38.Nm if_freenameindex
39.Nd convert interface index to name, and vice versa 39.Nd convert interface index to name, and vice versa
40.Sh SYNOPSIS 40.Sh SYNOPSIS
41.Fd #include <sys/socket.h>
41.Fd #include <net/if.h> 42.Fd #include <net/if.h>
42.Ft "unsigned int" 43.Ft "unsigned int"
43.Fn if_nametoindex "const char *ifname" 44.Fn if_nametoindex "const char *ifname"
@@ -81,16 +82,16 @@ is returned.
81.Pp 82.Pp
82.Fn if_nameindex 83.Fn if_nameindex
83returns an array of 84returns an array of
84.Fa if_nameindex 85.Vt if_nameindex
85structures. 86structures.
86.Fa if_nametoindex 87.Vt if_nameindex
87is also defined in 88is also defined in
88.Aq Pa net/if.h , 89.Aq Pa net/if.h ,
89and is as follows: 90and is as follows:
90.Bd -literal -offset 91.Bd -literal -offset indent
91struct if_nameindex { 92struct if_nameindex {
92 unsigned int if_index; /* 1, 2, ... */ 93 unsigned int if_index; /* 1, 2, ... */
93 char *if_name; /* NUL-terminated name: "le0", ... */ 94 char *if_name; /* NUL-terminated name */
94}; 95};
95.Ed 96.Ed
96.Pp 97.Pp
@@ -128,9 +129,15 @@ on errors.
128.Sh SEE ALSO 129.Sh SEE ALSO
129.Xr getifaddrs 3 , 130.Xr getifaddrs 3 ,
130.Xr networking 4 131.Xr networking 4
131.Pp 132.Rs
132R. Gilligan, S. Thomson, J. Bound, and W. Stevens, 133.%A R. Gilligan
133``Basic Socket Interface Extensions for IPv6,'' RFC 2553, March 1999. 134.%A S. Thomson
135.%A J. Bound
136.%A W. Stevens
137.%T Basic Socket Interface Extensions for IPv6
138.%R RFC 2553
139.%D March 1999
140.Re
134.Sh STANDARDS 141.Sh STANDARDS
135These functions are defined in ``Basic Socket Interface Extensions for IPv6'' 142These functions are defined in ``Basic Socket Interface Extensions for IPv6''
136.Pq RFC 2533 . 143.Pq RFC 2533 .
diff --git a/src/lib/libc/net/inet.3 b/src/lib/libc/net/inet.3
index 43cb5bafd7..f22e4b7d6f 100644
--- a/src/lib/libc/net/inet.3
+++ b/src/lib/libc/net/inet.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: inet.3,v 1.18 2003/09/09 12:00:39 jmc Exp $ 1.\" $OpenBSD: inet.3,v 1.19 2005/07/22 04:50:51 jaredy Exp $
2.\" $NetBSD: inet.3,v 1.7 1997/06/18 02:25:24 lukem Exp $ 2.\" $NetBSD: inet.3,v 1.7 1997/06/18 02:25:24 lukem Exp $
3.\" 3.\"
4.\" Copyright (c) 1983, 1990, 1991, 1993 4.\" Copyright (c) 1983, 1990, 1991, 1993
@@ -70,7 +70,7 @@
70.Sh DESCRIPTION 70.Sh DESCRIPTION
71The routines 71The routines
72.Fn inet_aton , 72.Fn inet_aton ,
73.Fn inet_addr 73.Fn inet_addr ,
74and 74and
75.Fn inet_network 75.Fn inet_network
76interpret character strings representing 76interpret character strings representing
@@ -83,8 +83,8 @@ function converts a presentation format address (that is, printable form
83as held in a character string) to network format (usually a 83as held in a character string) to network format (usually a
84.Li struct in_addr 84.Li struct in_addr
85or some other internal binary representation, in network byte order). 85or some other internal binary representation, in network byte order).
86It returns 1 if the address was valid for the specified address family, or 86It returns 1 if the address was valid for the specified address family;
870 if the address wasn't parseable in the specified address family, or \-1 870 if the address wasn't parseable in the specified address family; or \-1
88if some system error occurred (in which case 88if some system error occurred (in which case
89.Va errno 89.Va errno
90will have been set). 90will have been set).
@@ -192,7 +192,7 @@ in a
192notation 192notation
193may be decimal, octal, or hexadecimal, as specified 193may be decimal, octal, or hexadecimal, as specified
194in the C language (i.e., a leading 0x or 0X implies 194in the C language (i.e., a leading 0x or 0X implies
195hexadecimal; otherwise, a leading 0 implies octal; 195hexadecimal; a leading 0 implies octal;
196otherwise, the number is interpreted as decimal). 196otherwise, the number is interpreted as decimal).
197.Sh INTERNET ADDRESSES (IP VERSION 6) 197.Sh INTERNET ADDRESSES (IP VERSION 6)
198In order to support scoped IPv6 addresses, 198In order to support scoped IPv6 addresses,
@@ -314,7 +314,7 @@ The
314.Nm inet_addr , 314.Nm inet_addr ,
315.Nm inet_network , 315.Nm inet_network ,
316.Nm inet_makeaddr , 316.Nm inet_makeaddr ,
317.Nm inet_lnaof 317.Nm inet_lnaof ,
318and 318and
319.Nm inet_netof 319.Nm inet_netof
320functions appeared in 320functions appeared in
diff --git a/src/lib/libc/net/inet_net.3 b/src/lib/libc/net/inet_net.3
index c14fa52e38..569ddfc5c6 100644
--- a/src/lib/libc/net/inet_net.3
+++ b/src/lib/libc/net/inet_net.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: inet_net.3,v 1.10 2003/05/01 19:17:37 jmc Exp $ 1.\" $OpenBSD: inet_net.3,v 1.11 2005/07/22 04:50:51 jaredy Exp $
2.\" $NetBSD: inet_net.3,v 1.1 1997/06/18 02:25:27 lukem Exp $ 2.\" $NetBSD: inet_net.3,v 1.1 1997/06/18 02:25:27 lukem Exp $
3.\" 3.\"
4.\" Copyright (c) 1997 The NetBSD Foundation, Inc. 4.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -120,35 +120,36 @@ is not specified the number of bits in the network address is calculated
120as the larger of the number of bits in the class to which the address 120as the larger of the number of bits in the class to which the address
121belongs and the number of bits provided rounded up modulo 8. 121belongs and the number of bits provided rounded up modulo 8.
122Examples: 122Examples:
123.Bl -tag -width 10.1.2.3/24 123.Pp
124.Bl -tag -width 10.1.2.3/24 -offset indent -compact
124.It Li 10 125.It Li 10
125an 8 bit network number (class A), value 126an 8-bit network number (class A), value
126.Li 10.0.0.0 . 127.Li 10.0.0.0 .
127.It Li 192 128.It Li 192
128a 24 bit network number (class C), value 129a 24-bit network number (class C), value
129.Li 192.0.0.0 . 130.Li 192.0.0.0 .
130.It Li 10.10 131.It Li 10.10
131a 16 bit network number, value 132a 16-bit network number, value
132.Li 10.10.0.0 . 133.Li 10.10.0.0 .
133.It Li 10.1.2 134.It Li 10.1.2
134a 24 bit network number, value 135a 24-bit network number, value
135.Li 10.1.2.0 . 136.Li 10.1.2.0 .
136.It Li 10.1.2.3 137.It Li 10.1.2.3
137a 32 bit network number, value 138a 32-bit network number, value
138.Li 10.1.2.3 . 139.Li 10.1.2.3 .
139.It Li 10.1.2.3/24 140.It Li 10.1.2.3/24
140a 24 bit network number (explicit), value 141a 24-bit network number (explicit), value
141.Li 10.1.2.3 . 142.Li 10.1.2.3 .
142.El 143.El
143.Pp 144.Pp
144Note that when the number of bits is specified using 145Note that when the number of bits is specified using
145.Dq Li /bits 146.Dq Li /bits
146notation, the value of the address still includes all bits suplied 147notation, the value of the address still includes all bits supplied
147in the external representation, even those bits which are the host 148in the external representation, even those bits which are the host
148part of an internet address. 149part of an Internet address.
149Also, unlike 150Also, unlike
150.Xr inet_pton 3 151.Xr inet_pton 3
151where the external representation is assumed to be an internet address, the 152where the external representation is assumed to be a host address, the
152external representation for 153external representation for
153.Fn inet_net_pton 154.Fn inet_net_pton
154is assumed to be a network address. 155is assumed to be a network address.
diff --git a/src/lib/libc/net/link_addr.3 b/src/lib/libc/net/link_addr.3
index 0f8787e191..fc1fd85257 100644
--- a/src/lib/libc/net/link_addr.3
+++ b/src/lib/libc/net/link_addr.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: link_addr.3,v 1.10 2005/02/25 03:12:43 cloder Exp $ 1.\" $OpenBSD: link_addr.3,v 1.11 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (c) 1993 3.\" Copyright (c) 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -105,7 +105,8 @@ and
105functions appeared in 105functions appeared in
106.Bx 4.3 Reno . 106.Bx 4.3 Reno .
107.Sh BUGS 107.Sh BUGS
108The returned values for link_ntoa 108The returned values for
109.Fn link_ntoa
109reside in a static memory area. 110reside in a static memory area.
110.Pp 111.Pp
111The function 112The function
diff --git a/src/lib/libc/net/resolver.3 b/src/lib/libc/net/resolver.3
index d1eb2298ae..c9532e9c94 100644
--- a/src/lib/libc/net/resolver.3
+++ b/src/lib/libc/net/resolver.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: resolver.3,v 1.19 2005/04/05 22:14:20 fgsch Exp $ 1.\" $OpenBSD: resolver.3,v 1.20 2005/07/22 04:50:51 jaredy Exp $
2.\" 2.\"
3.\" Copyright (c) 1985, 1991, 1993 3.\" Copyright (c) 1985, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -49,7 +49,7 @@
49.Fa "const char *dname" 49.Fa "const char *dname"
50.Fa "int class" 50.Fa "int class"
51.Fa "int type" 51.Fa "int type"
52.Fa "u_char *answer" 52.Fa "unsigned char *answer"
53.Fa "int anslen" 53.Fa "int anslen"
54.Fc 54.Fc
55.Ft int 55.Ft int
@@ -57,7 +57,7 @@
57.Fa "const char *dname" 57.Fa "const char *dname"
58.Fa "int class" 58.Fa "int class"
59.Fa "int type" 59.Fa "int type"
60.Fa "u_char *answer" 60.Fa "unsigned char *answer"
61.Fa "int anslen" 61.Fa "int anslen"
62.Fc 62.Fc
63.Ft int 63.Ft int
@@ -66,17 +66,17 @@
66.Fa "const char *dname" 66.Fa "const char *dname"
67.Fa "int class" 67.Fa "int class"
68.Fa "int type" 68.Fa "int type"
69.Fa "const u_char *data" 69.Fa "const unsigned char *data"
70.Fa "int datalen" 70.Fa "int datalen"
71.Fa "const u_char *newrr" 71.Fa "const unsigned char *newrr"
72.Fa "u_char *buf" 72.Fa "unsigned char *buf"
73.Fa "int buflen" 73.Fa "int buflen"
74.Fc 74.Fc
75.Ft int 75.Ft int
76.Fo res_send 76.Fo res_send
77.Fa "const u_char *msg" 77.Fa "const unsigned char *msg"
78.Fa "int msglen" 78.Fa "int msglen"
79.Fa "u_char *answer" 79.Fa "unsigned char *answer"
80.Fa "int anslen" 80.Fa "int anslen"
81.Fc 81.Fc
82.Ft int 82.Ft int
@@ -84,16 +84,16 @@
84.Ft int 84.Ft int
85.Fo dn_comp 85.Fo dn_comp
86.Fa "const char *exp_dn" 86.Fa "const char *exp_dn"
87.Fa "u_char *comp_dn" 87.Fa "unsigned char *comp_dn"
88.Fa "int length" 88.Fa "int length"
89.Fa "u_char **dnptrs" 89.Fa "unsigned char **dnptrs"
90.Fa "u_char **lastdnptr" 90.Fa "unsigned char **lastdnptr"
91.Fc 91.Fc
92.Ft int 92.Ft int
93.Fo dn_expand 93.Fo dn_expand
94.Fa "const u_char *msg" 94.Fa "const unsigned char *msg"
95.Fa "const u_char *eomorig" 95.Fa "const unsigned char *eomorig"
96.Fa "const u_char *comp_dn" 96.Fa "const unsigned char *comp_dn"
97.Fa "char *exp_dn" 97.Fa "char *exp_dn"
98.Fa "int length" 98.Fa "int length"
99.Fc 99.Fc
@@ -237,7 +237,7 @@ and
237.Fa type 237.Fa type
238fields 238fields
239are defined in 239are defined in
240.Aq Pa arpa/nameserv.h . 240.Aq Pa arpa/nameser.h .
241.Pp 241.Pp
242The 242The
243.Fn res_search 243.Fn res_search
@@ -304,7 +304,7 @@ A side effect of
304is to update the list of pointers for labels inserted into the message 304is to update the list of pointers for labels inserted into the message
305as the name is compressed. 305as the name is compressed.
306If 306If
307.Em dnptr 307.Fa dnptrs
308is 308is
309.Dv NULL , 309.Dv NULL ,
310names are not compressed. 310names are not compressed.