{"id":3933,"date":"2022-12-20T17:28:26","date_gmt":"2022-12-20T20:28:26","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/ddp-man7\/"},"modified":"2022-12-20T17:28:26","modified_gmt":"2022-12-20T20:28:26","slug":"ddp-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/ddp-man7\/","title":{"rendered":"DDP (man7)"},"content":{"rendered":"<h1 align=\"center\">DDP<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#ERRORS\">ERRORS<\/a><br \/> <a href=\"#VERSIONS\">VERSIONS<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">ddp \u2212 Linux AppleTalk protocol implementation<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <sys\/socket.h> <br \/> #include <netatalk\/at.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>ddp_socket<\/i> <b>= socket(AF_APPLETALK, SOCK_DGRAM, 0);<\/b> <i><br \/> raw_socket<\/i> <b>= socket(AF_APPLETALK, SOCK_RAW,<\/b> <i>protocol<\/i><b>);<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Linux implements the AppleTalk protocols described in <i>Inside AppleTalk<\/i>. Only the DDP layer and AARP are present in the kernel. They are designed to be used via the <b>netatalk<\/b> protocol libraries. This page documents the interface for those who wish or need to use the DDP layer directly.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The communication between AppleTalk and the user program works using a BSD-compatible socket interface. For more information on sockets, see <b>socket<\/b>(7).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An AppleTalk socket is created by calling the <b>socket<\/b>(2) function with a <b>AF_APPLETALK<\/b> socket family argument. Valid socket types are <b>SOCK_DGRAM<\/b> to open a <b>ddp<\/b> socket or <b>SOCK_RAW<\/b> to open a <b>raw<\/b> socket. <i>protocol<\/i> is the AppleTalk protocol to be received or sent. For <b>SOCK_RAW<\/b> you must specify <b>ATPROTO_DDP<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Raw sockets may be opened only by a process with effective user ID 0 or when the process has the <b>CAP_NET_RAW<\/b> capability.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Address format<\/b> <br \/> An AppleTalk socket address is defined as a combination of a network number, a node number, and a port number.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">struct at_addr { <br \/> unsigned short s_net; <br \/> unsigned char s_node; <br \/> };<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">struct sockaddr_atalk { <br \/> sa_family_t sat_family; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var address family bodies\/ usr\/ <br \/> unsigned char sat_port; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var port bodies\/ usr\/ <br \/> struct at_addr sat_addr; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var net\/node bodies\/ usr\/ <br \/> };<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>sat_family<\/i> is always set to <b>AF_APPLETALK<\/b>. <i>sat_port<\/i> contains the port. The port numbers below 129 are known as <i>reserved ports<\/i>. Only processes with the effective user ID 0 or the <b>CAP_NET_BIND_SERVICE<\/b> capability may <b>bind<\/b>(2) to these sockets. <i>sat_addr<\/i> is the host address. The <i>net<\/i> member of <i>struct at_addr<\/i> contains the host network in network byte order. The value of <b>AT_ANYNET<\/b> is a wildcard and also implies \u201cthis network.\u201d The <i>node<\/i> member of <i>struct at_addr<\/i> contains the host node number. The value of <b>AT_ANYNODE<\/b> is a wildcard and also implies \u201cthis node.\u201d The value of <b>ATADDR_BCAST<\/b> is a link local broadcast address.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Socket options<\/b> <br \/> No protocol-specific socket options are supported.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\/proc interfaces<\/b> <br \/> IP supports a set of <i>\/proc<\/i> interfaces to configure some global AppleTalk parameters. The parameters can be accessed by reading or writing files in the directory <i>\/proc\/sys\/net\/atalk\/<\/i>. <i><br \/> aarp-expiry-time<\/i><\/p>\n<p style=\"margin-left:22%;\">The time interval (in seconds) before an AARP cache entry expires.<\/p>\n<p style=\"margin-left:11%;\"><i>aarp-resolve-time<\/i><\/p>\n<p style=\"margin-left:22%;\">The time interval (in seconds) before an AARP cache entry is resolved.<\/p>\n<p style=\"margin-left:11%;\"><i>aarp-retransmit-limit<\/i><\/p>\n<p style=\"margin-left:22%;\">The number of retransmissions of an AARP query before the node is declared dead.<\/p>\n<p style=\"margin-left:11%;\"><i>aarp-tick-time<\/i><\/p>\n<p style=\"margin-left:22%;\">The timer rate (in seconds) for the timer driving AARP.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The default values match the specification and should never need to be changed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Ioctls<\/b> <br \/> All ioctls described in <b>socket<\/b>(7) apply to DDP.<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>EACCES<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">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 <b>CAP_NET_BIND_SERVICE<\/b>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>EADDRINUSE<\/b><\/p>\n<p style=\"margin-left:22%;\">Tried to bind to an address already in use.<\/p>\n<p style=\"margin-left:11%;\"><b>EADDRNOTAVAIL<\/b><\/p>\n<p style=\"margin-left:22%;\">A nonexistent interface was requested or the requested source address was not local.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EAGAIN<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"70%\">\n<p>Operation on a nonblocking socket would block.<\/p>\n<\/td>\n<td width=\"8%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>EALREADY<\/b><\/p>\n<p style=\"margin-left:22%;\">A connection operation on a nonblocking socket is already in progress.<\/p>\n<p style=\"margin-left:11%;\"><b>ECONNABORTED<\/b><\/p>\n<p style=\"margin-left:22%;\">A connection was closed during an <b>accept<\/b>(2).<\/p>\n<p style=\"margin-left:11%;\"><b>EHOSTUNREACH<\/b><\/p>\n<p style=\"margin-left:22%;\">No routing table entry matches the destination address.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EINVAL<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"36%\">\n<p>Invalid argument passed.<\/p>\n<\/td>\n<td width=\"42%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>EISCONN<\/b><\/p>\n<p style=\"margin-left:22%;\"><b>connect<\/b>(2) was called on an already connected socket.<\/p>\n<p style=\"margin-left:11%;\"><b>EMSGSIZE<\/b><\/p>\n<p style=\"margin-left:22%;\">Datagram is bigger than the DDP MTU.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>ENODEV<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Network device not available or not capable of sending IP.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>ENOENT<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p><b>SIOCGSTAMP<\/b> was called on a socket where no packet arrived.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>ENOMEM<\/b> and <b>ENOBUFS<\/b><\/p>\n<p style=\"margin-left:22%;\">Not enough memory available.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>ENOPKG<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"58%\">\n<p>A kernel subsystem was not configured.<\/p>\n<\/td>\n<td width=\"20%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>ENOPROTOOPT<\/b> and <b>EOPNOTSUPP<\/b><\/p>\n<p style=\"margin-left:22%;\">Invalid socket option passed.<\/p>\n<p style=\"margin-left:11%;\"><b>ENOTCONN<\/b><\/p>\n<p style=\"margin-left:22%;\">The operation is defined only on a connected socket, but the socket wasn\u2019t connected.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>EPERM<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>User doesn\u2019t have permission to set high priority, make a configuration change, or send signals to the requested process or group.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>EPIPE<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>The connection was unexpectedly closed or shut down by the other end.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>ESOCKTNOSUPPORT<\/b><\/p>\n<p style=\"margin-left:22%;\">The socket was unconfigured, or an unknown socket type was requested.<\/p>\n<h2>VERSIONS <a name=\"VERSIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">AppleTalk is supported by Linux 2.0 or higher. The <i>\/proc<\/i> interfaces exist since Linux 2.2.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Be very careful with the <b>SO_BROADCAST<\/b> option; it is not privileged in Linux. It is easy to overload the network with careless sending to broadcast addresses.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Compatibility<\/b> <br \/> The basic AppleTalk socket interface is compatible with <b>netatalk<\/b> on BSD-derived systems. Many BSD systems fail to check <b>SO_BROADCAST<\/b> when sending broadcast frames; this can lead to compatibility problems.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The raw socket mode is unique to Linux and exists to support the alternative CAP package and AppleTalk monitoring tools more easily.<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">There are too many inconsistent error values.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The ioctls used to configure routing tables, devices, AARP tables, and other devices are not yet described.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>recvmsg<\/b>(2), <b>sendmsg<\/b>(2), <b>capabilities<\/b>(7), <b>socket<\/b>(7)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> 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\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  ddp \u2212 Linux AppleTalk protocol implementation <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,1026,972],"class_list":["post-3933","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-ddp","tag-man7"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3933"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3933\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}