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