Previous version restored back after Jordan's damage.
[unix-history] / share / man / man4 / ns.4
CommitLineData
15637ed4
RG
1.\" Copyright (c) 1985, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)ns.4 1.6 (Berkeley) 3/28/91
33.\"
34.Dd March 28, 1991
35.Dt NS 4
36.Os BSD 4.3
37.Sh NAME
38.Nm ns
39.Nd Xerox Network Systems(tm) protocol family
40.Sh SYNOPSIS
41.Nm options NS
42.Nm options NSIP
43.Nm pseudo-device ns
44.Sh DESCRIPTION
45The
46.Tn NS
47protocol family is a collection of protocols
48layered atop the
49.Em Internet Datagram Protocol
50.Pq Tn IDP
51transport layer, and using the Xerox
52.Tn NS
53address formats.
54The
55.Tn NS
56family provides protocol support for the
57.Dv SOCK_STREAM , SOCK_DGRAM , SOCK_SEQPACKET ,
58and
59.Dv SOCK_RAW
60socket types; the
61.Dv SOCK_RAW
62interface is a debugging tool, allowing you to trace all packets
63entering, (or with toggling kernel variable, additionally leaving) the local
64host.
65.Sh ADDRESSING
66.Tn NS
67addresses are 12 byte quantities, consisting of a
684 byte Network number, a 6 byte Host number and a 2 byte port number,
69all stored in network standard format.
70(on the
71.Tn VAX
72these are word and byte reversed; on the
73.Tn Sun
74they are not
75reversed). The include file
76.Aq Pa netns/ns.h
77defines the
78.Tn NS
79address as a structure containing unions (for quicker
80comparisons).
81.Pp
82Sockets in the Internet protocol family use the following
83addressing structure:
84.Bd -literal -offset indent
85struct sockaddr_ns {
86 short sns_family;
87 struct ns_addr sns_addr;
88 char sns_zero[2];
89};
90.Ed
91.Pp
92where an
93.Ar ns_addr
94is composed as follows:
95.Bd -literal -offset indent
96union ns_host {
97 u_char c_host[6];
98 u_short s_host[3];
99};
100
101union ns_net {
102 u_char c_net[4];
103 u_short s_net[2];
104};
105
106struct ns_addr {
107 union ns_net x_net;
108 union ns_host x_host;
109 u_short x_port;
110};
111.Ed
112.Pp
113Sockets may be created with an address of all zeroes to effect
114.Dq wildcard
115matching on incoming messages.
116The local port address specified in a
117.Xr bind 2
118call is restricted to be greater than
119.Dv NSPORT_RESERVED
120(=3000, in
121.Aq Pa netns/ns.h )
122unless the creating process is running
123as the super-user, providing a space of protected port numbers.
124.Sh PROTOCOLS
125The
126.Tn NS
127protocol family supported by the operating system
128is comprised of
129the Internet Datagram Protocol
130.Pq Tn IDP
131.Xr idp 4 ,
132Error Protocol (available through
133.Tn IDP ) ,
134and
135Sequenced Packet Protocol
136.Pq Tn SPP
137.Xr spp 4 .
138.Pp
139.Tn SPP
140is used to support the
141.Dv SOCK_STREAM
142and
143.Dv SOCK_SEQPACKET
144abstraction,
145while
146.Tn IDP
147is used to support the
148.Dv SOCK_DGRAM
149abstraction.
150The Error protocol is responded to by the kernel
151to handle and report errors in protocol processing;
152it is, however,
153only accessible to user programs through heroic actions.
154.Sh SEE ALSO
155.Xr intro 3 ,
156.Xr byteorder 3 ,
157.Xr gethostbyname 3 ,
158.Xr getnetent 3 ,
159.Xr getprotoent 3 ,
160.Xr getservent 3 ,
161.Xr ns 3 ,
162.Xr intro 4 ,
163.Xr spp 4 ,
164.Xr idp 4 ,
165.Xr nsip 4
166.Rs
167.%T "Internet Transport Protocols"
168.%R Xerox Corporation document XSIS
169.%N 028112
170.Re
171.Rs
172.%T "An Advanced 4.3 BSD Interprocess Communication Tutorial"
173.Re
174.Sh HISTORY
175The
176.Nm
177protocol family
178appeared in
179.Bx 4.3 .