606N/A - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 1088N/A - Copyright (C) 2001 Internet Software Consortium. 1088N/A - Permission to use, copy, modify, and distribute this software for any 606N/A - purpose with or without fee is hereby granted, provided that the above 606N/A - copyright notice and this permission notice appear in all copies. 919N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 919N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 919N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 919N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 919N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 919N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 919N/A - PERFORMANCE OF THIS SOFTWARE. 606N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.73 606N/A>lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free -- lightweight resolver no-op message handling</
DIV 606N/ACLASS="FUNCSYNOPSISINFO" lwres_nooprequest_render</
CODE>(lwres_context_t *ctx, lwres_nooprequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</
CODElwres_noopresponse_render</
CODE>(lwres_context_t *ctx, lwres_noopresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</
CODElwres_nooprequest_parse</
CODE>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp);</
CODElwres_noopresponse_parse</
CODE>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_noopresponse_t **structp);</
CODElwres_noopresponse_free</
CODE>(lwres_context_t *ctx, lwres_noopresponse_t **structp);</
CODElwres_nooprequest_free</
CODE>(lwres_context_t *ctx, lwres_nooprequest_t **structp);</
CODE>These are low-level routines for creating and parsing
lightweight resolver no-op request and response messages.</
P>The no-op message is analogous to a <
Ba packet is sent to the resolver daemon and is simply echoed back.
The opcode is intended to allow a client to determine if the server is
>There are four main functions for the no-op opcode.
One render function converts a no-op request structure —
>lwres_nooprequest_t</
SPANto the lighweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a no-op request structure.
Another render function converts the no-op response structure —
>lwres_noopresponse_t</
SPANThis is complemented by a parse function which converts a packet in
canonical format to a no-op response structure.</
P>These structures are defined in
>#define LWRES_OPCODE_NOOP 0x00000000U
lwres_uint16_t datalength;
lwres_uint16_t datalength;
} lwres_noopresponse_t;</
PREAlthough 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.</
P>lwres_nooprequest_render()</
TT> to convert no-op request structure
> to canonical format. The packet header
> is initialised and transferred to
> are then appended to the buffer in
>lwres_noopresponse_render()</
TTperforms the same task, except it converts a no-op response structure
>lwres_noopresponse_t</
SPAN> to the lightweight resolver's
>lwres_nooprequest_parse()</
TT> to convert the contents of packet
>lwres_nooprequest_t</
SPAN> provides space to be used
for storing this structure. When the function succeeds, the resulting
>lwres_nooprequest_t</
SPAN> is made available through
>lwres_noopresponse_parse()</
TT>lwres_nooprequest_parse()</
TT>lwres_noopresponse_t</
SPAN>lwres_noopresponse_free()</
TT>lwres_nooprequest_free()</
TT> that was allocated to the
>lwres_noopresponse_t</
SPAN>lwres_nooprequest_t</
SPANstructures referenced via <
TT>The no-op opcode functions
>lwres_nooprequest_render()</
TT>lwres_noopresponse_render()</
TT>lwres_nooprequest_parse()</
TT>lwres_noopresponse_parse()</
TTif 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_nooprequest_t</
SPAN>lwres_noopresponse_t</
SPAN>lwres_nooprequest_parse()</
TT>lwres_noopresponse_parse()</
TT>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