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