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 ADSPSOCK_DGRAMβ which is DDPSOCK_RDMβ which is ATPSOCK_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
bindmust always beATADDR_ANYNODEβ that's "this node." like, not negotiable, it's this node or nothing. π - the net may be
ATADDR_ANYNETorATADDR_LATENET.
and what do those two mean? so glad you asked bestie:
ATADDR_ANYNETcorresponds to the machine's "primary" address (the first configured). she's the main character, the one who got configured first. πATADDR_LATENETcauses the address in outgoing packets to be determined when a packet is sent, i.e. determined late. and here's the tea:ATADDR_LATENETis 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 theATALK(4)page. keep the network byte order thing in your head, keepATADDR_ANYNODEin yourbind, 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