version 2 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
DDP |
|
|
2 |
!!!DDP |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
ADDRESS FORMAT |
|
|
7 |
SOCKET OPTIONS |
|
|
8 |
SYSCTLS |
|
|
9 |
IOCTLS |
|
|
10 |
NOTES |
|
|
11 |
VERSIONS |
|
|
12 |
ERRORS |
|
|
13 |
COMPATIBILITY |
|
|
14 |
BUGS |
|
|
15 |
SEE ALSO |
|
|
16 |
---- |
|
|
17 |
!!NAME |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
ddp - Linux !AppleTalk protocol implementation |
|
|
21 |
!!SYNOPSIS |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__#include __ |
|
|
25 |
#include __ |
|
|
26 |
|
|
|
27 |
|
|
|
28 |
''ddp_socket'' __= socket(PF_APPLETALK, SOCK_DGRAM, |
|
|
29 |
0);__'' |
|
|
30 |
raw_socket'' __= socket(PF_APPLETALK, SOCK_RAW,__ |
|
|
31 |
''protocol''__);__ |
|
|
32 |
!!DESCRIPTION |
|
|
33 |
|
|
|
34 |
|
|
|
35 |
Linux implements the Appletalk protocols described in |
|
|
36 |
''Inside Appletalk''. Only the DDP layer and AARP are |
|
|
37 |
present in the kernel. They are designed to be used via the |
|
|
38 |
__netatalk__ protocol libraries. This page documents the |
|
|
39 |
interface for those who wish or need to use the DDP layer |
|
|
40 |
directly. |
|
|
41 |
|
|
|
42 |
|
|
|
43 |
The communication between Appletalk and the user program |
|
|
44 |
works using a BSD-compatible socket interface. For more |
|
|
45 |
information on sockets, see socket(7). |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
An !AppleTalk socket is created by calling the |
|
|
49 |
socket(2) function with a __PF_APPLETALK__ socket |
|
|
50 |
family argument. Valid socket types are __SOCK_DGRAM__ to |
|
|
51 |
open a __ddp__ socket or __SOCK_RAW__ to open a |
|
|
52 |
__raw__ socket. ''protocol'' is the Appletalk protocol |
|
|
53 |
to be received or sent. For __SOCK_RAW__ you must specify |
|
|
54 |
__ATPROTO_DDP__. |
|
|
55 |
|
|
|
56 |
|
|
|
57 |
Raw sockets may be only opened by a process with effective |
|
|
58 |
user id 0 or when the process has the __CAP_NET_RAW__ |
|
|
59 |
capability. |
|
|
60 |
!!ADDRESS FORMAT |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
An Appletalk socket address is defined as a combination of a |
|
|
64 |
network number, a node number, and a port |
|
|
65 |
number. |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
struct at_addr { |
|
|
69 |
u_short s_net; |
|
|
70 |
u_char s_node; |
|
|
71 |
}; |
|
|
72 |
struct sockaddr_atalk { |
|
|
73 |
sa_family_t sat_family; /* address family */ |
|
|
74 |
u_char sat_port; /* port */ |
|
|
75 |
struct at_addr sat_addr; /* net/node */ |
|
|
76 |
}; |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
''sat_family'' is always set to __AF_APPLETALK.__ |
|
|
80 |
''sat_port'' contains the port. The port numbers below |
|
|
81 |
129 are known as __reserved ports.__ Only processes with |
|
|
82 |
the effective user id 0 or the __CAP_NET_BIND_SERVICE__ |
|
|
83 |
capability may bind(2) to these sockets. |
|
|
84 |
''sat_addr'' is the host address. The ''net'' member |
|
|
85 |
of __struct at_addr__ contains the host network in |
|
|
86 |
network byte order. The value of __AT_ANYNET__ is a |
|
|
87 |
wildcard and also implies ``this network.'' The ''node'' |
|
|
88 |
member of __struct at_addr__ contains the host node |
|
|
89 |
number. The value of __AT_ANYNODE__ is a wildcard and |
|
|
90 |
also implies ``this node.'' The value of __ATADDR_BCAST__ |
|
|
91 |
is a link local broadcast address. |
|
|
92 |
!!SOCKET OPTIONS |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
No protocol-specific socket options are |
|
|
96 |
supported. |
|
|
97 |
!!SYSCTLS |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
IP supports a sysctl interface to configure some global |
|
|
101 |
!AppleTalk parameters. The sysctls can be accessed by reading |
|
|
102 |
or writing the __/proc/sys/net/atalk/*__ files or with |
|
|
103 |
the sysctl(2) interface. |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
__aarp-expiry-time__ |
|
|
107 |
|
|
|
108 |
|
|
|
109 |
The time interval (in seconds) before an AARP cache entry |
|
|
110 |
expires. |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
__aarp-resolve-time__ |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
The time interval (in seconds) before an AARP cache entry is |
|
|
117 |
resolved. |
|
|
118 |
|
|
|
119 |
|
|
|
120 |
__aarp-retransmit-limit__ |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
The number of retransmissions of an AARP query before the |
|
|
124 |
node is declared dead. |
|
|
125 |
|
|
|
126 |
|
|
|
127 |
__aarp-tick-time__ |
|
|
128 |
|
|
|
129 |
|
|
|
130 |
The timer rate (in seconds) for the timer driving |
|
|
131 |
AARP. |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
The default values match the specification and should never |
|
|
135 |
need to be changed. |
|
|
136 |
!!IOCTLS |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
All ioctls described in socket(7) apply to |
|
|
140 |
ddp. |
|
|
141 |
!!NOTES |
|
|
142 |
|
|
|
143 |
|
|
|
144 |
Be very careful with the __SO_BROADCAST__ option - it is |
|
|
145 |
not privileged in Linux. It is easy to overload the network |
|
|
146 |
with careless sending to broadcast addresses. |
|
|
147 |
!!VERSIONS |
|
|
148 |
|
|
|
149 |
|
|
|
150 |
Appletalk is supported by Linux 2.0 or higher. The |
|
|
151 |
__sysctl__ interface is new in Linux 2.2. |
|
|
152 |
!!ERRORS |
|
|
153 |
|
|
|
154 |
|
|
|
155 |
__ENOTCONN__ |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
The operation is only defined on a connected socket, but the |
|
|
159 |
socket wasn't connected. |
|
|
160 |
|
|
|
161 |
|
|
|
162 |
__EINVAL__ |
|
|
163 |
|
|
|
164 |
|
|
|
165 |
Invalid argument passed. |
|
|
166 |
|
|
|
167 |
|
|
|
168 |
__EMSGSIZE__ |
|
|
169 |
|
|
|
170 |
|
|
|
171 |
Datagram is bigger than the DDP MTU. |
|
|
172 |
|
|
|
173 |
|
|
|
174 |
__EACCES__ |
|
|
175 |
|
|
|
176 |
|
|
|
177 |
The user tried to execute an operation without the necessary |
|
|
178 |
permissions. These include sending to a broadcast address |
|
|
179 |
without having the broadcast flag set, and trying to bind to |
|
|
180 |
a reserved port without effective user id 0 or |
|
|
181 |
__CAP_NET_BIND_SERVICE__. |
|
|
182 |
|
|
|
183 |
|
|
|
184 |
__EADDRINUSE__ |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
Tried to bind to an address already in use. |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
__ENOMEM__ and __ENOBUFS__ |
|
|
191 |
|
|
|
192 |
|
|
|
193 |
Not enough memory available. |
|
|
194 |
|
|
|
195 |
|
|
|
196 |
__ENOPROTOOPT__ and __EOPNOTSUPP__ |
|
|
197 |
|
|
|
198 |
|
|
|
199 |
Invalid socket option passed. |
|
|
200 |
|
|
|
201 |
|
|
|
202 |
__EPERM__ |
|
|
203 |
|
|
|
204 |
|
|
|
205 |
User doesn't have permission to set high priority, make a |
|
|
206 |
configuration change, or send signals to the requested |
|
|
207 |
process or group, |
|
|
208 |
|
|
|
209 |
|
|
|
210 |
__EADDRNOTAVAIL__ |
|
|
211 |
|
|
|
212 |
|
|
|
213 |
A non-existent interface was requested or the requested |
|
|
214 |
source address was not local. |
|
|
215 |
|
|
|
216 |
|
|
|
217 |
__EAGAIN__ |
|
|
218 |
|
|
|
219 |
|
|
|
220 |
Operation on a nonblocking socket would block. |
|
|
221 |
|
|
|
222 |
|
|
|
223 |
__ESOCKTNOSUPPORT__ |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
The socket was unconfigured, or an unknown socket type was |
|
|
227 |
requested. |
|
|
228 |
|
|
|
229 |
|
|
|
230 |
__EISCONN__ |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
connect(2) was called on an already connected |
|
|
234 |
socket. |
|
|
235 |
|
|
|
236 |
|
|
|
237 |
__EALREADY__ |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
A connection operation on a non-blocking socket is already |
|
|
241 |
in progress. |
|
|
242 |
|
|
|
243 |
|
|
|
244 |
__ECONNABORTED__ |
|
|
245 |
|
|
|
246 |
|
|
|
247 |
A connection was closed during an |
|
|
248 |
accept(2). |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
__EPIPE__ |
|
|
252 |
|
|
|
253 |
|
|
|
254 |
The connection was unexpectedly closed or shut down by the |
|
|
255 |
other end. |
|
|
256 |
|
|
|
257 |
|
|
|
258 |
__ENOENT__ |
|
|
259 |
|
|
|
260 |
|
|
|
261 |
__SIOCGSTAMP__ was called on a socket where no packet |
|
|
262 |
arrived. |
|
|
263 |
|
|
|
264 |
|
|
|
265 |
__EHOSTUNREACH__ |
|
|
266 |
|
|
|
267 |
|
|
|
268 |
No routing table entry matches the destination |
|
|
269 |
address. |
|
|
270 |
|
|
|
271 |
|
|
|
272 |
__ENODEV__ |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
Network device not available or not capable of sending |
|
|
276 |
IP. |
|
|
277 |
|
|
|
278 |
|
|
|
279 |
__ENOPKG__ |
|
|
280 |
|
|
|
281 |
|
|
|
282 |
A kernel subsystem was not configured. |
|
|
283 |
!!COMPATIBILITY |
|
|
284 |
|
|
|
285 |
|
|
|
286 |
The basic !AppleTalk socket interface is compatible with |
|
|
287 |
__netatalk__ on BSD-derived systems. Many BSD systems |
|
|
288 |
fail to check __SO_BROADCAST__ when sending broadcast |
|
|
289 |
frames; this can lead to compatibility |
|
|
290 |
problems. |
|
|
291 |
|
|
|
292 |
|
|
|
293 |
The raw socket mode is unique to Linux and exists to support |
|
|
294 |
the alternative CAP package and !AppleTalk monitoring tools |
|
|
295 |
more easily. |
|
|
296 |
!!BUGS |
|
|
297 |
|
|
|
298 |
|
|
|
299 |
There are too many inconsistent error values. |
|
|
300 |
|
|
|
301 |
|
|
|
302 |
The ioctls used to configure routing tables, devices, AARP |
|
|
303 |
tables and other devices are not yet described. |
|
|
304 |
!!SEE ALSO |
|
|
305 |
|
|
|
306 |
|
|
|
307 |
sendmsg(2), recvmsg(2), |
|
|
308 |
socket(7) |
|
|
309 |
---- |