LOC_DATABASE_LOOKUP(3)
β¨ NAME β¨
okay so this is the whole vibe of loc_database_lookup(3) β the manual page for looking up a network from the database. Bestie, it's giving βfind my networkβ energy, but make it Unix. π
πΈ SYNOPSIS πΈ
#include <libloc/database.h>
int loc_database_lookup(struct loc_database* db, const struct in6_addr*
address, struct loc_network** network);
int loc_database_lookup_from_string(struct loc_database* db, const char*
string, struct loc_network** network);
π¦ DESCRIPTION π¦
The lookup functions are literally trying to find a network in the database. Main character behavior only. β¨
loc_database_lookupβ takes the IP address asstruct in6_addrformat. That can be a regular IPv6 address or a mapped IPv4 address. Both are valid, no cap. π«Άloc_database_lookup_stringβ that's the exact name the DESCRIPTION uses, bestie β takes the IP address as a string and will parse it automatically. Auto-parse vibes, slay. π
tiny heads-up: the SYNOPSIS above listsloc_database_lookup_from_string, while the DESCRIPTION saysloc_database_lookup_string. Keeping both exactly as the page has them. π
π RETURN VALUE π
On success, zero is returned. Otherwise, a non-zero value is returned and errno is set accordingly. So yes, check that return value, bestie β errno is doing its own thing. π
π SEE ALSO π
π AUTHORS π
- Michael Tremer
sign-off time, bestie π: the footer on this one is just LOC_DATABASE_LOOKUP(3) β so that's the source/version/date situation this page gives us, and we're not inventing extra tea. π
π«Ά
π¦ where this page comes from
- ubuntu stonking: libloc-dev 0.9.19-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms