share/mk/: Fix includes
[man-pages.git] / man7 / ddp.7
blobe52cd442b5f52d25c87dca12184f475e3af04eea
1 .\" This man page is Copyright (C) 1998 Alan Cox.
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" $Id: ddp.7,v 1.3 1999/05/13 11:33:22 freitag Exp $
6 .\"
7 .TH ddp 7 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 ddp \- Linux AppleTalk protocol implementation
10 .SH SYNOPSIS
11 .nf
12 .B #include <sys/socket.h>
13 .B #include <netatalk/at.h>
15 .IB ddp_socket " = socket(AF_APPLETALK, SOCK_DGRAM, 0);"
16 .IB raw_socket " = socket(AF_APPLETALK, SOCK_RAW, " protocol ");"
17 .fi
18 .SH DESCRIPTION
19 Linux implements the AppleTalk protocols described in
20 .IR "Inside AppleTalk" .
21 Only the DDP layer and AARP are present in
22 the kernel.
23 They are designed to be used via the
24 .B netatalk
25 protocol
26 libraries.
27 This page documents the interface for those who wish or need to
28 use the DDP layer directly.
30 The communication between AppleTalk and the user program works using a
31 BSD-compatible socket interface.
32 For more information on sockets, see
33 .BR socket (7).
35 An AppleTalk socket is created by calling the
36 .BR socket (2)
37 function with a
38 .B AF_APPLETALK
39 socket family argument.
40 Valid socket types are
41 .B SOCK_DGRAM
42 to open a
43 .B ddp
44 socket or
45 .B SOCK_RAW
46 to open a
47 .B raw
48 socket.
49 .I protocol
50 is the AppleTalk protocol to be received or sent.
51 For
52 .B SOCK_RAW
53 you must specify
54 .BR ATPROTO_DDP .
56 Raw sockets may be opened only by a process with effective user ID 0
57 or when the process has the
58 .B CAP_NET_RAW
59 capability.
60 .SS Address format
61 An AppleTalk socket address is defined as a combination of a network number,
62 a node number, and a port number.
64 .in +4n
65 .EX
66 struct at_addr {
67     unsigned short s_net;
68     unsigned char  s_node;
71 struct sockaddr_atalk {
72     sa_family_t    sat_family;    /* address family */
73     unsigned char  sat_port;      /* port */
74     struct at_addr sat_addr;      /* net/node */
76 .EE
77 .in
79 .I sat_family
80 is always set to
81 .BR AF_APPLETALK .
82 .I sat_port
83 contains the port.
84 The port numbers below 129 are known as
85 .IR "reserved ports" .
86 Only processes with the effective user ID 0 or the
87 .B CAP_NET_BIND_SERVICE
88 capability may
89 .BR bind (2)
90 to these sockets.
91 .I sat_addr
92 is the host address.
93 The
94 .I net
95 member of
96 .I struct at_addr
97 contains the host network in network byte order.
98 The value of
99 .B AT_ANYNET
100 is a
101 wildcard and also implies \[lq]this network.\[rq]
103 .I node
104 member of
105 .I struct at_addr
106 contains the host node number.
107 The value of
108 .B AT_ANYNODE
109 is a
110 wildcard and also implies \[lq]this node.\[rq] The value of
111 .B ATADDR_BCAST
112 is a link
113 local broadcast address.
114 .\" FIXME . this doesn't make sense [johnl]
115 .SS Socket options
116 No protocol-specific socket options are supported.
117 .SS /proc interfaces
118 IP supports a set of
119 .I /proc
120 interfaces to configure some global AppleTalk parameters.
121 The parameters can be accessed by reading or writing files in the directory
122 .IR /proc/sys/net/atalk/ .
124 .I aarp\-expiry\-time
125 The time interval (in seconds) before an AARP cache entry expires.
127 .I aarp\-resolve\-time
128 The time interval (in seconds) before an AARP cache entry is resolved.
130 .I aarp\-retransmit\-limit
131 The number of retransmissions of an AARP query before the node is declared
132 dead.
134 .I aarp\-tick\-time
135 The timer rate (in seconds) for the timer driving AARP.
137 The default values match the specification and should never need to be
138 changed.
139 .SS Ioctls
140 All ioctls described in
141 .BR socket (7)
142 apply to DDP.
143 .\" FIXME . Add a section about multicasting
144 .SH ERRORS
146 .B EACCES
147 The user tried to execute an operation without the necessary permissions.
148 These include sending to a broadcast address without
149 having the broadcast flag set,
150 and trying to bind to a reserved port without effective user ID 0 or
151 .BR CAP_NET_BIND_SERVICE .
153 .B EADDRINUSE
154 Tried to bind to an address already in use.
156 .B EADDRNOTAVAIL
157 A nonexistent interface was requested or the requested source address was
158 not local.
160 .B EAGAIN
161 Operation on a nonblocking socket would block.
163 .B EALREADY
164 A connection operation on a nonblocking socket is already in progress.
166 .B ECONNABORTED
167 A connection was closed during an
168 .BR accept (2).
170 .B EHOSTUNREACH
171 No routing table entry matches the destination address.
173 .B EINVAL
174 Invalid argument passed.
176 .B EISCONN
177 .BR connect (2)
178 was called on an already connected socket.
180 .B EMSGSIZE
181 Datagram is bigger than the DDP MTU.
183 .B ENODEV
184 Network device not available or not capable of sending IP.
186 .B ENOENT
187 .B SIOCGSTAMP
188 was called on a socket where no packet arrived.
190 .BR ENOMEM " and " ENOBUFS
191 Not enough memory available.
193 .B ENOPKG
194 A kernel subsystem was not configured.
196 .BR ENOPROTOOPT " and " EOPNOTSUPP
197 Invalid socket option passed.
199 .B ENOTCONN
200 The operation is defined only on a connected socket, but the socket wasn't
201 connected.
203 .B EPERM
204 User doesn't have permission to set high priority,
205 make a configuration change,
206 or send signals to the requested process or group.
208 .B EPIPE
209 The connection was unexpectedly closed or shut down by the other end.
211 .B ESOCKTNOSUPPORT
212 The socket was unconfigured, or an unknown socket type was requested.
213 .SH VERSIONS
214 AppleTalk is supported by Linux 2.0 or higher.
216 .I /proc
217 interfaces exist since Linux 2.2.
218 .SH NOTES
219 Be very careful with the
220 .B SO_BROADCAST
221 option; it is not privileged in Linux.
222 It is easy to overload the network
223 with careless sending to broadcast addresses.
224 .SS Compatibility
225 The basic AppleTalk socket interface is compatible with
226 .B netatalk
227 on BSD-derived systems.
228 Many BSD systems fail to check
229 .B SO_BROADCAST
230 when sending broadcast frames; this can lead to compatibility problems.
234 socket mode is unique to Linux and exists to support the alternative CAP
235 package and AppleTalk monitoring tools more easily.
236 .SH BUGS
237 There are too many inconsistent error values.
239 The ioctls used to configure routing tables, devices,
240 AARP tables, and other devices are not yet described.
241 .SH SEE ALSO
242 .BR recvmsg (2),
243 .BR sendmsg (2),
244 .BR capabilities (7),
245 .BR socket (7)