1 .\" $NetBSD: lwres_noop.3,v 1.5 2014/12/10 04:38:02 christos Exp $
3 .\" Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 .\" PERFORMANCE OF THIS SOFTWARE.
24 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
25 .\" Date: June 18, 2007
29 .TH "LWRES_NOOP" "3" "June 18, 2007" "BIND9" "BIND9"
30 .\" disable hyphenation
32 .\" disable justification (adjust text to left margin only)
35 lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free \- lightweight resolver no\-op message handling
38 #include <lwres/lwres.h>
41 .BI "lwres_result_t lwres_nooprequest_render(lwres_context_t\ *" "ctx" ", lwres_nooprequest_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");"
43 .BI "lwres_result_t lwres_noopresponse_render(lwres_context_t\ *" "ctx" ", lwres_noopresponse_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");"
45 .BI "lwres_result_t lwres_nooprequest_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_nooprequest_t\ **" "structp" ");"
47 .BI "lwres_result_t lwres_noopresponse_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_noopresponse_t\ **" "structp" ");"
49 .BI "void lwres_noopresponse_free(lwres_context_t\ *" "ctx" ", lwres_noopresponse_t\ **" "structp" ");"
51 .BI "void lwres_nooprequest_free(lwres_context_t\ *" "ctx" ", lwres_nooprequest_t\ **" "structp" ");"
54 These are low\-level routines for creating and parsing lightweight resolver no\-op request and response messages.
56 The no\-op message is analogous to a
58 packet: a 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 operational or not.
60 There are four main functions for the no\-op opcode. One render function converts a no\-op request structure \(em
61 \fBlwres_nooprequest_t\fR
62 \(em to the lightweight 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 \(em
63 \fBlwres_noopresponse_t\fR
64 to the canonical format. This is complemented by a parse function which converts a packet in canonical format to a no\-op response structure.
66 These structures are defined in
67 \fIlwres/lwres.h\fR. They are shown below.
71 #define LWRES_OPCODE_NOOP 0x00000000U
79 lwres_uint16_t datalength;
81 } lwres_nooprequest_t;
89 lwres_uint16_t datalength;
91 } lwres_noopresponse_t;
96 Although 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.
98 \fBlwres_nooprequest_render()\fR
101 to convert no\-op request structure
103 to canonical format. The packet header structure
105 is initialised and transferred to buffer
106 \fIb\fR. The contents of
108 are then appended to the buffer in canonical format.
109 \fBlwres_noopresponse_render()\fR
110 performs the same task, except it converts a no\-op response structure
111 \fBlwres_noopresponse_t\fR
112 to the lightweight resolver's canonical format.
114 \fBlwres_nooprequest_parse()\fR
117 to convert the contents of packet
120 \fBlwres_nooprequest_t\fR
123 provides space to be used for storing this structure. When the function succeeds, the resulting
124 \fBlwres_nooprequest_t\fR
125 is made available through
127 \fBlwres_noopresponse_parse()\fR
128 offers the same semantics as
129 \fBlwres_nooprequest_parse()\fR
131 \fBlwres_noopresponse_t\fR
134 \fBlwres_noopresponse_free()\fR
136 \fBlwres_nooprequest_free()\fR
137 release the memory in resolver context
139 that was allocated to the
140 \fBlwres_noopresponse_t\fR
142 \fBlwres_nooprequest_t\fR
143 structures referenced via
147 The no\-op opcode functions
148 \fBlwres_nooprequest_render()\fR,
149 \fBlwres_noopresponse_render()\fR
150 \fBlwres_nooprequest_parse()\fR
152 \fBlwres_noopresponse_parse()\fR
154 \fBLWRES_R_SUCCESS\fR
155 on success. They return
156 \fBLWRES_R_NOMEMORY\fR
157 if memory allocation fails.
158 \fBLWRES_R_UNEXPECTEDEND\fR
159 is returned if the available space in the buffer
161 is too small to accommodate the packet header or the
162 \fBlwres_nooprequest_t\fR
164 \fBlwres_noopresponse_t\fR
166 \fBlwres_nooprequest_parse()\fR
168 \fBlwres_noopresponse_parse()\fR
170 \fBLWRES_R_UNEXPECTEDEND\fR
171 if the buffer is not empty after decoding the received packet. These functions will return
172 \fBLWRES_R_FAILURE\fR
175 in the packet header structure
176 \fBlwres_lwpacket_t\fR
177 indicate that the packet is not a response to an earlier query.
180 \fBlwres_packet\fR(3)
182 Copyright \(co 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
184 Copyright \(co 2000, 2001 Internet Software Consortium.