bind - Upgraded vendor branch to 9.5.2-P1
[dragonfly.git] / contrib / bind-9.5.2 / lib / dns / include / dns / types.h
CommitLineData
bbbf71a3
JL
1/*
2 * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1998-2003 Internet Software Consortium.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
16 */
17
c4067435 18/* $Id: types.h,v 1.126.62.6.2.1 2009/11/18 23:41:18 marka Exp $ */
bbbf71a3
JL
19
20#ifndef DNS_TYPES_H
21#define DNS_TYPES_H 1
22
23/*! \file dns/types.h
24 * \brief
25 * Including this file gives you type declarations suitable for use in
26 * .h files, which lets us avoid circular type reference problems.
27 * \brief
28 * To actually use a type or get declarations of its methods, you must
29 * include the appropriate .h file too.
30 */
31
32#include <isc/types.h>
33
34typedef struct dns_acache dns_acache_t;
35typedef struct dns_acacheentry dns_acacheentry_t;
36typedef struct dns_acachestats dns_acachestats_t;
37typedef struct dns_acl dns_acl_t;
38typedef struct dns_aclelement dns_aclelement_t;
39typedef struct dns_aclenv dns_aclenv_t;
40typedef struct dns_adb dns_adb_t;
41typedef struct dns_adbaddrinfo dns_adbaddrinfo_t;
42typedef ISC_LIST(dns_adbaddrinfo_t) dns_adbaddrinfolist_t;
43typedef struct dns_adbentry dns_adbentry_t;
44typedef struct dns_adbfind dns_adbfind_t;
45typedef ISC_LIST(dns_adbfind_t) dns_adbfindlist_t;
46typedef struct dns_byaddr dns_byaddr_t;
47typedef struct dns_cache dns_cache_t;
48typedef isc_uint16_t dns_cert_t;
49typedef struct dns_compress dns_compress_t;
50typedef struct dns_db dns_db_t;
51typedef struct dns_dbimplementation dns_dbimplementation_t;
52typedef struct dns_dbiterator dns_dbiterator_t;
53typedef void dns_dbload_t;
54typedef void dns_dbnode_t;
55typedef struct dns_dbtable dns_dbtable_t;
56typedef void dns_dbversion_t;
57typedef struct dns_dlzimplementation dns_dlzimplementation_t;
58typedef struct dns_dlzdb dns_dlzdb_t;
59typedef struct dns_sdlzimplementation dns_sdlzimplementation_t;
60typedef struct dns_decompress dns_decompress_t;
61typedef struct dns_dispatch dns_dispatch_t;
62typedef struct dns_dispatchevent dns_dispatchevent_t;
63typedef struct dns_dispatchlist dns_dispatchlist_t;
64typedef struct dns_dispatchmgr dns_dispatchmgr_t;
65typedef struct dns_dispentry dns_dispentry_t;
66typedef struct dns_dumpctx dns_dumpctx_t;
67typedef struct dns_fetch dns_fetch_t;
68typedef struct dns_fixedname dns_fixedname_t;
69typedef struct dns_forwarders dns_forwarders_t;
70typedef struct dns_fwdtable dns_fwdtable_t;
71typedef struct dns_iptable dns_iptable_t;
72typedef isc_uint16_t dns_keyflags_t;
73typedef struct dns_keynode dns_keynode_t;
74typedef struct dns_keytable dns_keytable_t;
75typedef isc_uint16_t dns_keytag_t;
76typedef struct dns_loadctx dns_loadctx_t;
77typedef struct dns_loadmgr dns_loadmgr_t;
78typedef struct dns_message dns_message_t;
79typedef isc_uint16_t dns_messageid_t;
80typedef isc_region_t dns_label_t;
81typedef struct dns_lookup dns_lookup_t;
82typedef struct dns_name dns_name_t;
83typedef ISC_LIST(dns_name_t) dns_namelist_t;
84typedef isc_uint16_t dns_opcode_t;
85typedef unsigned char dns_offsets_t[128];
86typedef struct dns_order dns_order_t;
87typedef struct dns_peer dns_peer_t;
88typedef struct dns_peerlist dns_peerlist_t;
89typedef struct dns_portlist dns_portlist_t;
90typedef struct dns_rbt dns_rbt_t;
91typedef isc_uint16_t dns_rcode_t;
92typedef struct dns_rdata dns_rdata_t;
93typedef struct dns_rdatacallbacks dns_rdatacallbacks_t;
94typedef isc_uint16_t dns_rdataclass_t;
95typedef struct dns_rdatalist dns_rdatalist_t;
96typedef struct dns_rdataset dns_rdataset_t;
97typedef ISC_LIST(dns_rdataset_t) dns_rdatasetlist_t;
98typedef struct dns_rdatasetiter dns_rdatasetiter_t;
99typedef isc_uint16_t dns_rdatatype_t;
100typedef struct dns_request dns_request_t;
101typedef struct dns_requestmgr dns_requestmgr_t;
102typedef struct dns_resolver dns_resolver_t;
103typedef struct dns_sdbimplementation dns_sdbimplementation_t;
104typedef isc_uint8_t dns_secalg_t;
105typedef isc_uint8_t dns_secproto_t;
106typedef struct dns_signature dns_signature_t;
107typedef struct dns_ssurule dns_ssurule_t;
108typedef struct dns_ssutable dns_ssutable_t;
109typedef struct dns_stats dns_stats_t;
110typedef isc_uint32_t dns_rdatastatstype_t;
111typedef struct dns_tkeyctx dns_tkeyctx_t;
112typedef isc_uint16_t dns_trust_t;
113typedef struct dns_tsig_keyring dns_tsig_keyring_t;
114typedef struct dns_tsigkey dns_tsigkey_t;
115typedef isc_uint32_t dns_ttl_t;
116typedef struct dns_validator dns_validator_t;
117typedef struct dns_view dns_view_t;
118typedef ISC_LIST(dns_view_t) dns_viewlist_t;
119typedef struct dns_zone dns_zone_t;
120typedef ISC_LIST(dns_zone_t) dns_zonelist_t;
121typedef struct dns_zonemgr dns_zonemgr_t;
122typedef struct dns_zt dns_zt_t;
123
124/*
125 * If we are not using GSSAPI, define the types we use as opaque types here.
126 */
127#ifndef GSSAPI
128typedef struct not_defined_gss_cred_id *gss_cred_id_t;
129typedef struct not_defined_gss_ctx *gss_ctx_id_t;
130#endif
131typedef struct dst_gssapi_signverifyctx dst_gssapi_signverifyctx_t;
132
133typedef enum {
134 dns_fwdpolicy_none = 0,
135 dns_fwdpolicy_first = 1,
136 dns_fwdpolicy_only = 2
137} dns_fwdpolicy_t;
138
139typedef enum {
140 dns_namereln_none = 0,
141 dns_namereln_contains = 1,
142 dns_namereln_subdomain = 2,
143 dns_namereln_equal = 3,
144 dns_namereln_commonancestor = 4
145} dns_namereln_t;
146
147typedef enum {
148 dns_one_answer, dns_many_answers
149} dns_transfer_format_t;
150
151typedef enum {
152 dns_dbtype_zone = 0, dns_dbtype_cache = 1, dns_dbtype_stub = 3
153} dns_dbtype_t;
154
155typedef enum {
156 dns_notifytype_no = 0,
157 dns_notifytype_yes = 1,
158 dns_notifytype_explicit = 2,
159 dns_notifytype_masteronly = 3
160} dns_notifytype_t;
161
162typedef enum {
163 dns_dialuptype_no = 0,
164 dns_dialuptype_yes = 1,
165 dns_dialuptype_notify = 2,
166 dns_dialuptype_notifypassive = 3,
167 dns_dialuptype_refresh = 4,
168 dns_dialuptype_passive = 5
169} dns_dialuptype_t;
170
171typedef enum {
172 dns_masterformat_none = 0,
173 dns_masterformat_text = 1,
174 dns_masterformat_raw = 2
175} dns_masterformat_t;
176
177/*
178 * These are generated by gen.c.
179 */
180#include <dns/enumtype.h> /* Provides dns_rdatatype_t. */
181#include <dns/enumclass.h> /* Provides dns_rdataclass_t. */
182
183/*%
184 * rcodes.
185 */
186enum {
187 /*
188 * Standard rcodes.
189 */
190 dns_rcode_noerror = 0,
191#define dns_rcode_noerror ((dns_rcode_t)dns_rcode_noerror)
192 dns_rcode_formerr = 1,
193#define dns_rcode_formerr ((dns_rcode_t)dns_rcode_formerr)
194 dns_rcode_servfail = 2,
195#define dns_rcode_servfail ((dns_rcode_t)dns_rcode_servfail)
196 dns_rcode_nxdomain = 3,
197#define dns_rcode_nxdomain ((dns_rcode_t)dns_rcode_nxdomain)
198 dns_rcode_notimp = 4,
199#define dns_rcode_notimp ((dns_rcode_t)dns_rcode_notimp)
200 dns_rcode_refused = 5,
201#define dns_rcode_refused ((dns_rcode_t)dns_rcode_refused)
202 dns_rcode_yxdomain = 6,
203#define dns_rcode_yxdomain ((dns_rcode_t)dns_rcode_yxdomain)
204 dns_rcode_yxrrset = 7,
205#define dns_rcode_yxrrset ((dns_rcode_t)dns_rcode_yxrrset)
206 dns_rcode_nxrrset = 8,
207#define dns_rcode_nxrrset ((dns_rcode_t)dns_rcode_nxrrset)
208 dns_rcode_notauth = 9,
209#define dns_rcode_notauth ((dns_rcode_t)dns_rcode_notauth)
210 dns_rcode_notzone = 10,
211#define dns_rcode_notzone ((dns_rcode_t)dns_rcode_notzone)
212 /*
213 * Extended rcodes.
214 */
215 dns_rcode_badvers = 16
216#define dns_rcode_badvers ((dns_rcode_t)dns_rcode_badvers)
217};
218
219/*%
220 * TSIG errors.
221 */
222enum {
223 dns_tsigerror_badsig = 16,
224 dns_tsigerror_badkey = 17,
225 dns_tsigerror_badtime = 18,
226 dns_tsigerror_badmode = 19,
227 dns_tsigerror_badname = 20,
228 dns_tsigerror_badalg = 21,
229 dns_tsigerror_badtrunc = 22
230};
231
232/*%
233 * Opcodes.
234 */
235enum {
236 dns_opcode_query = 0,
237#define dns_opcode_query ((dns_opcode_t)dns_opcode_query)
238 dns_opcode_iquery = 1,
239#define dns_opcode_iquery ((dns_opcode_t)dns_opcode_iquery)
240 dns_opcode_status = 2,
241#define dns_opcode_status ((dns_opcode_t)dns_opcode_status)
242 dns_opcode_notify = 4,
243#define dns_opcode_notify ((dns_opcode_t)dns_opcode_notify)
244 dns_opcode_update = 5 /* dynamic update */
245#define dns_opcode_update ((dns_opcode_t)dns_opcode_update)
246};
247
248/*%
249 * Trust levels. Must be kept in sync with trustnames[] in masterdump.c.
250 */
251enum {
252 /* Sentinel value; no data should have this trust level. */
253 dns_trust_none = 0,
254#define dns_trust_none ((dns_trust_t)dns_trust_none)
255
c4067435
JL
256 /*%
257 * Subject to DNSSEC validation but has not yet been validated
258 * dns_trust_pending_additional (from the additional section).
259 */
260 dns_trust_pending_additional = 1,
261#define dns_trust_pending_additional \
262 ((dns_trust_t)dns_trust_pending_additional)
263
264 dns_trust_pending_answer = 2,
265#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer)
bbbf71a3
JL
266
267 /*% Received in the additional section of a response. */
c4067435 268 dns_trust_additional = 3,
bbbf71a3
JL
269#define dns_trust_additional ((dns_trust_t)dns_trust_additional)
270
271 /* Received in a referral response. */
c4067435 272 dns_trust_glue = 4,
bbbf71a3
JL
273#define dns_trust_glue ((dns_trust_t)dns_trust_glue)
274
275 /* Answer from a non-authoritative server */
c4067435 276 dns_trust_answer = 5,
bbbf71a3
JL
277#define dns_trust_answer ((dns_trust_t)dns_trust_answer)
278
279 /* Received in the authority section as part of an
280 authoritative response */
c4067435 281 dns_trust_authauthority = 6,
bbbf71a3
JL
282#define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority)
283
284 /* Answer from an authoritative server */
c4067435 285 dns_trust_authanswer = 7,
bbbf71a3
JL
286#define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer)
287
288 /* Successfully DNSSEC validated */
c4067435 289 dns_trust_secure = 8,
bbbf71a3
JL
290#define dns_trust_secure ((dns_trust_t)dns_trust_secure)
291
292 /* This server is authoritative */
c4067435 293 dns_trust_ultimate = 9
bbbf71a3
JL
294#define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate)
295};
296
c4067435
JL
297#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \
298 (x) == dns_trust_pending_additional)
299#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue)
300
301
bbbf71a3
JL
302/*%
303 * Name checking severities.
304 */
305typedef enum {
306 dns_severity_ignore,
307 dns_severity_warn,
308 dns_severity_fail
309} dns_severity_t;
310
311/*
312 * Functions.
313 */
314typedef void
315(*dns_dumpdonefunc_t)(void *, isc_result_t);
316
317typedef void
318(*dns_loaddonefunc_t)(void *, isc_result_t);
319
320typedef isc_result_t
321(*dns_addrdatasetfunc_t)(void *, dns_name_t *, dns_rdataset_t *);
322
323typedef isc_result_t
324(*dns_additionaldatafunc_t)(void *, dns_name_t *, dns_rdatatype_t);
325
326typedef isc_result_t
327(*dns_digestfunc_t)(void *, isc_region_t *);
328
329typedef void
330(*dns_xfrindone_t)(dns_zone_t *, isc_result_t);
331
332typedef void
333(*dns_updatecallback_t)(void *, isc_result_t, dns_message_t *);
334
335typedef int
336(*dns_rdatasetorderfunc_t)(const dns_rdata_t *, const void *);
337
338typedef isc_boolean_t
339(*dns_checkmxfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *);
340
341typedef isc_boolean_t
342(*dns_checksrvfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *);
343
344typedef isc_boolean_t
345(*dns_checknsfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *,
346 dns_rdataset_t *, dns_rdataset_t *);
347
348typedef isc_boolean_t
349(*dns_isselffunc_t)(dns_view_t *, dns_tsigkey_t *, isc_sockaddr_t *,
350 isc_sockaddr_t *, dns_rdataclass_t, void *);
351
352#endif /* DNS_TYPES_H */