mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Removed statements to the effect that certain functions
perform assertion checks. Such statements are inappropriate as they document the implementation rather than the public interface. The functions are not required to perform assertion checks, but the caller is required to pass arguments that conform to the API requirements.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_context.docbook,v 1.2 2001/04/10 21:51:25 bwelling Exp $ -->
|
||||
<!-- $Id: lwres_context.docbook,v 1.3 2001/06/18 22:56:16 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
@@ -207,10 +207,6 @@ allocates
|
||||
<parameter>len</parameter>
|
||||
bytes of memory and if successful returns a pointer to the allocated
|
||||
storage.
|
||||
<function>lwres_context_allocmem()</function>
|
||||
checks that
|
||||
<parameter>len</parameter>
|
||||
must be greater than 0.
|
||||
<function>lwres_context_freemem()</function>
|
||||
frees
|
||||
<parameter>len</parameter>
|
||||
|
@@ -171,7 +171,7 @@ is either a decimal port number or a service name as listed in
|
||||
<TT
|
||||
CLASS="FILENAME"
|
||||
>/etc/services</TT
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
><TT
|
||||
CLASS="PARAMETER"
|
||||
@@ -184,7 +184,6 @@ is an optional pointer to a
|
||||
CLASS="TYPE"
|
||||
>struct addrinfo</SPAN
|
||||
>.
|
||||
|
||||
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
|
||||
@@ -420,7 +419,7 @@ and no name resolution should be attempted.</P
|
||||
></DD
|
||||
></DL
|
||||
></DIV
|
||||
> </P
|
||||
></P
|
||||
><P
|
||||
>All other elements of the <SPAN
|
||||
CLASS="TYPE"
|
||||
|
@@ -139,109 +139,58 @@ or NIS. The lightweight resolver does not currently implement
|
||||
these functions; it only provides them as stub functions that always
|
||||
return failure.
|
||||
.PP
|
||||
\fBlwres_gethostbyname()\fR
|
||||
and
|
||||
\fBlwres_gethostbyname2()\fR
|
||||
look up the hostname
|
||||
\fBlwres_gethostbyname()\fR and
|
||||
\fBlwres_gethostbyname2()\fR look up the hostname
|
||||
\fIname\fR.
|
||||
\fBlwres_gethostbyname()\fR
|
||||
always looks for an IPv4 address while
|
||||
\fBlwres_gethostbyname2()\fR
|
||||
looks for an address of protocol family
|
||||
\fIaf\fR:
|
||||
either
|
||||
\fBPF_INET\fR
|
||||
or
|
||||
\fBPF_INET6\fR
|
||||
\(em IPv4 or IPV6 addresses respectively.
|
||||
Successful calls of the functions return a
|
||||
\fBstruct hostent\fRfor
|
||||
the name that was looked up.
|
||||
\fBNULL\fR
|
||||
is returned if the lookups by
|
||||
\fBlwres_gethostbyname()\fR
|
||||
or
|
||||
\fBlwres_gethostbyname2()\fR
|
||||
fail.
|
||||
\fBlwres_gethostbyname()\fR always looks for an IPv4
|
||||
address while \fBlwres_gethostbyname2()\fR looks for an
|
||||
address of protocol family \fIaf\fR: either
|
||||
\fBPF_INET\fR or \fBPF_INET6\fR \(em IPv4 or IPV6
|
||||
addresses respectively. Successful calls of the functions return a
|
||||
\fBstruct hostent\fRfor the name that was looked up.
|
||||
\fBNULL\fR is returned if the lookups by
|
||||
\fBlwres_gethostbyname()\fR or
|
||||
\fBlwres_gethostbyname2()\fR fail.
|
||||
.PP
|
||||
Reverse lookups of addresses are performed by
|
||||
\fBlwres_gethostbyaddr()\fR.
|
||||
\fIaddr\fR
|
||||
is an address of length
|
||||
\fIlen\fR
|
||||
bytes and protocol family
|
||||
\fItype\fR \(em
|
||||
\fBPF_INET\fR
|
||||
or
|
||||
\fIaddr\fR is an address of length
|
||||
\fIlen\fR bytes and protocol family
|
||||
\fItype\fR \(em \fBPF_INET\fR or
|
||||
\fBPF_INET6\fR.
|
||||
\fBlwres_gethostbyname_r()\fR
|
||||
is a thread-safe function for forward lookups.
|
||||
If an error occurs, an error code is returned in
|
||||
\fBlwres_gethostbyname_r()\fR is a thread-safe function
|
||||
for forward lookups. If an error occurs, an error code is returned in
|
||||
\fI*error\fR.
|
||||
\fIresbuf\fR
|
||||
is a pointer to a
|
||||
\fBstruct hostent\fR
|
||||
which is initialised by a successful call to
|
||||
\fIresbuf\fR is a pointer to a \fBstruct
|
||||
hostent\fR which is initialised by a successful call to
|
||||
\fBlwres_gethostbyname_r()\fR .
|
||||
\fIbuf\fR
|
||||
is a buffer of length
|
||||
\fIlen\fR
|
||||
bytes which is used to store the
|
||||
h_name,
|
||||
h_aliases,
|
||||
and
|
||||
h_addr_list
|
||||
elements of the
|
||||
\fBstruct hostent\fR
|
||||
returned in
|
||||
\fIresbuf\fR.
|
||||
Successful calls to
|
||||
\fBlwres_gethostbyname_r()\fR
|
||||
return
|
||||
\fIresbuf\fR,
|
||||
which is a pointer to the
|
||||
\fBstruct hostent\fR
|
||||
it created.
|
||||
\fIbuf\fR is a buffer of length
|
||||
\fIlen\fR bytes which is used to store the
|
||||
h_name, h_aliases, and
|
||||
h_addr_list elements of the \fBstruct
|
||||
hostent\fR returned in \fIresbuf\fR.
|
||||
Successful calls to \fBlwres_gethostbyname_r()\fR
|
||||
return \fIresbuf\fR,
|
||||
which is a pointer to the \fBstruct hostent\fR it created.
|
||||
.PP
|
||||
\fBlwres_gethostbyaddr_r()\fR
|
||||
is a thread-safe function that performs a reverse lookup of address
|
||||
\fIaddr\fR
|
||||
which is
|
||||
\fIlen\fR
|
||||
bytes long
|
||||
and is of protocol family
|
||||
\fItype\fR \(em
|
||||
\fBPF_INET\fR
|
||||
or
|
||||
\fBPF_INET6\fR.
|
||||
If an error occurs, the error code is returned in
|
||||
\fI*error\fR.
|
||||
The other function parameters are identical to those in
|
||||
\fBlwres_gethostbyname_r()\fR.
|
||||
\fIresbuf\fR
|
||||
is a pointer to a
|
||||
\fBstruct hostent\fR
|
||||
which is initialised by a successful call to
|
||||
\fBlwres_gethostbyaddr_r()\fR is a thread-safe function
|
||||
that performs a reverse lookup of address \fIaddr\fR
|
||||
which is \fIlen\fR bytes long and is of protocol
|
||||
family \fItype\fR \(em \fBPF_INET\fR or
|
||||
\fBPF_INET6\fR. If an error occurs, the error code is returned
|
||||
in \fI*error\fR. The other function parameters are
|
||||
identical to those in \fBlwres_gethostbyname_r()\fR.
|
||||
\fIresbuf\fR is a pointer to a \fBstruct
|
||||
hostent\fR which is initialised by a successful call to
|
||||
\fBlwres_gethostbyaddr_r()\fR.
|
||||
\fIbuf\fR
|
||||
is a buffer of length
|
||||
\fIlen\fR
|
||||
bytes which is used to store the
|
||||
h_name,
|
||||
h_aliases,
|
||||
and
|
||||
h_addr_list
|
||||
elements of the
|
||||
\fBstruct hostent\fR
|
||||
returned in
|
||||
\fIresbuf\fR.
|
||||
Successful calls to
|
||||
\fBlwres_gethostbyaddr_r()\fR
|
||||
return
|
||||
\fIresbuf\fR,
|
||||
which is a pointer to the
|
||||
\fBstruct hostent()\fR
|
||||
it created.
|
||||
\fIbuf\fR is a buffer of length
|
||||
\fIlen\fR bytes which is used to store the
|
||||
h_name, h_aliases, and
|
||||
h_addr_list elements of the \fBstruct
|
||||
hostent\fR returned in \fIresbuf\fR. Successful
|
||||
calls to \fBlwres_gethostbyaddr_r()\fR return
|
||||
\fIresbuf\fR, which is a pointer to the
|
||||
\fBstruct hostent()\fR it created.
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
The functions
|
||||
@@ -281,38 +230,18 @@ and
|
||||
always return
|
||||
\fBNULL\fR.
|
||||
.PP
|
||||
Successful calls to
|
||||
\fBlwres_gethostbyname_r()\fR
|
||||
and
|
||||
\fBlwres_gethostbyaddr_r()\fR
|
||||
return
|
||||
\fIresbuf\fR,
|
||||
a pointer to the
|
||||
\fBstruct hostent\fR
|
||||
that was initialised by these functions.
|
||||
They return
|
||||
\fBNULL\fR
|
||||
if the lookups fail
|
||||
or if
|
||||
\fIbuf\fR
|
||||
Successful calls to \fBlwres_gethostbyname_r()\fR and
|
||||
\fBlwres_gethostbyaddr_r()\fR return
|
||||
\fIresbuf\fR, a pointer to the \fBstruct
|
||||
hostent\fR that was initialised by these functions. They return
|
||||
\fBNULL\fR if the lookups fail or if \fIbuf\fR
|
||||
was too small to hold the list of addresses and names referenced by
|
||||
the
|
||||
h_name,
|
||||
h_aliases,
|
||||
and
|
||||
h_addr_list
|
||||
elements of the
|
||||
\fBstruct hostent\fR.
|
||||
If
|
||||
\fIbuf\fR
|
||||
was too small, both
|
||||
\fBlwres_gethostbyname_r()\fR
|
||||
and
|
||||
\fBlwres_gethostbyaddr_r()\fR
|
||||
set the global variable
|
||||
\fBerrno\fR
|
||||
to
|
||||
ERANGE.
|
||||
the h_name, h_aliases, and
|
||||
h_addr_list elements of the \fBstruct
|
||||
hostent\fR. If \fIbuf\fR was too small, both
|
||||
\fBlwres_gethostbyname_r()\fR and
|
||||
\fBlwres_gethostbyaddr_r()\fR set the global variable
|
||||
\fBerrno\fR to ERANGE.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBgethostent\fR(3),
|
||||
|
@@ -311,70 +311,55 @@ return failure.</P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname()</TT
|
||||
>
|
||||
and
|
||||
> and
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname2()</TT
|
||||
>
|
||||
look up the hostname
|
||||
> look up the hostname
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>name</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname()</TT
|
||||
>
|
||||
always looks for an IPv4 address while
|
||||
<TT
|
||||
> always looks for an IPv4
|
||||
address while <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname2()</TT
|
||||
>
|
||||
looks for an address of protocol family
|
||||
<TT
|
||||
> looks for an
|
||||
address of protocol family <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>af</I
|
||||
></TT
|
||||
>:
|
||||
|
||||
either
|
||||
>: either
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>PF_INET</SPAN
|
||||
>
|
||||
or
|
||||
<SPAN
|
||||
> or <SPAN
|
||||
CLASS="TYPE"
|
||||
>PF_INET6</SPAN
|
||||
>
|
||||
— IPv4 or IPV6 addresses respectively.
|
||||
Successful calls of the functions return a
|
||||
> — IPv4 or IPV6
|
||||
addresses respectively. Successful calls of the functions return a
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>for
|
||||
|
||||
the name that was looked up.
|
||||
>for the name that was looked up.
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>
|
||||
is returned if the lookups by
|
||||
> is returned if the lookups by
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname()</TT
|
||||
>
|
||||
or
|
||||
> or
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname2()</TT
|
||||
>
|
||||
fail.</P
|
||||
> fail.</P
|
||||
><P
|
||||
>Reverse lookups of addresses are performed by
|
||||
<TT
|
||||
@@ -386,56 +371,47 @@ CLASS="PARAMETER"
|
||||
><I
|
||||
>addr</I
|
||||
></TT
|
||||
>
|
||||
is an address of length
|
||||
> is an address of length
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>len</I
|
||||
></TT
|
||||
>
|
||||
bytes and protocol family
|
||||
> bytes and protocol family
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>type</I
|
||||
></TT
|
||||
> —
|
||||
<SPAN
|
||||
> — <SPAN
|
||||
CLASS="TYPE"
|
||||
>PF_INET</SPAN
|
||||
>
|
||||
or
|
||||
> or
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>PF_INET6</SPAN
|
||||
>.
|
||||
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname_r()</TT
|
||||
>
|
||||
is a thread-safe function for forward lookups.
|
||||
If an error occurs, an error code is returned in
|
||||
> is a thread-safe function
|
||||
for forward lookups. If an error occurs, an error code is returned in
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*error</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>resbuf</I
|
||||
></TT
|
||||
>
|
||||
is a pointer to a
|
||||
<SPAN
|
||||
> is a pointer to a <SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>
|
||||
which is initialised by a successful call to
|
||||
>struct
|
||||
hostent</SPAN
|
||||
> which is initialised by a successful call to
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname_r()</TT
|
||||
@@ -445,110 +421,84 @@ CLASS="PARAMETER"
|
||||
><I
|
||||
>buf</I
|
||||
></TT
|
||||
>
|
||||
is a buffer of length
|
||||
> is a buffer of length
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>len</I
|
||||
></TT
|
||||
>
|
||||
bytes which is used to store the
|
||||
> bytes which is used to store the
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>h_name</TT
|
||||
>,
|
||||
|
||||
<TT
|
||||
>, <TT
|
||||
CLASS="CONSTANT"
|
||||
>h_aliases</TT
|
||||
>,
|
||||
|
||||
and
|
||||
>, and
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>h_addr_list</TT
|
||||
>
|
||||
elements of the
|
||||
<SPAN
|
||||
> elements of the <SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>
|
||||
returned in
|
||||
<TT
|
||||
>struct
|
||||
hostent</SPAN
|
||||
> returned in <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>resbuf</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
Successful calls to
|
||||
<TT
|
||||
Successful calls to <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname_r()</TT
|
||||
>
|
||||
return
|
||||
<TT
|
||||
return <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>resbuf</I
|
||||
></TT
|
||||
>,
|
||||
|
||||
which is a pointer to the
|
||||
<SPAN
|
||||
which is a pointer to the <SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>
|
||||
it created.</P
|
||||
> it created.</P
|
||||
><P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyaddr_r()</TT
|
||||
>
|
||||
is a thread-safe function that performs a reverse lookup of address
|
||||
<TT
|
||||
> is a thread-safe function
|
||||
that performs a reverse lookup of address <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addr</I
|
||||
></TT
|
||||
>
|
||||
which is
|
||||
<TT
|
||||
which is <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>len</I
|
||||
></TT
|
||||
>
|
||||
bytes long
|
||||
and is of protocol family
|
||||
<TT
|
||||
> bytes long and is of protocol
|
||||
family <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>type</I
|
||||
></TT
|
||||
> —
|
||||
|
||||
<SPAN
|
||||
> — <SPAN
|
||||
CLASS="TYPE"
|
||||
>PF_INET</SPAN
|
||||
>
|
||||
or
|
||||
> or
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>PF_INET6</SPAN
|
||||
>.
|
||||
|
||||
If an error occurs, the error code is returned in
|
||||
<TT
|
||||
>. If an error occurs, the error code is returned
|
||||
in <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*error</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
The other function parameters are identical to those in
|
||||
<TT
|
||||
>. The other function parameters are
|
||||
identical to those in <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname_r()</TT
|
||||
>.
|
||||
@@ -557,13 +507,11 @@ CLASS="PARAMETER"
|
||||
><I
|
||||
>resbuf</I
|
||||
></TT
|
||||
>
|
||||
is a pointer to a
|
||||
<SPAN
|
||||
> is a pointer to a <SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>
|
||||
which is initialised by a successful call to
|
||||
>struct
|
||||
hostent</SPAN
|
||||
> which is initialised by a successful call to
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyaddr_r()</TT
|
||||
@@ -573,62 +521,47 @@ CLASS="PARAMETER"
|
||||
><I
|
||||
>buf</I
|
||||
></TT
|
||||
>
|
||||
is a buffer of length
|
||||
> is a buffer of length
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>len</I
|
||||
></TT
|
||||
>
|
||||
bytes which is used to store the
|
||||
> bytes which is used to store the
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>h_name</TT
|
||||
>,
|
||||
|
||||
<TT
|
||||
>, <TT
|
||||
CLASS="CONSTANT"
|
||||
>h_aliases</TT
|
||||
>,
|
||||
|
||||
and
|
||||
>, and
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>h_addr_list</TT
|
||||
>
|
||||
elements of the
|
||||
<SPAN
|
||||
> elements of the <SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>
|
||||
returned in
|
||||
<TT
|
||||
>struct
|
||||
hostent</SPAN
|
||||
> returned in <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>resbuf</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
Successful calls to
|
||||
<TT
|
||||
>. Successful
|
||||
calls to <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyaddr_r()</TT
|
||||
>
|
||||
return
|
||||
> return
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>resbuf</I
|
||||
></TT
|
||||
>,
|
||||
|
||||
which is a pointer to the
|
||||
>, which is a pointer to the
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>struct hostent()</TT
|
||||
>
|
||||
it created.</P
|
||||
> it created.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
@@ -739,95 +672,71 @@ always return
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
>Successful calls to
|
||||
<TT
|
||||
>Successful calls to <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname_r()</TT
|
||||
>
|
||||
and
|
||||
> and
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyaddr_r()</TT
|
||||
>
|
||||
return
|
||||
> return
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>resbuf</I
|
||||
></TT
|
||||
>,
|
||||
|
||||
a pointer to the
|
||||
<SPAN
|
||||
>, a pointer to the <SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>
|
||||
that was initialised by these functions.
|
||||
They return
|
||||
>struct
|
||||
hostent</SPAN
|
||||
> that was initialised by these functions. They return
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>
|
||||
if the lookups fail
|
||||
or if
|
||||
<TT
|
||||
> if the lookups fail or if <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>buf</I
|
||||
></TT
|
||||
>
|
||||
was too small to hold the list of addresses and names referenced by
|
||||
the
|
||||
<TT
|
||||
the <TT
|
||||
CLASS="CONSTANT"
|
||||
>h_name</TT
|
||||
>,
|
||||
|
||||
<TT
|
||||
>, <TT
|
||||
CLASS="CONSTANT"
|
||||
>h_aliases</TT
|
||||
>,
|
||||
|
||||
and
|
||||
>, and
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>h_addr_list</TT
|
||||
>
|
||||
elements of the
|
||||
<SPAN
|
||||
> elements of the <SPAN
|
||||
CLASS="TYPE"
|
||||
>struct hostent</SPAN
|
||||
>.
|
||||
|
||||
If
|
||||
<TT
|
||||
>struct
|
||||
hostent</SPAN
|
||||
>. If <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>buf</I
|
||||
></TT
|
||||
>
|
||||
was too small, both
|
||||
> was too small, both
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyname_r()</TT
|
||||
>
|
||||
and
|
||||
> and
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_gethostbyaddr_r()</TT
|
||||
>
|
||||
set the global variable
|
||||
> set the global variable
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>errno</SPAN
|
||||
>
|
||||
to
|
||||
<SPAN
|
||||
> to <SPAN
|
||||
CLASS="ERRORCODE"
|
||||
>ERANGE</SPAN
|
||||
>. </P
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
|
@@ -109,7 +109,6 @@ which is defined in
|
||||
CLASS="FILENAME"
|
||||
>namedb.h</TT
|
||||
>:
|
||||
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>struct hostent {
|
||||
|
@@ -26,37 +26,21 @@ lwres_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t ho
|
||||
.ad
|
||||
\fR.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function is equivalent to the
|
||||
\fBgetnameinfo\fR(3)
|
||||
function defined in RFC2133.
|
||||
\fBlwres_getnameinfo()\fR
|
||||
returns the hostname for the
|
||||
\fBstruct sockaddr\fR
|
||||
\fIsa\fR
|
||||
which is
|
||||
\fIsalen\fR
|
||||
bytes long.
|
||||
The hostname is of length
|
||||
\fIhostlen\fR
|
||||
and is returned via
|
||||
\fI*host.\fR
|
||||
The maximum length of the hostname is
|
||||
1025 bytes:
|
||||
NI_MAXHOST.
|
||||
This function is equivalent to the \fBgetnameinfo\fR(3) function defined in RFC2133.
|
||||
\fBlwres_getnameinfo()\fR returns the hostname for the
|
||||
\fBstruct sockaddr\fR \fIsa\fR which is
|
||||
\fIsalen\fR bytes long. The hostname is of length
|
||||
\fIhostlen\fR and is returned via
|
||||
\fI*host.\fR The maximum length of the hostname is
|
||||
1025 bytes: NI_MAXHOST.
|
||||
.PP
|
||||
The name of the service associated with the port number in
|
||||
\fIsa\fR
|
||||
is returned in
|
||||
\fI*serv.\fR
|
||||
It is
|
||||
\fIservlen\fR
|
||||
bytes long.
|
||||
The maximum length of the service name is
|
||||
NI_MAXSERV - 32 bytes.
|
||||
\fIsa\fR is returned in \fI*serv.\fR
|
||||
It is \fIservlen\fR bytes long. The maximum length
|
||||
of the service name is NI_MAXSERV - 32 bytes.
|
||||
.PP
|
||||
The
|
||||
\fIflags\fR
|
||||
argument sets the following bits:
|
||||
The \fIflags\fR argument sets the following
|
||||
bits:
|
||||
.TP
|
||||
\fBNI_NOFQDN\fR
|
||||
A fully qualified domain name is not required for local hosts.
|
||||
@@ -81,7 +65,6 @@ 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.
|
||||
.PP
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
\fBlwres_getnameinfo()\fR
|
||||
|
@@ -79,95 +79,79 @@ NAME="AEN24"
|
||||
><H2
|
||||
>DESCRIPTION</H2
|
||||
><P
|
||||
>This function is equivalent to the
|
||||
<SPAN
|
||||
> This function is equivalent to the <SPAN
|
||||
CLASS="CITEREFENTRY"
|
||||
><SPAN
|
||||
CLASS="REFENTRYTITLE"
|
||||
>getnameinfo</SPAN
|
||||
>(3)</SPAN
|
||||
>
|
||||
function defined in RFC2133.
|
||||
> function defined in RFC2133.
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getnameinfo()</TT
|
||||
>
|
||||
returns the hostname for the
|
||||
> returns the hostname for the
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>struct sockaddr</SPAN
|
||||
>
|
||||
<TT
|
||||
> <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>sa</I
|
||||
></TT
|
||||
>
|
||||
which is
|
||||
> which is
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>salen</I
|
||||
></TT
|
||||
>
|
||||
bytes long.
|
||||
The hostname is of length
|
||||
> bytes long. The hostname is of length
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>hostlen</I
|
||||
></TT
|
||||
>
|
||||
and is returned via
|
||||
> and is returned via
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*host.</I
|
||||
></TT
|
||||
>
|
||||
The maximum length of the hostname is
|
||||
1025 bytes:
|
||||
<TT
|
||||
> The maximum length of the hostname is
|
||||
1025 bytes: <TT
|
||||
CLASS="CONSTANT"
|
||||
>NI_MAXHOST</TT
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
>The name of the service associated with the port number in
|
||||
> The name of the service associated with the port number in
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>sa</I
|
||||
></TT
|
||||
>
|
||||
is returned in
|
||||
<TT
|
||||
> is returned in <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*serv.</I
|
||||
></TT
|
||||
>
|
||||
It is
|
||||
<TT
|
||||
It is <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>servlen</I
|
||||
></TT
|
||||
>
|
||||
bytes long.
|
||||
The maximum length of the service name is
|
||||
<TT
|
||||
> bytes long. The maximum length
|
||||
of the service name is <TT
|
||||
CLASS="CONSTANT"
|
||||
>NI_MAXSERV</TT
|
||||
> - 32 bytes.</P
|
||||
><P
|
||||
>The
|
||||
<TT
|
||||
> The <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>flags</I
|
||||
></TT
|
||||
>
|
||||
argument sets the following bits:
|
||||
> argument sets the following
|
||||
bits:
|
||||
<P
|
||||
></P
|
||||
><DIV
|
||||
@@ -230,13 +214,11 @@ TCP.</P
|
||||
></DL
|
||||
></DIV
|
||||
></P
|
||||
><P
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN71"
|
||||
NAME="AEN70"
|
||||
></A
|
||||
><H2
|
||||
>RETURN VALUES</H2
|
||||
@@ -250,7 +232,7 @@ returns 0 on success or a non-zero error code if an error occurs.</P
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN75"
|
||||
NAME="AEN74"
|
||||
></A
|
||||
><H2
|
||||
>SEE ALSO</H2
|
||||
@@ -301,7 +283,7 @@ CLASS="REFENTRYTITLE"
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN95"
|
||||
NAME="AEN94"
|
||||
></A
|
||||
><H2
|
||||
>BUGS</H2
|
||||
|
@@ -31,20 +31,14 @@ lwres_hstrerror(int err);
|
||||
.ad
|
||||
\fR.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBlwres_herror()\fR
|
||||
prints the string
|
||||
\fIs\fR
|
||||
on
|
||||
\fBstderr\fR
|
||||
followed by the string generated by
|
||||
\fBlwres_hstrerror()\fR
|
||||
for the error code stored in the global variable
|
||||
lwres_h_errno.
|
||||
\fBlwres_herror()\fR prints the string
|
||||
\fIs\fR on \fBstderr\fR followed by the string
|
||||
generated by \fBlwres_hstrerror()\fR for the error code
|
||||
stored in the global variable lwres_h_errno.
|
||||
.PP
|
||||
\fBlwres_hstrerror()\fR
|
||||
returns an appropriate string for the error code gievn by
|
||||
\fIerr\fR.
|
||||
The values of the error codes and messages are as follows:
|
||||
\fBlwres_hstrerror()\fR returns an appropriate string
|
||||
for the error code gievn by \fIerr\fR. The values of
|
||||
the error codes and messages are as follows:
|
||||
.TP
|
||||
\fBNETDB_SUCCESS\fR
|
||||
\fBResolver Error 0 (no error)\fR
|
||||
|
@@ -90,43 +90,37 @@ NAME="AEN23"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_herror()</TT
|
||||
>
|
||||
prints the string
|
||||
> prints the string
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>s</I
|
||||
></TT
|
||||
>
|
||||
on
|
||||
<SPAN
|
||||
> on <SPAN
|
||||
CLASS="TYPE"
|
||||
>stderr</SPAN
|
||||
>
|
||||
followed by the string generated by
|
||||
<TT
|
||||
> followed by the string
|
||||
generated by <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_hstrerror()</TT
|
||||
>
|
||||
for the error code stored in the global variable
|
||||
<TT
|
||||
> for the error code
|
||||
stored in the global variable <TT
|
||||
CLASS="CONSTANT"
|
||||
>lwres_h_errno</TT
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_hstrerror()</TT
|
||||
>
|
||||
returns an appropriate string for the error code gievn by
|
||||
<TT
|
||||
> returns an appropriate string
|
||||
for the error code gievn by <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>err</I
|
||||
></TT
|
||||
>.
|
||||
>. The values of
|
||||
the error codes and messages are as follows:
|
||||
|
||||
The values of the error codes and messages are as follows:
|
||||
<P
|
||||
></P
|
||||
><DIV
|
||||
|
@@ -26,39 +26,25 @@ lwres_net_ntop(int af, const void *src, char *dst, size_t size);
|
||||
.ad
|
||||
\fR.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBlwres_net_ntop()\fR
|
||||
converts an IP address of protocol family
|
||||
\fIaf\fR
|
||||
\(em IPv4 or IPv6 \(em
|
||||
at location
|
||||
\fIsrc\fR
|
||||
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.
|
||||
\fBlwres_net_ntop()\fR converts an IP address of
|
||||
protocol family \fIaf\fR \(em IPv4 or IPv6 \(em
|
||||
at location \fIsrc\fR 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.
|
||||
.PP
|
||||
The generated string is copied to
|
||||
\fIdst\fR
|
||||
provided
|
||||
\fIsize\fR
|
||||
indicates it is long enough to store the ASCII representation
|
||||
of the address.
|
||||
The generated string is copied to \fIdst\fR provided
|
||||
\fIsize\fR indicates it is long enough to store the
|
||||
ASCII representation of the address.
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
If successful, the function returns
|
||||
\fIdst\fR:
|
||||
a pointer to a string containing
|
||||
the presentation format of the address.
|
||||
\fBlwres_net_ntop()\fR
|
||||
returns
|
||||
\fBNULL\fR
|
||||
and sets the global variable
|
||||
errno
|
||||
to
|
||||
EAFNOSUPPORT
|
||||
if the protocol family given in
|
||||
\fIaf\fR
|
||||
is not supported.
|
||||
If successful, the function returns \fIdst\fR:
|
||||
a pointer to a string containing the presentation format of the
|
||||
address. \fBlwres_net_ntop()\fR returns
|
||||
\fBNULL\fR and sets the global variable
|
||||
errno to EAFNOSUPPORT if
|
||||
the protocol family given in \fIaf\fR is not
|
||||
supported.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBRFC1884\fR,
|
||||
|
@@ -82,43 +82,36 @@ NAME="AEN21"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_net_ntop()</TT
|
||||
>
|
||||
converts an IP address of protocol family
|
||||
<TT
|
||||
> converts an IP address of
|
||||
protocol family <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>af</I
|
||||
></TT
|
||||
>
|
||||
— IPv4 or IPv6 —
|
||||
at location
|
||||
<TT
|
||||
> — IPv4 or IPv6 —
|
||||
at location <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>src</I
|
||||
></TT
|
||||
>
|
||||
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.</P
|
||||
> 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.</P
|
||||
><P
|
||||
>The generated string is copied to
|
||||
<TT
|
||||
>The generated string is copied to <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>dst</I
|
||||
></TT
|
||||
>
|
||||
provided
|
||||
> provided
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>size</I
|
||||
></TT
|
||||
>
|
||||
indicates it is long enough to store the ASCII representation
|
||||
of the address.</P
|
||||
> indicates it is long enough to store the
|
||||
ASCII representation of the address.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
@@ -128,43 +121,35 @@ NAME="AEN30"
|
||||
><H2
|
||||
>RETURN VALUES</H2
|
||||
><P
|
||||
>If successful, the function returns
|
||||
<TT
|
||||
>If successful, the function returns <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>dst</I
|
||||
></TT
|
||||
>:
|
||||
|
||||
a pointer to a string containing
|
||||
the presentation format of the address.
|
||||
<TT
|
||||
a pointer to a string containing the presentation format of the
|
||||
address. <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_net_ntop()</TT
|
||||
>
|
||||
returns
|
||||
> returns
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>
|
||||
and sets the global variable
|
||||
> and sets the global variable
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>errno</TT
|
||||
>
|
||||
to
|
||||
<SPAN
|
||||
> to <SPAN
|
||||
CLASS="ERRORCODE"
|
||||
>EAFNOSUPPORT</SPAN
|
||||
>
|
||||
if the protocol family given in
|
||||
<TT
|
||||
> if
|
||||
the protocol family given in <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>af</I
|
||||
></TT
|
||||
>
|
||||
is not supported.</P
|
||||
> is not
|
||||
supported.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
|
@@ -93,58 +93,33 @@ 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.
|
||||
.PP
|
||||
\fBlwres_nooprequest_render()\fR
|
||||
uses resolver context
|
||||
\fIctx\fR
|
||||
to convert no-op request structure
|
||||
\fIreq\fR
|
||||
to canonical format.
|
||||
The packet header structure
|
||||
\fIpkt\fR
|
||||
is initialised and transferred to
|
||||
buffer
|
||||
\fIb\fR.
|
||||
The contents of
|
||||
\fI*req\fR
|
||||
are then appended to the buffer in canonical format.
|
||||
\fBlwres_noopresponse_render()\fR
|
||||
\fBlwres_nooprequest_render()\fR uses resolver
|
||||
context \fIctx\fR to convert no-op request structure
|
||||
\fIreq\fR to canonical format. The packet header
|
||||
structure \fIpkt\fR is initialised and transferred to
|
||||
buffer \fIb\fR. The contents of
|
||||
\fI*req\fR are then appended to the buffer in
|
||||
canonical format. \fBlwres_noopresponse_render()\fR
|
||||
performs the same task, except it converts a no-op response structure
|
||||
\fBlwres_noopresponse_t\fR
|
||||
to the lightweight resolver's canonical format.
|
||||
\fBlwres_noopresponse_t\fR to the lightweight resolver's
|
||||
canonical format.
|
||||
.PP
|
||||
\fBlwres_nooprequest_parse()\fR
|
||||
uses context
|
||||
\fIctx\fR
|
||||
to convert the contents of packet
|
||||
\fIpkt\fR
|
||||
to a
|
||||
\fBlwres_nooprequest_t\fR
|
||||
structure.
|
||||
Buffer
|
||||
\fIb\fR
|
||||
provides space to be used for storing this structure.
|
||||
When the function succeeds, the resulting
|
||||
\fBlwres_nooprequest_t\fR
|
||||
is made available through
|
||||
\fBlwres_nooprequest_parse()\fR uses context
|
||||
\fIctx\fR to convert the contents of packet
|
||||
\fIpkt\fR to a \fBlwres_nooprequest_t\fR
|
||||
structure. Buffer \fIb\fR provides space to be used
|
||||
for storing this structure. When the function succeeds, the resulting
|
||||
\fBlwres_nooprequest_t\fR is made available through
|
||||
\fI*structp\fR.
|
||||
\fBlwres_noopresponse_parse()\fR
|
||||
offers the same semantics as
|
||||
\fBlwres_nooprequest_parse()\fR
|
||||
except it yields a
|
||||
\fBlwres_noopresponse_t\fR
|
||||
structure.
|
||||
\fBlwres_noopresponse_parse()\fR offers the same
|
||||
semantics as \fBlwres_nooprequest_parse()\fR except it
|
||||
yields a \fBlwres_noopresponse_t\fR structure.
|
||||
.PP
|
||||
\fBlwres_noopresponse_free()\fR
|
||||
and
|
||||
\fBlwres_nooprequest_free()\fR
|
||||
release the memory in resolver context
|
||||
\fIctx\fR
|
||||
that was allocated to the
|
||||
\fBlwres_noopresponse_t\fR
|
||||
or
|
||||
\fBlwres_nooprequest_t\fR
|
||||
structures referenced via
|
||||
\fIstructp\fR.
|
||||
\fBlwres_noopresponse_free()\fR and
|
||||
\fBlwres_nooprequest_free()\fR release the memory in
|
||||
resolver context \fIctx\fR that was allocated to the
|
||||
\fBlwres_noopresponse_t\fR or \fBlwres_nooprequest_t\fR
|
||||
structures referenced via \fIstructp\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
The no-op opcode functions
|
||||
|
@@ -176,47 +176,38 @@ the response is therefore identical to the request.</P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_nooprequest_render()</TT
|
||||
>
|
||||
uses resolver context
|
||||
<TT
|
||||
> uses resolver
|
||||
context <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>ctx</I
|
||||
></TT
|
||||
>
|
||||
to convert no-op request structure
|
||||
> to convert no-op request structure
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>req</I
|
||||
></TT
|
||||
>
|
||||
to canonical format.
|
||||
The packet header structure
|
||||
<TT
|
||||
> to canonical format. The packet header
|
||||
structure <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>pkt</I
|
||||
></TT
|
||||
>
|
||||
is initialised and transferred to
|
||||
buffer
|
||||
<TT
|
||||
> is initialised and transferred to
|
||||
buffer <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>b</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
The contents of
|
||||
>. The contents of
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*req</I
|
||||
></TT
|
||||
>
|
||||
are then appended to the buffer in canonical format.
|
||||
<TT
|
||||
> are then appended to the buffer in
|
||||
canonical format. <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_noopresponse_render()</TT
|
||||
>
|
||||
@@ -224,103 +215,85 @@ performs the same task, except it converts a no-op response structure
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_noopresponse_t</SPAN
|
||||
>
|
||||
to the lightweight resolver's canonical format.</P
|
||||
> to the lightweight resolver's
|
||||
canonical format.</P
|
||||
><P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_nooprequest_parse()</TT
|
||||
>
|
||||
uses context
|
||||
> uses context
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>ctx</I
|
||||
></TT
|
||||
>
|
||||
to convert the contents of packet
|
||||
> to convert the contents of packet
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>pkt</I
|
||||
></TT
|
||||
>
|
||||
to a
|
||||
<SPAN
|
||||
> to a <SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_nooprequest_t</SPAN
|
||||
>
|
||||
structure.
|
||||
Buffer
|
||||
<TT
|
||||
structure. Buffer <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>b</I
|
||||
></TT
|
||||
>
|
||||
provides space to be used for storing this structure.
|
||||
When the function succeeds, the resulting
|
||||
> provides space to be used
|
||||
for storing this structure. When the function succeeds, the resulting
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_nooprequest_t</SPAN
|
||||
>
|
||||
is made available through
|
||||
> is made available through
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*structp</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_noopresponse_parse()</TT
|
||||
>
|
||||
offers the same semantics as
|
||||
<TT
|
||||
> offers the same
|
||||
semantics as <TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_nooprequest_parse()</TT
|
||||
>
|
||||
except it yields a
|
||||
<SPAN
|
||||
> except it
|
||||
yields a <SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_noopresponse_t</SPAN
|
||||
>
|
||||
structure.</P
|
||||
> structure.</P
|
||||
><P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_noopresponse_free()</TT
|
||||
>
|
||||
and
|
||||
> and
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_nooprequest_free()</TT
|
||||
>
|
||||
release the memory in resolver context
|
||||
<TT
|
||||
> release the memory in
|
||||
resolver context <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>ctx</I
|
||||
></TT
|
||||
>
|
||||
that was allocated to the
|
||||
> that was allocated to the
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_noopresponse_t</SPAN
|
||||
>
|
||||
or
|
||||
<SPAN
|
||||
> or <SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_nooprequest_t</SPAN
|
||||
>
|
||||
structures referenced via
|
||||
<TT
|
||||
structures referenced via <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>structp</I
|
||||
></TT
|
||||
>. </P
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
|
@@ -53,7 +53,6 @@ struct lwres_lwpacket {
|
||||
.sp
|
||||
.fi
|
||||
.PP
|
||||
.PP
|
||||
The elements of this structure are:
|
||||
.TP
|
||||
\fBlength\fR
|
||||
@@ -127,41 +126,28 @@ The lwres_gabn_*() functions should be used for this type.
|
||||
return the hostname for the given address.
|
||||
The lwres_gnba_*() functions should be used for this type.
|
||||
.PP
|
||||
\fBlwres_lwpacket_renderheader()\fR
|
||||
transfers the contents of lightweight resolver packet structure
|
||||
\fBlwres_lwpacket_t\fR
|
||||
\fI*pkt\fR
|
||||
in network byte order to the lightweight resolver buffer,
|
||||
\fBlwres_lwpacket_renderheader()\fR transfers the
|
||||
contents of lightweight resolver packet structure
|
||||
\fBlwres_lwpacket_t\fR \fI*pkt\fR in network
|
||||
byte order to the lightweight resolver buffer,
|
||||
\fI*b\fR.
|
||||
.PP
|
||||
\fBlwres_lwpacket_parseheader()\fR
|
||||
performs the converse operation.
|
||||
It transfers data in network byte order from buffer
|
||||
\fI*b\fR
|
||||
to resolver packet
|
||||
\fI*pkt\fR.
|
||||
The contents of the buffer
|
||||
\fIb\fR
|
||||
should correspond to a
|
||||
\fBlwres_lwpacket_parseheader()\fR performs the
|
||||
converse operation. It transfers data in network byte order from
|
||||
buffer \fI*b\fR to resolver packet
|
||||
\fI*pkt\fR. The contents of the buffer
|
||||
\fIb\fR should correspond to a
|
||||
\fBlwres_lwpacket_t\fR.
|
||||
.PP
|
||||
Both functions have assertion checks to ensure that
|
||||
\fIb\fR
|
||||
and
|
||||
\fIpkt\fR
|
||||
are not
|
||||
\fIb\fR and \fIpkt\fR are not
|
||||
\fBNULL\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
Successful calls to
|
||||
\fBlwres_lwpacket_renderheader()\fR
|
||||
and
|
||||
\fBlwres_lwpacket_parseheader()\fR
|
||||
return
|
||||
LWRES_R_SUCCESS.
|
||||
If there is insufficient space to copy data between the buffer
|
||||
\fI*b\fR
|
||||
and lightweight resolver packet
|
||||
\fI*pkt\fR
|
||||
both functions return
|
||||
LWRES_R_UNEXPECTEDEND.
|
||||
\fBlwres_lwpacket_renderheader()\fR and
|
||||
\fBlwres_lwpacket_parseheader()\fR return
|
||||
LWRES_R_SUCCESS. If there is insufficient
|
||||
space to copy data between the buffer \fI*b\fR and
|
||||
lightweight resolver packet \fI*pkt\fR both functions
|
||||
return LWRES_R_UNEXPECTEDEND.
|
||||
|
@@ -16,7 +16,7 @@
|
||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_packet.docbook,v 1.5 2001/06/18 22:07:01 gson Exp $ -->
|
||||
<!-- $Id: lwres_packet.docbook,v 1.6 2001/06/18 22:56:30 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
@@ -201,12 +201,6 @@ buffer <parameter>*b</parameter> to resolver packet
|
||||
<type>lwres_lwpacket_t</type>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Both functions have assertion checks to ensure that
|
||||
<parameter>b</parameter> and <parameter>pkt</parameter> are not
|
||||
<type>NULL</type>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
|
@@ -115,8 +115,6 @@ struct lwres_lwpacket {
|
||||
};</PRE
|
||||
></P
|
||||
><P
|
||||
></P
|
||||
><P
|
||||
>The elements of this structure are:
|
||||
<P
|
||||
></P
|
||||
@@ -285,58 +283,52 @@ The lwres_gnba_*() functions should be used for this type.</P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_lwpacket_renderheader()</TT
|
||||
>
|
||||
transfers the contents of lightweight resolver packet structure
|
||||
> transfers the
|
||||
contents of lightweight resolver packet structure
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_lwpacket_t</SPAN
|
||||
>
|
||||
<TT
|
||||
> <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*pkt</I
|
||||
></TT
|
||||
>
|
||||
in network byte order to the lightweight resolver buffer,
|
||||
> in network
|
||||
byte order to the lightweight resolver buffer,
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*b</I
|
||||
></TT
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_lwpacket_parseheader()</TT
|
||||
>
|
||||
performs the converse operation.
|
||||
It transfers data in network byte order from buffer
|
||||
<TT
|
||||
> performs the
|
||||
converse operation. It transfers data in network byte order from
|
||||
buffer <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*b</I
|
||||
></TT
|
||||
>
|
||||
to resolver packet
|
||||
> to resolver packet
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*pkt</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
The contents of the buffer
|
||||
>. The contents of the buffer
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>b</I
|
||||
></TT
|
||||
>
|
||||
should correspond to a
|
||||
> should correspond to a
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>lwres_lwpacket_t</SPAN
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
>Both functions have assertion checks to ensure that
|
||||
<TT
|
||||
@@ -344,63 +336,54 @@ CLASS="PARAMETER"
|
||||
><I
|
||||
>b</I
|
||||
></TT
|
||||
>
|
||||
and
|
||||
<TT
|
||||
> and <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>pkt</I
|
||||
></TT
|
||||
>
|
||||
are not
|
||||
> are not
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>. </P
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN112"
|
||||
NAME="AEN111"
|
||||
></A
|
||||
><H2
|
||||
>RETURN VALUES</H2
|
||||
><P
|
||||
>Successful calls to
|
||||
> Successful calls to
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_lwpacket_renderheader()</TT
|
||||
>
|
||||
and
|
||||
> and
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_lwpacket_parseheader()</TT
|
||||
>
|
||||
return
|
||||
> return
|
||||
<SPAN
|
||||
CLASS="ERRORCODE"
|
||||
>LWRES_R_SUCCESS</SPAN
|
||||
>.
|
||||
|
||||
If there is insufficient space to copy data between the buffer
|
||||
<TT
|
||||
>. If there is insufficient
|
||||
space to copy data between the buffer <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*b</I
|
||||
></TT
|
||||
>
|
||||
and lightweight resolver packet
|
||||
<TT
|
||||
> and
|
||||
lightweight resolver packet <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*pkt</I
|
||||
></TT
|
||||
>
|
||||
both functions return
|
||||
<SPAN
|
||||
> both functions
|
||||
return <SPAN
|
||||
CLASS="ERRORCODE"
|
||||
>LWRES_R_UNEXPECTEDEND</SPAN
|
||||
>. </P
|
||||
>.</P
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
|
@@ -41,44 +41,28 @@ lwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype, lwres_uint16_
|
||||
.ad
|
||||
\fR.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBlwres_string_parse()\fR
|
||||
retrieves a DNS-encoded string starting the current pointer of
|
||||
lightweight resolver buffer
|
||||
\fIb\fR:
|
||||
i.e.
|
||||
b->current.
|
||||
\fBlwres_string_parse()\fR retrieves a DNS-encoded
|
||||
string starting the current pointer of lightweight resolver buffer
|
||||
\fIb\fR: i.e. b->current.
|
||||
When the function returns, the address of the first byte of the
|
||||
encoded string is returned via
|
||||
\fI*c\fR
|
||||
and the length of that string is given by
|
||||
\fI*len\fR.
|
||||
The buffer's current pointer is advanced to point at the character
|
||||
encoded string is returned via \fI*c\fR and the
|
||||
length of that string is given by \fI*len\fR. The
|
||||
buffer's current pointer is advanced to point at the character
|
||||
following the string length, the encoded string, and the trailing
|
||||
\fBNULL\fR
|
||||
character.
|
||||
\fBlwres_string_parse()\fR
|
||||
has an assertion check that
|
||||
\fIb\fR
|
||||
is not
|
||||
\fBNULL\fR.
|
||||
\fBNULL\fR character.
|
||||
\fBlwres_string_parse()\fR has an assertion check that
|
||||
\fIb\fR is not \fBNULL\fR.
|
||||
.PP
|
||||
\fBlwres_addr_parse()\fR
|
||||
extracts an address from the buffer
|
||||
\fIb\fR.
|
||||
It checks that
|
||||
\fIaddr\fR
|
||||
is not null.
|
||||
The buffer's current pointer
|
||||
b->current
|
||||
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
|
||||
addr->address
|
||||
and
|
||||
addr->length
|
||||
indicates the size in bytes of the address that was copied.
|
||||
b->current
|
||||
is advanced to point at the next byte of available data in the buffer
|
||||
\fBlwres_addr_parse()\fR extracts an address from the
|
||||
buffer \fIb\fR. It checks that
|
||||
\fIaddr\fR is not null. The buffer's current pointer
|
||||
b->current 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
|
||||
addr->address and
|
||||
addr->length indicates the size in bytes of
|
||||
the address that was copied. b->current is
|
||||
advanced to point at the next byte of available data in the buffer
|
||||
following the encoded address.
|
||||
.PP
|
||||
\fBlwres_getaddrsbyname()\fR
|
||||
@@ -109,58 +93,32 @@ they are controlled through the
|
||||
functions.
|
||||
.PP
|
||||
The lightweight resolver uses
|
||||
\fBlwres_getaddrsbyname()\fR
|
||||
to perform foward lookups.
|
||||
Hostname
|
||||
\fIname\fR
|
||||
is looked up using the resolver context
|
||||
\fIctx\fR
|
||||
for memory allocation.
|
||||
\fIaddrtypes\fR
|
||||
is a bitmask indicating which type of addresses are to be looked up.
|
||||
Current values for this bitmask are
|
||||
\fBLWRES_ADDRTYPE_V4\fR
|
||||
for IPv4 addresses and
|
||||
\fBLWRES_ADDRTYPE_V6\fR
|
||||
for IPv6 addresses.
|
||||
Results of the lookup are returned in
|
||||
\fI*structp\fR.
|
||||
\fBlwres_getaddrsbyname()\fR
|
||||
checks that its pointer arguments are not
|
||||
\fBNULL\fR
|
||||
and that
|
||||
\fIaddrtypes\fR
|
||||
is non-zero.
|
||||
\fBlwres_getaddrsbyname()\fR to perform foward lookups.
|
||||
Hostname \fIname\fR is looked up using the resolver
|
||||
context \fIctx\fR for memory allocation.
|
||||
\fIaddrtypes\fR is a bitmask indicating which type of
|
||||
addresses are to be looked up. Current values for this bitmask are
|
||||
\fBLWRES_ADDRTYPE_V4\fR for IPv4 addresses and
|
||||
\fBLWRES_ADDRTYPE_V6\fR for IPv6 addresses. Results of the
|
||||
lookup are returned in \fI*structp\fR.
|
||||
\fBlwres_getaddrsbyname()\fR checks that its pointer
|
||||
arguments are not \fBNULL\fR and that
|
||||
\fIaddrtypes\fR is non-zero.
|
||||
.PP
|
||||
\fBlwres_getnamebyaddr()\fR
|
||||
performs reverse lookups.
|
||||
Resolver context
|
||||
\fIctx\fR
|
||||
is used for memory allocation.
|
||||
The address type is indicated by
|
||||
\fIaddrtype\fR:
|
||||
\fBLWRES_ADDRTYPE_V4\fR
|
||||
or
|
||||
\fBLWRES_ADDRTYPE_V6\fR.
|
||||
The address to be looked up is given by
|
||||
\fIaddr\fR
|
||||
and its length is
|
||||
\fIaddrlen\fR
|
||||
bytes.
|
||||
The result of the function call is made available through
|
||||
\fI*structp\fR.
|
||||
Like
|
||||
\fBlwres_getnamebyaddr()\fR performs reverse lookups.
|
||||
Resolver context \fIctx\fR is used for memory
|
||||
allocation. The address type is indicated by
|
||||
\fIaddrtype\fR: \fBLWRES_ADDRTYPE_V4\fR or
|
||||
\fBLWRES_ADDRTYPE_V6\fR. The address to be looked up is given
|
||||
by \fIaddr\fR and its length is
|
||||
\fIaddrlen\fR bytes. The result of the function call
|
||||
is made available through \fI*structp\fR. Like
|
||||
\fBlwres_getaddrsbyname()\fR,
|
||||
\fBlwres_getnamebyaddr()\fR
|
||||
uses assertion checking to ensure its pointer arguments are not
|
||||
\fBNULL\fR
|
||||
and
|
||||
\fIaddrtype\fR
|
||||
is not zero.
|
||||
\fBlwres_getaddrsbyname()\fR
|
||||
also checks that
|
||||
\fIaddrlen\fR
|
||||
is non-zero.
|
||||
\fBlwres_getnamebyaddr()\fR uses assertion checking to
|
||||
ensure its pointer arguments are not \fBNULL\fR and
|
||||
\fIaddrtype\fR is not zero.
|
||||
\fBlwres_getaddrsbyname()\fR also checks that
|
||||
\fIaddrlen\fR is non-zero.
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
Successful calls to
|
||||
|
@@ -16,7 +16,7 @@
|
||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- $Id: lwres_resutil.docbook,v 1.4 2001/06/18 22:07:02 gson Exp $ -->
|
||||
<!-- $Id: lwres_resutil.docbook,v 1.5 2001/06/18 22:56:34 gson Exp $ -->
|
||||
|
||||
<refentry>
|
||||
|
||||
@@ -90,14 +90,11 @@ 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>.
|
||||
</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
|
||||
buffer <parameter>b</parameter>. 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
|
||||
@@ -148,9 +145,9 @@ 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>
|
||||
</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
|
||||
@@ -158,13 +155,7 @@ allocation. The address type is indicated by
|
||||
<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.
|
||||
is made available through <parameter>*structp</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@@ -106,105 +106,85 @@ NAME="AEN43"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_string_parse()</TT
|
||||
>
|
||||
retrieves a DNS-encoded string starting the current pointer of
|
||||
lightweight resolver buffer
|
||||
> retrieves a DNS-encoded
|
||||
string starting the current pointer of lightweight resolver buffer
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>b</I
|
||||
></TT
|
||||
>:
|
||||
|
||||
i.e.
|
||||
<TT
|
||||
>: i.e. <TT
|
||||
CLASS="CONSTANT"
|
||||
>b->current</TT
|
||||
>.
|
||||
|
||||
When the function returns, the address of the first byte of the
|
||||
encoded string is returned via
|
||||
<TT
|
||||
encoded string is returned via <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*c</I
|
||||
></TT
|
||||
>
|
||||
and the length of that string is given by
|
||||
<TT
|
||||
> and the
|
||||
length of that string is given by <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*len</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
The buffer's current pointer is advanced to point at the character
|
||||
>. The
|
||||
buffer's current pointer is advanced to point at the character
|
||||
following the string length, the encoded string, and the trailing
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>
|
||||
character.
|
||||
> character.
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_string_parse()</TT
|
||||
>
|
||||
has an assertion check that
|
||||
> has an assertion check that
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>b</I
|
||||
></TT
|
||||
>
|
||||
is not
|
||||
<SPAN
|
||||
> is not <SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_addr_parse()</TT
|
||||
>
|
||||
extracts an address from the buffer
|
||||
<TT
|
||||
> extracts an address from the
|
||||
buffer <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>b</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
It checks that
|
||||
>. It checks that
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addr</I
|
||||
></TT
|
||||
>
|
||||
is not null.
|
||||
The buffer's current pointer
|
||||
> is not null. The buffer's current pointer
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>b->current</TT
|
||||
>
|
||||
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
|
||||
> 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
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>addr->address</TT
|
||||
>
|
||||
and
|
||||
> and
|
||||
<TT
|
||||
CLASS="CONSTANT"
|
||||
>addr->length</TT
|
||||
>
|
||||
indicates the size in bytes of the address that was copied.
|
||||
<TT
|
||||
> indicates the size in bytes of
|
||||
the address that was copied. <TT
|
||||
CLASS="CONSTANT"
|
||||
>b->current</TT
|
||||
>
|
||||
is advanced to point at the next byte of available data in the buffer
|
||||
> is
|
||||
advanced to point at the next byte of available data in the buffer
|
||||
following the encoded address.</P
|
||||
><P
|
||||
><TT
|
||||
@@ -252,156 +232,125 @@ functions.</P
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getaddrsbyname()</TT
|
||||
>
|
||||
to perform foward lookups.
|
||||
Hostname
|
||||
<TT
|
||||
> to perform foward lookups.
|
||||
Hostname <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>name</I
|
||||
></TT
|
||||
>
|
||||
is looked up using the resolver context
|
||||
<TT
|
||||
> is looked up using the resolver
|
||||
context <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>ctx</I
|
||||
></TT
|
||||
>
|
||||
for memory allocation.
|
||||
> for memory allocation.
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addrtypes</I
|
||||
></TT
|
||||
>
|
||||
is a bitmask indicating which type of addresses are to be looked up.
|
||||
Current values for this bitmask are
|
||||
> is a bitmask indicating which type of
|
||||
addresses are to be looked up. Current values for this bitmask are
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>LWRES_ADDRTYPE_V4</SPAN
|
||||
>
|
||||
for IPv4 addresses and
|
||||
> for IPv4 addresses and
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>LWRES_ADDRTYPE_V6</SPAN
|
||||
>
|
||||
for IPv6 addresses.
|
||||
Results of the lookup are returned in
|
||||
<TT
|
||||
> for IPv6 addresses. Results of the
|
||||
lookup are returned in <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*structp</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getaddrsbyname()</TT
|
||||
>
|
||||
checks that its pointer arguments are not
|
||||
<SPAN
|
||||
> checks that its pointer
|
||||
arguments are not <SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>
|
||||
and that
|
||||
> and that
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addrtypes</I
|
||||
></TT
|
||||
>
|
||||
is non-zero.</P
|
||||
> is non-zero. </P
|
||||
><P
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getnamebyaddr()</TT
|
||||
>
|
||||
performs reverse lookups.
|
||||
Resolver context
|
||||
<TT
|
||||
> performs reverse lookups.
|
||||
Resolver context <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>ctx</I
|
||||
></TT
|
||||
>
|
||||
is used for memory allocation.
|
||||
The address type is indicated by
|
||||
> is used for memory
|
||||
allocation. The address type is indicated by
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addrtype</I
|
||||
></TT
|
||||
>:
|
||||
|
||||
<SPAN
|
||||
>: <SPAN
|
||||
CLASS="TYPE"
|
||||
>LWRES_ADDRTYPE_V4</SPAN
|
||||
>
|
||||
or
|
||||
> or
|
||||
<SPAN
|
||||
CLASS="TYPE"
|
||||
>LWRES_ADDRTYPE_V6</SPAN
|
||||
>.
|
||||
|
||||
The address to be looked up is given by
|
||||
<TT
|
||||
>. The address to be looked up is given
|
||||
by <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addr</I
|
||||
></TT
|
||||
>
|
||||
and its length is
|
||||
> and its length is
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addrlen</I
|
||||
></TT
|
||||
>
|
||||
bytes.
|
||||
The result of the function call is made available through
|
||||
<TT
|
||||
> bytes. The result of the function call
|
||||
is made available through <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>*structp</I
|
||||
></TT
|
||||
>.
|
||||
|
||||
Like
|
||||
>. Like
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getaddrsbyname()</TT
|
||||
>,
|
||||
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getnamebyaddr()</TT
|
||||
>
|
||||
uses assertion checking to ensure its pointer arguments are not
|
||||
<SPAN
|
||||
> uses assertion checking to
|
||||
ensure its pointer arguments are not <SPAN
|
||||
CLASS="TYPE"
|
||||
>NULL</SPAN
|
||||
>
|
||||
and
|
||||
> and
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addrtype</I
|
||||
></TT
|
||||
>
|
||||
is not zero.
|
||||
> is not zero.
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getaddrsbyname()</TT
|
||||
>
|
||||
also checks that
|
||||
> also checks that
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>addrlen</I
|
||||
></TT
|
||||
>
|
||||
is non-zero.</P
|
||||
> is non-zero.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
@@ -470,7 +419,7 @@ is returned by a successful call to
|
||||
<TT
|
||||
CLASS="FUNCTION"
|
||||
>lwres_getnamebyaddr()</TT
|
||||
>. </P
|
||||
>.</P
|
||||
><P
|
||||
>Both
|
||||
<TT
|
||||
|
Reference in New Issue
Block a user