diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/byteorder.3 | 107 | ||||
-rw-r--r-- | lib/libc/net/ethers.3 | 34 | ||||
-rw-r--r-- | lib/libc/net/getaddrinfo.3 | 97 | ||||
-rw-r--r-- | lib/libc/net/gethostbyname.3 | 34 | ||||
-rw-r--r-- | lib/libc/net/getnameinfo.3 | 33 | ||||
-rw-r--r-- | lib/libc/net/getnetent.3 | 11 | ||||
-rw-r--r-- | lib/libc/net/getprotoent.3 | 11 | ||||
-rw-r--r-- | lib/libc/net/getservent.3 | 14 | ||||
-rw-r--r-- | lib/libc/net/if_indextoname.3 | 37 | ||||
-rw-r--r-- | lib/libc/net/inet.3 | 38 | ||||
-rw-r--r-- | lib/libc/net/inet_net.3 | 24 | ||||
-rw-r--r-- | lib/libc/net/ipx.3 | 18 | ||||
-rw-r--r-- | lib/libc/net/iso_addr.3 | 8 | ||||
-rw-r--r-- | lib/libc/net/link_addr.3 | 15 | ||||
-rw-r--r-- | lib/libc/net/ns.3 | 18 | ||||
-rw-r--r-- | lib/libc/net/rcmd.3 | 38 | ||||
-rw-r--r-- | lib/libc/net/rcmdsh.3 | 11 | ||||
-rw-r--r-- | lib/libc/net/resolver.3 | 17 |
18 files changed, 299 insertions, 266 deletions
diff --git a/lib/libc/net/byteorder.3 b/lib/libc/net/byteorder.3 index aa11b22664f..64a13d47baf 100644 --- a/lib/libc/net/byteorder.3 +++ b/lib/libc/net/byteorder.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: byteorder.3,v 1.6 1999/05/23 14:11:01 aaron Exp $ +.\" $OpenBSD: byteorder.3,v 1.7 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -82,56 +82,86 @@ .Ft u_int16_t .Fn swap16 "u_int16_t val16" .Sh DESCRIPTION -These routines convert 16 and 32 bit quantities between different -byte orderings. The "swap" functions reverse the byte ordering of +These routines convert 16- and 32-bit quantities between different +byte orderings. The +.Dq swap +functions reverse the byte ordering of the given quantity, the others converts either from/to the native byte order used by the host to/from either little- or big-endian (a.k.a network) order. .Pp -Apart from the "swap" functions, the names can be described by this form: +Apart from the swap functions, the names can be described by this form: {src-order}to{dst-order}{size}. Both {src-order} and {dst-order} can take the following forms: -.Bl -tag -width "be " -.It Em h -host order -.It Em n -network order (big-endian) -.It Em be -big-endian (Most significant byte first) -.It Em le -little-endian (Least significant byte first) +.Pp +.Bl -tag -width "be " -offset indent -compact +.It h +Host order. +.It n +Network order (big-endian). +.It be +Big-endian (most significant byte first). +.It le +Little-endian (least significant byte first). .El .Pp -One of the specified orderings must be "h". -{Size} will take these forms: -.Bl -tag -width "32 " -.It Em l -long (32-bit, used in conjunction with forms involving "n") -.It Em s -short (16-bit, used in conjunction with forms involving "n") -.It Em 16 -16-bit -.It Em 32 -32-bit +One of the specified orderings must be +.Sq h . +{size} will take these forms: +.Pp +.Bl -tag -width "32 " -offset indent -compact +.It l +Long (32-bit, used in conjunction with forms involving +.Sq n ) . +.It s +Short (16-bit, used in conjunction with forms involving +.Sq n ) . +.It 16 +16-bit. +.It 32 +32-bit. .El .Pp -The "swap" functions are of the form: swap{size}. +The swap functions are of the form: swap{size}. .Pp -Names involving "n" convert quantities between network -byte order and host byte order. The last letter (s/l) is a mnemonic -for the traditional names for such quantities, short and long, -respectively. Today, the C concept of "short"/"long" integers -need not coincide with this traditional misunderstanding. +Names involving +.Sq n +convert quantities between network +byte order and host byte order. The last letter +.Pf ( Sq s +or +.Sq l ) +is a mnemonic +for the traditional names for such quantities, +.Li short +and +.Li long , +respectively. Today, the C concept of +.Li short +and +.Li long +integers need not coincide with this traditional misunderstanding. On machines which have a byte order which is the same as the network order, routines are defined as null macros. .Pp -The functions involving either "be", "le" or "swap" use the numbers -(16/32) for specifying the bitwidth of the quantities they operate on. +The functions involving either +.Dq be , +.Dq le , +or +.Dq swap +use the numbers +16 and 32 for specifying the bitwidth of the quantities they operate on. Currently all supported architectures are either big- or little-endian -so either the "be" or the "le" variants are implemented as null macros. +so either the +.Dq be +or +.Dq le +variants are implemented as null macros. .Pp The routines mentioned above which have either {src-order} or {dst-order} -set to "n" are most often used in +set to +.Sq n +are most often used in conjunction with Internet addresses and ports as returned by .Xr gethostbyname 3 and @@ -142,14 +172,9 @@ and .Sh HISTORY The .Nm byteorder -functions appeared in +functions appeared in .Bx 4.2 . .Sh BUGS -On the -.Tn vax , -.Tn alpha , -.Tn i386 , -and so far -.Tn mips +On the vax, alpha, i386, and so far mips, bytes are handled backwards from most everyone else in the world. This is not expected to be fixed in the near future. diff --git a/lib/libc/net/ethers.3 b/lib/libc/net/ethers.3 index 74d153fce61..39968f3e65e 100644 --- a/lib/libc/net/ethers.3 +++ b/lib/libc/net/ethers.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ethers.3,v 1.10 1999/03/18 11:09:15 aaron Exp $ +.\" $OpenBSD: ethers.3,v 1.11 1999/07/05 04:40:59 aaron Exp $ .\" .\" Written by roland@frob.com. Public domain. .\" @@ -26,7 +26,7 @@ .Ft int .Fn ether_line "char *l" "struct ether_addr *e" "char *hostname" .Sh DESCRIPTION -Ethernet addresses are represented by the +Ethernet addresses are represented by the following structure: .Bd -literal -offset indent struct ether_addr { @@ -36,13 +36,18 @@ struct ether_addr { .Pp The .Fn ether_ntoa -function converts this structure into an ASCII string of the form -``xx:xx:xx:xx:xx:xx'', consisting of 6 hexadecimal numbers separated +function converts this structure into an +.Tn ASCII +string of the form +.Dq xx:xx:xx:xx:xx:xx , +consisting of 6 hexadecimal numbers separated by colons. It returns a pointer to a static buffer that is reused for each call. The .Fn ether_aton -converts an ASCII string of the same form and to a structure +converts an +.Tn ASCII +string of the same form and to a structure containing the 6 octets of the address. It returns a pointer to a static structure that is reused for each call. .Pp @@ -57,17 +62,19 @@ The .Fn ether_ntohost function looks up the given Ethernet address and writes the associated host name into the character buffer passed. This buffer should be -.Ev MAXHOSTNAMELEN +.Dv MAXHOSTNAMELEN characters in size. The .Fn ether_hostton function looks up the given host name and writes the associated Ethernet address into the structure passed. Both functions return -zero if they find the requested host name or address, and -1 if not. +zero if they find the requested host name or address, and \-1 if not. .Pp Each call reads -.Pa /etc/ethers -from the beginning; if a + appears alone on a line in the file, then +.Pa /etc/ethers +from the beginning; if a +.Ql + +appears alone on a line in the file, then .Fn ether_hostton will consult the .Pa ethers.byname @@ -81,11 +88,12 @@ The .Fn ether_line function parses a line from the .Pa /etc/ethers -file and fills in the passed ``struct ether_addr'' and character -buffer with the Ethernet address and host name on the line. It -returns zero if the line was successfully parsed and -1 if not. +file and fills in the passed +.Li struct ether_addr +and character buffer with the Ethernet address and host name on the line. It +returns zero if the line was successfully parsed and \-1 if not. The character buffer should be -.Ev MAXHOSTNAMELEN +.Dv MAXHOSTNAMELEN characters in size. .Sh FILES .Bl -tag -width /etc/ethers -compact diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3 index 5d644ba549e..6bf86d48cf3 100644 --- a/lib/libc/net/getaddrinfo.3 +++ b/lib/libc/net/getaddrinfo.3 @@ -1,3 +1,4 @@ +.\" $OpenBSD: getaddrinfo.3,v 1.3 1999/07/05 04:40:59 aaron Exp $ .\" Copyright (c) 1983, 1987, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -30,13 +31,13 @@ .\" SUCH DAMAGE. .\" .\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 -.\" $Id: getaddrinfo.3,v 1.2 1999/07/03 20:26:55 deraadt Exp $ +.\" $Id: getaddrinfo.3,v 1.3 1999/07/05 04:40:59 aaron Exp $ .\" .Dd May 25, 1995 .Dt GETADDRINFO 3 -.Os KAME +.Os .Sh NAME -.Nm getaddrinfo +.Nm getaddrinfo , .Nm freeaddrinfo , .Nm gai_strerror .Nd nodename-to-address translation in protocol-independent manner @@ -60,8 +61,10 @@ and .Xr getservbyname 3 , but in a more sophisticated manner. .Pp -The addrinfo structure is defined as a result of including the -.Li <netdb.h> +The +.Li addrinfo +structure is defined as a result of including the +.Aq Pa netdb.h header: .Bd -literal -offset struct addrinfo { * @@ -82,9 +85,7 @@ and .Fa servname arguments are pointers to null-terminated strings or .Dv NULL . -One or both of these two arguments must be a -.Pf non Dv -NULL -pointer. +One or both of these two arguments must be a non-null pointer. In the normal client scenario, both the .Fa nodename and @@ -93,15 +94,11 @@ are specified. In the normal server scenario, only the .Fa servname is specified. -A -.Pf non Dv -NULL +A non-null .Fa nodename string can be either a node name or a numeric host address string -.Po -i.e., a dotted-decimal IPv4 address or an IPv6 hex address -.Pc . -A -.Pf non Dv -NULL +(i.e., a dotted-decimal IPv4 address or an IPv6 hex address) +A non-null .Fa servname string can be either a service name or a decimal port number. .Pp @@ -117,9 +114,7 @@ structure all members other than .Fa ai_socktype , and .Fa ai_protocol -must be zero or a -.Dv NULL -pointer. +must be zero or a null pointer. A value of .Dv PF_UNSPEC for @@ -149,13 +144,12 @@ when is called. If the third argument to .Fn getaddrinfo -is a -.Dv NULL -pointer, this is the same as if the caller had filled in an +is a null pointer, this is the same as if the caller had filled in an .Li addrinfo structure initialized to zero with .Fa ai_family -set to PF_UNSPEC. +set to +.Dv PF_UNSPEC . .Pp Upon successful return a pointer to a linked list of one or more .Li addrinfo @@ -164,9 +158,7 @@ The caller can process each .Li addrinfo structure in this list by following the .Fa ai_next -pointer, until a -.Dv NULL -pointer is encountered. +pointer, until a null pointer is encountered. In each returned .Li addrinfo structure the three members @@ -197,9 +189,7 @@ structure in a call to .Fn bind . In this case, if the .Fa nodename -argument is a -.Dv NULL -pointer, then the IP address portion of the socket +argument is a null pointer, then the IP address portion of the socket address structure will be set to .Dv INADDR_ANY for an IPv4 address or @@ -218,14 +208,13 @@ call to .Pq for a connection-oriented protocol or either .Fn connect , -.Fn sendto , or +.Fn sendto , +or .Fn sendmsg .Pq for a connectionless protocol . In this case, if the .Fa nodename -argument is a -.Dv NULL -pointer, then the IP address portion of the +argument is a null pointer, then the IP address portion of the socket address structure will be set to the loopback address. .Pp If the @@ -248,8 +237,7 @@ bit is set in the .Fa ai_flags member of the .Fa hints -structure, then a -.Pf non Dv -NULL +structure, then a non-null .Fa nodename string must be a numeric host address string. Otherwise an error of @@ -263,7 +251,7 @@ All of the information returned by is dynamically allocated: the .Li addrinfo -structures, and the socket address structures and canonical node name +structures, the socket address structures, and canonical node name strings pointed to by the addrinfo structures. To return this information to the system the function .Fn freeaddrinfo @@ -303,32 +291,44 @@ Error return status from .Fn getaddrinfo is zero on success and non-zero on errors. Non-zero error codes are defined in -.Li <netdb.h> , +.Aq Pa netdb.h , and as follows: .Pp .Bl -tag -width EAI_ADDRFAMILY -compact .It Dv EAI_ADDRFAMILY -address family for nodename not supported +Address family for +.Fa nodename +not supported. .It Dv EAI_AGAIN -temporary failure in name resolution +Temporary failure in name resolution. .It Dv EAI_BADFLAGS -invalid value for ai_flags +Invalid value for +.Fa ai_flags . .It Dv EAI_FAIL -non-recoverable failure in name resolution +Non-recoverable failure in name resolution. .It Dv EAI_FAMILY -ai_family not supported +.Fa ai_family +not supported. .It Dv EAI_MEMORY -memory allocation failure +Memory allocation failure. .It Dv EAI_NODATA -no address associated with nodename +No address associated with +.Fa nodename . .It Dv EAI_NONAME -nodename nor servname provided, or not known +.Fa nodename +nor +.Fa servname +provided, or not known. .It Dv EAI_SERVICE -servname not supported for ai_socktype +.Fa servname +not supported for +.Fa ai_socktype . .It Dv EAI_SOCKTYPE -ai_socktype not supported +.Fa ai_socktype +not supported. .It Dv EAI_SYSTEM -system error returned in errno +System error returned in +.Va errno . .El .Pp If called with proper argument, @@ -353,7 +353,8 @@ R. Gilligan, S. Thomson, J. Bound, and W. Stevens, The .Fn getaddrinfo function is defined IEEE POSIX 1003.1g draft specification, -and documented in ``Basic Socket Interface Extensions for IPv6'' +and documented in +.Dq Basic Socket Interface Extensions for IPv6 .Pq RFC2533 . .Sh BUGS The text was shamelessly copied from RFC2553. diff --git a/lib/libc/net/gethostbyname.3 b/lib/libc/net/gethostbyname.3 index a71048779b8..4465fa57340 100644 --- a/lib/libc/net/gethostbyname.3 +++ b/lib/libc/net/gethostbyname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: gethostbyname.3,v 1.11 1999/05/21 18:18:09 deraadt Exp $ +.\" $OpenBSD: gethostbyname.3,v 1.12 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1983, 1987, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -72,11 +72,11 @@ functions each return a pointer to an object with the following structure describing an internet host referenced by name or by address, respectively. -This structure contains either information obtained from the name server (ie. +This structure contains either information obtained from the name server (i.e., .Xr resolver 3 and -.Xr named 8 ), Ns -broken-out fields from a line in +.Xr named 8 ), +broken-out fields from a line in .Pa /etc/hosts , or database entries supplied by the .Xr yp 8 @@ -99,13 +99,13 @@ The members of this structure are: .It Fa h_name Official name of the host. .It Fa h_aliases -A zero terminated array of alternate names for the host. +A zero-terminated array of alternate names for the host. .It Fa h_addrtype The type of address being returned. .It Fa h_length The length, in bytes, of the address. .It Fa h_addr_list -A zero terminated array of network addresses for the host. +A zero-terminated array of network addresses for the host. Host addresses are returned in network byte order. .It Fa h_addr The first address in @@ -132,9 +132,9 @@ for example The .Fn gethostbyaddr function will search for the specified address of length -.Dv len +.Fa len in the address family -.Dv af . +.Fa af . The only address family currently supported is .Dv AF_INET . .Pp @@ -149,7 +149,7 @@ If the flag is non-zero, this sets the option to send all queries to the name server using .Tn TCP -and to retain the connection after each call to +and to retain the connection after each call to .Fn gethostbyname or .Fn gethostbyaddr . @@ -168,11 +168,11 @@ The .Fn herror function prints an error message describing the failure. If its argument .Fa string -is -.Pf non Dv -NULL , +is non-null, it is prepended to the message string and separated from it by a colon +.Pq Ql \&: and a space. The error message is printed with a trailing newline. -The contents of the error message is the same as that returned by +The contents of the error message is the same as that returned by .Fn hstrerror with argument .Fa h_errno . @@ -182,7 +182,7 @@ with argument .It Pa /etc/resolv.conf .El .Sh DIAGNOSTICS -Error return status from +Error return status from .Fn gethostbyname , .Fn gethostbyname2 , and @@ -208,8 +208,8 @@ A retry at some later time may succeed. Some unexpected server failure was encountered. This is a non-recoverable error. .It Dv NO_DATA -The requested name is valid but does not have an IP address; -this is not a temporary error. +The requested name is valid but does not have an IP address; +this is not a temporary error. This means that the name is known to the name server but there is no address associated with this name. Another type of request to the name server using this domain name @@ -254,7 +254,7 @@ closes the file. .Sh HISTORY The .Fn herror -function appeared in +function appeared in .Bx 4.3 . The .Fn endhostent , @@ -272,7 +272,7 @@ copied before any subsequent calls overwrite it. Only the Internet address formats are currently understood. .Pp -YP does not support any address families other than +YP does not support any address families other than .Dv AF_INET and uses the traditional database format. diff --git a/lib/libc/net/getnameinfo.3 b/lib/libc/net/getnameinfo.3 index a1b3bdabb6d..dd1ff6b9473 100644 --- a/lib/libc/net/getnameinfo.3 +++ b/lib/libc/net/getnameinfo.3 @@ -30,11 +30,11 @@ .\" SUCH DAMAGE. .\" .\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 -.\" $Id: getnameinfo.3,v 1.1 1999/07/03 20:26:55 deraadt Exp $ +.\" $Id: getnameinfo.3,v 1.2 1999/07/05 04:40:59 aaron Exp $ .\" .Dd May 25, 1995 .Dt GETNAMEINFO 3 -.Os KAME +.Os .Sh NAME .Nm getnameinfo .Nd address-to-nodename translation in protocol-independent manner @@ -64,16 +64,16 @@ a non-zero return value indicates failure. The first argument, .Fa sa , points to either a -.Fa sockaddr_in +.Li sockaddr_in structure (for IPv4) or a -.Fa sockaddr_in6 +.Li sockaddr_in6 structure (for IPv6) that holds the IP address and port number. The .Fa salen argument gives the length of the -.Fa sockaddr_in +.Li sockaddr_in or -.Fa sockaddr_in6 +.Li sockaddr_in6 structure. .Pp The function returns the nodename associated with the IP address in @@ -102,7 +102,7 @@ Unfortunately most systems do not provide constants that specify the maximum size of either a fully-qualified domain name or a service name. Therefore to aid the application in allocating buffers for these two returned strings the following constants are defined in -.Li <netdb.h> : +.Aq Pa netdb.h : .Bd -literal -offset #define NI_MAXHOST 1025 #define NI_MAXSERV 32 @@ -111,11 +111,8 @@ returned strings the following constants are defined in The first value is actually defined as the constant .Dv MAXDNAME in recent versions of BIND's -.Li <arpa/nameser.h> -header -.Po -older versions of BIND define this constant to be 256 -.Pc +.Aq Pa arpa/nameser.h +header (older versions of BIND define this constant to be 256) and the second is a guess based on the services listed in the current Assigned Numbers RFC. .Pp @@ -154,21 +151,24 @@ instead of its name. The two .Dv NI_NUMERICxxx flags are required to support the -.Li "-n" +.Fl n flag that many commands provide. .Pp A fifth flag bit, .Dv NI_DGRAM , specifies that the service is a datagram service, and causes .Fn getservbyport -to be called with a second argument of "udp" instead of its default of "tcp". +to be called with a second argument of +.Qq udp +instead of its default of +.Qq tcp . This is required for the few ports (512-514) that have different services for UDP and TCP. .Pp These .Dv NI_xxx flags are defined in -.Li <netdb.h> . +.Aq Pa netdb.h . .Sh FILES .Bl -tag -width /etc/resolv.conf -compact .It Pa /etc/hosts @@ -193,7 +193,8 @@ R. Gilligan, S. Thomson, J. Bound, and W. Stevens, The .Fn getaddrinfo function is defined IEEE POSIX 1003.1g draft specification, -and documented in ``Basic Socket Interface Extensions for IPv6'' +and documented in +.Dq Basic Socket Interface Extensions for IPv6 .Pq RFC2533 . .Sh BUGS The text was shamelessly copied from RFC2553. diff --git a/lib/libc/net/getnetent.3 b/lib/libc/net/getnetent.3 index ddc9a8513b9..05478afdfbb 100644 --- a/lib/libc/net/getnetent.3 +++ b/lib/libc/net/getnetent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getnetent.3,v 1.7 1999/05/25 01:50:58 aaron Exp $ +.\" $OpenBSD: getnetent.3,v 1.8 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -79,9 +79,10 @@ The members of this structure are: .It Fa n_name The official name of the network. .It Fa n_aliases -A zero terminated list of alternate names for the network. +A zero-terminated list of alternate names for the network. .It Fa n_addrtype -The type of the network number returned; currently only AF_INET. +The type of the network number returned; currently only +.Dv AF_INET . .It Fa n_net The network number. Network numbers are returned in machine byte order. @@ -98,7 +99,7 @@ function opens and rewinds the file. If the .Fa stayopen flag is non-zero, -the net data base will not be closed after each call to +the net data base will not be closed after each call to .Fn getnetbyname or .Fn getnetbyaddr . @@ -140,7 +141,7 @@ The .Fn setnetent , and .Fn endnetent -functions appeared in +functions appeared in .Bx 4.2 . .Sh BUGS The data space used by these functions is static; if future use diff --git a/lib/libc/net/getprotoent.3 b/lib/libc/net/getprotoent.3 index 46ab239c508..01f752ad5ff 100644 --- a/lib/libc/net/getprotoent.3 +++ b/lib/libc/net/getprotoent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getprotoent.3,v 1.4 1999/05/25 01:50:58 aaron Exp $ +.\" $OpenBSD: getprotoent.3,v 1.5 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -79,7 +79,7 @@ The members of this structure are: .It Fa p_name The official name of the protocol. .It Fa p_aliases -A zero terminated list of alternate names for the protocol. +A zero-terminated list of alternate names for the protocol. .It Fa p_proto The protocol number. .El @@ -95,7 +95,7 @@ function opens and rewinds the file. If the .Fa stayopen flag is non-zero, -the net data base will not be closed after each call to +the net data base will not be closed after each call to .Fn getprotobyname or .Fn getprotobynumber . @@ -136,11 +136,10 @@ The .Fn setprotoent , and .Fn endprotoent -functions appeared in +functions appeared in .Bx 4.2 . .Sh BUGS These functions use a static data space; if the data is needed for future use, it should be copied before any subsequent calls overwrite it. -Only the Internet -protocols are currently understood. +Only the Internet protocols are currently understood. diff --git a/lib/libc/net/getservent.3 b/lib/libc/net/getservent.3 index 477d34249d3..3ef95fb817a 100644 --- a/lib/libc/net/getservent.3 +++ b/lib/libc/net/getservent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getservent.3,v 1.7 1999/07/04 18:59:43 aaron Exp $ +.\" $OpenBSD: getservent.3,v 1.8 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -79,7 +79,7 @@ The members of this structure are: .It Fa s_name The official name of the service. .It Fa s_aliases -A zero terminated list of alternate names for the service. +A zero-terminated list of alternate names for the service. .It Fa s_port The port number at which the service resides. Port numbers are returned in network byte order. @@ -99,7 +99,7 @@ function opens and rewinds the file. If the .Fa stayopen flag is non-zero, -the net data base will not be closed after each call to +the net data base will not be closed after each call to .Fn getservbyname or .Fn getservbyport . @@ -121,8 +121,7 @@ port number (specified in network byte order) is found, or until .Dv EOF is encountered. -If a protocol name is also supplied (non- -.Dv NULL ) , +If a protocol name is also supplied (non-null), searches must also match the protocol. .Sh FILES .Bl -tag -width /etc/services -compact @@ -144,11 +143,10 @@ The .Fn setservent , and .Fn endservent -functions appeared in +functions appeared in .Bx 4.2 . .Sh BUGS These functions use static data storage; if the data is needed for future use, it should be copied before any subsequent calls overwrite it. -Expecting port numbers to fit in a 32 bit -quantity is probably naive. +Expecting port numbers to fit in a 32-bit quantity is probably naive. diff --git a/lib/libc/net/if_indextoname.3 b/lib/libc/net/if_indextoname.3 index eb33c942549..604ac7412f7 100644 --- a/lib/libc/net/if_indextoname.3 +++ b/lib/libc/net/if_indextoname.3 @@ -30,11 +30,11 @@ .\" SUCH DAMAGE. .\" .\" From: @(#)rcmd.3 8.1 (Berkeley) 6/4/93 -.\" $Id: if_indextoname.3,v 1.2 1999/07/03 21:43:12 deraadt Exp $ +.\" $Id: if_indextoname.3,v 1.3 1999/07/05 04:40:59 aaron Exp $ .\" .Dd May 21, 1998 .Dt IF_NAMETOINDEX 3 -.Os KAME +.Os .Sh NAME .Nm if_nametoindex , .Nm if_indextoname , @@ -52,33 +52,32 @@ .Ft "void" .Fn if_freenameindex "struct if_nameindex *ptr" .Sh DESCRIPTION -The functions map interface index to readable interface name -.Po -such as -.Li ``lo0'' -.Pc -, and vice versa. +These functions map interface indexes to interface names (such as +.Dq lo0 ) , +and vice versa. .Pp +The .Fn if_nametoindex -converts readable interface name to interface index -.Pp positive integer value . +function converts an interface name specified by the +.Fa ifname +argument to an interface index (positive integer value). If the specified interface does not exist, 0 will be returned. .Pp .Fn if_indextoname -converts interface index to readable interface name. +converts an interface index specified by the +.Fa ifindex +argument to an interface name. The .Fa ifname argument must point to a buffer of at least .Dv IF_NAMESIZE bytes into which the interface name corresponding to the specified index is returned. -.Po -.Dv IF_NAMESIZE +.Pf ( Dv IF_NAMESIZE is also defined in -.Li <net/if.h> +.Aq Pa net/if.h and its value includes a terminating null byte at the end of the -interface name. -.Pc +interface name.) This pointer is also the return value of the function. If there is no interface corresponding to the specified index, .Dv NULL @@ -90,7 +89,7 @@ returns an array of structures. .Fa if_nametoindex is also defined in -.Li <net/if.h> , +.Aq Pa net/if.h , and is as follows: .Bd -literal -offset struct if_nameindex { @@ -106,9 +105,7 @@ of 0 and an .Fa if_name of .Dv NULL . -The function returns a -.Dv NULL -pointer upon an error. +The function returns a null pointer on error. The memory used for this array of structures along with the interface names pointed to by the .Fa if_name diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3 index d29f3160aa9..1e38bdc0560 100644 --- a/lib/libc/net/inet.3 +++ b/lib/libc/net/inet.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: inet.3,v 1.7 1999/06/05 19:29:43 deraadt Exp $ +.\" $OpenBSD: inet.3,v 1.8 1999/07/05 04:40:59 aaron Exp $ .\" $NetBSD: inet.3,v 1.7 1997/06/18 02:25:24 lukem Exp $ .\" .\" Copyright (c) 1983, 1990, 1991, 1993 @@ -84,14 +84,17 @@ The .Fn inet_pton function converts a presentation format address (that is, printable form as held in a character string) to network format (usually a -.Ft struct in_addr +.Li struct in_addr or some other internal binary representation, in network byte order). It returns 1 if the address was valid for the specified address family, or -0 if the address wasn't parseable in the specified address family, or -1 +0 if the address wasn't parseable in the specified address family, or \-1 if some system error occurred (in which case .Va errno -will have been set). This function is presently valid for AF_INET and -AF_INET6. The +will have been set). This function is presently valid for +.Dv AF_INET +and +.Dv AF_INET6 . +The .Fn inet_aton routine interprets the specified character string as an Internet address, placing the address into the structure provided. @@ -108,9 +111,11 @@ numbers, respectively. The function .Fn inet_ntop converts an address from network format (usually a -.Ft struct in_addr +.Li struct in_addr or some other binary form, in network byte order) to presentation format -(suitable for external display purposes). It returns NULL if a system +(suitable for external display purposes). It returns +.Dv NULL +if a system error occurs (in which case, .Va errno will have been set), or it returns a pointer to the destination string. @@ -153,7 +158,7 @@ as a byte of data and assigned, from left to right, to the four bytes of an Internet address. Note that when an Internet address is viewed as a 32-bit integer quantity on a system that uses little-endian -byte order (such as the +byte order (such as the .Tn Intel 386, 486 and .Tn Pentium @@ -212,10 +217,15 @@ addresses, it will be common for addresses to contain long strings of zero bits. In order to make writing addresses .Pp containing zero bits easier a special syntax is available to -compress the zeros. The use of ``::'' indicates multiple groups -of 16-bits of zeros. The ``::'' can only appear once in an -address. The ``::'' can also be used to compress the leading -and/or trailing zeros in an address. +compress the zeros. The use of +.Dq \&:\&: +indicates multiple groups +of 16 bits of zeros. The +.Dq \&:\&: +can only appear once in an +address. The +.Dq \&:\&: +can also be used to compress the leading and/or trailing zeros in an address. .Pp For example the following addresses: .Bd -literal -offset indent @@ -277,7 +287,7 @@ does not accept 1-, 2-, or 3-part dotted addresses; all four parts must be specified. This is a narrower input set than that accepted by .Nm inet_aton . .Sh HISTORY -The +The .Nm inet_addr , .Nm inet_network , .Nm inet_makeaddr , @@ -306,7 +316,7 @@ cannot return that value without indicating failure. Also, .Fn inet_addr should have been designed to return a -.Fa "struct in_addr" . +.Li struct in_addr . The newer .Fn inet_aton function does not share these problems, and almost all existing code diff --git a/lib/libc/net/inet_net.3 b/lib/libc/net/inet_net.3 index 1b55411a284..1eb157c429d 100644 --- a/lib/libc/net/inet_net.3 +++ b/lib/libc/net/inet_net.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: inet_net.3,v 1.3 1999/07/02 20:58:00 aaron Exp $ +.\" $OpenBSD: inet_net.3,v 1.4 1999/07/05 04:40:59 aaron Exp $ .\" $NetBSD: inet_net.3,v 1.1 1997/06/18 02:25:27 lukem Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -54,14 +54,16 @@ The .Fn inet_net_ntop function converts an Internet network number from network format (usually a -.Ft struct in_addr +.Li struct in_addr or some other binary form, in network byte order) to CIDR presentation format (suitable for external display purposes). .Fa bits is the number of bits in .Fa src that are the network number. -It returns NULL if a system error occurs (in which case, +It returns +.Dv NULL +if a system error occurs (in which case, .Va errno will have been set), or it returns a pointer to the destination string. .Pp @@ -69,10 +71,10 @@ The .Fn inet_net_pton function converts a presentation format Internet network number (that is, printable form as held in a character string) to network format (usually a -.Ft struct in_addr +.Li struct in_addr or some other internal binary representation, in network byte order). It returns the number of bits (either computed based on the class, or -specified with /CIDR), or -1 if a failure occurred +specified with /CIDR), or \-1 if a failure occurred (in which case .Va errno will have been set. @@ -80,9 +82,10 @@ It will be set to .Er ENOENT if the Internet network number was not valid). .Pp -The currently supported value for +The only value for .Fa af -is: AF_INET. +currently supported is +.Dv AF_INET . .Fa size is the size of the result buffer .Fa dst . @@ -101,11 +104,8 @@ as a byte of data and assigned, from left to right, to the four bytes of an Internet network number. Note that when an Internet network number is viewed as a 32-bit integer quantity on a system that uses little-endian -byte order (such as the -.Tn Intel 386, 486 -and -.Tn Pentium -processors) the bytes referred to above appear as +byte order (such as the Intel 386, 486, and Pentium processors) +the bytes referred to above appear as .Dq Li d.c.b.a . That is, little-endian bytes are ordered from right to left. .Pp diff --git a/lib/libc/net/ipx.3 b/lib/libc/net/ipx.3 index 28113d705ee..8cc36f08145 100644 --- a/lib/libc/net/ipx.3 +++ b/lib/libc/net/ipx.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ipx.3,v 1.4 1999/05/23 14:11:01 aaron Exp $ +.\" $OpenBSD: ipx.3,v 1.5 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <netipx/ipx.h> -.Ft struct ipx_addr +.Ft struct ipx_addr .Fn ipx_addr "char *cp" .Ft char * .Fn ipx_ntoa "struct ipx_addr ipx" @@ -65,11 +65,11 @@ notation in common use: .Ed .Pp Trailing zero fields are suppressed, and each number is printed in hexadecimal, -in a format suitable for input to +in a format suitable for input to .Fn ipx_addr . Any fields lacking super-decimal digits will have a trailing -.Ql H +.Sq H appended. .Pp An effort has been made to insure that @@ -78,11 +78,11 @@ be compatible with most formats in common use. It will first separate an address into 1 to 3 fields using a single delimiter chosen from period -.Ql \&. , +.Pq Ql \&. , colon -.Ql \&: +.Pq Ql \&: , or pound-sign -.Ql \&# . +.Pq Ql # . Each field is then examined for byte separators (colon or period). If there are byte separators, each subfield separated is taken to be a small hexadecimal number, and the entirety is taken as a network-byte-ordered @@ -96,7 +96,7 @@ as hexadecimal if there is a leading .Ql 0x (as in C), a trailing -.Ql H +.Sq H (as in Mesa), or there are any super-decimal digits present. It is interpreted as octal is there is a leading .Ql 0 @@ -114,7 +114,7 @@ The precursor .Fn ns_addr and .Fn ns_ntoa -functions appeared in +functions appeared in .Bx 4.3 . .Sh BUGS The string returned by diff --git a/lib/libc/net/iso_addr.3 b/lib/libc/net/iso_addr.3 index d9bf9086be4..e5b3f0fbdf5 100644 --- a/lib/libc/net/iso_addr.3 +++ b/lib/libc/net/iso_addr.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: iso_addr.3,v 1.2 1996/08/19 08:29:22 tholo Exp $ +.\" $OpenBSD: iso_addr.3,v 1.3 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -37,7 +37,7 @@ .Sh NAME .Nm iso_addr , .Nm iso_ntoa -.Nd "elementary network address conversion routines for Open System Interconnection +.Nd "network address conversion routines for Open System Interconnection" .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <netiso/iso.h> @@ -60,7 +60,7 @@ addresses and returns .Tn ASCII strings representing NSAPs (network service access points) in a -notation inverse to that accepted by +notation inverse to that accepted by .Fn iso_addr . .Pp Unfortunately, no universal standard exists for representing @@ -98,7 +98,7 @@ The .Fn iso_addr and .Fn iso_ntoa -functions appeared in +functions appeared in .Bx 4.3 Reno . .Sh BUGS The returned values diff --git a/lib/libc/net/link_addr.3 b/lib/libc/net/link_addr.3 index c96e24f441f..b7ada819975 100644 --- a/lib/libc/net/link_addr.3 +++ b/lib/libc/net/link_addr.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: link_addr.3,v 1.5 1999/05/23 14:11:02 aaron Exp $ +.\" $OpenBSD: link_addr.3,v 1.6 1999/07/05 04:40:59 aaron Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -50,12 +50,11 @@ .Ft char * .Fn link_ntoa "const struct sockaddr_dl *sdl" .Sh DESCRIPTION -The routine +The .Fn link_addr -interprets character strings representing +function interprets character strings representing link-level addresses, returning binary information suitable for use in system calls. -The routine .Fn link_ntoa takes a link-level @@ -73,7 +72,7 @@ the string .Fa addr may contain an optional network interface identifier of the form -.Dq "name unit-number" , +.Dq name unit-number , suitable for the first argument to .Xr ifconfig 8 , followed in all cases by a colon and @@ -95,7 +94,7 @@ represents an Ethernet address to be transmitted on the first Lance Ethernet interface. .Sh RETURN VALUES .Fn link_ntoa -always returns a null terminated string. +always returns a null-terminated string. .Fn link_addr has no return value. (See @@ -108,7 +107,7 @@ The .Fn link_addr and .Fn link_ntoa -functions appeared in +functions appeared in .Bx 4.3 Reno . .Sh BUGS The returned values for link_ntoa @@ -120,7 +119,7 @@ should diagnose improperly formed input, and there should be an unambiguous way to recognize this. .Pp If the -.Va sdl_len +.Fa sdl_len field of the link socket address .Fa sdl is 0, diff --git a/lib/libc/net/ns.3 b/lib/libc/net/ns.3 index ee49237a24b..24e69c8388e 100644 --- a/lib/libc/net/ns.3 +++ b/lib/libc/net/ns.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ns.3,v 1.4 1999/05/23 14:11:02 aaron Exp $ +.\" $OpenBSD: ns.3,v 1.5 1999/07/05 04:41:00 aaron Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -43,7 +43,7 @@ address conversion routines .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <netns/ns.h> -.Ft struct ns_addr +.Ft struct ns_addr .Fn ns_addr "char *cp" .Ft char * .Fn ns_ntoa "struct ns_addr ns" @@ -67,11 +67,11 @@ notation in common use in the Xerox Development Environment: .Ed .Pp Trailing zero fields are suppressed, and each number is printed in hexadecimal, -in a format suitable for input to +in a format suitable for input to .Fn ns_addr . Any fields lacking super-decimal digits will have a trailing -.Ql H +.Sq H appended. .Pp Unfortunately, no universal standard exists for representing @@ -83,11 +83,11 @@ be compatible with most formats in common use. It will first separate an address into 1 to 3 fields using a single delimiter chosen from period -.Ql \&. , +.Pq Ql \&. , colon -.Ql \&: +.Pq Ql \&: , or pound-sign -.Ql \&# . +.Ql # . Each field is then examined for byte separators (colon or period). If there are byte separators, each subfield separated is taken to be a small hexadecimal number, and the entirety is taken as a network-byte-ordered @@ -101,7 +101,7 @@ as hexadecimal if there is a leading .Ql 0x (as in C), a trailing -.Ql H +.Sq H (as in Mesa), or there are any super-decimal digits present. It is interpreted as octal is there is a leading .Ql 0 @@ -118,7 +118,7 @@ The .Fn ns_addr and .Fn ns_toa -functions appeared in +functions appeared in .Bx 4.3 . .Sh BUGS The string returned by diff --git a/lib/libc/net/rcmd.3 b/lib/libc/net/rcmd.3 index c68a3338a03..d086e875bf6 100644 --- a/lib/libc/net/rcmd.3 +++ b/lib/libc/net/rcmd.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rcmd.3,v 1.12 1999/05/23 14:11:02 aaron Exp $ +.\" $OpenBSD: rcmd.3,v 1.13 1999/07/05 04:41:00 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,15 +56,15 @@ The function is used by the super-user to execute a command on a remote machine using an authentication scheme based on reserved -port numbers. If the calling process is not setuid and the -.Li RSH -environment variable is set and +port numbers. If the calling process is not setuid, the +.Ev RSH +environment variable is set, and .Fa inport is -.Li shell/tcp , +.Dq shell/tcp , .Xr rcmdsh 3 is called instead with the value of -.Li RSH . +.Ev RSH . Alternately, if the user is not the super-user, .Fn rcmd will invoke @@ -103,17 +103,14 @@ and a connection is established to a server residing at the well-known Internet port .Fa inport . If the user is not the super-user, the only valid port is -.Li shell/tcp , +.Dq shell/tcp (usually port 514). .Pp If the connection succeeds, a socket in the Internet domain of type .Dv SOCK_STREAM is returned to the caller, and given to the remote -command as -.Em stdin -and -.Em stdout . +command as stdin and stdout. If .Fa fd2p is non-zero, then an auxiliary channel to a control @@ -128,10 +125,10 @@ signal numbers, to be forwarded to the process group of the command. If .Fa fd2p -is 0, then the +is 0, then the .Em stderr (unit 2 of the remote -command) will be made the same as the +command) will be made the same as the .Em stdout and no provision is made for sending arbitrary signals to the remote process, @@ -147,7 +144,7 @@ The .Fn rresvport function is used to obtain a socket with a privileged address bound to it. This socket is suitable for use -by +by .Fn rcmd and several other functions. Privileged Internet ports are those in the range 0 to 1023. Only the super-user @@ -164,7 +161,7 @@ functions take a remote host's IP address or name, respectively, two user names and a flag indicating whether the local user's name is that of the super-user. Then, if the user is -.Em NOT +.Em not the super-user, it checks the .Pa /etc/hosts.equiv file. @@ -177,9 +174,9 @@ If this file does not exist, is not a regular file, is owned by anyone other than the user or the super-user, or is writeable by anyone other than the owner, the check automatically fails. Zero is returned if the machine name is listed in the -.Dq Pa hosts.equiv +.Pa hosts.equiv file, or the host and remote user name are found in the -.Dq Pa .rhosts +.Pa .rhosts file; otherwise .Fn iruserok and @@ -209,8 +206,9 @@ It returns \-1 on error with the global value .Va errno set according to the reason for failure. The error code -.Dv EAGAIN -is overloaded to mean ``All network ports in use.'' +.Er EAGAIN +is overloaded to mean +.Dq all network ports in use . .Sh SEE ALSO .Xr rlogin 1 , .Xr rsh 1 , @@ -223,5 +221,5 @@ is overloaded to mean ``All network ports in use.'' .Xr rshd 8 .Sh HISTORY These -functions appeared in +functions appeared in .Bx 4.2 . diff --git a/lib/libc/net/rcmdsh.3 b/lib/libc/net/rcmdsh.3 index f5fbe1e891a..2498f4c708a 100644 --- a/lib/libc/net/rcmdsh.3 +++ b/lib/libc/net/rcmdsh.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rcmdsh.3,v 1.5 1999/07/02 17:04:16 aaron Exp $ +.\" $OpenBSD: rcmdsh.3,v 1.6 1999/07/05 04:41:00 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -51,7 +51,7 @@ on reserved port numbers using .Xr rshd 8 or the value of .Fa rshprog -(if non-NULL). +(if non-null). .Pp The .Fn rcmdsh @@ -80,12 +80,7 @@ a socket in the domain of type .Dv SOCK_STREAM is returned to the caller, and given to the remote -command as -.Em stdin -and -.Em stdout , -and -.Em stderr . +command as stdin and stdout, and stderr. .Sh DIAGNOSTICS The .Fn rcmdsh diff --git a/lib/libc/net/resolver.3 b/lib/libc/net/resolver.3 index 7c60ea4dcb9..27d393193d3 100644 --- a/lib/libc/net/resolver.3 +++ b/lib/libc/net/resolver.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: resolver.3,v 1.11 1999/05/25 13:06:45 aaron Exp $ +.\" $OpenBSD: resolver.3,v 1.12 1999/07/05 04:41:00 aaron Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -101,20 +101,21 @@ .Fa "int length" .Fc .Sh DESCRIPTION -These routines are used for making, sending and interpreting +These routines are used for making, sending, and interpreting query and reply messages with Internet domain name servers. .Pp Global configuration and state information that is used by the resolver routines is kept in the structure -.Em _res . +.Li _res . Most of the values have reasonable defaults and can be ignored. Options stored in -.Em _res.options +.Li _res.options are defined in -.Pa resolv.h +.Aq Pa resolv.h and are as follows. -Options are stored as a simple bit mask containing the bitwise ``or'' +Options are stored as a simple bit mask containing the bitwise +.Tn OR of the options enabled. .Bl -tag -width RES_USE_INET6 .It Dv RES_INIT @@ -326,7 +327,7 @@ The size of compressed name is returned or \-1 if there was an error. .Sh FILES .Bl -tag -width Pa /etc/resolv.conf -The configuration file +configuration file see .Xr resolv.conf 5 . .El @@ -348,5 +349,5 @@ see .Sh HISTORY The .Nm -function appeared in +function appeared in .Bx 4.3 . |