loc_database_lookup(3)

loc_database_lookup3

Lookup a network from the database

Usage

#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);

Overview

The lookup functions try finding a network in the database.

loc_database_lookup takes the IP address as struct in6_addr format which can either be a regular IPv6 address or a mapped IPv4 address.

loc_database_lookup_string takes the IP address as string and will parse it automatically.

Return value

On success, zero is returned. Otherwise non-zero is being returned and errno is set accordingly.

Releases

3 releases since Debian 12 (Bookworm); the text changed 2 times.

  1. 12
  2. 13
  3. Arch

Authors

Michael Tremer

From libloc 0.9.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.