.\" and in case of nontrivial modification author and date
.\" of the modification is added to the header.
.\" $Id: ddp.7,v 1.3 1999/05/13 11:33:22 freitag Exp $
-.TH DDP 7 1999-05-01 "Linux Man Page" "Linux Programmer's Manual"
+.TH DDP 7 1999-05-01 "Linux Man Page" "Linux Programmer's Manual"
.SH NAME
ddp \- Linux AppleTalk protocol implementation
.SH SYNOPSIS
.B #include <sys/socket.h>
.br
-.B #include <netatalk/at.h>
+.B #include <netatalk/at.h>
.sp
.IB ddp_socket " = socket(PF_APPLETALK, SOCK_DGRAM, 0);"
-.br
+.br
.IB raw_socket " = socket(PF_APPLETALK, SOCK_RAW, " protocol ");"
.SH DESCRIPTION
-Linux implements the Appletalk protocols described in
+Linux implements the Appletalk protocols described in
.IR "Inside Appletalk" .
Only the DDP layer and AARP are present in
-the kernel. They are designed to be used via the
-.B netatalk
+the kernel.
+They are designed to be used via the
+.B netatalk
protocol
-libraries. This page documents the interface for those who wish or need to
+libraries.
+This page documents the interface for those who wish or need to
use the DDP layer directly.
.PP
The communication between Appletalk and the user program works using a
-BSD-compatible socket interface. For more information on sockets, see
-.BR socket (7).
+BSD-compatible socket interface.
+For more information on sockets, see
+.BR socket (7).
.PP
-An AppleTalk socket is created by calling the
-.BR socket (2)
-function with a
+An AppleTalk socket is created by calling the
+.BR socket (2)
+function with a
.B PF_APPLETALK
-socket family argument. Valid socket types are
+socket family argument.
+Valid socket types are
.B SOCK_DGRAM
-to open a
-.B ddp
+to open a
+.B ddp
socket or
.B SOCK_RAW
-to open a
-.B raw
-socket.
-.I protocol
-is the Appletalk protocol to be received or sent. For
-.B SOCK_RAW
+to open a
+.B raw
+socket.
+.I protocol
+is the Appletalk protocol to be received or sent.
+For
+.B SOCK_RAW
you must specify
.BR ATPROTO_DDP .
.PP
-Raw sockets may be only opened by a process with effective user ID 0
-or when the process has the
-.B CAP_NET_RAW
-capability.
+Raw sockets may be only opened by a process with effective user ID 0
+or when the process has the
+.B CAP_NET_RAW
+capability.
.SH "ADDRESS FORMAT"
An Appletalk socket address is defined as a combination of a network number,
-a node number, and a port number.
+a node number, and a port number.
.PP
.RS
.nf
};
.ta
.fi
-.RE
+.RE
.PP
.I sat_family
-is always set to
-.BR AF_APPLETALK .
+is always set to
+.BR AF_APPLETALK .
.I sat_port
-contains the port. The port numbers below 129 are known as
+contains the port.
+The port numbers below 129 are known as
.I reserved ports.
-Only processes with the effective user ID 0 or the
-.B CAP_NET_BIND_SERVICE
-capability may
-.BR bind (2)
-to these sockets.
-.I sat_addr
+Only processes with the effective user ID 0 or the
+.B CAP_NET_BIND_SERVICE
+capability may
+.BR bind (2)
+to these sockets.
+.I sat_addr
is the host address.
-The
+The
.I net
-member of
+member of
.I struct at_addr
-contains the host network in network byte order. The value of
-.B AT_ANYNET
-is a
+contains the host network in network byte order.
+The value of
+.B AT_ANYNET
+is a
wildcard and also implies \(lqthis network.\(rq
-The
+The
.I node
-member of
+member of
.I struct at_addr
-contains the host node number. The value of
-.B AT_ANYNODE
-is a
-wildcard and also implies \(lqthis node.\(rq The value of
-.B ATADDR_BCAST
+contains the host node number.
+The value of
+.B AT_ANYNODE
+is a
+wildcard and also implies \(lqthis node.\(rq The value of
+.B ATADDR_BCAST
is a link
local broadcast address.
.\" FIXME this doesn't make sense [johnl]
.SH "SOCKET OPTIONS"
No protocol-specific socket options are supported.
.SH SYSCTLS
-IP supports a sysctl interface to configure some global AppleTalk
-parameters.
-The sysctls can be accessed by reading or writing the
-.I /proc/sys/net/atalk/*
-files or with the
+IP supports a sysctl interface to configure some global AppleTalk
+parameters.
+The sysctls can be accessed by reading or writing the
+.I /proc/sys/net/atalk/*
+files or with the
.BR sysctl (2)
interface.
.TP
The time interval (in seconds) before an AARP cache entry expires.
.TP
.B aarp-resolve-time
-The time interval (in seconds) before an AARP cache entry is resolved.
+The time interval (in seconds) before an AARP cache entry is resolved.
.TP
.B aarp-retransmit-limit
The number of retransmissions of an AARP query before the node is declared
-dead.
+dead.
.TP
.B aarp-tick-time
The timer rate (in seconds) for the timer driving AARP.
changed.
.SH IOCTLS
All ioctls described in
-.BR socket (7)
+.BR socket (7)
apply to ddp.
.\" FIXME Add a section about multicasting
.SH NOTES
-Be very careful with the
+Be very careful with the
.B SO_BROADCAST
-option \- it is not privileged in Linux. It is easy to overload the network
-with careless sending to broadcast addresses.
+option \- it is not privileged in Linux.
+It is easy to overload the network
+with careless sending to broadcast addresses.
.SH VERSIONS
-Appletalk is supported by Linux 2.0 or higher. The
-.B sysctl
+Appletalk is supported by Linux 2.0 or higher.
+The
+.B sysctl
interface is
new in Linux 2.2.
.SH ERRORS
.\" FIXME document all errors. We should really fix the kernels to
-.\" give more uniform error returns (ENOMEM vs ENOBUFS, EPERM vs
+.\" give more uniform error returns (ENOMEM vs ENOBUFS, EPERM vs
.\" EACCES etc.)
.TP
.B ENOTCONN
connected.
.TP
.B EINVAL
-Invalid argument passed.
+Invalid argument passed.
.TP
-.B EMSGSIZE
+.B EMSGSIZE
Datagram is bigger than the DDP MTU.
.TP
.B EACCES
-The user tried to execute an operation without the necessary permissions.
-These include sending to a broadcast address without
+The user tried to execute an operation without the necessary permissions.
+These include sending to a broadcast address without
having the broadcast flag set,
-and trying to bind to a reserved port without effective user ID 0 or
-.BR CAP_NET_BIND_SERVICE .
+and trying to bind to a reserved port without effective user ID 0 or
+.BR CAP_NET_BIND_SERVICE .
.TP
.B EADDRINUSE
Tried to bind to an address already in use.
.TP
.BR ENOMEM " and " ENOBUFS
-Not enough memory available.
+Not enough memory available.
.TP
.BR ENOPROTOOPT " and " EOPNOTSUPP
Invalid socket option passed.
.TP
.B EPERM
-User doesn't have permission to set high priority,
+User doesn't have permission to set high priority,
make a configuration change,
or send signals to the requested process or group,
.TP
The socket was unconfigured, or an unknown socket type was requested.
.TP
.B EISCONN
-.BR connect (2)
+.BR connect (2)
was called on an already connected socket.
.TP
.B EALREADY
A connection operation on a non-blocking socket is already in progress.
.TP
.B ECONNABORTED
-A connection was closed during an
-.BR accept (2).
+A connection was closed during an
+.BR accept (2).
.TP
.B EPIPE
The connection was unexpectedly closed or shut down by the other end.
.TP
.B ENOENT
-.B SIOCGSTAMP
+.B SIOCGSTAMP
was called on a socket where no packet arrived.
.TP
.B EHOSTUNREACH
-No routing table entry matches the destination address.
+No routing table entry matches the destination address.
.TP
-.B ENODEV
+.B ENODEV
Network device not available or not capable of sending IP.
.TP
-.B ENOPKG
+.B ENOPKG
A kernel subsystem was not configured.
.SH COMPATIBILITY
-The basic AppleTalk socket interface is compatible with
-.B netatalk
-on BSD-derived systems. Many BSD systems fail to check
+The basic AppleTalk socket interface is compatible with
+.B netatalk
+on BSD-derived systems.
+Many BSD systems fail to check
.B SO_BROADCAST
when sending broadcast frames; this can lead to compatibility problems.
.PP
-The
+The
raw
socket mode is unique to Linux and exists to support the alternative CAP
package and AppleTalk monitoring tools more easily.
.SH BUGS
-There are too many inconsistent error values.
+There are too many inconsistent error values.
.PP
-The ioctls used to configure routing tables, devices,
+The ioctls used to configure routing tables, devices,
AARP tables and other devices are not yet described.
.SH "SEE ALSO"
.BR recvmsg (2),