10139N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 10139N/A - Permission to use, copy, modify, and distribute this software for any 10139N/A - purpose with or without fee is hereby granted, provided that the above 10139N/A - copyright notice and this permission notice appear in all copies. 10139N/A - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM 10139N/A - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 10139N/A - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 10139N/A - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 10139N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 11922N/A - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 10139N/A - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 10139N/A - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 10139N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.61 10139N/A>lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr -- lightweight resolver utility functions</
DIV 10139N/A>(lwres_buffer_t *b, char **c, lwres_uint16_t *len);</
CODE 10139N/A>(lwres_buffer_t *b, lwres_addr_t *addr);</
CODE 10139N/A>(lwres_context_t *ctx, const char *name, lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp);</
CODE 10139N/A>(lwres_context_t *ctx, lwres_uint32_t addrtype, lwres_uint16_t addrlen, const unsigned char *addr, lwres_gnbaresponse_t **structp);</
CODE 10139N/Aretrieves a DNS-encoded string starting the current pointer of
10139N/AWhen the function returns, the address of the first byte of the
10139N/Aand the length of that string is given by
11819N/AThe buffer's current pointer is advanced to point at the character
11819N/Afollowing the string length, the encoded string, and the trailing
10778N/Aextracts an address from the buffer
10346N/Ais presumed to point at an encoded address: the address preceded by a
10285N/A32-bit protocol family identifier and a 16-bit length field.
10285N/AThe encoded address is copied to
10139N/Aindicates the size in bytes of the address that was copied.
10139N/Ais advanced to point at the next byte of available data in the buffer
10139N/Afollowing the encoded address.</
P 10139N/AThe contents of this structure are not manipulated directly but
10139N/Ais looked up using the resolver context
10139N/Ais a bitmask indicating which type of addresses are to be looked up.
10139N/ACurrent values for this bitmask are
10139N/AResults of the lookup are returned in
10139N/Achecks that its pointer arguments are not
10139N/AThe address type is indicated by
10139N/AThe address to be looked up is given by
10139N/AThe result of the function call is made available through
>lwres_getaddrsbyname()</
TT>lwres_getnamebyaddr()</
TTuses assertion checking to ensure its pointer arguments are not
>lwres_getaddrsbyname()</
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