Commit | Line | Data |
---|---|---|
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 | |
45 | The | |
46 | .Tn NS | |
47 | protocol family is a collection of protocols | |
48 | layered atop the | |
49 | .Em Internet Datagram Protocol | |
50 | .Pq Tn IDP | |
51 | transport layer, and using the Xerox | |
52 | .Tn NS | |
53 | address formats. | |
54 | The | |
55 | .Tn NS | |
56 | family provides protocol support for the | |
57 | .Dv SOCK_STREAM , SOCK_DGRAM , SOCK_SEQPACKET , | |
58 | and | |
59 | .Dv SOCK_RAW | |
60 | socket types; the | |
61 | .Dv SOCK_RAW | |
62 | interface is a debugging tool, allowing you to trace all packets | |
63 | entering, (or with toggling kernel variable, additionally leaving) the local | |
64 | host. | |
65 | .Sh ADDRESSING | |
66 | .Tn NS | |
67 | addresses are 12 byte quantities, consisting of a | |
68 | 4 byte Network number, a 6 byte Host number and a 2 byte port number, | |
69 | all stored in network standard format. | |
70 | (on the | |
71 | .Tn VAX | |
72 | these are word and byte reversed; on the | |
73 | .Tn Sun | |
74 | they are not | |
75 | reversed). The include file | |
76 | .Aq Pa netns/ns.h | |
77 | defines the | |
78 | .Tn NS | |
79 | address as a structure containing unions (for quicker | |
80 | comparisons). | |
81 | .Pp | |
82 | Sockets in the Internet protocol family use the following | |
83 | addressing structure: | |
84 | .Bd -literal -offset indent | |
85 | struct sockaddr_ns { | |
86 | short sns_family; | |
87 | struct ns_addr sns_addr; | |
88 | char sns_zero[2]; | |
89 | }; | |
90 | .Ed | |
91 | .Pp | |
92 | where an | |
93 | .Ar ns_addr | |
94 | is composed as follows: | |
95 | .Bd -literal -offset indent | |
96 | union ns_host { | |
97 | u_char c_host[6]; | |
98 | u_short s_host[3]; | |
99 | }; | |
100 | ||
101 | union ns_net { | |
102 | u_char c_net[4]; | |
103 | u_short s_net[2]; | |
104 | }; | |
105 | ||
106 | struct ns_addr { | |
107 | union ns_net x_net; | |
108 | union ns_host x_host; | |
109 | u_short x_port; | |
110 | }; | |
111 | .Ed | |
112 | .Pp | |
113 | Sockets may be created with an address of all zeroes to effect | |
114 | .Dq wildcard | |
115 | matching on incoming messages. | |
116 | The local port address specified in a | |
117 | .Xr bind 2 | |
118 | call is restricted to be greater than | |
119 | .Dv NSPORT_RESERVED | |
120 | (=3000, in | |
121 | .Aq Pa netns/ns.h ) | |
122 | unless the creating process is running | |
123 | as the super-user, providing a space of protected port numbers. | |
124 | .Sh PROTOCOLS | |
125 | The | |
126 | .Tn NS | |
127 | protocol family supported by the operating system | |
128 | is comprised of | |
129 | the Internet Datagram Protocol | |
130 | .Pq Tn IDP | |
131 | .Xr idp 4 , | |
132 | Error Protocol (available through | |
133 | .Tn IDP ) , | |
134 | and | |
135 | Sequenced Packet Protocol | |
136 | .Pq Tn SPP | |
137 | .Xr spp 4 . | |
138 | .Pp | |
139 | .Tn SPP | |
140 | is used to support the | |
141 | .Dv SOCK_STREAM | |
142 | and | |
143 | .Dv SOCK_SEQPACKET | |
144 | abstraction, | |
145 | while | |
146 | .Tn IDP | |
147 | is used to support the | |
148 | .Dv SOCK_DGRAM | |
149 | abstraction. | |
150 | The Error protocol is responded to by the kernel | |
151 | to handle and report errors in protocol processing; | |
152 | it is, however, | |
153 | only 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 | |
175 | The | |
176 | .Nm | |
177 | protocol family | |
178 | appeared in | |
179 | .Bx 4.3 . |