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 as struct in6_addr format. 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 lists loc_database_lookup_from_string, while the DESCRIPTION says loc_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