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 | .\" @(#)idp.4 1.4 (Berkeley) 3/28/91 | |
33 | .\" | |
34 | .Dd March 28, 1991 | |
35 | .Dt IDP 4 | |
36 | .Os BSD 4.3 | |
37 | .Sh NAME | |
38 | .Nm idp | |
39 | .Nd Xerox Internet Datagram Protocol | |
40 | .Sh SYNOPSIS | |
41 | .Fd #include <sys/socket.h> | |
42 | .Fd #include <netns/ns.h> | |
43 | .Fd #include <netns/idp.h> | |
44 | .Ft int | |
45 | .Fn socket AF_NS SOCK_DGRAM 0 | |
46 | .Sh DESCRIPTION | |
47 | .Tn IDP | |
48 | is a simple, unreliable datagram protocol which is used | |
49 | to support the | |
50 | .Dv SOCK_DGRAM | |
51 | abstraction for the Internet | |
52 | protocol family. | |
53 | .Tn IDP | |
54 | sockets are connectionless, and are | |
55 | normally used with the | |
56 | .Xr sendto | |
57 | and | |
58 | .Xr recvfrom | |
59 | calls, though the | |
60 | .Xr connect 2 | |
61 | call may also be used to fix the destination for future | |
62 | packets (in which case the | |
63 | .Xr recv 2 | |
64 | or | |
65 | .Xr read 2 | |
66 | and | |
67 | .Xr send 2 | |
68 | or | |
69 | .Xr write 2 | |
70 | system calls may be used). | |
71 | .Pp | |
72 | Xerox protocols are built vertically on top of | |
73 | .Tn IDP . | |
74 | Thus, | |
75 | .Tn IDP | |
76 | address formats are identical to those used by | |
77 | .Tn SPP . | |
78 | Note that the | |
79 | .Tn IDP | |
80 | port | |
81 | space is the same as the | |
82 | .Tn SPP | |
83 | port space (i.e. a | |
84 | .Tn IDP | |
85 | port | |
86 | may be | |
87 | .Dq connected | |
88 | to a | |
89 | .Tn SPP | |
90 | port, with certain | |
91 | options enabled below). | |
92 | In addition broadcast packets may be sent | |
93 | (assuming the underlying network supports | |
94 | this) by using a reserved | |
95 | .Dq broadcast address ; | |
96 | this address | |
97 | is network interface dependent. | |
98 | .Sh DIAGNOSTICS | |
99 | A socket operation may fail with one of the following errors returned: | |
100 | .Bl -tag -width [EADDRNOTAVAIL] | |
101 | .It Bq Er EISCONN | |
102 | when trying to establish a connection on a socket which | |
103 | already has one, or when trying to send a datagram with the destination | |
104 | address specified and the socket is already connected; | |
105 | .It Bq Er ENOTCONN | |
106 | when trying to send a datagram, but | |
107 | no destination address is specified, and the socket hasn't been | |
108 | connected; | |
109 | .It Bq Er ENOBUFS | |
110 | when the system runs out of memory for | |
111 | an internal data structure; | |
112 | .It Bq Er EADDRINUSE | |
113 | when an attempt | |
114 | is made to create a socket with a port which has already been | |
115 | allocated; | |
116 | .It Bq Er EADDRNOTAVAIL | |
117 | when an attempt is made to create a | |
118 | socket with a network address for which no network interface | |
119 | exists. | |
120 | .El | |
121 | .Sh SOCKET OPTIONS | |
122 | .Bl -tag -width [SO_HEADERS_ON_OUTPUT] | |
123 | .It Bq Dv SO_ALL_PACKETS | |
124 | When set, this option defeats automatic processing of Error packets, | |
125 | and Sequence Protocol packets. | |
126 | .It Bq Dv SO_DEFAULT_HEADERS | |
127 | The user provides the kernel an | |
128 | .Tn IDP | |
129 | header, from which | |
130 | it gleans the Packet Type. | |
131 | When requested, the kernel will provide an | |
132 | .Tn IDP | |
133 | header, showing | |
134 | the default packet type, and local and foreign addresses, if | |
135 | connected. | |
136 | .It Bq Dv SO_HEADERS_ON_INPUT | |
137 | When set, the first 30 bytes of any data returned from a read | |
138 | or recv from will be the initial 30 bytes of the | |
139 | .Tn IDP | |
140 | packet, | |
141 | as described by | |
142 | .Bd -literal -offset indent | |
143 | struct idp { | |
144 | u_short idp_sum; | |
145 | u_short idp_len; | |
146 | u_char idp_tc; | |
147 | u_char idp_pt; | |
148 | struct ns_addr idp_dna; | |
149 | struct ns_addr idp_sna; | |
150 | }; | |
151 | .Ed | |
152 | .Pp | |
153 | This allows the user to determine the packet type, and whether | |
154 | the packet was a multi-cast packet or directed specifically at | |
155 | the local host. | |
156 | When requested, gives the current state of the option, | |
157 | .Pf ( Dv NSP_RAWIN | |
158 | or 0). | |
159 | .It Bq Dv SO_HEADERS_ON_OUTPUT | |
160 | When set, the first 30 bytes of any data sent | |
161 | will be the initial 30 bytes of the | |
162 | .Tn IDP | |
163 | packet. | |
164 | This allows the user to determine the packet type, and whether | |
165 | the packet should be multi-cast packet or directed specifically at | |
166 | the local host. | |
167 | You can also misrepresent the sender of the packet. | |
168 | When requested, gives the current state of the option. | |
169 | .Pf ( Dv NSP_RAWOUT | |
170 | or 0). | |
171 | .It Bq Dv SO_SEQNO | |
172 | When requested, this returns a sequence number which is not likely | |
173 | to be repeated until the machine crashes or a very long time has passed. | |
174 | It is useful in constructing Packet Exchange Protocol packets. | |
175 | .El | |
176 | .Sh SEE ALSO | |
177 | .Xr send 2 , | |
178 | .Xr recv 2 , | |
179 | .Xr intro 4 , | |
180 | .Xr ns 4 | |
181 | .Sh HISTORY | |
182 | The | |
183 | .Nm | |
184 | protocol appeared in | |
185 | .Bx 4.3 . |