lwres_resutil.docbook revision 8eea877894ea5bcf5cdd9ca124a8601ad421d753
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User<!--
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - Copyright (C) 2001 Internet Software Consortium.
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User -
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - Permission to use, copy, modify, and distribute this software for any
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - purpose with or without fee is hereby granted, provided that the above
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - copyright notice and this permission notice appear in all copies.
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User -
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User-->
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User<!-- $Id: lwres_resutil.docbook,v 1.3 2001/04/24 18:11:26 gson Exp $ -->
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User<refentry>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User <refentryinfo>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<date>Jun 30, 2000</date>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</refentryinfo>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<refmeta>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt <refentrytitle>lwres_resutil</refentrytitle>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt <manvolnum>3</manvolnum>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt <refmiscinfo>BIND9</refmiscinfo>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</refmeta>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<refnamediv>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refname>lwres_string_parse</refname>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refname>lwres_addr_parse</refname>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<refname>lwres_getaddrsbyname</refname>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refname>lwres_getnamebyaddr</refname>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<refpurpose>lightweight resolver utility functions</refpurpose>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</refnamediv>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refsynopsisdiv>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<funcsynopsis>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<funcsynopsisinfo>#include &lt;lwres/lwres.h&gt;</funcsynopsisinfo>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<funcprototype>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<funcdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntlwres_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_string_parse</function></funcdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<paramdef>lwres_buffer_t *b</paramdef>
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User<paramdef>char **c</paramdef>
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User<paramdef>lwres_uint16_t *len</paramdef>
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User</funcprototype>
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User<funcprototype>
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User<funcdef>
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox Userlwres_result_t
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User<function>lwres_addr_parse</function></funcdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<paramdef>lwres_buffer_t *b</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<paramdef>lwres_addr_t *addr</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</funcprototype>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<funcprototype>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<funcdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntlwres_result_t
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<function>lwres_getaddrsbyname</function></funcdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<paramdef>lwres_context_t *ctx</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<paramdef>const char *name</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<paramdef>lwres_uint32_t addrtypes</paramdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<paramdef>lwres_gabnresponse_t **structp</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</funcprototype>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<funcprototype>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<funcdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlwres_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getnamebyaddr</function></funcdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<paramdef>lwres_context_t *ctx</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<paramdef>lwres_uint32_t addrtype</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<paramdef>lwres_uint16_t addrlen</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<paramdef>const unsigned char *addr</paramdef>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<paramdef>lwres_gnbaresponse_t **structp</paramdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</funcprototype>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</funcsynopsis>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</refsynopsisdiv>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<refsect1>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<title>DESCRIPTION</title>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_string_parse()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntretrieves a DNS-encoded string starting the current pointer of
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntlightweight resolver buffer
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>b</parameter>:
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunti.e.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<constant>b-&gt;current</constant>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserWhen the function returns, the address of the first byte of the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntencoded string is returned via
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<parameter>*c</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntand the length of that string is given by
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>*len</parameter>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntThe buffer's current pointer is advanced to point at the character
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntfollowing the string length, the encoded string, and the trailing
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<type>NULL</type>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntcharacter.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_string_parse()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunthas an assertion check that
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>b</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis not
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<type>NULL</type>.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_addr_parse()</function>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userextracts an address from the buffer
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>b</parameter>.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntIt checks that
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>addr</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis not null.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntThe buffer's current pointer
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<constant>b-&gt;current</constant>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis presumed to point at an encoded address: the address preceded by a
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt32-bit protocol family identifier and a 16-bit length field.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntThe encoded address is copied to
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<constant>addr-&gt;address</constant>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userand
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<constant>addr-&gt;length</constant>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntindicates the size in bytes of the address that was copied.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<constant>b-&gt;current</constant>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis advanced to point at the next byte of available data in the buffer
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userfollowing the encoded address.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getaddrsbyname()</function>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userand
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getnamebyaddr()</function>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Useruse the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<type>lwres_gnbaresponse_t</type>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntstructure defined below:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<programlisting>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunttypedef struct {
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt lwres_uint32_t flags;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt lwres_uint16_t naliases;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt lwres_uint16_t naddrs;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User char *realname;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt char **aliases;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt lwres_uint16_t realnamelen;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt lwres_uint16_t *aliaslen;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt lwres_addrlist_t addrs;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt void *base;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt size_t baselen;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User} lwres_gabnresponse_t;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</programlisting>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserThe contents of this structure are not manipulated directly but
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userthey are controlled through the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<citerefentry>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refentrytitle>lwres_gabn</refentrytitle><manvolnum>3
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</manvolnum>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</citerefentry>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userfunctions.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntThe lightweight resolver uses
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getaddrsbyname()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntto perform foward lookups.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserHostname
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>name</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis looked up using the resolver context
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>ctx</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntfor memory allocation.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>addrtypes</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis a bitmask indicating which type of addresses are to be looked up.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCurrent values for this bitmask are
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<type>LWRES_ADDRTYPE_V4</type>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntfor IPv4 addresses and
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<type>LWRES_ADDRTYPE_V6</type>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntfor IPv6 addresses.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntResults of the lookup are returned in
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>*structp</parameter>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<function>lwres_getaddrsbyname()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntchecks that its pointer arguments are not
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<type>NULL</type>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntand that
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>addrtypes</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis non-zero.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getnamebyaddr()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntperforms reverse lookups.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntResolver context
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<parameter>ctx</parameter>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Useris used for memory allocation.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntThe address type is indicated by
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>addrtype</parameter>:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<type>LWRES_ADDRTYPE_V4</type>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntor
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<type>LWRES_ADDRTYPE_V6</type>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserThe address to be looked up is given by
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<parameter>addr</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntand its length is
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>addrlen</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntbytes.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntThe result of the function call is made available through
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<parameter>*structp</parameter>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserLike
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getaddrsbyname()</function>,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getnamebyaddr()</function>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Useruses assertion checking to ensure its pointer arguments are not
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<type>NULL</type>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userand
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>addrtype</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis not zero.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getaddrsbyname()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntalso checks that
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<parameter>addrlen</parameter>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Useris non-zero.
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox User</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</refsect1>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refsect1>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<title>RETURN VALUES</title>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserSuccessful calls to
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_string_parse()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntand
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_addr_parse()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntreturn
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<errorcode>LWRES_R_SUCCESS.</errorcode>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntBoth functions return
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<errorcode>LWRES_R_FAILURE</errorcode>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntif the buffer is corrupt or
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<errorcode>LWRES_R_UNEXPECTEDEND</errorcode>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userif the buffer has less space than expected for the components of the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntencoded string or address.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getaddrsbyname()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntreturns
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<errorcode>LWRES_R_SUCCESS</errorcode>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunton success and it returns
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<errorcode>LWRES_R_NOTFOUND</errorcode>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntif the hostname
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<parameter>name</parameter>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usercould not be found.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<errorcode>LWRES_R_SUCCESS</errorcode>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis returned by a successful call to
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getnamebyaddr()</function>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserBoth
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<function>lwres_getaddrsbyname()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntand
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_getnamebyaddr()</function>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntreturn
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<errorcode>LWRES_R_NOMEMORY</errorcode>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntwhen memory allocation requests fail and
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<errorcode>LWRES_R_UNEXPECTEDEND</errorcode>
e2b184f84e846bbcb764b6f0aef5dcd583d3d7a1Tinderbox Userif the buffers used for sending queries and receiving replies are too
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntsmall.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</para>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</refsect1>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refsect1>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<title>SEE ALSO</title>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<citerefentry>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refentrytitle>lwres_buffer</refentrytitle><manvolnum>3</manvolnum>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</citerefentry>,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<citerefentry>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refentrytitle>lwres_gabn</refentrytitle><manvolnum>3</manvolnum>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</citerefentry>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</para>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</refsect1>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</refentry>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt