# man > ddp(7)

[DDP(7)](https://www.chedong.com/phpMan.php/man/DDP/7/markdown)                                Linux Programmer's Manual                               [DDP(7)](https://www.chedong.com/phpMan.php/man/DDP/7/markdown)



## NAME
       ddp - Linux AppleTalk protocol implementation

## SYNOPSIS
### #include <sys/socket.h>
### #include <netatalk/at.h>

       _ddp_socket_ **=** **socket(AF**___**APPLETALK,** **SOCK**___**DGRAM,** **0);**
       _raw_socket_ **=** **socket(AF**___**APPLETALK,** **SOCK**___**RAW,** _protocol_**);**

## DESCRIPTION
       Linux  implements  the AppleTalk protocols described in _Inside_ _AppleTalk_.  Only the DDP layer
       and AARP are present in the kernel.  They are designed to be used via the  **netatalk**  protocol
       libraries.  This page documents the interface for those who wish or need to use the DDP layer
       directly.

       The communication between AppleTalk and the user program works using a BSD-compatible  socket
       interface.  For more information on sockets, see [**socket**(7)](https://www.chedong.com/phpMan.php/man/socket/7/markdown).

       An  AppleTalk  socket is created by calling the [**socket**(2)](https://www.chedong.com/phpMan.php/man/socket/2/markdown) function with a **AF**___**APPLETALK** socket
       family argument.  Valid socket types are **SOCK**___**DGRAM** to open a **ddp** socket or **SOCK**___**RAW** to  open
       a  **raw**  socket.  _protocol_ is the AppleTalk protocol to be received or sent.  For **SOCK**___**RAW** you
       must specify **ATPROTO**___**DDP**.

       Raw sockets may be opened only by a process with effective user ID 0 or when the process  has
       the **CAP**___**NET**___**RAW** capability.

### Address format
       An  AppleTalk  socket address is defined as a combination of a network number, a node number,
       and a port number.

           struct at_addr {
               unsigned short s_net;
               unsigned char  s_node;
           };

           struct sockaddr_atalk {
               sa_family_t    sat_family;    /* address family */
               unsigned char  sat_port;      /* port */
               struct at_addr sat_addr;      /* net/node */
           };

       _sat_family_ is always set to **AF**___**APPLETALK**.  _sat_port_ contains the port.  The port numbers  be‐
       low  129  are  known  as  _reserved_ _ports_.  Only processes with the effective user ID 0 or the
       **CAP**___**NET**___**BIND**___**SERVICE** capability may [**bind**(2)](https://www.chedong.com/phpMan.php/man/bind/2/markdown) to these sockets.  _sat_addr_ is the host  address.
       The  _net_ member of _struct_ _at_addr_ contains the host network in network byte order.  The value
       of **AT**___**ANYNET** is a wildcard and also implies  “this  network.”   The  _node_  member  of  _struct_
       _at_addr_  contains  the  host node number.  The value of **AT**___**ANYNODE** is a wildcard and also im‐
       plies “this node.” The value of **ATADDR**___**BCAST** is a link local broadcast address.

### Socket options
       No protocol-specific socket options are supported.

### /proc interfaces
       IP supports a set of _/proc_ interfaces to configure some global AppleTalk parameters.  The pa‐
       rameters can be accessed by reading or writing files in the directory _/proc/sys/net/atalk/_.

       _aarp-expiry-time_
              The time interval (in seconds) before an AARP cache entry expires.

       _aarp-resolve-time_
              The time interval (in seconds) before an AARP cache entry is resolved.

       _aarp-retransmit-limit_
              The number of retransmissions of an AARP query before the node is declared dead.

       _aarp-tick-time_
              The timer rate (in seconds) for the timer driving AARP.

       The default values match the specification and should never need to be changed.

### Ioctls
       All ioctls described in [**socket**(7)](https://www.chedong.com/phpMan.php/man/socket/7/markdown) apply to DDP.

## ERRORS
       **EACCES** The  user  tried to execute an operation without the necessary permissions.  These in‐
              clude 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 **CAP**___**NET**___**BIND**___**SERVICE**.

       **EADDRINUSE**
              Tried to bind to an address already in use.

       **EADDRNOTAVAIL**
              A nonexistent interface was requested or the requested source address was not local.

       **EAGAIN** Operation on a nonblocking socket would block.

       **EALREADY**
              A connection operation on a nonblocking socket is already in progress.

       **ECONNABORTED**
              A connection was closed during an [**accept**(2)](https://www.chedong.com/phpMan.php/man/accept/2/markdown).

       **EHOSTUNREACH**
              No routing table entry matches the destination address.

       **EINVAL** Invalid argument passed.

       **EISCONN**
              [**connect**(2)](https://www.chedong.com/phpMan.php/man/connect/2/markdown) was called on an already connected socket.

       **EMSGSIZE**
              Datagram is bigger than the DDP MTU.

       **ENODEV** Network device not available or not capable of sending IP.

       **ENOENT** **SIOCGSTAMP** was called on a socket where no packet arrived.

       **ENOMEM** and **ENOBUFS**
              Not enough memory available.

       **ENOPKG** A kernel subsystem was not configured.

       **ENOPROTOOPT** and **EOPNOTSUPP**
              Invalid socket option passed.

       **ENOTCONN**
              The operation is defined only on a connected socket, but the socket wasn't connected.

       **EPERM**  User  doesn't  have  permission  to set high priority, make a configuration change, or
              send signals to the requested process or group.

       **EPIPE**  The connection was unexpectedly closed or shut down by the other end.

       **ESOCKTNOSUPPORT**
              The socket was unconfigured, or an unknown socket type was requested.

## VERSIONS
       AppleTalk is supported by Linux 2.0 or higher.  The _/proc_ interfaces exist since Linux 2.2.

## NOTES
       Be very careful with the **SO**___**BROADCAST** option; it is not privileged in Linux.  It is  easy  to
       overload the network with careless sending to broadcast addresses.

### Compatibility
       The  basic  AppleTalk  socket  interface  is compatible with **netatalk** on BSD-derived systems.
       Many BSD systems fail to check **SO**___**BROADCAST** when sending broadcast frames; this can  lead  to
       compatibility problems.

       The  raw socket mode is unique to Linux and exists to support the alternative CAP package and
       AppleTalk monitoring tools more easily.

## BUGS
       There are too many inconsistent error values.

       The ioctls used to configure routing tables, devices, AARP tables, and other devices are  not
       yet described.

## SEE ALSO
       [**recvmsg**(2)](https://www.chedong.com/phpMan.php/man/recvmsg/2/markdown), [**sendmsg**(2)](https://www.chedong.com/phpMan.php/man/sendmsg/2/markdown), [**capabilities**(7)](https://www.chedong.com/phpMan.php/man/capabilities/7/markdown), [**socket**(7)](https://www.chedong.com/phpMan.php/man/socket/7/markdown)

## COLOPHON
       This  page  is  part  of  release  5.10 of the Linux _man-pages_ project.  A description of the
       project, information about reporting bugs, and the latest version of this page, can be  found
       at <https://www.kernel.org/doc/man-pages/>.



Linux                                        2017-09-15                                       [DDP(7)](https://www.chedong.com/phpMan.php/man/DDP/7/markdown)
