ATALK(4)

πŸ‘‘ ATALK(4) β€” the AppleTalk protocol family, bestie πŸ‘‘

okay so listen. this is ATALK(4), the page for the AppleTalk protocol family, and it's genuinely iconic. it's from the Netatalk AFP Fileserver Manual and it is so much cooler than it sounds. sit down, grab a boba, we're doing network protocols πŸ’…


✨ Name ✨

atalk β€” the AppleTalk protocol family. that's it, that's the name, she's simple and she ate πŸŽ€


🌸 Synopsis 🌸

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

literally two includes and you're in. no cap. πŸ¦‹


πŸ’– Description πŸ’–

okay so here's the vibe: the AppleTalk protocol family is a whole collection of protocols layered above the Datagram Delivery Protocol (DDP), and they all use the AppleTalk address format. it's giving protocol stack, it's giving layers, it's giving structure. 🫢

the AppleTalk family may provide these socket types:

  • SOCK_STREAM β€” which is ADSP
  • SOCK_DGRAM β€” which is DDP
  • SOCK_RDM β€” which is ATP
  • SOCK_SEQPACKET β€” which is ASP

and now the part that lowkey matters: currently, DDP is implemented in the kernel; ATP and ASP are implemented in Netatalk user level libraries. so DDP is the one living in kernel space, and ATP + ASP are hanging out in userspace. periodt. πŸ’€


πŸ¦‹ Addressing πŸ¦‹

AppleTalk addresses are three byte quantities, stored in network byte order. remember that, it'll come up. the include file <netatalk/at.h> defines the AppleTalk address format, so that's your girl for definitions. ✨

sockets in the AppleTalk protocol family use this exact address structure, and no we are not paraphrasing it:

struct sockaddr_at {
    short sat_family;
    unsigned char sat_port;
    struct at_addr sat_addr;
    char sat_zero[8];
};

okay so now the rules of the road, and they are strict:

  • the port of a socket may be set with bind(2).
  • the node for bind must always be ATADDR_ANYNODE β€” that's "this node." like, not negotiable, it's this node or nothing. πŸ™ˆ
  • the net may be ATADDR_ANYNET or ATADDR_LATENET.

and what do those two mean? so glad you asked bestie:

  • ATADDR_ANYNET corresponds to the machine's "primary" address (the first configured). she's the main character, the one who got configured first. πŸ‘‘
  • ATADDR_LATENET causes the address in outgoing packets to be determined when a packet is sent, i.e. determined late. and here's the tea: ATADDR_LATENET is equivalent to opening one socket for each network interface. same energy, different outfit. πŸ’…

lastly, the port of a socket and either the primary address or ATADDR_LATENET are returned with getsockname(2). so that's how you find out what you got. 🌈


πŸ”₯ See Also πŸ”₯

go read those too, i'm not joking, they're the supporting cast and they carry. πŸ“


πŸ’œ Author πŸ’œ

Contributors to the Netatalk Project β€” an absolute squad, fr fr. 🫢


⭐ real talk though: this page is from Netatalk 4.4.3, and it's the ATALK(4) page. keep the network byte order thing in your head, keep ATADDR_ANYNODE in your bind, and you're gonna slay. bye bestie, mwah πŸ’–πŸŽ€βœ¨
πŸ“¦ where this page comes from
  • epel 10: netatalk-devel 5:4.4.3-1.el10_3 Β· GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-BSD AND FSFUL AND LicenseRef-Callaway-MIT
  • fedora 43: netatalk-devel 5:4.4.3-1.fc43 Β· GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-BSD AND FSFUL AND LicenseRef-Callaway-MIT
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms