|
Packit |
7cfc04 |
.\" This man page is Copyright (C) 1998 Alan Cox.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_START(VERBATIM_ONE_PARA)
|
|
Packit |
7cfc04 |
.\" Permission is granted to distribute possibly modified copies
|
|
Packit |
7cfc04 |
.\" of this page provided the header is included verbatim,
|
|
Packit |
7cfc04 |
.\" and in case of nontrivial modification author and date
|
|
Packit |
7cfc04 |
.\" of the modification is added to the header.
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_END
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" $Id: ddp.7,v 1.3 1999/05/13 11:33:22 freitag Exp $
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.TH DDP 7 2017-09-15 "Linux" "Linux Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
ddp \- Linux AppleTalk protocol implementation
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.B #include <sys/socket.h>
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
.B #include <netatalk/at.h>
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.IB ddp_socket " = socket(AF_APPLETALK, SOCK_DGRAM, 0);"
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
.IB raw_socket " = socket(AF_APPLETALK, SOCK_RAW, " protocol ");"
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
Linux implements the AppleTalk protocols described in
|
|
Packit |
7cfc04 |
.IR "Inside AppleTalk" .
|
|
Packit |
7cfc04 |
Only the DDP layer and AARP are present in
|
|
Packit |
7cfc04 |
the kernel.
|
|
Packit |
7cfc04 |
They are designed to be used via the
|
|
Packit |
7cfc04 |
.B netatalk
|
|
Packit |
7cfc04 |
protocol
|
|
Packit |
7cfc04 |
libraries.
|
|
Packit |
7cfc04 |
This page documents the interface for those who wish or need to
|
|
Packit |
7cfc04 |
use the DDP layer directly.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The communication between AppleTalk and the user program works using a
|
|
Packit |
7cfc04 |
BSD-compatible socket interface.
|
|
Packit |
7cfc04 |
For more information on sockets, see
|
|
Packit |
7cfc04 |
.BR socket (7).
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
An AppleTalk socket is created by calling the
|
|
Packit |
7cfc04 |
.BR socket (2)
|
|
Packit |
7cfc04 |
function with a
|
|
Packit |
7cfc04 |
.B AF_APPLETALK
|
|
Packit |
7cfc04 |
socket family argument.
|
|
Packit |
7cfc04 |
Valid socket types are
|
|
Packit |
7cfc04 |
.B SOCK_DGRAM
|
|
Packit |
7cfc04 |
to open a
|
|
Packit |
7cfc04 |
.B ddp
|
|
Packit |
7cfc04 |
socket or
|
|
Packit |
7cfc04 |
.B SOCK_RAW
|
|
Packit |
7cfc04 |
to open a
|
|
Packit |
7cfc04 |
.B raw
|
|
Packit |
7cfc04 |
socket.
|
|
Packit |
7cfc04 |
.I protocol
|
|
Packit |
7cfc04 |
is the AppleTalk protocol to be received or sent.
|
|
Packit |
7cfc04 |
For
|
|
Packit |
7cfc04 |
.B SOCK_RAW
|
|
Packit |
7cfc04 |
you must specify
|
|
Packit |
7cfc04 |
.BR ATPROTO_DDP .
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
Raw sockets may be opened only by a process with effective user ID 0
|
|
Packit |
7cfc04 |
or when the process has the
|
|
Packit |
7cfc04 |
.B CAP_NET_RAW
|
|
Packit |
7cfc04 |
capability.
|
|
Packit |
7cfc04 |
.SS Address format
|
|
Packit |
7cfc04 |
An AppleTalk socket address is defined as a combination of a network number,
|
|
Packit |
7cfc04 |
a node number, and a port number.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.in +4n
|
|
Packit |
7cfc04 |
.EX
|
|
Packit |
7cfc04 |
struct at_addr {
|
|
Packit |
7cfc04 |
unsigned short s_net;
|
|
Packit |
7cfc04 |
unsigned char s_node;
|
|
Packit |
7cfc04 |
};
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
struct sockaddr_atalk {
|
|
Packit |
7cfc04 |
sa_family_t sat_family; /* address family */
|
|
Packit |
7cfc04 |
unsigned char sat_port; /* port */
|
|
Packit |
7cfc04 |
struct at_addr sat_addr; /* net/node */
|
|
Packit |
7cfc04 |
};
|
|
Packit |
7cfc04 |
.EE
|
|
Packit |
7cfc04 |
.in
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.I sat_family
|
|
Packit |
7cfc04 |
is always set to
|
|
Packit |
7cfc04 |
.BR AF_APPLETALK .
|
|
Packit |
7cfc04 |
.I sat_port
|
|
Packit |
7cfc04 |
contains the port.
|
|
Packit |
7cfc04 |
The port numbers below 129 are known as
|
|
Packit |
7cfc04 |
.IR "reserved ports" .
|
|
Packit |
7cfc04 |
Only processes with the effective user ID 0 or the
|
|
Packit |
7cfc04 |
.B CAP_NET_BIND_SERVICE
|
|
Packit |
7cfc04 |
capability may
|
|
Packit |
7cfc04 |
.BR bind (2)
|
|
Packit |
7cfc04 |
to these sockets.
|
|
Packit |
7cfc04 |
.I sat_addr
|
|
Packit |
7cfc04 |
is the host address.
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.I net
|
|
Packit |
7cfc04 |
member of
|
|
Packit |
7cfc04 |
.I struct at_addr
|
|
Packit |
7cfc04 |
contains the host network in network byte order.
|
|
Packit |
7cfc04 |
The value of
|
|
Packit |
7cfc04 |
.B AT_ANYNET
|
|
Packit |
7cfc04 |
is a
|
|
Packit |
7cfc04 |
wildcard and also implies \(lqthis network.\(rq
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.I node
|
|
Packit |
7cfc04 |
member of
|
|
Packit |
7cfc04 |
.I struct at_addr
|
|
Packit |
7cfc04 |
contains the host node number.
|
|
Packit |
7cfc04 |
The value of
|
|
Packit |
7cfc04 |
.B AT_ANYNODE
|
|
Packit |
7cfc04 |
is a
|
|
Packit |
7cfc04 |
wildcard and also implies \(lqthis node.\(rq The value of
|
|
Packit |
7cfc04 |
.B ATADDR_BCAST
|
|
Packit |
7cfc04 |
is a link
|
|
Packit |
7cfc04 |
local broadcast address.
|
|
Packit |
7cfc04 |
.\" FIXME . this doesn't make sense [johnl]
|
|
Packit |
7cfc04 |
.SS Socket options
|
|
Packit |
7cfc04 |
No protocol-specific socket options are supported.
|
|
Packit |
7cfc04 |
.SS /proc interfaces
|
|
Packit |
7cfc04 |
IP supports a set of
|
|
Packit |
7cfc04 |
.I /proc
|
|
Packit |
7cfc04 |
interfaces to configure some global AppleTalk parameters.
|
|
Packit |
7cfc04 |
The parameters can be accessed by reading or writing files in the directory
|
|
Packit |
7cfc04 |
.IR /proc/sys/net/atalk/ .
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.I aarp-expiry-time
|
|
Packit |
7cfc04 |
The time interval (in seconds) before an AARP cache entry expires.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.I aarp-resolve-time
|
|
Packit |
7cfc04 |
The time interval (in seconds) before an AARP cache entry is resolved.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.I aarp-retransmit-limit
|
|
Packit |
7cfc04 |
The number of retransmissions of an AARP query before the node is declared
|
|
Packit |
7cfc04 |
dead.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.I aarp-tick-time
|
|
Packit |
7cfc04 |
The timer rate (in seconds) for the timer driving AARP.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The default values match the specification and should never need to be
|
|
Packit |
7cfc04 |
changed.
|
|
Packit |
7cfc04 |
.SS Ioctls
|
|
Packit |
7cfc04 |
All ioctls described in
|
|
Packit |
7cfc04 |
.BR socket (7)
|
|
Packit |
7cfc04 |
apply to DDP.
|
|
Packit |
7cfc04 |
.\" FIXME . Add a section about multicasting
|
|
Packit |
7cfc04 |
.SH ERRORS
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EACCES
|
|
Packit |
7cfc04 |
The user tried to execute an operation without the necessary permissions.
|
|
Packit |
7cfc04 |
These include sending to a broadcast address without
|
|
Packit |
7cfc04 |
having the broadcast flag set,
|
|
Packit |
7cfc04 |
and trying to bind to a reserved port without effective user ID 0 or
|
|
Packit |
7cfc04 |
.BR CAP_NET_BIND_SERVICE .
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EADDRINUSE
|
|
Packit |
7cfc04 |
Tried to bind to an address already in use.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EADDRNOTAVAIL
|
|
Packit |
7cfc04 |
A nonexistent interface was requested or the requested source address was
|
|
Packit |
7cfc04 |
not local.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EAGAIN
|
|
Packit |
7cfc04 |
Operation on a nonblocking socket would block.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EALREADY
|
|
Packit |
7cfc04 |
A connection operation on a nonblocking socket is already in progress.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B ECONNABORTED
|
|
Packit |
7cfc04 |
A connection was closed during an
|
|
Packit |
7cfc04 |
.BR accept (2).
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EHOSTUNREACH
|
|
Packit |
7cfc04 |
No routing table entry matches the destination address.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EINVAL
|
|
Packit |
7cfc04 |
Invalid argument passed.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EISCONN
|
|
Packit |
7cfc04 |
.BR connect (2)
|
|
Packit |
7cfc04 |
was called on an already connected socket.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EMSGSIZE
|
|
Packit |
7cfc04 |
Datagram is bigger than the DDP MTU.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B ENODEV
|
|
Packit |
7cfc04 |
Network device not available or not capable of sending IP.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B ENOENT
|
|
Packit |
7cfc04 |
.B SIOCGSTAMP
|
|
Packit |
7cfc04 |
was called on a socket where no packet arrived.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ENOMEM " and " ENOBUFS
|
|
Packit |
7cfc04 |
Not enough memory available.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B ENOPKG
|
|
Packit |
7cfc04 |
A kernel subsystem was not configured.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ENOPROTOOPT " and " EOPNOTSUPP
|
|
Packit |
7cfc04 |
Invalid socket option passed.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B ENOTCONN
|
|
Packit |
7cfc04 |
The operation is defined only on a connected socket, but the socket wasn't
|
|
Packit |
7cfc04 |
connected.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EPERM
|
|
Packit |
7cfc04 |
User doesn't have permission to set high priority,
|
|
Packit |
7cfc04 |
make a configuration change,
|
|
Packit |
7cfc04 |
or send signals to the requested process or group.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EPIPE
|
|
Packit |
7cfc04 |
The connection was unexpectedly closed or shut down by the other end.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B ESOCKTNOSUPPORT
|
|
Packit |
7cfc04 |
The socket was unconfigured, or an unknown socket type was requested.
|
|
Packit |
7cfc04 |
.SH VERSIONS
|
|
Packit |
7cfc04 |
AppleTalk is supported by Linux 2.0 or higher.
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.I /proc
|
|
Packit |
7cfc04 |
interfaces exist since Linux 2.2.
|
|
Packit |
7cfc04 |
.SH NOTES
|
|
Packit |
7cfc04 |
Be very careful with the
|
|
Packit |
7cfc04 |
.B SO_BROADCAST
|
|
Packit |
7cfc04 |
option; it is not privileged in Linux.
|
|
Packit |
7cfc04 |
It is easy to overload the network
|
|
Packit |
7cfc04 |
with careless sending to broadcast addresses.
|
|
Packit |
7cfc04 |
.SS Compatibility
|
|
Packit |
7cfc04 |
The basic AppleTalk socket interface is compatible with
|
|
Packit |
7cfc04 |
.B netatalk
|
|
Packit |
7cfc04 |
on BSD-derived systems.
|
|
Packit |
7cfc04 |
Many BSD systems fail to check
|
|
Packit |
7cfc04 |
.B SO_BROADCAST
|
|
Packit |
7cfc04 |
when sending broadcast frames; this can lead to compatibility problems.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
raw
|
|
Packit |
7cfc04 |
socket mode is unique to Linux and exists to support the alternative CAP
|
|
Packit |
7cfc04 |
package and AppleTalk monitoring tools more easily.
|
|
Packit |
7cfc04 |
.SH BUGS
|
|
Packit |
7cfc04 |
There are too many inconsistent error values.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The ioctls used to configure routing tables, devices,
|
|
Packit |
7cfc04 |
AARP tables, and other devices are not yet described.
|
|
Packit |
7cfc04 |
.SH SEE ALSO
|
|
Packit |
7cfc04 |
.BR recvmsg (2),
|
|
Packit |
7cfc04 |
.BR sendmsg (2),
|
|
Packit |
7cfc04 |
.BR capabilities (7),
|
|
Packit |
7cfc04 |
.BR socket (7)
|
|
Packit |
7cfc04 |
.SH COLOPHON
|
|
Packit |
7cfc04 |
This page is part of release 4.15 of the Linux
|
|
Packit |
7cfc04 |
.I man-pages
|
|
Packit |
7cfc04 |
project.
|
|
Packit |
7cfc04 |
A description of the project,
|
|
Packit |
7cfc04 |
information about reporting bugs,
|
|
Packit |
7cfc04 |
and the latest version of this page,
|
|
Packit |
7cfc04 |
can be found at
|
|
Packit |
7cfc04 |
\%https://www.kernel.org/doc/man\-pages/.
|