304N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 304N/A - Permission to use, copy, modify, and distribute this software for any 304N/A - purpose with or without fee is hereby granted, provided that the above 304N/A - copyright notice and this permission notice appear in all copies. 304N/A - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM 304N/A - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 304N/A - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 304N/A - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 304N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 304N/A - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 304N/A - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 304N/A - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 304N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.61 304N/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 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()</
TTto convert no-op request structure
The packet header structure
is initialised and transferred to
are then appended to the buffer in canonical format.
>lwres_noopresponse_render()</
TTperforms the same task, except it converts a no-op response structure
>lwres_noopresponse_t</
SPANto the lightweight resolver's canonical format.</
P>lwres_nooprequest_parse()</
TTto convert the contents of packet
>lwres_nooprequest_t</
SPANprovides space to be used for storing this structure.
When the function succeeds, the resulting
>lwres_nooprequest_t</
SPANis made available through
>lwres_noopresponse_parse()</
TToffers the same semantics as
>lwres_nooprequest_parse()</
TT>lwres_noopresponse_t</
SPAN>lwres_noopresponse_free()</
TT>lwres_nooprequest_free()</
TTrelease the memory in resolver context
that was allocated to the
>lwres_noopresponse_t</
SPAN>lwres_nooprequest_t</
SPANstructures referenced via
>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