1IDP(4P) IDP(4P)
2
3
4
6 idp - Xerox Internet Datagram Protocol
7
9 #include <sys/socket.h>
10 #include <netns/ns.h>
11 #include <netns/idp.h>
12
13 s = socket(AF_NS, SOCK_DGRAM, 0);
14
16 IDP is a simple, unreliable datagram protocol which is used to support
17 the SOCK_DGRAM abstraction for the Internet protocol family. IDP sock‐
18 ets are connectionless, and are normally used with the sendto and
19 recvfrom calls, though the connect(2) call may also be used to fix the
20 destination for future packets (in which case the recv(2) or read(2)
21 and send(2) or write(2) system calls may be used).
22
23 Xerox protocols are built vertically on top of IDP. Thus, IDP address
24 formats are identical to those used by SPP. Note that the IDP port
25 space is the same as the SPP port space (i.e. a IDP port may be “con‐
26 nected” to a SPP port, with certain options enabled below). In addi‐
27 tion broadcast packets may be sent (assuming the underlying network
28 supports this) by using a reserved “broadcast address”; this address is
29 network interface dependent.
30
32 A socket operation may fail with one of the following errors returned:
33
34 [EISCONN] when trying to establish a connection on a socket which
35 already has one, or when trying to send a datagram with
36 the destination address specified and the socket is
37 already connected;
38
39 [ENOTCONN] when trying to send a datagram, but no destination
40 address is specified, and the socket hasn't been con‐
41 nected;
42
43 [ENOBUFS] when the system runs out of memory for an internal data
44 structure;
45
46 [EADDRINUSE] when an attempt is made to create a socket with a port
47 which has already been allocated;
48
49 [EADDRNOTAVAIL]
50 when an attempt is made to create a socket with a net‐
51 work address for which no network interface exists.
52
54 [SO_HEADERS_ON_INPUT]
55 When set, the first 30 bytes of any data returned from a
56 read or recv from will be the initial 30 bytes of the
57 IDP packet, as described by
58 struct idp {
59 u_short idp_sum;
60 u_short idp_len;
61 u_char idp_tc;
62 u_char idp_pt;
63 struct ns_addr idp_dna;
64 struct ns_addr idp_sna;
65 };
66 This allows the user to determine the packet type, and
67 whether the packet was a multi-cast packet or directed
68 specifically at the local host. When requested, gives
69 the current state of the option, (NSP_RAWIN or 0).
70
71 [SO_HEADERS_ON_OUTPUT]
72 When set, the first 30 bytes of any data sent will be
73 the initial 30 bytes of the IDP packet. This allows the
74 user to determine the packet type, and whether the
75 packet should be multi-cast packet or directed specifi‐
76 cally at the local host. You can also misrepresent the
77 sender of the packet. When requested, gives the current
78 state of the option. (NSP_RAWOUT or 0).
79
80 [SO_DEFAULT_HEADERS]
81 The user provides the kernel an IDP header, from which
82 it gleans the Packet Type. When requested, the kernel
83 will provide an IDP header, showing the default packet
84 type, and local and foreign addresses, if connected.
85
86 [SO_ALL_PACKETS]
87 When set, this option defeats automatic processing of
88 Error packets, and Sequence Protocol packets.
89
90 [SO_SEQNO] When requested, this returns a sequence number which is
91 not likely to be repeated until the machine crashes or a
92 very long time has passed. It is useful in constructing
93 Packet Exchange Protocol packets.
94
96 send(2), recv(2), intro(4N), ns(4F)
97
98
99
1004.3 Berkeley Distribution July 30, 1985 IDP(4P)