INET(3)
π INET(3) β the AX25 address glow-up guide π
okay bestie, so this is a page from the Linux Programmer's Manual, and it's literally all about the AX25 Address manipulation routines. yes, the same INET(3) you were looking for. sit down, hydrate, and let's get into it π«Ά
β¨ NAME β¨
ax25_aton, ax25_aton_entry, ax25_aton_arglist, ax25_ntoa, ax25_cmp, ax25_validate β AX25 Address manipulation routines
likeβ¦ they manipulate AX25 addresses. that's the whole vibe. π
β¨ 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);
seven function signatures. she's thorough. π
β¨ DESCRIPTION β¨
okay so let's go one by one, no skimming, i see you π
ax25_aton() takes the ASCII string cp that is in the format callsign [[V|VIA]callsign...] and stores it in fsap in network format.
ax25_aton_entry() takes the ASCII string of a callsign cp and stores it in network format in axp.
ax25_aton_arglist() takes a NULL terminated array of strings cp and stores it in fsap in network format.
ax25_ntoa() takes a network format address axp and returns the ASCII representation. and bestie, listen β the string is returned in a statically allocated buffer, which subsequent calls will overwrite. so if you're holding onto that pointer expecting it to stay cute foreverβ¦ it will not. it's giving "rented, not owned." π copy it if you need it.
ax25_cmp() compares the two ax25 addresses, ax1 and ax2, that are in network format, and figures out whether they are identical, differ only by their SSIDs, or are just straight up different. three-way vibe check. π
ax25_validate() checks to see if the address axp in network format is a correctly formatted address. is she valid? is she formatted right? we find out. β
β¨ RETURN VALUE β¨
the receipts, in order π
ax25_aton()andax25_aton_arglist()return-1if an error occurs, otherwise the length of the returned structure.ax25_aton_entry()returns-1if an error occurs, otherwise zero.ax25_cmp()returns0if the two addresses are identical,1if they are different, or2if only the SSIDs are different.ax25_validate()returnsTRUEif the callsign is valid orFALSEif it is not.
lowkey memorize thoseax25_cmp()numbers, bestie.0same,1different,2just the SSID being messy. iykyk β¨
β¨ SEE ALSO β¨
ax25(4), netrom(4), rose(4) β go read those next, they're the supporting cast π¦
and that's the whole page, no cap. this little masterpiece lives in the Linux Programmer's Manual and it's dated 2008-Feb-04. yeah, she's an older icon but she still ate. ππ
stay valid, stay formatted, and always free your statically allocated buffers (jk you can't, just copy them). mwah. πππ¦πΈ
π¦ where this page comes from
- debian bookworm: libax25-dev 0.0.12-rc5+git20190411+b17ff36-4+b1 Β· LGPL-2.1-or-later
- debian trixie: libax25-dev 0.0.12-rc5+git20230513+5581005-1 Β· LGPL-2.1-or-later
- ubuntu jammy: libax25-dev 0.0.12-rc5+git20190411+b17ff36-4 Β· LGPL-2.1-or-later
- ubuntu noble: libax25-dev 0.0.12-rc5+git20230513+5581005-1 Β· LGPL-2.1-or-later
- ubuntu questing: libax25-dev 0.0.12-rc5+git20230513+5581005-1
- ubuntu resolute: libax25-dev 0.0.12-rc5+git20230513+5581005-1build1 Β· LGPL-2.1-or-later
- ubuntu stonking: libax25-dev 0.0.12-rc5+git20230513+5581005-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms