date and time created 87/11/21 14:33:27 by karels
[unix-history] / usr / src / share / man / man4 / idp.4
CommitLineData
c239fd3a
KS
1.\" Copyright (c) 1985 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)idp.4 1.1 (Berkeley) %G%
6.\"
7.TH IDP 4P "July 30, 1985"
8.UC 6
9.SH NAME
10idp \- Xerox Internet Datagram Protocol
11.SH SYNOPSIS
12.B #include <sys/socket.h>
13.br
14.B #include <netns/ns.h>
15.br
16.B #include <netns/idp.h>
17.PP
18.B s = socket(AF_NS, SOCK_DGRAM, 0);
19.SH DESCRIPTION
20IDP is a simple, unreliable datagram protocol which is used
21to support the SOCK_DGRAM abstraction for the Internet
22protocol family. IDP sockets are connectionless, and are
23normally used with the
24.I sendto
25and
26.IR recvfrom
27calls, though the
28.IR connect (2)
29call may also be used to fix the destination for future
30packets (in which case the
31.IR recv (2)
32or
33.IR read (2)
34and
35.IR send (2)
36or
37.IR write(2)
38system calls may be used).
39.PP
40Xerox protocols are built vertically on top of IDP.
41Thus, IDP address formats are identical to those used by
42SPP.
43Note that the IDP port
44space is the same as the SPP port space (i.e. a IDP port
45may be \*(lqconnected\*(rq to a SPP port, with certain
46options enabled below).
47In addition broadcast packets may be sent
48(assuming the underlying network supports
49this) by using a reserved \*(lqbroadcast address\*(rq; this address
50is network interface dependent.
51.SH DIAGNOSTICS
52A socket operation may fail with one of the following errors returned:
53.TP 15
54[EISCONN]
55when trying to establish a connection on a socket which
56already has one, or when trying to send a datagram with the destination
57address specified and the socket is already connected;
58.TP 15
59[ENOTCONN]
60when trying to send a datagram, but
61no destination address is specified, and the socket hasn't been
62connected;
63.TP 15
64[ENOBUFS]
65when the system runs out of memory for
66an internal data structure;
67.TP 15
68[EADDRINUSE]
69when an attempt
70is made to create a socket with a port which has already been
71allocated;
72.TP 15
73[EADDRNOTAVAIL]
74when an attempt is made to create a
75socket with a network address for which no network interface
76exists.
77.SH SOCKET OPTIONS
78.TP 15
79[SO_HEADERS_ON_INPUT]
80When set, the first 30 bytes of any data returned from a read
81or recv from will be the initial 30 bytes of the IDP packet,
82as described by
83.nf
84struct idp {
85 u_short idp_sum;
86 u_short idp_len;
87 u_char idp_tc;
88 u_char idp_pt;
89 struct ns_addr idp_dna;
90 struct ns_addr idp_sna;
91};
92.fi
93This allows the user to determine the packet type, and whether
94the packet was a multi-cast packet or directed specifically at
95the local host.
96When requested, gives the current state of the option,
97(NSP_RAWIN or 0).
98.TP 15
99[SO_HEADERS_ON_OUTPUT]
100When set, the first 30 bytes of any data sent
101will be the initial 30 bytes of the IDP packet.
102This allows the user to determine the packet type, and whether
103the packet should be multi-cast packet or directed specifically at
104the local host.
105You can also misrepresent the sender of the packet.
106When requested, gives the current state of the option.
107(NSP_RAWOUT or 0).
108.TP 15
109[SO_DEFAULT_HEADERS]
110The user provides the kernel an IDP header, from which
111it gleans the Packet Type.
112When requested, the kernel will provide an IDP header, showing
113the default packet type, and local and foreign addresses, if
114connected.
115.TP 15
116[SO_ALL_PACKETS]
117When set, this option defeats automatic processing of Error packets,
118and Sequence Protocol packets.
119.TP 15
120[SO_SEQNO]
121When requested, this returns a sequence number which is not likely
122to be repeated until the machine crashes or a very long time has passed.
123It is useful in constructing Packet Exchange Protocol packets.
124.SH SEE ALSO
125send(2),
126recv(2),
127intro(4N),
128ns(4F)