'\" t
.\" Title: loc_database_lookup
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 02/01/2024
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LOC_DATABASE_LOOKUP" "3" "" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
loc_database_lookup \- Lookup a network from the database
.SH "SYNOPSIS"
.sp
#include
.sp
int loc_database_lookup(struct loc_database* db, const struct in6_addr* address, struct loc_network** network);
.sp
int loc_database_lookup_from_string(struct loc_database* db, const char* string, struct loc_network** network);
.SH "DESCRIPTION"
.sp
The lookup functions try finding a network in the database\&.
.sp
\fIloc_database_lookup\fR takes the IP address as \fIstruct in6_addr\fR format which can either be a regular IPv6 address or a mapped IPv4 address\&.
.sp
\fIloc_database_lookup_string\fR takes the IP address as string and will parse it automatically\&.
.SH "RETURN VALUE"
.sp
On success, zero is returned\&. Otherwise non\-zero is being returned and \fIerrno\fR is set accordingly\&.
.SH "SEE ALSO"
.sp
\fBlibloc\fR(3)
.SH "AUTHORS"
.sp
Michael Tremer