1 .\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 .\" PERFORMANCE OF THIS SOFTWARE.
16 .\" $Id: lwres_noop.3,v 1.14.2.1.8.6 2006/06/29 13:02:31 marka Exp $
22 .\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
23 .\" Date: Jun 30, 2000
27 .TH "LWRES_NOOP" "3" "Jun 30, 2000" "BIND9" "BIND9"
28 .\" disable hyphenation
30 .\" disable justification (adjust text to left margin only)
33 lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free \- lightweight resolver no\-op message handling
36 #include <lwres/lwres.h>
39 .BI "lwres_result_t lwres_nooprequest_render(lwres_context_t\ *ctx, lwres_nooprequest_t\ *req, lwres_lwpacket_t\ *pkt, lwres_buffer_t\ *b);"
41 .BI "lwres_result_t lwres_noopresponse_render(lwres_context_t\ *ctx, lwres_noopresponse_t\ *req, lwres_lwpacket_t\ *pkt, lwres_buffer_t\ *b);"
43 .BI "lwres_result_t lwres_nooprequest_parse(lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_nooprequest_t\ **structp);"
45 .BI "lwres_result_t lwres_noopresponse_parse(lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_noopresponse_t\ **structp);"
47 .BI "void lwres_noopresponse_free(lwres_context_t\ *ctx, lwres_noopresponse_t\ **structp);"
49 .BI "void lwres_nooprequest_free(lwres_context_t\ *ctx, lwres_nooprequest_t\ **structp);"
52 These are low\-level routines for creating and parsing lightweight resolver no\-op request and response messages.
54 The no\-op message is analogous to a
56 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.
58 There are four main functions for the no\-op opcode. One render function converts a no\-op request structure \(em
59 \fBlwres_nooprequest_t\fR
60 \(em to 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 \(em
61 \fBlwres_noopresponse_t\fR
62 to the canonical format. This is complemented by a parse function which converts a packet in canonical format to a no\-op response structure.
64 These structures are defined in
65 \fIlwres/lwres.h\fR. They are shown below.
69 #define LWRES_OPCODE_NOOP 0x00000000U
71 lwres_uint16_t datalength;
73 } lwres_nooprequest_t;
75 lwres_uint16_t datalength;
77 } lwres_noopresponse_t;
81 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.
83 \fBlwres_nooprequest_render()\fR
86 to convert no\-op request structure
88 to canonical format. The packet header structure
90 is initialised and transferred to buffer
91 \fIb\fR. The contents of
93 are then appended to the buffer in canonical format.
94 \fBlwres_noopresponse_render()\fR
95 performs the same task, except it converts a no\-op response structure
96 \fBlwres_noopresponse_t\fR
97 to the lightweight resolver's canonical format.
99 \fBlwres_nooprequest_parse()\fR
102 to convert the contents of packet
105 \fBlwres_nooprequest_t\fR
108 provides space to be used for storing this structure. When the function succeeds, the resulting
109 \fBlwres_nooprequest_t\fR
110 is made available through
112 \fBlwres_noopresponse_parse()\fR
113 offers the same semantics as
114 \fBlwres_nooprequest_parse()\fR
116 \fBlwres_noopresponse_t\fR
119 \fBlwres_noopresponse_free()\fR
121 \fBlwres_nooprequest_free()\fR
122 release the memory in resolver context
124 that was allocated to the
125 \fBlwres_noopresponse_t\fR
127 \fBlwres_nooprequest_t\fR
128 structures referenced via
132 The no\-op opcode functions
133 \fBlwres_nooprequest_render()\fR,
134 \fBlwres_noopresponse_render()\fR
135 \fBlwres_nooprequest_parse()\fR
137 \fBlwres_noopresponse_parse()\fR
139 \fBLWRES_R_SUCCESS\fR
140 on success. They return
141 \fBLWRES_R_NOMEMORY\fR
142 if memory allocation fails.
143 \fBLWRES_R_UNEXPECTEDEND\fR
144 is returned if the available space in the buffer
146 is too small to accommodate the packet header or the
147 \fBlwres_nooprequest_t\fR
149 \fBlwres_noopresponse_t\fR
151 \fBlwres_nooprequest_parse()\fR
153 \fBlwres_noopresponse_parse()\fR
155 \fBLWRES_R_UNEXPECTEDEND\fR
156 if the buffer is not empty after decoding the received packet. These functions will return
157 \fBLWRES_R_FAILURE\fR
160 in the packet header structure
161 \fBlwres_lwpacket_t\fR
162 indicate that the packet is not a response to an earlier query.
165 \fBlwres_packet\fR(3 )
167 Copyright \(co 2004, 2005 Internet Systems Consortium, Inc. ("ISC")