diff options
Diffstat (limited to 'src/lib/libc/net/ns.3')
| -rw-r--r-- | src/lib/libc/net/ns.3 | 127 | 
1 files changed, 127 insertions, 0 deletions
| diff --git a/src/lib/libc/net/ns.3 b/src/lib/libc/net/ns.3 new file mode 100644 index 0000000000..9c7aeab312 --- /dev/null +++ b/src/lib/libc/net/ns.3 | |||
| @@ -0,0 +1,127 @@ | |||
| 1 | .\" $OpenBSD: ns.3,v 1.9 2003/06/02 20:18:35 millert Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 1986, 1991, 1993 | ||
| 4 | .\" The Regents of the University of California. All rights reserved. | ||
| 5 | .\" | ||
| 6 | .\" Redistribution and use in source and binary forms, with or without | ||
| 7 | .\" modification, are permitted provided that the following conditions | ||
| 8 | .\" are met: | ||
| 9 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 10 | .\" notice, this list of conditions and the following disclaimer. | ||
| 11 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | .\" notice, this list of conditions and the following disclaimer in the | ||
| 13 | .\" documentation and/or other materials provided with the distribution. | ||
| 14 | .\" 3. Neither the name of the University nor the names of its contributors | ||
| 15 | .\" may be used to endorse or promote products derived from this software | ||
| 16 | .\" without specific prior written permission. | ||
| 17 | .\" | ||
| 18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 28 | .\" SUCH DAMAGE. | ||
| 29 | .\" | ||
| 30 | .Dd June 4, 1993 | ||
| 31 | .Dt NS 3 | ||
| 32 | .Os | ||
| 33 | .Sh NAME | ||
| 34 | .Nm ns_addr , | ||
| 35 | .Nm ns_ntoa | ||
| 36 | .Nd Xerox | ||
| 37 | .Tn NS Ns (tm) | ||
| 38 | address conversion routines | ||
| 39 | .Sh SYNOPSIS | ||
| 40 | .Fd #include <sys/types.h> | ||
| 41 | .Fd #include <netns/ns.h> | ||
| 42 | .Ft struct ns_addr | ||
| 43 | .Fn ns_addr "char *cp" | ||
| 44 | .Ft char * | ||
| 45 | .Fn ns_ntoa "struct ns_addr ns" | ||
| 46 | .Sh DESCRIPTION | ||
| 47 | The routine | ||
| 48 | .Fn ns_addr | ||
| 49 | interprets character strings representing | ||
| 50 | .Tn XNS | ||
| 51 | addresses, returning binary information suitable | ||
| 52 | for use in system calls. | ||
| 53 | The routine | ||
| 54 | .Fn ns_ntoa | ||
| 55 | takes | ||
| 56 | .Tn XNS | ||
| 57 | addresses and returns | ||
| 58 | .Tn ASCII | ||
| 59 | strings representing the address in a | ||
| 60 | notation in common use in the Xerox Development Environment: | ||
| 61 | .Bd -filled -offset indent | ||
| 62 | <network number>.<host number>.<port number> | ||
| 63 | .Ed | ||
| 64 | .Pp | ||
| 65 | Trailing zero fields are suppressed, and each number is printed in hexadecimal, | ||
| 66 | in a format suitable for input to | ||
| 67 | .Fn ns_addr . | ||
| 68 | Any fields lacking super-decimal digits will have a | ||
| 69 | trailing | ||
| 70 | .Sq H | ||
| 71 | appended. | ||
| 72 | .Pp | ||
| 73 | Unfortunately, no universal standard exists for representing | ||
| 74 | .Tn XNS | ||
| 75 | addresses. | ||
| 76 | An effort has been made to ensure that | ||
| 77 | .Fn ns_addr | ||
| 78 | be compatible with most formats in common use. | ||
| 79 | It will first separate an address into 1 to 3 fields using a single delimiter | ||
| 80 | chosen from | ||
| 81 | period | ||
| 82 | .Pq Ql \&. , | ||
| 83 | colon | ||
| 84 | .Pq Ql \&: , | ||
| 85 | or pound-sign | ||
| 86 | .Ql # . | ||
| 87 | Each field is then examined for byte separators (colon or period). | ||
| 88 | If there are byte separators, each subfield separated is taken to be | ||
| 89 | a small hexadecimal number, and the entirety is taken as a network-byte-ordered | ||
| 90 | quantity to be zero extended in the high-network-order bytes. | ||
| 91 | Next, the field is inspected for hyphens, in which case | ||
| 92 | the field is assumed to be a number in decimal notation | ||
| 93 | with hyphens separating the millenia. | ||
| 94 | Next, the field is assumed to be a number: | ||
| 95 | It is interpreted | ||
| 96 | as hexadecimal if there is a leading | ||
| 97 | .Ql 0x | ||
| 98 | (as in C), | ||
| 99 | a trailing | ||
| 100 | .Sq H | ||
| 101 | (as in Mesa), or there are any super-decimal digits present. | ||
| 102 | It is interpreted as octal if there is a leading | ||
| 103 | .Ql 0 | ||
| 104 | and there are no super-octal digits. | ||
| 105 | Otherwise, it is converted as a decimal number. | ||
| 106 | .Sh RETURN VALUES | ||
| 107 | None. | ||
| 108 | (See | ||
| 109 | .Sx BUGS . ) | ||
| 110 | .Sh SEE ALSO | ||
| 111 | .Xr hosts 5 , | ||
| 112 | .Xr networks 5 | ||
| 113 | .Sh HISTORY | ||
| 114 | The | ||
| 115 | .Fn ns_addr | ||
| 116 | and | ||
| 117 | .Fn ns_toa | ||
| 118 | functions appeared in | ||
| 119 | .Bx 4.3 . | ||
| 120 | .Sh BUGS | ||
| 121 | The string returned by | ||
| 122 | .Fn ns_ntoa | ||
| 123 | resides in a static memory area. | ||
| 124 | The function | ||
| 125 | .Fn ns_addr | ||
| 126 | should diagnose improperly formed input, and there should be an unambiguous | ||
| 127 | way to recognize this. | ||
