KRB5_GET_ADDRS(3)
β¨ KRB5_GET_ADDRS β¨
okay bestie, so this is a page from the Kerberos 5 Library β that's libkrb5, linked with -lkrb5 β and it's literally all about finding out what addresses your local host is repping. two functions, both iconic, both your new faves π
πΈ NAME πΈ
krb5_get_all_client_addrs, krb5_get_all_server_addrs β return local addresses
like. they get you the addresses. the local ones. that's the whole vibe. π«Ά
π LIBRARY π
Kerberos 5 Library β libkrb5, -lkrb5
π SYNOPSIS π
#include <krb5.h>
krb5_error_code
krb5_get_all_client_addrs(krb5_context context, krb5_addresses *addrs);
krb5_error_code
krb5_get_all_server_addrs(krb5_context context, krb5_addresses *addrs);
no cap, that's it. two calls, both taking a krb5_context context and a krb5_addresses *addrs, both handing you back a krb5_error_code so you can vibe-check whether it worked. β¨
π DESCRIPTION π
so here's the tea π β these functions return in addrs a list of addresses associated with the local host. that's it, that's the core.
now let's talk about the two of them, because they are NOT the same girl. π
π the server variant
krb5_get_all_server_addrs returns all configured interface addresses (if possible), and yes bestie, it includes loop-back addresses. this is the one you want if you're about to create sockets to listen to. it's giving main character energy, it's giving "i am the host, hear me roar." π₯
π¦ the client variant
krb5_get_all_client_addrs will also scan local interfaces β but lowkey you can turn that off by setting libdefaults/scan_interfaces to false in krb5.conf. and here's the key difference, don't miss it:
- it will not include loop-back addressesβ¦ unless there are no other addresses found. (pity loopback, honestly. it only shows up when nobody else does. π)
- it will remove all addresses included in
libdefaults/ignore_addressesβ like, blocked, unfollowed, done. π - but it will unconditionally include addresses in
libdefaults/extra_addresses. no questions asked. those are the ride-or-dies. π
β οΈ okay this part is IMPORTANT, do not skip it: the returned addresses should be freed by calling krb5_free_addresses(). don't just leave them lying around, bestie, that's not the move. free your memory. it's self-care. π§
π SEE ALSO π
and that's the whole page!! π this one's from HEIMDAL, dated July 1, 2001 β yeah, it's an elder but she still slays, periodt. πβ¨ go get those addresses, bestie, and remember to free them. iykyk. π
π¦ where this page comes from
- alpine 3.22: heimdal-doc 7.8.0-r4 Β· BSD-3-Clause
- alpine 3.23: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- alpine 3.24: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- debian bookworm: heimdal-dev 7.8.git20221117.28daf24+dfsg-2 Β· BSD-3-Clause
- debian trixie: heimdal-dev 7.8.git20221117.28daf24+dfsg-9+deb13u1 Β· BSD-3-Clause
- epel 10: heimdal-devel 7.8.0-26.el10_2 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- epel 9: heimdal-devel 7.8.0-5.el9 Β· BSD and MIT
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- freebsd 14.5: base 14.5
- nixpkgs unstable: heimdal 7.8.0-unstable-2024-09-10
- ubuntu jammy: heimdal-dev 7.7.0+dfsg-3ubuntu1 Β· BSD-3-Clause
- ubuntu noble: heimdal-dev 7.8.git20221117.28daf24+dfsg-5ubuntu3 Β· BSD-3-Clause
- ubuntu questing: heimdal-dev 7.8.git20221117.28daf24+dfsg-9ubuntu1
- ubuntu resolute: heimdal-dev 7.8.git20221117.28daf24+dfsg-11ubuntu1 Β· BSD-3-Clause
- ubuntu stonking: heimdal-dev 7.8.git20240113.1b4565a+dfsg-2ubuntu1 Β· BSD-3-Clause
- Copyright (c) 2001 Kungliga Tekniska HΓΆgskolan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms