mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
missing end tags; other cleanup
This commit is contained in:
parent
01d9a393ec
commit
86b0285d7e
9 changed files with 300 additions and 490 deletions
|
|
@ -16,7 +16,7 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_getaddrinfo.docbook,v 1.4 2001/06/18 17:53:59 gson Exp $ -->
|
||||
<!-- $Id: lwres_getaddrinfo.docbook,v 1.5 2001/06/18 22:06:53 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
|
|
@ -101,13 +101,12 @@ IPv4 address or an IPv6 address.
|
|||
<parameter>servname</parameter>
|
||||
is either a decimal port number or a service name as listed in
|
||||
<filename>/etc/services</filename>.
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<parameter>hints</parameter>
|
||||
is an optional pointer to a
|
||||
<type>struct addrinfo</type>.
|
||||
|
||||
This structure can be used to provide hints concerning the type of socket
|
||||
that the caller supports or wishes to use.
|
||||
The caller can supply the following structure elements in
|
||||
|
|
@ -230,6 +229,7 @@ and no name resolution should be attempted.
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All other elements of the <type>struct addrinfo</type> passed
|
||||
|
|
|
|||
|
|
@ -16,19 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_gethostent.docbook,v 1.4 2001/04/24 18:13:46 gson Exp $ -->
|
||||
<!-- $Id: lwres_gethostent.docbook,v 1.5 2001/06/18 22:06:54 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
<refentryinfo>
|
||||
|
||||
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_gethostent</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_gethostbyname</refname>
|
||||
<refname>lwres_gethostbyname2</refname>
|
||||
|
|
@ -166,13 +167,13 @@ The members of this structure are:
|
|||
<para>
|
||||
The official (canonical) name of the host.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_aliases</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A NULL-terminated array of alternate names (nicknames) for the host.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_addrtype</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -181,13 +182,13 @@ The type of address being returned —
|
|||
or
|
||||
<type>PF_INET6</type>.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_length</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The length of the address in bytes.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_addr_list</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -195,7 +196,7 @@ A <type>NULL</type>
|
|||
terminated array of network addresses for the host.
|
||||
Host addresses are returned in network byte order.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
|
|
@ -219,130 +220,68 @@ or NIS. The lightweight resolver does not currently implement
|
|||
these functions; it only provides them as stub functions that always
|
||||
return failure.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_gethostbyname()</function>
|
||||
and
|
||||
<function>lwres_gethostbyname2()</function>
|
||||
look up the hostname
|
||||
<function>lwres_gethostbyname()</function> and
|
||||
<function>lwres_gethostbyname2()</function> look up the hostname
|
||||
<parameter>name</parameter>.
|
||||
|
||||
<function>lwres_gethostbyname()</function>
|
||||
always looks for an IPv4 address while
|
||||
<function>lwres_gethostbyname2()</function>
|
||||
looks for an address of protocol family
|
||||
<parameter>af</parameter>:
|
||||
|
||||
either
|
||||
<type>PF_INET</type>
|
||||
or
|
||||
<type>PF_INET6</type>
|
||||
— IPv4 or IPV6 addresses respectively.
|
||||
Successful calls of the functions return a
|
||||
<type>struct hostent</type>for
|
||||
|
||||
the name that was looked up.
|
||||
<type>NULL</type>
|
||||
is returned if the lookups by
|
||||
<function>lwres_gethostbyname()</function>
|
||||
or
|
||||
<function>lwres_gethostbyname2()</function>
|
||||
fail.
|
||||
<function>lwres_gethostbyname()</function> always looks for an IPv4
|
||||
address while <function>lwres_gethostbyname2()</function> looks for an
|
||||
address of protocol family <parameter>af</parameter>: either
|
||||
<type>PF_INET</type> or <type>PF_INET6</type> — IPv4 or IPV6
|
||||
addresses respectively. Successful calls of the functions return a
|
||||
<type>struct hostent</type>for the name that was looked up.
|
||||
<type>NULL</type> is returned if the lookups by
|
||||
<function>lwres_gethostbyname()</function> or
|
||||
<function>lwres_gethostbyname2()</function> fail.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Reverse lookups of addresses are performed by
|
||||
<function>lwres_gethostbyaddr()</function>.
|
||||
<parameter>addr</parameter>
|
||||
is an address of length
|
||||
<parameter>len</parameter>
|
||||
bytes and protocol family
|
||||
<parameter>type</parameter> —
|
||||
<type>PF_INET</type>
|
||||
or
|
||||
<parameter>addr</parameter> is an address of length
|
||||
<parameter>len</parameter> bytes and protocol family
|
||||
<parameter>type</parameter> — <type>PF_INET</type> or
|
||||
<type>PF_INET6</type>.
|
||||
|
||||
<function>lwres_gethostbyname_r()</function>
|
||||
is a thread-safe function for forward lookups.
|
||||
If an error occurs, an error code is returned in
|
||||
<function>lwres_gethostbyname_r()</function> is a thread-safe function
|
||||
for forward lookups. If an error occurs, an error code is returned in
|
||||
<parameter>*error</parameter>.
|
||||
|
||||
<parameter>resbuf</parameter>
|
||||
is a pointer to a
|
||||
<type>struct hostent</type>
|
||||
which is initialised by a successful call to
|
||||
<parameter>resbuf</parameter> is a pointer to a <type>struct
|
||||
hostent</type> which is initialised by a successful call to
|
||||
<function>lwres_gethostbyname_r()</function> .
|
||||
<parameter>buf</parameter>
|
||||
is a buffer of length
|
||||
<parameter>len</parameter>
|
||||
bytes which is used to store the
|
||||
<constant>h_name</constant>,
|
||||
|
||||
<constant>h_aliases</constant>,
|
||||
|
||||
and
|
||||
<constant>h_addr_list</constant>
|
||||
elements of the
|
||||
<type>struct hostent</type>
|
||||
returned in
|
||||
<parameter>resbuf</parameter>.
|
||||
|
||||
Successful calls to
|
||||
<function>lwres_gethostbyname_r()</function>
|
||||
return
|
||||
<parameter>resbuf</parameter>,
|
||||
|
||||
which is a pointer to the
|
||||
<type>struct hostent</type>
|
||||
it created.
|
||||
<parameter>buf</parameter> is a buffer of length
|
||||
<parameter>len</parameter> bytes which is used to store the
|
||||
<constant>h_name</constant>, <constant>h_aliases</constant>, and
|
||||
<constant>h_addr_list</constant> elements of the <type>struct
|
||||
hostent</type> returned in <parameter>resbuf</parameter>.
|
||||
Successful calls to <function>lwres_gethostbyname_r()</function>
|
||||
return <parameter>resbuf</parameter>,
|
||||
which is a pointer to the <type>struct hostent</type> it created.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_gethostbyaddr_r()</function>
|
||||
is a thread-safe function that performs a reverse lookup of address
|
||||
<parameter>addr</parameter>
|
||||
which is
|
||||
<parameter>len</parameter>
|
||||
bytes long
|
||||
and is of protocol family
|
||||
<parameter>type</parameter> —
|
||||
|
||||
<type>PF_INET</type>
|
||||
or
|
||||
<type>PF_INET6</type>.
|
||||
|
||||
If an error occurs, the error code is returned in
|
||||
<parameter>*error</parameter>.
|
||||
|
||||
The other function parameters are identical to those in
|
||||
<function>lwres_gethostbyname_r()</function>.
|
||||
<parameter>resbuf</parameter>
|
||||
is a pointer to a
|
||||
<type>struct hostent</type>
|
||||
which is initialised by a successful call to
|
||||
<function>lwres_gethostbyaddr_r()</function> is a thread-safe function
|
||||
that performs a reverse lookup of address <parameter>addr</parameter>
|
||||
which is <parameter>len</parameter> bytes long and is of protocol
|
||||
family <parameter>type</parameter> — <type>PF_INET</type> or
|
||||
<type>PF_INET6</type>. If an error occurs, the error code is returned
|
||||
in <parameter>*error</parameter>. The other function parameters are
|
||||
identical to those in <function>lwres_gethostbyname_r()</function>.
|
||||
<parameter>resbuf</parameter> is a pointer to a <type>struct
|
||||
hostent</type> which is initialised by a successful call to
|
||||
<function>lwres_gethostbyaddr_r()</function>.
|
||||
<parameter>buf</parameter>
|
||||
is a buffer of length
|
||||
<parameter>len</parameter>
|
||||
bytes which is used to store the
|
||||
<constant>h_name</constant>,
|
||||
|
||||
<constant>h_aliases</constant>,
|
||||
|
||||
and
|
||||
<constant>h_addr_list</constant>
|
||||
elements of the
|
||||
<type>struct hostent</type>
|
||||
returned in
|
||||
<parameter>resbuf</parameter>.
|
||||
|
||||
Successful calls to
|
||||
<function>lwres_gethostbyaddr_r()</function>
|
||||
return
|
||||
<parameter>resbuf</parameter>,
|
||||
|
||||
which is a pointer to the
|
||||
<function>struct hostent()</function>
|
||||
it created.
|
||||
<parameter>buf</parameter> is a buffer of length
|
||||
<parameter>len</parameter> bytes which is used to store the
|
||||
<constant>h_name</constant>, <constant>h_aliases</constant>, and
|
||||
<constant>h_addr_list</constant> elements of the <type>struct
|
||||
hostent</type> returned in <parameter>resbuf</parameter>. Successful
|
||||
calls to <function>lwres_gethostbyaddr_r()</function> return
|
||||
<parameter>resbuf</parameter>, which is a pointer to the
|
||||
<function>struct hostent()</function> it created.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>RETURN VALUES</title>
|
||||
<para>
|
||||
|
|
@ -363,20 +302,20 @@ will contain one of the following error codes defined in
|
|||
<para>
|
||||
The host or address was not found.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>TRY_AGAIN</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A recoverable error occurred, e.g., a timeout.
|
||||
Retrying the lookup may succeed.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>NO_RECOVERY</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A non-recoverable error occurred.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>NO_DATA</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -386,9 +325,10 @@ of a reverse lookup). The code NO_ADDRESS
|
|||
is accepted as a synonym for NO_DATA for backwards
|
||||
compatibility.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>lwres_hstrerror</refentrytitle><manvolnum>3
|
||||
|
|
@ -396,53 +336,30 @@ compatibility.
|
|||
</citerefentry>
|
||||
translates these error codes to suitable error messages.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_gethostent()</function>
|
||||
and
|
||||
<function>lwres_gethostent_r()</function>
|
||||
always return
|
||||
<type>NULL</type>.
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Successful calls to
|
||||
<function>lwres_gethostbyname_r()</function>
|
||||
and
|
||||
<function>lwres_gethostbyaddr_r()</function>
|
||||
return
|
||||
<parameter>resbuf</parameter>,
|
||||
|
||||
a pointer to the
|
||||
<type>struct hostent</type>
|
||||
that was initialised by these functions.
|
||||
They return
|
||||
<type>NULL</type>
|
||||
if the lookups fail
|
||||
or if
|
||||
<parameter>buf</parameter>
|
||||
Successful calls to <function>lwres_gethostbyname_r()</function> and
|
||||
<function>lwres_gethostbyaddr_r()</function> return
|
||||
<parameter>resbuf</parameter>, a pointer to the <type>struct
|
||||
hostent</type> that was initialised by these functions. They return
|
||||
<type>NULL</type> if the lookups fail or if <parameter>buf</parameter>
|
||||
was too small to hold the list of addresses and names referenced by
|
||||
the
|
||||
<constant>h_name</constant>,
|
||||
|
||||
<constant>h_aliases</constant>,
|
||||
|
||||
and
|
||||
<constant>h_addr_list</constant>
|
||||
elements of the
|
||||
<type>struct hostent</type>.
|
||||
|
||||
If
|
||||
<parameter>buf</parameter>
|
||||
was too small, both
|
||||
<function>lwres_gethostbyname_r()</function>
|
||||
and
|
||||
<function>lwres_gethostbyaddr_r()</function>
|
||||
set the global variable
|
||||
<type>errno</type>
|
||||
to
|
||||
<errorcode>ERANGE</errorcode>.
|
||||
|
||||
the <constant>h_name</constant>, <constant>h_aliases</constant>, and
|
||||
<constant>h_addr_list</constant> elements of the <type>struct
|
||||
hostent</type>. If <parameter>buf</parameter> was too small, both
|
||||
<function>lwres_gethostbyname_r()</function> and
|
||||
<function>lwres_gethostbyaddr_r()</function> set the global variable
|
||||
<type>errno</type> to <errorcode>ERANGE</errorcode>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>SEE ALSO</title>
|
||||
|
|
|
|||
|
|
@ -16,19 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_getipnode.docbook,v 1.3 2001/04/24 18:11:13 gson Exp $ -->
|
||||
<!-- $Id: lwres_getipnode.docbook,v 1.4 2001/06/18 22:06:55 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
<refentryinfo>
|
||||
|
||||
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_getipnode</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_getipnodebyname</refname>
|
||||
<refname>lwres_getipnodebyaddr</refname>
|
||||
|
|
@ -64,19 +65,21 @@ void
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>DESCRIPTION</title>
|
||||
|
||||
<para>
|
||||
These functions perform thread safe, protocol independent
|
||||
nodename-to-address and address-to-nodename
|
||||
translation as defined in RFC2553.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
They use a
|
||||
<type>struct hostent</type>
|
||||
which is defined in
|
||||
<filename>namedb.h</filename>:
|
||||
|
||||
<programlisting>
|
||||
struct hostent {
|
||||
char *h_name; /* official name of host */
|
||||
|
|
@ -88,6 +91,7 @@ struct hostent {
|
|||
#define h_addr h_addr_list[0] /* address, for backward compatibility */
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The members of this structure are:
|
||||
<variablelist>
|
||||
|
|
@ -96,13 +100,13 @@ The members of this structure are:
|
|||
<para>
|
||||
The official (canonical) name of the host.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_aliases</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A NULL-terminated array of alternate names (nicknames) for the host.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_addrtype</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -112,13 +116,13 @@ or
|
|||
<type>PF_INET6</type>.
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_length</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The length of the address in bytes.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>h_addr_list</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -127,7 +131,7 @@ A
|
|||
terminated array of network addresses for the host.
|
||||
Host addresses are returned in network byte order.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
|
|
@ -153,7 +157,7 @@ This is used with an
|
|||
of AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped
|
||||
IPv6 addresses.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>AI_ALL</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -163,7 +167,7 @@ of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned.
|
|||
If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped
|
||||
IPv6 addresses.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>AI_ADDRCONFIG</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -171,7 +175,7 @@ Only return an IPv6 or IPv4 address if here is an active network
|
|||
interface of that type. This is not currently implemented
|
||||
in the BIND 9 lightweight resolver, and the flag is ignored.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>AI_DEFAULT</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -181,7 +185,7 @@ and
|
|||
<constant>AI_ADDRCONFIG</constant>
|
||||
flag bits.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
|
|
@ -238,7 +242,7 @@ The error codes and their meanings are defined in
|
|||
<para>
|
||||
No such host is known.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>NO_ADDRESS</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -246,7 +250,7 @@ The server recognised the request and the name but no address is
|
|||
available. Another type of request to the name server for the
|
||||
domain might return an answer.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>TRY_AGAIN</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -254,14 +258,14 @@ A temporary and possibly transient error occurred, such as a
|
|||
failure of a server to respond. The request may succeed if
|
||||
retried.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
<varlistentry><term><constant>NO_RECOVERY</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An unexpected failure occurred, and retrying the request
|
||||
is pointless.
|
||||
</para>
|
||||
</listitem>
|
||||
</listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
|
|
|
|||
|
|
@ -16,17 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_getnameinfo.docbook,v 1.2 2001/04/10 21:51:47 bwelling Exp $ -->
|
||||
<!-- $Id: lwres_getnameinfo.docbook,v 1.3 2001/06/18 22:06:56 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
<refentryinfo>
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_getnameinfo</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_getnameinfo</refname>
|
||||
<refpurpose>lightweight resolver socket address structure to hostname and service name</refpurpose>
|
||||
|
|
@ -48,59 +51,41 @@ int
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>DESCRIPTION</title>
|
||||
<para>
|
||||
This function is equivalent to the
|
||||
<citerefentry>
|
||||
<refentrytitle>getnameinfo</refentrytitle><manvolnum>3
|
||||
</manvolnum>
|
||||
</citerefentry>
|
||||
function defined in RFC2133.
|
||||
<function>lwres_getnameinfo()</function>
|
||||
returns the hostname for the
|
||||
<type>struct sockaddr</type>
|
||||
<parameter>sa</parameter>
|
||||
which is
|
||||
<parameter>salen</parameter>
|
||||
bytes long.
|
||||
The hostname is of length
|
||||
<parameter>hostlen</parameter>
|
||||
and is returned via
|
||||
<parameter>*host.</parameter>
|
||||
The maximum length of the hostname is
|
||||
1025 bytes:
|
||||
<constant>NI_MAXHOST</constant>.
|
||||
|
||||
<para> This function is equivalent to the <citerefentry>
|
||||
<refentrytitle>getnameinfo</refentrytitle><manvolnum>3</manvolnum>
|
||||
</citerefentry> function defined in RFC2133.
|
||||
<function>lwres_getnameinfo()</function> returns the hostname for the
|
||||
<type>struct sockaddr</type> <parameter>sa</parameter> which is
|
||||
<parameter>salen</parameter> bytes long. The hostname is of length
|
||||
<parameter>hostlen</parameter> and is returned via
|
||||
<parameter>*host.</parameter> The maximum length of the hostname is
|
||||
1025 bytes: <constant>NI_MAXHOST</constant>.</para>
|
||||
|
||||
<para> The name of the service associated with the port number in
|
||||
<parameter>sa</parameter> is returned in <parameter>*serv.</parameter>
|
||||
It is <parameter>servlen</parameter> bytes long. The maximum length
|
||||
of the service name is <constant>NI_MAXSERV</constant> - 32 bytes.
|
||||
</para>
|
||||
<para>
|
||||
The name of the service associated with the port number in
|
||||
<parameter>sa</parameter>
|
||||
is returned in
|
||||
<parameter>*serv.</parameter>
|
||||
It is
|
||||
<parameter>servlen</parameter>
|
||||
bytes long.
|
||||
The maximum length of the service name is
|
||||
<constant>NI_MAXSERV</constant> - 32 bytes.
|
||||
</para>
|
||||
<para>
|
||||
The
|
||||
<parameter>flags</parameter>
|
||||
argument sets the following bits:
|
||||
|
||||
<para> The <parameter>flags</parameter> argument sets the following
|
||||
bits:
|
||||
<variablelist>
|
||||
<varlistentry><term><constant>NI_NOFQDN</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A fully qualified domain name is not required for local hosts.
|
||||
The local part of the fully qualified domain name is returned instead.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>NI_NUMERICHOST</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Return the address in numeric form, as if calling inet_ntop(),
|
||||
instead of a host name.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>NI_NAMEREQD</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -108,12 +93,12 @@ A name is required. If the hostname cannot be found in the DNS and
|
|||
this flag is set, a non-zero error code is returned.
|
||||
If the hostname is not found and the flag is not set, the
|
||||
address is returned in numeric form.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>NI_NUMERICSERV</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The service name is returned as a digit string representing the port number.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>NI_DGRAM</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -122,13 +107,11 @@ service, and causes getservbyport() to be called with a second
|
|||
argument of "udp" instead of its default of "tcp". This is required
|
||||
for the few ports (512-514) that have different services for UDP and
|
||||
TCP.
|
||||
</para>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>RETURN VALUES</title>
|
||||
<para>
|
||||
|
|
|
|||
|
|
@ -16,19 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_hstrerror.docbook,v 1.2 2001/04/10 21:51:57 bwelling Exp $ -->
|
||||
<!-- $Id: lwres_hstrerror.docbook,v 1.3 2001/06/18 22:06:58 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
<refentryinfo>
|
||||
|
||||
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_hstrerror</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_herror</refname>
|
||||
<refname>lwres_hstrerror</refname>
|
||||
|
|
@ -54,54 +55,50 @@ const char *
|
|||
|
||||
<refsect1>
|
||||
<title>DESCRIPTION</title>
|
||||
<para>
|
||||
<function>lwres_herror()</function>
|
||||
prints the string
|
||||
<parameter>s</parameter>
|
||||
on
|
||||
<type>stderr</type>
|
||||
followed by the string generated by
|
||||
<function>lwres_hstrerror()</function>
|
||||
for the error code stored in the global variable
|
||||
<constant>lwres_h_errno</constant>.
|
||||
|
||||
<para>
|
||||
<function>lwres_herror()</function> prints the string
|
||||
<parameter>s</parameter> on <type>stderr</type> followed by the string
|
||||
generated by <function>lwres_hstrerror()</function> for the error code
|
||||
stored in the global variable <constant>lwres_h_errno</constant>.
|
||||
</para>
|
||||
<para>
|
||||
<function>lwres_hstrerror()</function>
|
||||
returns an appropriate string for the error code gievn by
|
||||
<parameter>err</parameter>.
|
||||
|
||||
The values of the error codes and messages are as follows:
|
||||
<para>
|
||||
<function>lwres_hstrerror()</function> returns an appropriate string
|
||||
for the error code gievn by <parameter>err</parameter>. The values of
|
||||
the error codes and messages are as follows:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry><term><errorcode>NETDB_SUCCESS</errorcode></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<errorname>Resolver Error 0 (no error)</errorname>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><errorcode>HOST_NOT_FOUND</errorcode></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<errorname>Unknown host</errorname>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><errorcode>TRY_AGAIN</errorcode></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<errorname>Host name lookup failure</errorname>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><errorcode>NO_RECOVERY</errorcode></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<errorname>Unknown server error</errorname>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><errorcode>NO_DATA</errorcode></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<errorname>No address associated with name</errorname>
|
||||
</para>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>RETURN VALUES</title>
|
||||
<para>
|
||||
|
|
|
|||
|
|
@ -16,19 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_inetntop.docbook,v 1.2 2001/04/10 21:52:00 bwelling Exp $ -->
|
||||
<!-- $Id: lwres_inetntop.docbook,v 1.3 2001/06/18 22:06:59 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
<refentryinfo>
|
||||
|
||||
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_inetntop</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_net_ntop</refname>
|
||||
<refpurpose>lightweight resolver IP address presentation</refpurpose>
|
||||
|
|
@ -47,48 +48,39 @@ const char *
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>DESCRIPTION</title>
|
||||
|
||||
<para>
|
||||
<function>lwres_net_ntop()</function>
|
||||
converts an IP address of protocol family
|
||||
<parameter>af</parameter>
|
||||
— IPv4 or IPv6 —
|
||||
at location
|
||||
<parameter>src</parameter>
|
||||
from network format to its conventional representation as a string.
|
||||
For IPv4 addresses, that string would be a dotted-decimal.
|
||||
An IPv6 address would be represented in colon notation as described in
|
||||
RFC1884.
|
||||
<function>lwres_net_ntop()</function> converts an IP address of
|
||||
protocol family <parameter>af</parameter> — IPv4 or IPv6 —
|
||||
at location <parameter>src</parameter> from network format to its
|
||||
conventional representation as a string. For IPv4 addresses, that
|
||||
string would be a dotted-decimal. An IPv6 address would be
|
||||
represented in colon notation as described in RFC1884.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The generated string is copied to
|
||||
<parameter>dst</parameter>
|
||||
provided
|
||||
<parameter>size</parameter>
|
||||
indicates it is long enough to store the ASCII representation
|
||||
of the address.
|
||||
The generated string is copied to <parameter>dst</parameter> provided
|
||||
<parameter>size</parameter> indicates it is long enough to store the
|
||||
ASCII representation of the address.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>RETURN VALUES</title>
|
||||
<para>
|
||||
If successful, the function returns
|
||||
<parameter>dst</parameter>:
|
||||
|
||||
a pointer to a string containing
|
||||
the presentation format of the address.
|
||||
<function>lwres_net_ntop()</function>
|
||||
returns
|
||||
<type>NULL</type>
|
||||
and sets the global variable
|
||||
<constant>errno</constant>
|
||||
to
|
||||
<errorcode>EAFNOSUPPORT</errorcode>
|
||||
if the protocol family given in
|
||||
<parameter>af</parameter>
|
||||
is not supported.
|
||||
<para>
|
||||
If successful, the function returns <parameter>dst</parameter>:
|
||||
a pointer to a string containing the presentation format of the
|
||||
address. <function>lwres_net_ntop()</function> returns
|
||||
<type>NULL</type> and sets the global variable
|
||||
<constant>errno</constant> to <errorcode>EAFNOSUPPORT</errorcode> if
|
||||
the protocol family given in <parameter>af</parameter> is not
|
||||
supported.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>SEE ALSO</title>
|
||||
|
|
|
|||
|
|
@ -16,19 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_noop.docbook,v 1.3 2001/04/24 18:11:19 gson Exp $ -->
|
||||
<!-- $Id: lwres_noop.docbook,v 1.4 2001/06/18 22:07:00 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
<refentryinfo>
|
||||
|
||||
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_noop</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_nooprequest_render</refname>
|
||||
<refname>lwres_noopresponse_render</refname>
|
||||
|
|
@ -141,65 +142,41 @@ Although the structures have different types, they are identical.
|
|||
This is because the no-op opcode simply echos whatever data was sent:
|
||||
the response is therefore identical to the request.
|
||||
</para>
|
||||
<para>
|
||||
<function>lwres_nooprequest_render()</function>
|
||||
uses resolver context
|
||||
<parameter>ctx</parameter>
|
||||
to convert no-op request structure
|
||||
<parameter>req</parameter>
|
||||
to canonical format.
|
||||
The packet header structure
|
||||
<parameter>pkt</parameter>
|
||||
is initialised and transferred to
|
||||
buffer
|
||||
<parameter>b</parameter>.
|
||||
|
||||
The contents of
|
||||
<parameter>*req</parameter>
|
||||
are then appended to the buffer in canonical format.
|
||||
<function>lwres_noopresponse_render()</function>
|
||||
<para>
|
||||
<function>lwres_nooprequest_render()</function> uses resolver
|
||||
context <parameter>ctx</parameter> to convert no-op request structure
|
||||
<parameter>req</parameter> to canonical format. The packet header
|
||||
structure <parameter>pkt</parameter> is initialised and transferred to
|
||||
buffer <parameter>b</parameter>. The contents of
|
||||
<parameter>*req</parameter> are then appended to the buffer in
|
||||
canonical format. <function>lwres_noopresponse_render()</function>
|
||||
performs the same task, except it converts a no-op response structure
|
||||
<type>lwres_noopresponse_t</type>
|
||||
to the lightweight resolver's canonical format.
|
||||
<type>lwres_noopresponse_t</type> to the lightweight resolver's
|
||||
canonical format.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_nooprequest_parse()</function>
|
||||
uses context
|
||||
<parameter>ctx</parameter>
|
||||
to convert the contents of packet
|
||||
<parameter>pkt</parameter>
|
||||
to a
|
||||
<type>lwres_nooprequest_t</type>
|
||||
structure.
|
||||
Buffer
|
||||
<parameter>b</parameter>
|
||||
provides space to be used for storing this structure.
|
||||
When the function succeeds, the resulting
|
||||
<type>lwres_nooprequest_t</type>
|
||||
is made available through
|
||||
<function>lwres_nooprequest_parse()</function> uses context
|
||||
<parameter>ctx</parameter> to convert the contents of packet
|
||||
<parameter>pkt</parameter> to a <type>lwres_nooprequest_t</type>
|
||||
structure. Buffer <parameter>b</parameter> provides space to be used
|
||||
for storing this structure. When the function succeeds, the resulting
|
||||
<type>lwres_nooprequest_t</type> is made available through
|
||||
<parameter>*structp</parameter>.
|
||||
|
||||
<function>lwres_noopresponse_parse()</function>
|
||||
offers the same semantics as
|
||||
<function>lwres_nooprequest_parse()</function>
|
||||
except it yields a
|
||||
<type>lwres_noopresponse_t</type>
|
||||
structure.
|
||||
<function>lwres_noopresponse_parse()</function> offers the same
|
||||
semantics as <function>lwres_nooprequest_parse()</function> except it
|
||||
yields a <type>lwres_noopresponse_t</type> structure.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_noopresponse_free()</function>
|
||||
and
|
||||
<function>lwres_nooprequest_free()</function>
|
||||
release the memory in resolver context
|
||||
<parameter>ctx</parameter>
|
||||
that was allocated to the
|
||||
<type>lwres_noopresponse_t</type>
|
||||
or
|
||||
<type>lwres_nooprequest_t</type>
|
||||
structures referenced via
|
||||
<parameter>structp</parameter>.
|
||||
|
||||
<function>lwres_noopresponse_free()</function> and
|
||||
<function>lwres_nooprequest_free()</function> release the memory in
|
||||
resolver context <parameter>ctx</parameter> that was allocated to the
|
||||
<type>lwres_noopresponse_t</type> or <type>lwres_nooprequest_t</type>
|
||||
structures referenced via <parameter>structp</parameter>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>RETURN VALUES</title>
|
||||
|
|
|
|||
|
|
@ -16,17 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_packet.docbook,v 1.4 2001/04/24 18:11:23 gson Exp $ -->
|
||||
<!-- $Id: lwres_packet.docbook,v 1.5 2001/06/18 22:07:01 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
<refentryinfo>
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_packet</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_lwpacket_renderheader</refname>
|
||||
<refname>lwres_lwpacket_parseheader</refname>
|
||||
|
|
@ -75,8 +78,7 @@ struct lwres_lwpacket {
|
|||
};
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The elements of this structure are:
|
||||
<variablelist>
|
||||
|
|
@ -86,7 +88,7 @@ The elements of this structure are:
|
|||
the overall packet length, including the entire packet header.
|
||||
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
|
||||
calls.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>version</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -95,7 +97,7 @@ the header format. There is currently only one format,
|
|||
|
||||
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
|
||||
calls.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>pktflags</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -105,7 +107,7 @@ the caller.
|
|||
This field is filled in by the application wit the exception of the
|
||||
LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the
|
||||
lwres_gabn_*() and lwres_gnba_*() calls.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>serial</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -114,7 +116,7 @@ packets from the same source have the same serial number and are from
|
|||
the same source, they are assumed to be duplicates and the latter ones
|
||||
may be dropped.
|
||||
This field must be set by the application.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>opcode</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -124,7 +126,7 @@ reserved for use by the lightweight resolver library. Opcodes between
|
|||
0x04000000 and 0xffffffff are application defined.
|
||||
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
|
||||
calls.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>result</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -133,7 +135,7 @@ Results between 0x04000000 and 0xffffffff are application defined.
|
|||
Results between 0x00000000 and 0x03ffffff are reserved for library use.
|
||||
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
|
||||
calls.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>recvlength</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -141,7 +143,7 @@ is the maximum buffer size that the receiver can handle on requests
|
|||
and the size of the buffer needed to satisfy a request when the buffer
|
||||
is too large for replies.
|
||||
This field is supplied by the application.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>authtype</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
@ -149,14 +151,13 @@ defines the packet level authentication that is used.
|
|||
Authorisation types between 0x1000 and 0xffff are application defined
|
||||
and types between 0x0000 and 0x0fff are reserved for library use.
|
||||
Currently these are not used and must be zero.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>authlen</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
gives the length of the authentication data.
|
||||
Since packet authentication is currently not used, this must be zero.
|
||||
</para>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
|
|
@ -167,72 +168,57 @@ The following opcodes are currently defined:
|
|||
<para>
|
||||
Success is always returned and the packet contents are echoed.
|
||||
The lwres_noop_*() functions should be used for this type.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>GETADDRSBYNAME</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
returns all known addresses for a given name.
|
||||
The lwres_gabn_*() functions should be used for this type.
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
<varlistentry><term><constant>GETNAMEBYADDR</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
return the hostname for the given address.
|
||||
The lwres_gnba_*() functions should be used for this type.
|
||||
</para>
|
||||
</listitem>
|
||||
</para></listitem></varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_lwpacket_renderheader()</function>
|
||||
transfers the contents of lightweight resolver packet structure
|
||||
<type>lwres_lwpacket_t</type>
|
||||
<parameter>*pkt</parameter>
|
||||
in network byte order to the lightweight resolver buffer,
|
||||
<function>lwres_lwpacket_renderheader()</function> transfers the
|
||||
contents of lightweight resolver packet structure
|
||||
<type>lwres_lwpacket_t</type> <parameter>*pkt</parameter> in network
|
||||
byte order to the lightweight resolver buffer,
|
||||
<parameter>*b</parameter>.
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_lwpacket_parseheader()</function>
|
||||
performs the converse operation.
|
||||
It transfers data in network byte order from buffer
|
||||
<parameter>*b</parameter>
|
||||
to resolver packet
|
||||
<parameter>*pkt</parameter>.
|
||||
|
||||
The contents of the buffer
|
||||
<parameter>b</parameter>
|
||||
should correspond to a
|
||||
<function>lwres_lwpacket_parseheader()</function> performs the
|
||||
converse operation. It transfers data in network byte order from
|
||||
buffer <parameter>*b</parameter> to resolver packet
|
||||
<parameter>*pkt</parameter>. The contents of the buffer
|
||||
<parameter>b</parameter> should correspond to a
|
||||
<type>lwres_lwpacket_t</type>.
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Both functions have assertion checks to ensure that
|
||||
<parameter>b</parameter>
|
||||
and
|
||||
<parameter>pkt</parameter>
|
||||
are not
|
||||
<parameter>b</parameter> and <parameter>pkt</parameter> are not
|
||||
<type>NULL</type>.
|
||||
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>RETURN VALUES</title>
|
||||
<para>
|
||||
Successful calls to
|
||||
<function>lwres_lwpacket_renderheader()</function>
|
||||
and
|
||||
<function>lwres_lwpacket_parseheader()</function>
|
||||
return
|
||||
<errorcode>LWRES_R_SUCCESS</errorcode>.
|
||||
|
||||
If there is insufficient space to copy data between the buffer
|
||||
<parameter>*b</parameter>
|
||||
and lightweight resolver packet
|
||||
<parameter>*pkt</parameter>
|
||||
both functions return
|
||||
<errorcode>LWRES_R_UNEXPECTEDEND</errorcode>.
|
||||
|
||||
<para> Successful calls to
|
||||
<function>lwres_lwpacket_renderheader()</function> and
|
||||
<function>lwres_lwpacket_parseheader()</function> return
|
||||
<errorcode>LWRES_R_SUCCESS</errorcode>. If there is insufficient
|
||||
space to copy data between the buffer <parameter>*b</parameter> and
|
||||
lightweight resolver packet <parameter>*pkt</parameter> both functions
|
||||
return <errorcode>LWRES_R_UNEXPECTEDEND</errorcode>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
|||
|
|
@ -16,19 +16,20 @@
|
|||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_resutil.docbook,v 1.3 2001/04/24 18:11:26 gson Exp $ -->
|
||||
<!-- $Id: lwres_resutil.docbook,v 1.4 2001/06/18 22:07:02 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
|
||||
|
||||
<refentryinfo>
|
||||
<date>Jun 30, 2000</date>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>lwres_resutil</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>BIND9</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>lwres_string_parse</refname>
|
||||
<refname>lwres_addr_parse</refname>
|
||||
|
|
@ -75,55 +76,38 @@ lwres_result_t
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>DESCRIPTION</title>
|
||||
|
||||
<para>
|
||||
<function>lwres_string_parse()</function>
|
||||
retrieves a DNS-encoded string starting the current pointer of
|
||||
lightweight resolver buffer
|
||||
<parameter>b</parameter>:
|
||||
|
||||
i.e.
|
||||
<constant>b->current</constant>.
|
||||
|
||||
<function>lwres_string_parse()</function> retrieves a DNS-encoded
|
||||
string starting the current pointer of lightweight resolver buffer
|
||||
<parameter>b</parameter>: i.e. <constant>b->current</constant>.
|
||||
When the function returns, the address of the first byte of the
|
||||
encoded string is returned via
|
||||
<parameter>*c</parameter>
|
||||
and the length of that string is given by
|
||||
<parameter>*len</parameter>.
|
||||
|
||||
The buffer's current pointer is advanced to point at the character
|
||||
encoded string is returned via <parameter>*c</parameter> and the
|
||||
length of that string is given by <parameter>*len</parameter>. The
|
||||
buffer's current pointer is advanced to point at the character
|
||||
following the string length, the encoded string, and the trailing
|
||||
<type>NULL</type>
|
||||
character.
|
||||
<function>lwres_string_parse()</function>
|
||||
has an assertion check that
|
||||
<parameter>b</parameter>
|
||||
is not
|
||||
<type>NULL</type>.
|
||||
|
||||
<type>NULL</type> character.
|
||||
<function>lwres_string_parse()</function> has an assertion check that
|
||||
<parameter>b</parameter> is not <type>NULL</type>.
|
||||
</para>
|
||||
<para>
|
||||
<function>lwres_addr_parse()</function>
|
||||
extracts an address from the buffer
|
||||
<parameter>b</parameter>.
|
||||
|
||||
It checks that
|
||||
<parameter>addr</parameter>
|
||||
is not null.
|
||||
The buffer's current pointer
|
||||
<constant>b->current</constant>
|
||||
is presumed to point at an encoded address: the address preceded by a
|
||||
32-bit protocol family identifier and a 16-bit length field.
|
||||
The encoded address is copied to
|
||||
<constant>addr->address</constant>
|
||||
and
|
||||
<constant>addr->length</constant>
|
||||
indicates the size in bytes of the address that was copied.
|
||||
<constant>b->current</constant>
|
||||
is advanced to point at the next byte of available data in the buffer
|
||||
<para>
|
||||
<function>lwres_addr_parse()</function> extracts an address from the
|
||||
buffer <parameter>b</parameter>. It checks that
|
||||
<parameter>addr</parameter> is not null. The buffer's current pointer
|
||||
<constant>b->current</constant> is presumed to point at an encoded
|
||||
address: the address preceded by a 32-bit protocol family identifier
|
||||
and a 16-bit length field. The encoded address is copied to
|
||||
<constant>addr->address</constant> and
|
||||
<constant>addr->length</constant> indicates the size in bytes of
|
||||
the address that was copied. <constant>b->current</constant> is
|
||||
advanced to point at the next byte of available data in the buffer
|
||||
following the encoded address.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>lwres_getaddrsbyname()</function>
|
||||
and
|
||||
|
|
@ -153,68 +137,37 @@ they are controlled through the
|
|||
</citerefentry>
|
||||
functions.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The lightweight resolver uses
|
||||
<function>lwres_getaddrsbyname()</function>
|
||||
to perform foward lookups.
|
||||
Hostname
|
||||
<parameter>name</parameter>
|
||||
is looked up using the resolver context
|
||||
<parameter>ctx</parameter>
|
||||
for memory allocation.
|
||||
<parameter>addrtypes</parameter>
|
||||
is a bitmask indicating which type of addresses are to be looked up.
|
||||
Current values for this bitmask are
|
||||
<type>LWRES_ADDRTYPE_V4</type>
|
||||
for IPv4 addresses and
|
||||
<type>LWRES_ADDRTYPE_V6</type>
|
||||
for IPv6 addresses.
|
||||
Results of the lookup are returned in
|
||||
<parameter>*structp</parameter>.
|
||||
|
||||
<function>lwres_getaddrsbyname()</function>
|
||||
checks that its pointer arguments are not
|
||||
<type>NULL</type>
|
||||
and that
|
||||
<parameter>addrtypes</parameter>
|
||||
is non-zero.
|
||||
</para>
|
||||
<para>
|
||||
<function>lwres_getnamebyaddr()</function>
|
||||
performs reverse lookups.
|
||||
Resolver context
|
||||
<parameter>ctx</parameter>
|
||||
is used for memory allocation.
|
||||
The address type is indicated by
|
||||
<parameter>addrtype</parameter>:
|
||||
|
||||
<type>LWRES_ADDRTYPE_V4</type>
|
||||
or
|
||||
<type>LWRES_ADDRTYPE_V6</type>.
|
||||
|
||||
The address to be looked up is given by
|
||||
<parameter>addr</parameter>
|
||||
and its length is
|
||||
<parameter>addrlen</parameter>
|
||||
bytes.
|
||||
The result of the function call is made available through
|
||||
<parameter>*structp</parameter>.
|
||||
|
||||
Like
|
||||
<function>lwres_getaddrsbyname()</function> to perform foward lookups.
|
||||
Hostname <parameter>name</parameter> is looked up using the resolver
|
||||
context <parameter>ctx</parameter> for memory allocation.
|
||||
<parameter>addrtypes</parameter> is a bitmask indicating which type of
|
||||
addresses are to be looked up. Current values for this bitmask are
|
||||
<type>LWRES_ADDRTYPE_V4</type> for IPv4 addresses and
|
||||
<type>LWRES_ADDRTYPE_V6</type> for IPv6 addresses. Results of the
|
||||
lookup are returned in <parameter>*structp</parameter>.
|
||||
<function>lwres_getaddrsbyname()</function> checks that its pointer
|
||||
arguments are not <type>NULL</type> and that
|
||||
<parameter>addrtypes</parameter> is non-zero. </para> <para>
|
||||
<function>lwres_getnamebyaddr()</function> performs reverse lookups.
|
||||
Resolver context <parameter>ctx</parameter> is used for memory
|
||||
allocation. The address type is indicated by
|
||||
<parameter>addrtype</parameter>: <type>LWRES_ADDRTYPE_V4</type> or
|
||||
<type>LWRES_ADDRTYPE_V6</type>. The address to be looked up is given
|
||||
by <parameter>addr</parameter> and its length is
|
||||
<parameter>addrlen</parameter> bytes. The result of the function call
|
||||
is made available through <parameter>*structp</parameter>. Like
|
||||
<function>lwres_getaddrsbyname()</function>,
|
||||
|
||||
<function>lwres_getnamebyaddr()</function>
|
||||
uses assertion checking to ensure its pointer arguments are not
|
||||
<type>NULL</type>
|
||||
and
|
||||
<parameter>addrtype</parameter>
|
||||
is not zero.
|
||||
<function>lwres_getaddrsbyname()</function>
|
||||
also checks that
|
||||
<parameter>addrlen</parameter>
|
||||
is non-zero.
|
||||
<function>lwres_getnamebyaddr()</function> uses assertion checking to
|
||||
ensure its pointer arguments are not <type>NULL</type> and
|
||||
<parameter>addrtype</parameter> is not zero.
|
||||
<function>lwres_getaddrsbyname()</function> also checks that
|
||||
<parameter>addrlen</parameter> is non-zero.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>RETURN VALUES</title>
|
||||
<para>
|
||||
|
|
@ -245,8 +198,8 @@ could not be found.
|
|||
<errorcode>LWRES_R_SUCCESS</errorcode>
|
||||
is returned by a successful call to
|
||||
<function>lwres_getnamebyaddr()</function>.
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Both
|
||||
<function>lwres_getaddrsbyname()</function>
|
||||
|
|
@ -259,6 +212,7 @@ when memory allocation requests fail and
|
|||
if the buffers used for sending queries and receiving replies are too
|
||||
small.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>SEE ALSO</title>
|
||||
|
|
|
|||
Loading…
Reference in a new issue