diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/net/inet.3 | 38 |
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 |
| 85 | function converts a presentation format address (that is, printable form | 85 | function converts a presentation format address (that is, printable form |
| 86 | as held in a character string) to network format (usually a | 86 | as held in a character string) to network format (usually a |
| 87 | .Ft struct in_addr | 87 | .Li struct in_addr |
| 88 | or some other internal binary representation, in network byte order). It | 88 | or some other internal binary representation, in network byte order). It |
| 89 | returns 1 if the address was valid for the specified address family, or | 89 | returns 1 if the address was valid for the specified address family, or |
| 90 | 0 if the address wasn't parseable in the specified address family, or -1 | 90 | 0 if the address wasn't parseable in the specified address family, or \-1 |
| 91 | if some system error occurred (in which case | 91 | if some system error occurred (in which case |
| 92 | .Va errno | 92 | .Va errno |
| 93 | will have been set). This function is presently valid for AF_INET and | 93 | will have been set). This function is presently valid for |
| 94 | AF_INET6. The | 94 | .Dv AF_INET |
| 95 | and | ||
| 96 | .Dv AF_INET6 . | ||
| 97 | The | ||
| 95 | .Fn inet_aton | 98 | .Fn inet_aton |
| 96 | routine interprets the specified character string as an Internet address, | 99 | routine interprets the specified character string as an Internet address, |
| 97 | placing the address into the structure provided. | 100 | placing the address into the structure provided. |
| @@ -108,9 +111,11 @@ numbers, respectively. | |||
| 108 | The function | 111 | The function |
| 109 | .Fn inet_ntop | 112 | .Fn inet_ntop |
| 110 | converts an address from network format (usually a | 113 | converts an address from network format (usually a |
| 111 | .Ft struct in_addr | 114 | .Li struct in_addr |
| 112 | or some other binary form, in network byte order) to presentation format | 115 | or 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 | ||
| 118 | if a system | ||
| 114 | error occurs (in which case, | 119 | error occurs (in which case, |
| 115 | .Va errno | 120 | .Va errno |
| 116 | will have been set), or it returns a pointer to the destination string. | 121 | 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, | |||
| 153 | to the four bytes of an Internet address. Note | 158 | to the four bytes of an Internet address. Note |
| 154 | that when an Internet address is viewed as a 32-bit | 159 | that when an Internet address is viewed as a 32-bit |
| 155 | integer quantity on a system that uses little-endian | 160 | integer quantity on a system that uses little-endian |
| 156 | byte order (such as the | 161 | byte order (such as the |
| 157 | .Tn Intel 386, 486 | 162 | .Tn Intel 386, 486 |
| 158 | and | 163 | and |
| 159 | .Tn Pentium | 164 | .Tn Pentium |
| @@ -212,10 +217,15 @@ addresses, it will be common for addresses to contain long | |||
| 212 | strings of zero bits. In order to make writing addresses | 217 | strings of zero bits. In order to make writing addresses |
| 213 | .Pp | 218 | .Pp |
| 214 | containing zero bits easier a special syntax is available to | 219 | containing zero bits easier a special syntax is available to |
| 215 | compress the zeros. The use of ``::'' indicates multiple groups | 220 | compress the zeros. The use of |
| 216 | of 16-bits of zeros. The ``::'' can only appear once in an | 221 | .Dq \&:\&: |
| 217 | address. The ``::'' can also be used to compress the leading | 222 | indicates multiple groups |
| 218 | and/or trailing zeros in an address. | 223 | of 16 bits of zeros. The |
| 224 | .Dq \&:\&: | ||
| 225 | can only appear once in an | ||
| 226 | address. The | ||
| 227 | .Dq \&:\&: | ||
| 228 | can also be used to compress the leading and/or trailing zeros in an address. | ||
| 219 | .Pp | 229 | .Pp |
| 220 | For example the following addresses: | 230 | For 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 | |||
| 277 | must be specified. This is a narrower input set than that accepted by | 287 | must 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 |
| 280 | The | 290 | The |
| 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. | |||
| 306 | Also, | 316 | Also, |
| 307 | .Fn inet_addr | 317 | .Fn inet_addr |
| 308 | should have been designed to return a | 318 | should have been designed to return a |
| 309 | .Fa "struct in_addr" . | 319 | .Li struct in_addr . |
| 310 | The newer | 320 | The newer |
| 311 | .Fn inet_aton | 321 | .Fn inet_aton |
| 312 | function does not share these problems, and almost all existing code | 322 | function does not share these problems, and almost all existing code |
