2945N/A - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 2945N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 2945N/A - Permission to use, copy, modify, and distribute this software for any 2945N/A - purpose with or without fee is hereby granted, provided that the above 2945N/A - copyright notice and this permission notice appear in all copies. 2945N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 2945N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 2945N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 2945N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 2945N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 2945N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 2945N/A - PERFORMANCE OF THIS SOFTWARE. 2945N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.73 4618N/A>lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr -- lightweight resolver utility functions</
DIV 4618N/A>(lwres_buffer_t *b, char **c, lwres_uint16_t *len);</
CODE 4618N/A>(lwres_buffer_t *b, lwres_addr_t *addr);</
CODE 4618N/A>(lwres_context_t *ctx, const char *name, lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp);</
CODE 5554N/A>(lwres_context_t *ctx, lwres_uint32_t addrtype, lwres_uint16_t addrlen, const unsigned char *addr, lwres_gnbaresponse_t **structp);</
CODE 4618N/Astring starting the current pointer of lightweight resolver buffer
4618N/AWhen the function returns, the address of the first byte of the
4618N/Aencoded string is returned via <
TT 4618N/Alength of that string is given by <
TT 2945N/Abuffer's current pointer is advanced to point at the character
following the string length, the encoded string, and the trailing
> extracts an address from the
>. The buffer's current pointer
> 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
> indicates the size in bytes of
the address that was copied. <
TTadvanced to point at the next byte of available data in the buffer
following the encoded address.</
P>lwres_getaddrsbyname()</
TT>lwres_getnamebyaddr()</
TT>lwres_gnbaresponse_t</
SPAN lwres_uint16_t realnamelen;
lwres_uint16_t *aliaslen;
} lwres_gabnresponse_t;</
PREThe contents of this structure are not manipulated directly but
they are controlled through the
>The lightweight resolver uses
>lwres_getaddrsbyname()</
TT> to perform foward lookups.
> is looked up using the resolver
> is a bitmask indicating which type of
addresses are to be looked up. Current values for this bitmask are
> for IPv6 addresses. Results of the
lookup are returned in <
TT>lwres_getnamebyaddr()</
TT> performs reverse lookups.
allocation. The address type is indicated by
>. The address to be looked up is given
> bytes. The result of the function call
is made available through <
TT>lwres_string_parse()</
TTif the buffer is corrupt or
>LWRES_R_UNEXPECTEDEND</
SPANif the buffer has less space than expected for the components of the
encoded string or address.</
P>lwres_getaddrsbyname()</
TTon success and it returns
is returned by a successful call to
>lwres_getnamebyaddr()</
TT>lwres_getaddrsbyname()</
TT>lwres_getnamebyaddr()</
TTwhen memory allocation requests fail and
>LWRES_R_UNEXPECTEDEND</
SPANif the buffers used for sending queries and receiving replies are too