# man > ddp(7)

---
type: CommandReference
command: ddp
mode: man
section: 7
source: man-pages
---

## Quick Reference
- `socket(AF_APPLETALK, SOCK_DGRAM, 0)` — create a DDP datagram socket
- `socket(AF_APPLETALK, SOCK_RAW, ATPROTO_DDP)` — create a raw DDP socket (requires `CAP_NET_RAW`)
- `struct sockaddr_atalk { sa_family_t sat_family; unsigned char sat_port; struct at_addr sat_addr; };` — AppleTalk socket address structure
- `struct at_addr { unsigned short s_net; unsigned char s_node; };` — network/node address
- `AT_ANYNET` — wildcard for network (implies "this network")
- `AT_ANYNODE` — wildcard for node (implies "this node")
- `ATADDR_BCAST` — link local broadcast address

## Name
ddp — Linux AppleTalk protocol implementation

## Synopsis
c
#include <sys/socket.h>
#include <netatalk/at.h>

ddp_socket = socket(AF_APPLETALK, SOCK_DGRAM, 0);
raw_socket = socket(AF_APPLETALK, SOCK_RAW, protocol);
## Options
No protocol-specific socket options are supported.

**/proc interfaces** (under `/proc/sys/net/atalk/`):
- `aarp-expiry-time` — time (seconds) before AARP cache entry expires
- `aarp-resolve-time` — time (seconds) before AARP cache entry is resolved
- `aarp-retransmit-limit` — retransmissions before node is declared dead
- `aarp-tick-time` — timer rate (seconds) for AARP driver

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

## Exit Codes
- `EACCES` — operation without necessary permissions (broadcast without flag, bind to reserved port without `CAP_NET_BIND_SERVICE`)
- `EADDRINUSE` — address already in use
- `EADDRNOTAVAIL` — nonexistent interface or non-local source address
- `EAGAIN` — nonblocking socket would block
- `EALREADY` — connection operation on nonblocking socket in progress
- `ECONNABORTED` — connection closed during `accept(2)`
- `EHOSTUNREACH` — no route to destination
- `EINVAL` — invalid argument
- `EISCONN` — `connect(2)` on already connected socket
- `EMSGSIZE` — datagram exceeds DDP MTU
- `ENODEV` — network device not available or not capable of IP
- `ENOENT` — `SIOCGSTAMP` on socket with no packet
- `ENOMEM` / `ENOBUFS` — insufficient memory
- `ENOPKG` — kernel subsystem not configured
- `ENOPROTOOPT` / `EOPNOTSUPP` — invalid socket option
- `ENOTCONN` — operation on unconnected socket that requires connection
- `EPERM` — no permission for high priority, config change, or signal
- `EPIPE` — connection unexpectedly closed
- `ESOCKTNOSUPPORT` — unknown socket type or unconfigured socket

## Notes
- AppleTalk supported since Linux 2.0; `/proc` interfaces since Linux 2.2.
- `SO_BROADCAST` option is not privileged; use with care to avoid overloading the network.
- Basic AppleTalk socket interface is compatible with BSD `netatalk`. Many BSD systems fail to check `SO_BROADCAST` when sending broadcast frames — potential compatibility issue.
- Raw socket mode is Linux-specific, supports the CAP package and monitoring tools.
- Bugs: inconsistent error values; ioctls for routing tables, AARP tables, etc. are not yet documented.

## 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)