2N/A - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 2N/A - Copyright (C) 2001 Internet Software Consortium. 2N/A - Permission to use, copy, modify, and distribute this software for any 2N/A - purpose with or without fee is hereby granted, provided that the above 2N/A - copyright notice and this permission notice appear in all copies. 2N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 2N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 2N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 2N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 2N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 2N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 2N/A - PERFORMANCE OF THIS SOFTWARE. 2N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.79"></
HEAD 2N/A>lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free -- lightweight resolver getnamebyaddress message handling</
DIV 2N/ACLASS="REFSYNOPSISDIV" 2N/ACLASS="FUNCSYNOPSISINFO" 2N/Alwres_gnbarequest_render</
CODE 2N/A>(lwres_context_t *ctx, lwres_gnbarequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</
CODE 2N/Alwres_gnbaresponse_render</
CODE 2N/A>(lwres_context_t *ctx, lwres_gnbaresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</
CODE 2N/Alwres_gnbarequest_parse</
CODE 2N/A>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp);</
CODE 2N/Alwres_gnbaresponse_parse</
CODE 2N/A>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbaresponse_t **structp);</
CODE 2N/Alwres_gnbaresponse_free</
CODE 2N/A>(lwres_context_t *ctx, lwres_gnbaresponse_t **structp);</
CODE 2N/Alwres_gnbarequest_free</
CODE 2N/A>(lwres_context_t *ctx, lwres_gnbarequest_t **structp);</
CODE 2N/A>These are low-level routines for creating and parsing
2N/Alightweight resolver address-to-name lookup request and
2N/Aresponse messages.</
P 2N/A>There are four main functions for the getnamebyaddr opcode.
2N/AOne render function converts a getnamebyaddr request structure —
2N/A>lwres_gnbarequest_t</
SPAN 2N/Ato the lightweight resolver's canonical format.
2N/AIt is complemented by a parse function that converts a packet in this
2N/Acanonical format to a getnamebyaddr request structure.
2N/AAnother render function converts the getnamebyaddr response structure —
2N/A>lwres_gnbaresponse_t</
SPAN 2N/Ato the canonical format.
2N/AThis is complemented by a parse function which converts a packet in
2N/Acanonical format to a getnamebyaddr response structure.</
P 2N/A>These structures are defined in
2N/AThey are shown below.
2N/ACLASS="PROGRAMLISTING" 2N/A>#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
2N/A lwres_uint32_t flags;
2N/A} lwres_gnbarequest_t;
2N/A lwres_uint32_t flags;
2N/A lwres_uint16_t naliases;
2N/A lwres_uint16_t realnamelen;
2N/A lwres_uint16_t *aliaslen;
2N/A} lwres_gnbaresponse_t;</
PRE 2N/A>lwres_gnbarequest_render()</
CODE 2N/Auses resolver context
2N/Ato convert getnamebyaddr request structure
2N/AThe packet header structure
2N/Ais initialised and transferred to
2N/Aare then appended to the buffer in canonical format.
2N/A>lwres_gnbaresponse_render()</
CODE 2N/Aperforms the same task, except it converts a getnamebyaddr response structure
2N/A>lwres_gnbaresponse_t</
SPAN 2N/Ato the lightweight resolver's canonical format.</
P 2N/A>lwres_gnbarequest_parse()</
CODE 2N/Ato convert the contents of packet
2N/A>lwres_gnbarequest_t</
SPAN 2N/Aprovides space to be used for storing this structure.
2N/AWhen the function succeeds, the resulting
2N/A>lwres_gnbarequest_t</
SPAN 2N/Ais made available through
2N/A>lwres_gnbaresponse_parse()</
CODE 2N/Aoffers the same semantics as
2N/A>lwres_gnbarequest_parse()</
CODE 2N/A>lwres_gnbaresponse_t</
SPAN 2N/A>lwres_gnbaresponse_free()</
CODE 2N/A>lwres_gnbarequest_free()</
CODE 2N/Arelease the memory in resolver context
2N/Athat was allocated to the
2N/A>lwres_gnbaresponse_t</
SPAN 2N/A>lwres_gnbarequest_t</
SPAN 2N/Astructures referenced via
2N/AAny memory associated with ancillary buffers and strings for those
2N/Astructures is also discarded.</
P 2N/A>The getnamebyaddr opcode functions
2N/A>lwres_gnbarequest_render()</
CODE 2N/A>lwres_gnbaresponse_render()</
CODE 2N/A>lwres_gnbarequest_parse()</
CODE 2N/A>lwres_gnbaresponse_parse()</
CODE 2N/A>LWRES_R_SUCCESS</
SPAN 2N/A>LWRES_R_NOMEMORY</
SPAN 2N/Aif memory allocation fails.
2N/A>LWRES_R_UNEXPECTEDEND</
SPAN 2N/Ais returned if the available space in the buffer
2N/Ais too small to accommodate the packet header or the
2N/A>lwres_gnbarequest_t</
SPAN 2N/A>lwres_gnbaresponse_t</
SPAN 2N/A>lwres_gnbarequest_parse()</
CODE 2N/A>lwres_gnbaresponse_parse()</
CODE 2N/A>LWRES_R_UNEXPECTEDEND</
SPAN 2N/Aif the buffer is not empty after decoding the received packet.
2N/AThese functions will return
2N/A>LWRES_R_FAILURE</
SPAN 2N/Ain the packet header structure
2N/A>lwres_lwpacket_t</
SPAN 2N/Aindicate that the packet is not a response to an earlier query.</
P 2N/ACLASS="REFENTRYTITLE"