- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></
HEAD >lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free -- lightweight resolver getnamebyaddress message handling</
DIVlwres_gnbarequest_render</
CODE>(lwres_context_t *ctx, lwres_gnbarequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</
CODElwres_gnbaresponse_render</
CODE>(lwres_context_t *ctx, lwres_gnbaresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</
CODElwres_gnbarequest_parse</
CODE>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp);</
CODElwres_gnbaresponse_parse</
CODE>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbaresponse_t **structp);</
CODElwres_gnbaresponse_free</
CODE>(lwres_context_t *ctx, lwres_gnbaresponse_t **structp);</
CODElwres_gnbarequest_free</
CODE>(lwres_context_t *ctx, lwres_gnbarequest_t **structp);</
CODE>These are low-level routines for creating and parsing
lightweight resolver address-to-name lookup request and
>There are four main functions for the getnamebyaddr opcode.
One render function converts a getnamebyaddr request structure —
>lwres_gnbarequest_t</
SPANto the lightweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a getnamebyaddr request structure.
Another render function converts the getnamebyaddr response structure —
>lwres_gnbaresponse_t</
SPANThis is complemented by a parse function which converts a packet in
canonical format to a getnamebyaddr response structure.</
P>These structures are defined in
>#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
lwres_uint16_t realnamelen;
lwres_uint16_t *aliaslen;
} lwres_gnbaresponse_t;</
PRE>lwres_gnbarequest_render()</
CODEto convert getnamebyaddr request structure
The packet header structure
is initialised and transferred to
are then appended to the buffer in canonical format.
>lwres_gnbaresponse_render()</
CODEperforms the same task, except it converts a getnamebyaddr response structure
>lwres_gnbaresponse_t</
SPANto the lightweight resolver's canonical format.</
P>lwres_gnbarequest_parse()</
CODEto convert the contents of packet
>lwres_gnbarequest_t</
SPANprovides space to be used for storing this structure.
When the function succeeds, the resulting
>lwres_gnbarequest_t</
SPANis made available through
>lwres_gnbaresponse_parse()</
CODEoffers the same semantics as
>lwres_gnbarequest_parse()</
CODE>lwres_gnbaresponse_t</
SPAN>lwres_gnbaresponse_free()</
CODE>lwres_gnbarequest_free()</
CODErelease the memory in resolver context
that was allocated to the
>lwres_gnbaresponse_t</
SPAN>lwres_gnbarequest_t</
SPANstructures referenced via
Any memory associated with ancillary buffers and strings for those
structures is also discarded.</
P>The getnamebyaddr opcode functions
>lwres_gnbarequest_render()</
CODE>lwres_gnbaresponse_render()</
CODE>lwres_gnbarequest_parse()</
CODE>lwres_gnbaresponse_parse()</
CODEif memory allocation fails.
>LWRES_R_UNEXPECTEDEND</
SPANis returned if the available space in the buffer
is too small to accommodate the packet header or the
>lwres_gnbarequest_t</
SPAN>lwres_gnbaresponse_t</
SPAN>lwres_gnbarequest_parse()</
CODE>lwres_gnbaresponse_parse()</
CODE>LWRES_R_UNEXPECTEDEND</
SPANif the buffer is not empty after decoding the received packet.
These functions will return
in the packet header structure
indicate that the packet is not a response to an earlier query.</
P