fts_load no longer has any return value
[unix-history] / usr / src / lib / libc / net / ns.3
CommitLineData
968d6b3e
KB
1.\" Copyright (c) 1986 The Regents of the University of California.
2.\" All rights reserved.
78e649e1 3.\"
91cff1e1 4.\" %sccs.include.redist.man%
78e649e1 5.\"
91cff1e1 6.\" @(#)ns.3 6.4 (Berkeley) %G%
968d6b3e
KB
7.\"
8.TH NS 3 ""
78e649e1
KM
9.UC 6
10.SH NAME
11ns_addr, ns_ntoa \- Xerox NS(tm) address conversion routines
12.SH SYNOPSIS
13.nf
14.B "#include <sys/types.h>
15.B "#include <netns/ns.h>
16.PP
17.B "struct ns_addr ns_addr(cp)
18.B "char *cp;
19.PP
20.B "char *ns_ntoa(ns)
21.B "struct ns_addr ns;
22.fi
23.SH DESCRIPTION
24The routine
a7b6cc8d 25.I ns_addr
78e649e1
KM
26interprets character strings representing
27XNS addresses, returning binary information suitable
28for use in system calls.
a7b6cc8d 29.I ns_ntoa
78e649e1
KM
30takes XNS addresses and returns ASCII
31strings representing the address in a
32notation in common use in the Xerox Development Environment:
33.nf
34 <network number>.<host number>.<port number>
35.fi
36Trailing zero fields are suppressed, and each number is printed in hexadecimal,
a7b6cc8d
MK
37in a format suitable for input to
38.IR ns_addr .
78e649e1 39Any fields lacking super-decimal digits will have a
a7b6cc8d 40trailing ``H'' appended.
78e649e1
KM
41.PP
42Unfortunately, no universal standard exists for representing XNS addresses.
43An effort has been made to insure that
a7b6cc8d 44.I ns_addr
78e649e1
KM
45be compatible with most formats in common use.
46It will first separate an address into 1 to 3 fields using a single delimiter
47chosen from
48period (``.''),
49colon (``:'') or pound-sign (``#'').
a7b6cc8d 50Each field is then examined for byte separators (colon or period).
78e649e1
KM
51If there are byte separators, each subfield separated is taken to be
52a small hexadecimal number, and the entirety is taken as a network-byte-ordered
53quantity to be zero extended in the high-network-order bytes.
54Next, the field is inspected for hyphens, in which case
55the field is assumed to be a number in decimal notation
56with hyphens separating the millenia.
57Next, the field is assumed to be a number:
58It is interpreted
59as hexadecimal if there is a leading ``0x'' (as in C),
a7b6cc8d
MK
60a trailing ``H'' (as in Mesa), or there are any super-decimal digits present.
61It is interpreted as octal is there is a leading ``0''
62and there are no super-octal digits.
78e649e1
KM
63Otherwise, it is converted as a decimal number.
64.SH "SEE ALSO"
65hosts(5), networks(5),
66.SH DIAGNOSTICS
67None (see BUGS).
68.SH BUGS
69The string returned by
70.I ns_ntoa
71resides in a static memory area.
72.br
73.I ns_addr
74should diagnose improperly formed input, and there should be an unambiguous
75way to recognize this.