]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/lib/lwres/man/lwres_noop.3
MFV r306384:
[FreeBSD/stable/9.git] / contrib / bind9 / lib / lwres / man / lwres_noop.3
1 .\" Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
3 .\" 
4 .\" Permission to use, copy, modify, and/or 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.
7 .\" 
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.
15 .\"
16 .hy 0
17 .ad l
18 '\" t
19 .\"     Title: lwres_noop
20 .\"    Author: 
21 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
22 .\"      Date: 2007-06-18
23 .\"    Manual: BIND9
24 .\"    Source: ISC
25 .\"  Language: English
26 .\"
27 .TH "LWRES_NOOP" "3" "2007\-06\-18" "ISC" "BIND9"
28 .\" -----------------------------------------------------------------
29 .\" * Define some portability stuff
30 .\" -----------------------------------------------------------------
31 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 .\" http://bugs.debian.org/507673
33 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 .ie \n(.g .ds Aq \(aq
36 .el       .ds Aq '
37 .\" -----------------------------------------------------------------
38 .\" * set default formatting
39 .\" -----------------------------------------------------------------
40 .\" disable hyphenation
41 .nh
42 .\" disable justification (adjust text to left margin only)
43 .ad l
44 .\" -----------------------------------------------------------------
45 .\" * MAIN CONTENT STARTS HERE *
46 .\" -----------------------------------------------------------------
47 .SH "NAME"
48 lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free \- lightweight resolver no\-op message handling
49 .SH "SYNOPSIS"
50 .sp
51 .ft B
52 .nf
53 #include <lwres/lwres\&.h>
54 .fi
55 .ft
56 .HP \w'lwres_result_t\ lwres_nooprequest_render('u
57 .BI "lwres_result_t lwres_nooprequest_render(lwres_context_t\ *" "ctx" ", lwres_nooprequest_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");"
58 .HP \w'lwres_result_t\ lwres_noopresponse_render('u
59 .BI "lwres_result_t lwres_noopresponse_render(lwres_context_t\ *" "ctx" ", lwres_noopresponse_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");"
60 .HP \w'lwres_result_t\ lwres_nooprequest_parse('u
61 .BI "lwres_result_t lwres_nooprequest_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_nooprequest_t\ **" "structp" ");"
62 .HP \w'lwres_result_t\ lwres_noopresponse_parse('u
63 .BI "lwres_result_t lwres_noopresponse_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_noopresponse_t\ **" "structp" ");"
64 .HP \w'void\ lwres_noopresponse_free('u
65 .BI "void lwres_noopresponse_free(lwres_context_t\ *" "ctx" ", lwres_noopresponse_t\ **" "structp" ");"
66 .HP \w'void\ lwres_nooprequest_free('u
67 .BI "void lwres_nooprequest_free(lwres_context_t\ *" "ctx" ", lwres_nooprequest_t\ **" "structp" ");"
68 .SH "DESCRIPTION"
69 .PP
70 These are low\-level routines for creating and parsing lightweight resolver no\-op request and response messages\&.
71 .PP
72 The no\-op message is analogous to a
73 \fBping\fR
74 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\&.
75 .PP
76 There are four main functions for the no\-op opcode\&. One render function converts a no\-op request structure \(em
77 \fBlwres_nooprequest_t\fR
78 \(em to the lightweight resolver\*(Aqs 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
79 \fBlwres_noopresponse_t\fR
80 to the canonical format\&. This is complemented by a parse function which converts a packet in canonical format to a no\-op response structure\&.
81 .PP
82 These structures are defined in
83 lwres/lwres\&.h\&. They are shown below\&.
84 .PP
85 .if n \{\
86 .RS 4
87 .\}
88 .nf
89 #define LWRES_OPCODE_NOOP       0x00000000U
90 .fi
91 .if n \{\
92 .RE
93 .\}
94 .PP
95 .if n \{\
96 .RS 4
97 .\}
98 .nf
99 typedef struct {
100         lwres_uint16_t  datalength;
101         unsigned char   *data;
102 } lwres_nooprequest_t;
103 .fi
104 .if n \{\
105 .RE
106 .\}
107 .PP
108 .if n \{\
109 .RS 4
110 .\}
111 .nf
112 typedef struct {
113         lwres_uint16_t  datalength;
114         unsigned char   *data;
115 } lwres_noopresponse_t;
116 .fi
117 .if n \{\
118 .RE
119 .\}
120 .PP
121 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\&.
122 .PP
123 \fBlwres_nooprequest_render()\fR
124 uses resolver context
125 \fIctx\fR
126 to convert no\-op request structure
127 \fIreq\fR
128 to canonical format\&. The packet header structure
129 \fIpkt\fR
130 is initialised and transferred to buffer
131 \fIb\fR\&. The contents of
132 \fI*req\fR
133 are then appended to the buffer in canonical format\&.
134 \fBlwres_noopresponse_render()\fR
135 performs the same task, except it converts a no\-op response structure
136 \fBlwres_noopresponse_t\fR
137 to the lightweight resolver\*(Aqs canonical format\&.
138 .PP
139 \fBlwres_nooprequest_parse()\fR
140 uses context
141 \fIctx\fR
142 to convert the contents of packet
143 \fIpkt\fR
144 to a
145 \fBlwres_nooprequest_t\fR
146 structure\&. Buffer
147 \fIb\fR
148 provides space to be used for storing this structure\&. When the function succeeds, the resulting
149 \fBlwres_nooprequest_t\fR
150 is made available through
151 \fI*structp\fR\&.
152 \fBlwres_noopresponse_parse()\fR
153 offers the same semantics as
154 \fBlwres_nooprequest_parse()\fR
155 except it yields a
156 \fBlwres_noopresponse_t\fR
157 structure\&.
158 .PP
159 \fBlwres_noopresponse_free()\fR
160 and
161 \fBlwres_nooprequest_free()\fR
162 release the memory in resolver context
163 \fIctx\fR
164 that was allocated to the
165 \fBlwres_noopresponse_t\fR
166 or
167 \fBlwres_nooprequest_t\fR
168 structures referenced via
169 \fIstructp\fR\&.
170 .SH "RETURN VALUES"
171 .PP
172 The no\-op opcode functions
173 \fBlwres_nooprequest_render()\fR,
174 \fBlwres_noopresponse_render()\fR\fBlwres_nooprequest_parse()\fR
175 and
176 \fBlwres_noopresponse_parse()\fR
177 all return
178 \fBLWRES_R_SUCCESS\fR
179 on success\&. They return
180 \fBLWRES_R_NOMEMORY\fR
181 if memory allocation fails\&.
182 \fBLWRES_R_UNEXPECTEDEND\fR
183 is returned if the available space in the buffer
184 \fIb\fR
185 is too small to accommodate the packet header or the
186 \fBlwres_nooprequest_t\fR
187 and
188 \fBlwres_noopresponse_t\fR
189 structures\&.
190 \fBlwres_nooprequest_parse()\fR
191 and
192 \fBlwres_noopresponse_parse()\fR
193 will return
194 \fBLWRES_R_UNEXPECTEDEND\fR
195 if the buffer is not empty after decoding the received packet\&. These functions will return
196 \fBLWRES_R_FAILURE\fR
197 if
198 \fBpktflags\fR
199 in the packet header structure
200 \fBlwres_lwpacket_t\fR
201 indicate that the packet is not a response to an earlier query\&.
202 .SH "SEE ALSO"
203 .PP
204 \fBlwres_packet\fR(3)
205 .SH "AUTHOR"
206 .PP
207 \fBInternet Systems Consortium, Inc\&.\fR
208 .SH "COPYRIGHT"
209 .br
210 Copyright \(co 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
211 .br
212 Copyright \(co 2000, 2001 Internet Software Consortium.
213 .br