Merge from vendor branch GCC:
[dragonfly.git] / contrib / bind-9.3 / lib / lwres / man / lwres_noop.html
1 <!--
2  - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
3  - Copyright (C) 2000, 2001 Internet Software Consortium.
4  - 
5  - Permission to use, copy, modify, and distribute this software for any
6  - purpose with or without fee is hereby granted, provided that the above
7  - copyright notice and this permission notice appear in all copies.
8  - 
9  - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  - PERFORMANCE OF THIS SOFTWARE.
16 -->
17 <!-- $Id: lwres_noop.html,v 1.7.2.1.4.9 2005/10/13 02:33:57 marka Exp $ -->
18 <html>
19 <head>
20 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21 <title>lwres_noop</title>
22 <meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
23 </head>
24 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
25 <a name="id2463721"></a><div class="titlepage"></div>
26 <div class="refnamediv">
27 <h2>Name</h2>
28 <p>lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free &#8212; lightweight resolver no-op message handling</p>
29 </div>
30 <div class="refsynopsisdiv">
31 <h2>Synopsis</h2>
32 <div class="funcsynopsis">
33 <pre class="funcsynopsisinfo">
34 #include &lt;lwres/lwres.h&gt;</pre>
35 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
36 <tr>
37 <td><code class="funcdef">
38 lwres_result_t
39 <b class="fsfunc">lwres_nooprequest_render</b>(</code></td>
40 <td> </td>
41 <td>, </td>
42 </tr>
43 <tr>
44 <td> </td>
45 <td> </td>
46 <td>, </td>
47 </tr>
48 <tr>
49 <td> </td>
50 <td> </td>
51 <td>, </td>
52 </tr>
53 <tr>
54 <td> </td>
55 <td> </td>
56 <td>
57 <code>)</code>;</td>
58 </tr>
59 </table>
60 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
61 <tr>
62 <td><code class="funcdef">
63 lwres_result_t
64 <b class="fsfunc">lwres_noopresponse_render</b>(</code></td>
65 <td> </td>
66 <td>, </td>
67 </tr>
68 <tr>
69 <td> </td>
70 <td> </td>
71 <td>, </td>
72 </tr>
73 <tr>
74 <td> </td>
75 <td> </td>
76 <td>, </td>
77 </tr>
78 <tr>
79 <td> </td>
80 <td> </td>
81 <td>
82 <code>)</code>;</td>
83 </tr>
84 </table>
85 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
86 <tr>
87 <td><code class="funcdef">
88 lwres_result_t
89 <b class="fsfunc">lwres_nooprequest_parse</b>(</code></td>
90 <td> </td>
91 <td>, </td>
92 </tr>
93 <tr>
94 <td> </td>
95 <td> </td>
96 <td>, </td>
97 </tr>
98 <tr>
99 <td> </td>
100 <td> </td>
101 <td>, </td>
102 </tr>
103 <tr>
104 <td> </td>
105 <td> </td>
106 <td>
107 <code>)</code>;</td>
108 </tr>
109 </table>
110 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
111 <tr>
112 <td><code class="funcdef">
113 lwres_result_t
114 <b class="fsfunc">lwres_noopresponse_parse</b>(</code></td>
115 <td> </td>
116 <td>, </td>
117 </tr>
118 <tr>
119 <td> </td>
120 <td> </td>
121 <td>, </td>
122 </tr>
123 <tr>
124 <td> </td>
125 <td> </td>
126 <td>, </td>
127 </tr>
128 <tr>
129 <td> </td>
130 <td> </td>
131 <td>
132 <code>)</code>;</td>
133 </tr>
134 </table>
135 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
136 <tr>
137 <td><code class="funcdef">
138 void
139 <b class="fsfunc">lwres_noopresponse_free</b>(</code></td>
140 <td> </td>
141 <td>, </td>
142 </tr>
143 <tr>
144 <td> </td>
145 <td> </td>
146 <td>
147 <code>)</code>;</td>
148 </tr>
149 </table>
150 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
151 <tr>
152 <td><code class="funcdef">
153 void
154 <b class="fsfunc">lwres_nooprequest_free</b>(</code></td>
155 <td> </td>
156 <td>, </td>
157 </tr>
158 <tr>
159 <td> </td>
160 <td> </td>
161 <td>
162 <code>)</code>;</td>
163 </tr>
164 </table>
165 </div>
166 </div>
167 <div class="refsect1" lang="en">
168 <a name="id2525963"></a><h2>DESCRIPTION</h2>
169 <p>
170 These are low-level routines for creating and parsing
171 lightweight resolver no-op request and response messages.
172 </p>
173 <p>
174 The no-op message is analogous to a <span><strong class="command">ping</strong></span> packet: 
175 a packet is sent to the resolver daemon and is simply echoed back.
176 The opcode is intended to allow a client to determine if the server is
177 operational or not.
178 </p>
179 <p>
180 There are four main functions for the no-op opcode.
181 One render function converts a no-op request structure &#8212;
182 <span class="type">lwres_nooprequest_t</span> &#8212;
183 to the lighweight resolver's canonical format.
184 It is complemented by a parse function that converts a packet in this
185 canonical format to a no-op request structure.
186 Another render function converts the no-op response structure &#8212;
187 <span class="type">lwres_noopresponse_t</span>
188 to the canonical format.
189 This is complemented by a parse function which converts a packet in
190 canonical format to a no-op response structure.
191 </p>
192 <p>
193 These structures are defined in
194 <code class="filename">lwres/lwres.h</code>.
195
196 They are shown below.
197 </p>
198 <pre class="programlisting">
199 #define LWRES_OPCODE_NOOP       0x00000000U
200
201 typedef struct {
202         lwres_uint16_t  datalength;
203         unsigned char   *data;
204 } lwres_nooprequest_t;
205
206 typedef struct {
207         lwres_uint16_t  datalength;
208         unsigned char   *data;
209 } lwres_noopresponse_t;
210 </pre>
211 <p>
212 Although the structures have different types, they are identical.
213 This is because the no-op opcode simply echos whatever data was sent:
214 the response is therefore identical to the request.
215 </p>
216 <p>
217 <code class="function">lwres_nooprequest_render()</code> uses resolver
218 context <em class="parameter"><code>ctx</code></em> to convert no-op request structure
219 <em class="parameter"><code>req</code></em> to canonical format.  The packet header
220 structure <em class="parameter"><code>pkt</code></em> is initialised and transferred to
221 buffer <em class="parameter"><code>b</code></em>.  The contents of
222 <em class="parameter"><code>*req</code></em> are then appended to the buffer in
223 canonical format.  <code class="function">lwres_noopresponse_render()</code>
224 performs the same task, except it converts a no-op response structure
225 <span class="type">lwres_noopresponse_t</span> to the lightweight resolver's
226 canonical format.
227 </p>
228 <p>
229 <code class="function">lwres_nooprequest_parse()</code> uses context
230 <em class="parameter"><code>ctx</code></em> to convert the contents of packet
231 <em class="parameter"><code>pkt</code></em> to a <span class="type">lwres_nooprequest_t</span>
232 structure.  Buffer <em class="parameter"><code>b</code></em> provides space to be used
233 for storing this structure.  When the function succeeds, the resulting
234 <span class="type">lwres_nooprequest_t</span> is made available through
235 <em class="parameter"><code>*structp</code></em>.
236 <code class="function">lwres_noopresponse_parse()</code> offers the same
237 semantics as <code class="function">lwres_nooprequest_parse()</code> except it
238 yields a <span class="type">lwres_noopresponse_t</span> structure.
239 </p>
240 <p>
241 <code class="function">lwres_noopresponse_free()</code> and
242 <code class="function">lwres_nooprequest_free()</code> release the memory in
243 resolver context <em class="parameter"><code>ctx</code></em> that was allocated to the
244 <span class="type">lwres_noopresponse_t</span> or <span class="type">lwres_nooprequest_t</span>
245 structures referenced via <em class="parameter"><code>structp</code></em>.
246 </p>
247 </div>
248 <div class="refsect1" lang="en">
249 <a name="id2526096"></a><h2>RETURN VALUES</h2>
250 <p>
251 The no-op opcode functions
252 <code class="function">lwres_nooprequest_render()</code>,
253
254 <code class="function">lwres_noopresponse_render()</code>
255 <code class="function">lwres_nooprequest_parse()</code>
256 and
257 <code class="function">lwres_noopresponse_parse()</code>
258 all return
259 <span class="errorcode">LWRES_R_SUCCESS</span>
260 on success.
261 They return
262 <span class="errorcode">LWRES_R_NOMEMORY</span>
263 if memory allocation fails.
264 <span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
265 is returned if the available space in the buffer
266 <em class="parameter"><code>b</code></em>
267 is too small to accommodate the packet header or the
268 <span class="type">lwres_nooprequest_t</span>
269 and
270 <span class="type">lwres_noopresponse_t</span>
271 structures.
272 <code class="function">lwres_nooprequest_parse()</code>
273 and
274 <code class="function">lwres_noopresponse_parse()</code>
275 will return
276 <span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
277 if the buffer is not empty after decoding the received packet.
278 These functions will return
279 <span class="errorcode">LWRES_R_FAILURE</span>
280 if
281 <code class="constant">pktflags</code>
282 in the packet header structure
283 <span class="type">lwres_lwpacket_t</span>
284 indicate that the packet is not a response to an earlier query.
285 </p>
286 </div>
287 <div class="refsect1" lang="en">
288 <a name="id2526160"></a><h2>SEE ALSO</h2>
289 <p>
290 <span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3
291 )</span>
292 </p>
293 </div>
294 </div></body>
295 </html>