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