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 INTERNET SOFTWARE CONSORTIUM
9
- DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
10
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
11
- INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
13
- FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
14
- NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
15
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
44
>lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free -- lightweight resolver getnamebyaddress message handling</DIV
46
CLASS="REFSYNOPSISDIV"
60
CLASS="FUNCSYNOPSISINFO"
61
>#include <lwres/lwres.h></PRE
67
lwres_gnbarequest_render</CODE
68
>(lwres_context_t *ctx, lwres_gnbarequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
75
lwres_gnbaresponse_render</CODE
76
>(lwres_context_t *ctx, lwres_gnbaresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
83
lwres_gnbarequest_parse</CODE
84
>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp);</CODE
91
lwres_gnbaresponse_parse</CODE
92
>(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbaresponse_t **structp);</CODE
99
lwres_gnbaresponse_free</CODE
100
>(lwres_context_t *ctx, lwres_gnbaresponse_t **structp);</CODE
107
lwres_gnbarequest_free</CODE
108
>(lwres_context_t *ctx, lwres_gnbarequest_t **structp);</CODE
122
>These are low-level routines for creating and parsing
123
lightweight resolver address-to-name lookup request and
124
response messages.</P
126
>There are four main functions for the getnamebyaddr opcode.
127
One render function converts a getnamebyaddr request structure —
130
>lwres_gnbarequest_t</SPAN
132
to the lightweight resolver's canonical format.
133
It is complemented by a parse function that converts a packet in this
134
canonical format to a getnamebyaddr request structure.
135
Another render function converts the getnamebyaddr response structure —
138
>lwres_gnbaresponse_t</SPAN
140
to the canonical format.
141
This is complemented by a parse function which converts a packet in
142
canonical format to a getnamebyaddr response structure.</P
144
>These structures are defined in
149
They are shown below.
151
CLASS="PROGRAMLISTING"
152
>#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
155
lwres_uint32_t flags;
157
} lwres_gnbarequest_t;
160
lwres_uint32_t flags;
161
lwres_uint16_t naliases;
164
lwres_uint16_t realnamelen;
165
lwres_uint16_t *aliaslen;
168
} lwres_gnbaresponse_t;</PRE
173
>lwres_gnbarequest_render()</TT
175
uses resolver context
180
to convert getnamebyaddr request structure
186
The packet header structure
191
is initialised and transferred to
202
are then appended to the buffer in canonical format.
205
>lwres_gnbaresponse_render()</TT
207
performs the same task, except it converts a getnamebyaddr response structure
210
>lwres_gnbaresponse_t</SPAN
212
to the lightweight resolver's canonical format.</P
216
>lwres_gnbarequest_parse()</TT
223
to convert the contents of packet
231
>lwres_gnbarequest_t</SPAN
239
provides space to be used for storing this structure.
240
When the function succeeds, the resulting
243
>lwres_gnbarequest_t</SPAN
245
is made available through
252
>lwres_gnbaresponse_parse()</TT
254
offers the same semantics as
257
>lwres_gnbarequest_parse()</TT
262
>lwres_gnbaresponse_t</SPAN
268
>lwres_gnbaresponse_free()</TT
273
>lwres_gnbarequest_free()</TT
275
release the memory in resolver context
280
that was allocated to the
283
>lwres_gnbaresponse_t</SPAN
288
>lwres_gnbarequest_t</SPAN
290
structures referenced via
295
Any memory associated with ancillary buffers and strings for those
296
structures is also discarded.</P
306
>The getnamebyaddr opcode functions
309
>lwres_gnbarequest_render()</TT
313
>lwres_gnbaresponse_render()</TT
317
>lwres_gnbarequest_parse()</TT
322
>lwres_gnbaresponse_parse()</TT
327
>LWRES_R_SUCCESS</SPAN
333
>LWRES_R_NOMEMORY</SPAN
335
if memory allocation fails.
338
>LWRES_R_UNEXPECTEDEND</SPAN
340
is returned if the available space in the buffer
345
is too small to accommodate the packet header or the
348
>lwres_gnbarequest_t</SPAN
353
>lwres_gnbaresponse_t</SPAN
358
>lwres_gnbarequest_parse()</TT
363
>lwres_gnbaresponse_parse()</TT
368
>LWRES_R_UNEXPECTEDEND</SPAN
370
if the buffer is not empty after decoding the received packet.
371
These functions will return
374
>LWRES_R_FAILURE</SPAN
383
in the packet header structure
386
>lwres_lwpacket_t</SPAN
388
indicate that the packet is not a response to an earlier query.</P
401
CLASS="REFENTRYTITLE"
b'\\ No newline at end of file'