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