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