1ddp(7) Miscellaneous Information Manual ddp(7)
2
3
4
6 ddp - Linux AppleTalk protocol implementation
7
9 #include <sys/socket.h>
10 #include <netatalk/at.h>
11
12 ddp_socket = socket(AF_APPLETALK, SOCK_DGRAM, 0);
13 raw_socket = socket(AF_APPLETALK, SOCK_RAW, protocol);
14
16 Linux implements the AppleTalk protocols described in Inside AppleTalk.
17 Only the DDP layer and AARP are present in the kernel. They are de‐
18 signed to be used via the netatalk protocol libraries. This page docu‐
19 ments the interface for those who wish or need to use the DDP layer di‐
20 rectly.
21
22 The communication between AppleTalk and the user program works using a
23 BSD-compatible socket interface. For more information on sockets, see
24 socket(7).
25
26 An AppleTalk socket is created by calling the socket(2) function with a
27 AF_APPLETALK socket family argument. Valid socket types are SOCK_DGRAM
28 to open a ddp socket or SOCK_RAW to open a raw socket. protocol is the
29 AppleTalk protocol to be received or sent. For SOCK_RAW you must spec‐
30 ify ATPROTO_DDP.
31
32 Raw sockets may be opened only by a process with effective user ID 0 or
33 when the process has the CAP_NET_RAW capability.
34
35 Address format
36 An AppleTalk socket address is defined as a combination of a network
37 number, a node number, and a port number.
38
39 struct at_addr {
40 unsigned short s_net;
41 unsigned char s_node;
42 };
43
44 struct sockaddr_atalk {
45 sa_family_t sat_family; /* address family */
46 unsigned char sat_port; /* port */
47 struct at_addr sat_addr; /* net/node */
48 };
49
50 sat_family is always set to AF_APPLETALK. sat_port contains the port.
51 The port numbers below 129 are known as reserved ports. Only processes
52 with the effective user ID 0 or the CAP_NET_BIND_SERVICE capability may
53 bind(2) to these sockets. sat_addr is the host address. The net mem‐
54 ber of struct at_addr contains the host network in network byte order.
55 The value of AT_ANYNET is a wildcard and also implies “this network.”
56 The node member of struct at_addr contains the host node number. The
57 value of AT_ANYNODE is a wildcard and also implies “this node.” The
58 value of ATADDR_BCAST is a link local broadcast address.
59
60 Socket options
61 No protocol-specific socket options are supported.
62
63 /proc interfaces
64 IP supports a set of /proc interfaces to configure some global Ap‐
65 pleTalk parameters. The parameters can be accessed by reading or writ‐
66 ing files in the directory /proc/sys/net/atalk/.
67
68 aarp-expiry-time
69 The time interval (in seconds) before an AARP cache entry ex‐
70 pires.
71
72 aarp-resolve-time
73 The time interval (in seconds) before an AARP cache entry is re‐
74 solved.
75
76 aarp-retransmit-limit
77 The number of retransmissions of an AARP query before the node
78 is declared dead.
79
80 aarp-tick-time
81 The timer rate (in seconds) for the timer driving AARP.
82
83 The default values match the specification and should never need to be
84 changed.
85
86 Ioctls
87 All ioctls described in socket(7) apply to DDP.
88
90 EACCES The user tried to execute an operation without the necessary
91 permissions. These include sending to a broadcast address with‐
92 out having the broadcast flag set, and trying to bind to a re‐
93 served port without effective user ID 0 or CAP_NET_BIND_SERVICE.
94
95 EADDRINUSE
96 Tried to bind to an address already in use.
97
98 EADDRNOTAVAIL
99 A nonexistent interface was requested or the requested source
100 address was not local.
101
102 EAGAIN Operation on a nonblocking socket would block.
103
104 EALREADY
105 A connection operation on a nonblocking socket is already in
106 progress.
107
108 ECONNABORTED
109 A connection was closed during an accept(2).
110
111 EHOSTUNREACH
112 No routing table entry matches the destination address.
113
114 EINVAL Invalid argument passed.
115
116 EISCONN
117 connect(2) was called on an already connected socket.
118
119 EMSGSIZE
120 Datagram is bigger than the DDP MTU.
121
122 ENODEV Network device not available or not capable of sending IP.
123
124 ENOENT SIOCGSTAMP was called on a socket where no packet arrived.
125
126 ENOMEM and ENOBUFS
127 Not enough memory available.
128
129 ENOPKG A kernel subsystem was not configured.
130
131 ENOPROTOOPT and EOPNOTSUPP
132 Invalid socket option passed.
133
134 ENOTCONN
135 The operation is defined only on a connected socket, but the
136 socket wasn't connected.
137
138 EPERM User doesn't have permission to set high priority, make a con‐
139 figuration change, or send signals to the requested process or
140 group.
141
142 EPIPE The connection was unexpectedly closed or shut down by the other
143 end.
144
145 ESOCKTNOSUPPORT
146 The socket was unconfigured, or an unknown socket type was re‐
147 quested.
148
150 AppleTalk is supported by Linux 2.0 or higher. The /proc interfaces
151 exist since Linux 2.2.
152
154 Be very careful with the SO_BROADCAST option; it is not privileged in
155 Linux. It is easy to overload the network with careless sending to
156 broadcast addresses.
157
158 Compatibility
159 The basic AppleTalk socket interface is compatible with netatalk on
160 BSD-derived systems. Many BSD systems fail to check SO_BROADCAST when
161 sending broadcast frames; this can lead to compatibility problems.
162
163 The raw socket mode is unique to Linux and exists to support the alter‐
164 native CAP package and AppleTalk monitoring tools more easily.
165
167 There are too many inconsistent error values.
168
169 The ioctls used to configure routing tables, devices, AARP tables, and
170 other devices are not yet described.
171
173 recvmsg(2), sendmsg(2), capabilities(7), socket(7)
174
175
176
177Linux man-pages 6.04 2023-02-05 ddp(7)