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