1
.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
2
.\" Copyright (C) 2000, 2001 Internet Software Consortium.
1
.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
2
.\" Copyright (C) 2000, 2001 Internet Software Consortium.
4
4
.\" Permission to use, copy, modify, and distribute this software for any
5
5
.\" purpose with or without fee is hereby granted, provided that the above
6
6
.\" copyright notice and this permission notice appear in all copies.
8
8
.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9
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,
10
.\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11
11
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13
13
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
.\" PERFORMANCE OF THIS SOFTWARE.
16
.\" $Id: lwres_noop.3,v 1.14.2.1.8.1 2004/03/06 07:41:44 marka Exp $
16
.\" $Id: lwres_noop.3,v 1.14.2.1.8.5 2005/10/13 02:33:54 marka Exp $
18
.TH "LWRES_NOOP" "3" "Jun 30, 2000" "BIND9" ""
20
lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free \- lightweight resolver no-op message handling
22
\fB#include <lwres/lwres.h>
26
lwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);
31
lwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);
36
lwres_nooprequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp);
41
lwres_noopresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_noopresponse_t **structp);
46
lwres_noopresponse_free(lwres_context_t *ctx, lwres_noopresponse_t **structp);
51
lwres_nooprequest_free(lwres_context_t *ctx, lwres_nooprequest_t **structp);
20
.\" ** You probably do not want to edit this file directly **
21
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
22
.\" Instead of manually editing it, you probably should edit the DocBook XML
23
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
24
.TH "LWRES_NOOP" "3" "Jun 30, 2000" "BIND9" "BIND9"
25
.\" disable hyphenation
27
.\" disable justification (adjust text to left margin only)
30
lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free \- lightweight resolver no\-op message handling
33
#include <lwres/lwres.h>
36
\fBlwres_result_t\ \fBlwres_nooprequest_render\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBlwres_nooprequest_t\ *req\fR\fB, \fR\fBlwres_lwpacket_t\ *pkt\fR\fB, \fR\fBlwres_buffer_t\ *b\fR\fB);\fR
38
\fBlwres_result_t\ \fBlwres_noopresponse_render\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBlwres_noopresponse_t\ *req\fR\fB, \fR\fBlwres_lwpacket_t\ *pkt\fR\fB, \fR\fBlwres_buffer_t\ *b\fR\fB);\fR
40
\fBlwres_result_t\ \fBlwres_nooprequest_parse\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBlwres_buffer_t\ *b\fR\fB, \fR\fBlwres_lwpacket_t\ *pkt\fR\fB, \fR\fBlwres_nooprequest_t\ **structp\fR\fB);\fR
42
\fBlwres_result_t\ \fBlwres_noopresponse_parse\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBlwres_buffer_t\ *b\fR\fB, \fR\fBlwres_lwpacket_t\ *pkt\fR\fB, \fR\fBlwres_noopresponse_t\ **structp\fR\fB);\fR
44
\fBvoid\ \fBlwres_noopresponse_free\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBlwres_noopresponse_t\ **structp\fR\fB);\fR
46
\fBvoid\ \fBlwres_nooprequest_free\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBlwres_nooprequest_t\ **structp\fR\fB);\fR
56
These are low-level routines for creating and parsing
57
lightweight resolver no-op request and response messages.
59
The no-op message is analogous to a \fBping\fR packet:
60
a packet is sent to the resolver daemon and is simply echoed back.
61
The opcode is intended to allow a client to determine if the server is
64
There are four main functions for the no-op opcode.
65
One render function converts a no-op request structure \(em
66
\fBlwres_nooprequest_t\fR \(em
67
to the lighweight resolver's canonical format.
68
It is complemented by a parse function that converts a packet in this
69
canonical format to a no-op request structure.
70
Another render function converts the no-op response structure \(em
49
These are low\-level routines for creating and parsing lightweight resolver no\-op request and response messages.
51
The no\-op message is analogous to a
53
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.
55
There are four main functions for the no\-op opcode. One render function converts a no\-op request structure \(em
56
\fBlwres_nooprequest_t\fR
57
\(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
71
58
\fBlwres_noopresponse_t\fR
72
to the canonical format.
73
This is complemented by a parse function which converts a packet in
74
canonical format to a no-op response structure.
59
to the canonical format. This is complemented by a parse function which converts a packet in canonical format to a no\-op response structure.
76
61
These structures are defined in
62
\fIlwres/lwres.h\fR. They are shown below.
81
65
#define LWRES_OPCODE_NOOP 0x00000000U
84
67
lwres_uint16_t datalength;
85
68
unsigned char *data;
86
69
} lwres_nooprequest_t;
89
71
lwres_uint16_t datalength;
90
72
unsigned char *data;
91
73
} lwres_noopresponse_t;
94
Although the structures have different types, they are identical.
95
This is because the no-op opcode simply echos whatever data was sent:
96
the response is therefore identical to the request.
98
\fBlwres_nooprequest_render()\fR uses resolver
99
context \fIctx\fR to convert no-op request structure
100
\fIreq\fR to canonical format. The packet header
101
structure \fIpkt\fR is initialised and transferred to
102
buffer \fIb\fR. The contents of
103
\fI*req\fR are then appended to the buffer in
104
canonical format. \fBlwres_noopresponse_render()\fR
105
performs the same task, except it converts a no-op response structure
106
\fBlwres_noopresponse_t\fR to the lightweight resolver's
109
\fBlwres_nooprequest_parse()\fR uses context
110
\fIctx\fR to convert the contents of packet
111
\fIpkt\fR to a \fBlwres_nooprequest_t\fR
112
structure. Buffer \fIb\fR provides space to be used
113
for storing this structure. When the function succeeds, the resulting
114
\fBlwres_nooprequest_t\fR is made available through
76
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.
78
\fBlwres_nooprequest_render()\fR
81
to convert no\-op request structure
83
to canonical format. The packet header structure
85
is initialised and transferred to buffer
86
\fIb\fR. The contents of
88
are then appended to the buffer in canonical format.
89
\fBlwres_noopresponse_render()\fR
90
performs the same task, except it converts a no\-op response structure
91
\fBlwres_noopresponse_t\fR
92
to the lightweight resolver's canonical format.
94
\fBlwres_nooprequest_parse()\fR
97
to convert the contents of packet
100
\fBlwres_nooprequest_t\fR
103
provides space to be used for storing this structure. When the function succeeds, the resulting
104
\fBlwres_nooprequest_t\fR
105
is made available through
116
\fBlwres_noopresponse_parse()\fR offers the same
117
semantics as \fBlwres_nooprequest_parse()\fR except it
118
yields a \fBlwres_noopresponse_t\fR structure.
107
\fBlwres_noopresponse_parse()\fR
108
offers the same semantics as
109
\fBlwres_nooprequest_parse()\fR
111
\fBlwres_noopresponse_t\fR
120
\fBlwres_noopresponse_free()\fR and
121
\fBlwres_nooprequest_free()\fR release the memory in
122
resolver context \fIctx\fR that was allocated to the
123
\fBlwres_noopresponse_t\fR or \fBlwres_nooprequest_t\fR
124
structures referenced via \fIstructp\fR.
114
\fBlwres_noopresponse_free()\fR
116
\fBlwres_nooprequest_free()\fR
117
release the memory in resolver context
119
that was allocated to the
120
\fBlwres_noopresponse_t\fR
122
\fBlwres_nooprequest_t\fR
123
structures referenced via
125
125
.SH "RETURN VALUES"
127
The no-op opcode functions
127
The no\-op opcode functions
128
128
\fBlwres_nooprequest_render()\fR,
129
\fBlwres_noopresponse_render()\fR
130
\fBlwres_nooprequest_parse()\fR
129
\fBlwres_noopresponse_render()\fR\fBlwres_nooprequest_parse()\fR
132
131
\fBlwres_noopresponse_parse()\fR
133
\fBLWRES_R_SUCCESS\fR
134
on success. They return
135
\fBLWRES_R_NOMEMORY\fR
138
136
if memory allocation fails.
139
LWRES_R_UNEXPECTEDEND
137
\fBLWRES_R_UNEXPECTEDEND\fR
140
138
is returned if the available space in the buffer
142
140
is too small to accommodate the packet header or the