Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / lib / lwres / man / lwres_gabn.3
blob1a9000aed95ac4650b325ee8ab5094fe25967e9d
1 .\"     $NetBSD: lwres_gabn.3,v 1.5 2014/12/10 04:38:02 christos Exp $
2 .\"
3 .\" Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (C) 2000, 2001 Internet Software Consortium.
5 .\" 
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\" 
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 .\" PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .\" Id
19 .\"
20 .hy 0
21 .ad l
22 .\"     Title: lwres_gabn
23 .\"    Author: 
24 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
25 .\"      Date: June 18, 2007
26 .\"    Manual: BIND9
27 .\"    Source: BIND9
28 .\"
29 .TH "LWRES_GABN" "3" "June 18, 2007" "BIND9" "BIND9"
30 .\" disable hyphenation
31 .nh
32 .\" disable justification (adjust text to left margin only)
33 .ad l
34 .SH "NAME"
35 lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free \- lightweight resolver getaddrbyname message handling
36 .SH "SYNOPSIS"
37 .nf
38 #include <lwres/lwres.h>
39 .fi
40 .HP 40
41 .BI "lwres_result_t lwres_gabnrequest_render(lwres_context_t\ *" "ctx" ", lwres_gabnrequest_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");"
42 .HP 41
43 .BI "lwres_result_t lwres_gabnresponse_render(lwres_context_t\ *" "ctx" ", lwres_gabnresponse_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");"
44 .HP 39
45 .BI "lwres_result_t lwres_gabnrequest_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_gabnrequest_t\ **" "structp" ");"
46 .HP 40
47 .BI "lwres_result_t lwres_gabnresponse_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_gabnresponse_t\ **" "structp" ");"
48 .HP 29
49 .BI "void lwres_gabnresponse_free(lwres_context_t\ *" "ctx" ", lwres_gabnresponse_t\ **" "structp" ");"
50 .HP 28
51 .BI "void lwres_gabnrequest_free(lwres_context_t\ *" "ctx" ", lwres_gabnrequest_t\ **" "structp" ");"
52 .SH "DESCRIPTION"
53 .PP
54 These are low\-level routines for creating and parsing lightweight resolver name\-to\-address lookup request and response messages.
55 .PP
56 There are four main functions for the getaddrbyname opcode. One render function converts a getaddrbyname request structure \(em
57 \fBlwres_gabnrequest_t\fR
58 \(em to the lightweight resolver's canonical format. It is complemented by a parse function that converts a packet in this canonical format to a getaddrbyname request structure. Another render function converts the getaddrbyname response structure \(em
59 \fBlwres_gabnresponse_t\fR
60 \(em to the canonical format. This is complemented by a parse function which converts a packet in canonical format to a getaddrbyname response structure.
61 .PP
62 These structures are defined in
63 \fI<lwres/lwres.h>\fR. They are shown below.
64 .PP
65 .RS 4
66 .nf
67 #define LWRES_OPCODE_GETADDRSBYNAME     0x00010001U
68 .fi
69 .RE
70 .sp
71 .PP
72 .RS 4
73 .nf
74 typedef struct lwres_addr lwres_addr_t;
75 typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
76 .fi
77 .RE
78 .sp
79 .PP
80 .RS 4
81 .nf
82 typedef struct {
83         lwres_uint32_t  flags;
84         lwres_uint32_t  addrtypes;
85         lwres_uint16_t  namelen;
86         char           *name;
87 } lwres_gabnrequest_t;
88 .fi
89 .RE
90 .sp
91 .PP
92 .RS 4
93 .nf
94 typedef struct {
95         lwres_uint32_t          flags;
96         lwres_uint16_t          naliases;
97         lwres_uint16_t          naddrs;
98         char                   *realname;
99         char                  **aliases;
100         lwres_uint16_t          realnamelen;
101         lwres_uint16_t         *aliaslen;
102         lwres_addrlist_t        addrs;
103         void                   *base;
104         size_t                  baselen;
105 } lwres_gabnresponse_t;
110 \fBlwres_gabnrequest_render()\fR
111 uses resolver context
112 \fIctx\fR
113 to convert getaddrbyname request structure
114 \fIreq\fR
115 to canonical format. The packet header structure
116 \fIpkt\fR
117 is initialised and transferred to buffer
118 \fIb\fR. The contents of
119 \fI*req\fR
120 are then appended to the buffer in canonical format.
121 \fBlwres_gabnresponse_render()\fR
122 performs the same task, except it converts a getaddrbyname response structure
123 \fBlwres_gabnresponse_t\fR
124 to the lightweight resolver's canonical format.
126 \fBlwres_gabnrequest_parse()\fR
127 uses context
128 \fIctx\fR
129 to convert the contents of packet
130 \fIpkt\fR
131 to a
132 \fBlwres_gabnrequest_t\fR
133 structure. Buffer
134 \fIb\fR
135 provides space to be used for storing this structure. When the function succeeds, the resulting
136 \fBlwres_gabnrequest_t\fR
137 is made available through
138 \fI*structp\fR.
139 \fBlwres_gabnresponse_parse()\fR
140 offers the same semantics as
141 \fBlwres_gabnrequest_parse()\fR
142 except it yields a
143 \fBlwres_gabnresponse_t\fR
144 structure.
146 \fBlwres_gabnresponse_free()\fR
148 \fBlwres_gabnrequest_free()\fR
149 release the memory in resolver context
150 \fIctx\fR
151 that was allocated to the
152 \fBlwres_gabnresponse_t\fR
154 \fBlwres_gabnrequest_t\fR
155 structures referenced via
156 \fIstructp\fR. Any memory associated with ancillary buffers and strings for those structures is also discarded.
157 .SH "RETURN VALUES"
159 The getaddrbyname opcode functions
160 \fBlwres_gabnrequest_render()\fR,
161 \fBlwres_gabnresponse_render()\fR
162 \fBlwres_gabnrequest_parse()\fR
164 \fBlwres_gabnresponse_parse()\fR
165 all return
166 \fBLWRES_R_SUCCESS\fR
167 on success. They return
168 \fBLWRES_R_NOMEMORY\fR
169 if memory allocation fails.
170 \fBLWRES_R_UNEXPECTEDEND\fR
171 is returned if the available space in the buffer
172 \fIb\fR
173 is too small to accommodate the packet header or the
174 \fBlwres_gabnrequest_t\fR
176 \fBlwres_gabnresponse_t\fR
177 structures.
178 \fBlwres_gabnrequest_parse()\fR
180 \fBlwres_gabnresponse_parse()\fR
181 will return
182 \fBLWRES_R_UNEXPECTEDEND\fR
183 if the buffer is not empty after decoding the received packet. These functions will return
184 \fBLWRES_R_FAILURE\fR
186 pktflags
187 in the packet header structure
188 \fBlwres_lwpacket_t\fR
189 indicate that the packet is not a response to an earlier query.
190 .SH "SEE ALSO"
192 \fBlwres_packet\fR(3)
193 .SH "COPYRIGHT"
194 Copyright \(co 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
196 Copyright \(co 2000, 2001 Internet Software Consortium.