ddp - Linux AppleTalk protocol implementation


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

   ddp_socket = socket(AF_APPLETALK, SOCK_DGRAM, 0);
   raw_socket = socket(AF_APPLETALK, SOCK_RAW, protocol);


   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

   The  communication between AppleTalk and the user program works using a
   BSD-compatible socket interface.  For more information on sockets,  see

   An AppleTalk socket is created by calling the socket(2) 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 below 129 are known as reserved ports.  Only processes
   with the effective user ID 0 or the CAP_NET_BIND_SERVICE capability may
   bind(2) 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  implies  "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 parameters can be  accessed  by  reading  or
   writing files in the directory /proc/sys/net/atalk/.

          The  time  interval  (in  seconds)  before  an  AARP cache entry

          The time interval (in seconds) before an  AARP  cache  entry  is

          The  number  of retransmissions of an AARP query before the node
          is declared dead.

          The timer rate (in seconds) for the timer driving AARP.

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

   All ioctls described in socket(7) apply to DDP.


   EACCES 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

          Tried to bind to an address already in use.

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

   EAGAIN Operation on a nonblocking socket would block.

          A connection operation on a nonblocking  socket  is  already  in

          A connection was closed during an accept(2).

          No routing table entry matches the destination address.

   EINVAL Invalid argument passed.

          connect(2) was called on an already connected socket.

          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.

          Not enough memory available.

   ENOPKG A kernel subsystem was not configured.

          Invalid socket option passed.

          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

          The  socket  was  unconfigured,  or  an  unknown socket type was


   AppleTalk is supported by Linux 2.0 or higher.   The  /proc  interfaces
   exist since Linux 2.2.


   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.

   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.


   There are too many inconsistent error values.

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


   recvmsg(2), sendmsg(2), capabilities(7), socket(7)


   This  page  is  part of release 4.09 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


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.

Free Software

Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.

Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.

Free Books

The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.

Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.

Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.