summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/inet.3
diff options
context:
space:
mode:
authoraaron <>1999-07-05 04:41:00 +0000
committeraaron <>1999-07-05 04:41:00 +0000
commitc47037b066169c61c5eefad3368f2da73ca4be54 (patch)
treefa80157fecd0fbb57811f82d8f3ce1366b44a203 /src/lib/libc/net/inet.3
parent5f78a44df1a8e524a82445f2fedb382128869a2a (diff)
downloadopenbsd-c47037b066169c61c5eefad3368f2da73ca4be54.tar.gz
openbsd-c47037b066169c61c5eefad3368f2da73ca4be54.tar.bz2
openbsd-c47037b066169c61c5eefad3368f2da73ca4be54.zip
repairs; better English, formatting, etc.
Diffstat (limited to 'src/lib/libc/net/inet.3')
-rw-r--r--src/lib/libc/net/inet.338
1 files changed, 24 insertions, 14 deletions
diff --git a/src/lib/libc/net/inet.3 b/src/lib/libc/net/inet.3
index d29f3160aa..1e38bdc056 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.7 1999/06/05 19:29:43 deraadt Exp $ 1.\" $OpenBSD: inet.3,v 1.8 1999/07/05 04:40:59 aaron 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
@@ -84,14 +84,17 @@ The
84.Fn inet_pton 84.Fn inet_pton
85function converts a presentation format address (that is, printable form 85function converts a presentation format address (that is, printable form
86as held in a character string) to network format (usually a 86as held in a character string) to network format (usually a
87.Ft struct in_addr 87.Li struct in_addr
88or some other internal binary representation, in network byte order). It 88or some other internal binary representation, in network byte order). It
89returns 1 if the address was valid for the specified address family, or 89returns 1 if the address was valid for the specified address family, or
900 if the address wasn't parseable in the specified address family, or -1 900 if the address wasn't parseable in the specified address family, or \-1
91if some system error occurred (in which case 91if some system error occurred (in which case
92.Va errno 92.Va errno
93will have been set). This function is presently valid for AF_INET and 93will have been set). This function is presently valid for
94AF_INET6. The 94.Dv AF_INET
95and
96.Dv AF_INET6 .
97The
95.Fn inet_aton 98.Fn inet_aton
96routine interprets the specified character string as an Internet address, 99routine interprets the specified character string as an Internet address,
97placing the address into the structure provided. 100placing the address into the structure provided.
@@ -108,9 +111,11 @@ numbers, respectively.
108The function 111The function
109.Fn inet_ntop 112.Fn inet_ntop
110converts an address from network format (usually a 113converts an address from network format (usually a
111.Ft struct in_addr 114.Li struct in_addr
112or some other binary form, in network byte order) to presentation format 115or some other binary form, in network byte order) to presentation format
113(suitable for external display purposes). It returns NULL if a system 116(suitable for external display purposes). It returns
117.Dv NULL
118if a system
114error occurs (in which case, 119error occurs (in which case,
115.Va errno 120.Va errno
116will have been set), or it returns a pointer to the destination string. 121will 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,
153to the four bytes of an Internet address. Note 158to the four bytes of an Internet address. Note
154that when an Internet address is viewed as a 32-bit 159that when an Internet address is viewed as a 32-bit
155integer quantity on a system that uses little-endian 160integer quantity on a system that uses little-endian
156byte order (such as the 161byte order (such as the
157.Tn Intel 386, 486 162.Tn Intel 386, 486
158and 163and
159.Tn Pentium 164.Tn Pentium
@@ -212,10 +217,15 @@ addresses, it will be common for addresses to contain long
212strings of zero bits. In order to make writing addresses 217strings of zero bits. In order to make writing addresses
213.Pp 218.Pp
214containing zero bits easier a special syntax is available to 219containing zero bits easier a special syntax is available to
215compress the zeros. The use of ``::'' indicates multiple groups 220compress the zeros. The use of
216of 16-bits of zeros. The ``::'' can only appear once in an 221.Dq \&:\&:
217address. The ``::'' can also be used to compress the leading 222indicates multiple groups
218and/or trailing zeros in an address. 223of 16 bits of zeros. The
224.Dq \&:\&:
225can only appear once in an
226address. The
227.Dq \&:\&:
228can also be used to compress the leading and/or trailing zeros in an address.
219.Pp 229.Pp
220For example the following addresses: 230For example the following addresses:
221.Bd -literal -offset indent 231.Bd -literal -offset indent
@@ -277,7 +287,7 @@ does not accept 1-, 2-, or 3-part dotted addresses; all four parts
277must be specified. This is a narrower input set than that accepted by 287must be specified. This is a narrower input set than that accepted by
278.Nm inet_aton . 288.Nm inet_aton .
279.Sh HISTORY 289.Sh HISTORY
280The 290The
281.Nm inet_addr , 291.Nm inet_addr ,
282.Nm inet_network , 292.Nm inet_network ,
283.Nm inet_makeaddr , 293.Nm inet_makeaddr ,
@@ -306,7 +316,7 @@ cannot return that value without indicating failure.
306Also, 316Also,
307.Fn inet_addr 317.Fn inet_addr
308should have been designed to return a 318should have been designed to return a
309.Fa "struct in_addr" . 319.Li struct in_addr .
310The newer 320The newer
311.Fn inet_aton 321.Fn inet_aton
312function does not share these problems, and almost all existing code 322function does not share these problems, and almost all existing code