INET(3)

πŸ“¦
version 1.2.2 Β· 2 versions
, in alpine 3.24, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– INET β€” the AX25 address glow-up zone πŸ’–

okay bestie, listen. this is INET(3), straight out of the Linux Programmer's Manual, and it's literally the whole toolkit for messing with AX25 addresses. it's giving "ham radio but make it fashion." no cap. πŸŽ€


✨ NAME ✨

ax25_aton, ax25_aton_entry, ax25_aton_arglist, ax25_ntoa, ax25_cmp, ax25_validate β€” the AX25 Address manipulation routines. that's the whole squad. 🫢


🌸 SYNOPSIS 🌸

#include <netax25/ax25.h>

int ax25_aton(const char *cp, struct full_sockaddr_ax25 *fsap);

int ax25_aton_arglist(const char **cp, struct full_sockaddr_ax25 *fsap);

int ax25_aton_entry(const char *cp, char *axp);

char *ax25_ntoa(ax25_address *axp);

int ax25_cmp(ax25_address *ax1, ax25_address *ax2);

int ax25_validate(char *axp);

char *ax25_config_file(const char *filename);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea on every single one of them, one by one, no skips:

  • ax25_aton() β€” takes the ASCII string cp in the format callsign [[V|VIA]callsign...] and stores it in fsap in network format. like, translating from human-speak to computer-speak. iconic behaviour tbh. ✨
  • ax25_aton_entry() β€” takes the ASCII string of a callsign cp and stores it in network format in axp. just one callsign, one entry, no drama. πŸ’…
  • ax25_aton_arglist() β€” takes a NULL terminated array of strings cp and stores it in fsap in network format. it's the arglist version, she does the same thing but with a whole little array. main character energy.
  • ax25_ntoa() β€” takes a network format address axp and returns the ASCII representation. ⚠️ important⚠️ the string comes back in a statically allocated buffer, which means subsequent calls will overwrite it. so like, copy it if you need it to stick around, bestie. don't get caught lacking. 😭
  • ax25_cmp() β€” compares the two ax25 addresses, ax1 and ax2, that are in network format, and figures out whether they're identical, whether they differ only by their SSIDs, or whether they're just plain different. a whole vibe check, basically. 🌈
  • ax25_validate() β€” checks to see if the address axp in network format is a correctly formatted address. yes queen, validation. we love to see it. πŸ‘‘

πŸ’œ RETURN VALUE πŸ’œ

okay so what do these divas hand back to you:

  • ax25_aton() and ax25_aton_arglist() return -1 if an error occurs, otherwise the length of the returned structure. error = -1, bestie, watch for it.
  • ax25_aton_entry() returns -1 if an error occurs, otherwise zero. yep, 0 means slay, -1 means πŸ’€.
  • ax25_cmp() returns 0 if the two addresses are identical, 1 if they are different, or 2 if only the SSIDs are different. three whole moods. ⭐
  • ax25_validate() returns TRUE if the callsign is valid or FALSE if it is not. simple as that, fr fr. πŸ“

🧚 SEE ALSO 🧚

ax25(4), netrom(4), rose(4)

go read those too, iykyk. πŸ“š


and that's the whole page, bestie!! πŸŽ€ this was the INET(3) page from the Linux crew, dated 2008-Feb-04, and honestly? it ate. periodt. πŸ’…βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from