Merge from vendor branch SENDMAIL:
[dragonfly.git] / contrib / bind-9.2.4rc7 / lib / dns / include / dns / types.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1998-2001  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and 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
18 /* $Id: types.h,v 1.103.2.1 2004/03/09 06:11:24 marka Exp $ */
19
20 #ifndef DNS_TYPES_H
21 #define DNS_TYPES_H 1
22
23 /*
24  * Including this file gives you type declarations suitable for use in
25  * .h files, which lets us avoid circular type reference problems.
26  *
27  * To actually use a type or get declarations of its methods, you must
28  * include the appropriate .h file too.
29  */
30
31 #include <isc/types.h>
32
33 typedef struct dns_a6context                    dns_a6context_t;
34 typedef struct dns_acl                          dns_acl_t;
35 typedef struct dns_aclelement                   dns_aclelement_t;
36 typedef struct dns_aclenv                       dns_aclenv_t;
37 typedef struct dns_adb                          dns_adb_t;
38 typedef struct dns_adbaddrinfo                  dns_adbaddrinfo_t;
39 typedef ISC_LIST(dns_adbaddrinfo_t)             dns_adbaddrinfolist_t;
40 typedef struct dns_adbentry                     dns_adbentry_t;
41 typedef struct dns_adbfind                      dns_adbfind_t;
42 typedef ISC_LIST(dns_adbfind_t)                 dns_adbfindlist_t;
43 typedef struct dns_byaddr                       dns_byaddr_t;
44 typedef struct dns_cache                        dns_cache_t;
45 typedef isc_uint16_t                            dns_cert_t;
46 typedef struct dns_compress                     dns_compress_t;
47 typedef struct dns_db                           dns_db_t;
48 typedef struct dns_dbimplementation             dns_dbimplementation_t;
49 typedef struct dns_dbiterator                   dns_dbiterator_t;
50 typedef void                                    dns_dbload_t;
51 typedef void                                    dns_dbnode_t;
52 typedef struct dns_dbtable                      dns_dbtable_t;
53 typedef void                                    dns_dbversion_t;
54 typedef struct dns_decompress                   dns_decompress_t;
55 typedef struct dns_dispatch                     dns_dispatch_t;
56 typedef struct dns_dispatchevent                dns_dispatchevent_t;
57 typedef struct dns_dispatchlist                 dns_dispatchlist_t;
58 typedef struct dns_dispatchmgr                  dns_dispatchmgr_t;
59 typedef struct dns_dispentry                    dns_dispentry_t;
60 typedef struct dns_fetch                        dns_fetch_t;
61 typedef struct dns_fixedname                    dns_fixedname_t;
62 typedef struct dns_forwarders                   dns_forwarders_t;
63 typedef struct dns_fwdtable                     dns_fwdtable_t;
64 typedef isc_uint16_t                            dns_keyflags_t;
65 typedef struct dns_keynode                      dns_keynode_t;
66 typedef struct dns_keytable                     dns_keytable_t;
67 typedef isc_uint16_t                            dns_keytag_t;
68 typedef struct dns_loadctx                      dns_loadctx_t;
69 typedef struct dns_loadmgr                      dns_loadmgr_t;
70 typedef struct dns_message                      dns_message_t;
71 typedef isc_uint16_t                            dns_messageid_t;
72 typedef isc_region_t                            dns_label_t;
73 typedef struct dns_lookup                       dns_lookup_t;
74 typedef struct dns_name                         dns_name_t;
75 typedef ISC_LIST(dns_name_t)                    dns_namelist_t;
76 typedef isc_uint16_t                            dns_opcode_t;
77 typedef unsigned char                           dns_offsets_t[128];
78 typedef struct dns_peer                         dns_peer_t;
79 typedef struct dns_peerlist                     dns_peerlist_t;
80 typedef struct dns_rbt                          dns_rbt_t;
81 typedef isc_uint16_t                            dns_rcode_t;
82 typedef struct dns_rdata                        dns_rdata_t;
83 typedef struct dns_rdatacallbacks               dns_rdatacallbacks_t;
84 typedef isc_uint16_t                            dns_rdataclass_t;
85 typedef struct dns_rdatalist                    dns_rdatalist_t;
86 typedef struct dns_rdataset                     dns_rdataset_t;
87 typedef ISC_LIST(dns_rdataset_t)                dns_rdatasetlist_t;
88 typedef struct dns_rdatasetiter                 dns_rdatasetiter_t;
89 typedef isc_uint16_t                            dns_rdatatype_t;
90 typedef struct dns_request                      dns_request_t;
91 typedef struct dns_requestmgr                   dns_requestmgr_t;
92 typedef struct dns_resolver                     dns_resolver_t;
93 typedef struct dns_sdbimplementation            dns_sdbimplementation_t;
94 typedef isc_uint8_t                             dns_secalg_t;
95 typedef isc_uint8_t                             dns_secproto_t;
96 typedef struct dns_signature                    dns_signature_t;
97 typedef struct dns_ssurule                      dns_ssurule_t;
98 typedef struct dns_ssutable                     dns_ssutable_t;
99 typedef struct dns_tkeyctx                      dns_tkeyctx_t;
100 typedef isc_uint16_t                            dns_trust_t;
101 typedef struct dns_tsig_keyring                 dns_tsig_keyring_t;
102 typedef struct dns_tsigkey                      dns_tsigkey_t;
103 typedef isc_uint32_t                            dns_ttl_t;
104 typedef struct dns_validator                    dns_validator_t;
105 typedef struct dns_view                         dns_view_t;
106 typedef ISC_LIST(dns_view_t)                    dns_viewlist_t;
107 typedef struct dns_zone                         dns_zone_t;
108 typedef ISC_LIST(dns_zone_t)                    dns_zonelist_t;
109 typedef struct dns_zonemgr                      dns_zonemgr_t;
110 typedef struct dns_zt                           dns_zt_t;
111
112 typedef enum {
113         dns_bitlabel_0 = 0,
114         dns_bitlabel_1 = 1
115 } dns_bitlabel_t;
116
117 typedef enum {
118         dns_fwdpolicy_none = 0,
119         dns_fwdpolicy_first = 1,
120         dns_fwdpolicy_only = 2
121 } dns_fwdpolicy_t;
122
123 typedef enum {
124         dns_labeltype_ordinary = 0,
125         dns_labeltype_bitstring = 1
126 } dns_labeltype_t;
127
128 typedef enum {
129         dns_namereln_none = 0,
130         dns_namereln_contains = 1,
131         dns_namereln_subdomain = 2,
132         dns_namereln_equal = 3,
133         dns_namereln_commonancestor = 4
134 } dns_namereln_t;
135
136 typedef enum {
137         dns_one_answer, dns_many_answers
138 } dns_transfer_format_t;
139
140 typedef enum {
141         dns_dbtype_zone = 0, dns_dbtype_cache = 1, dns_dbtype_stub = 3
142 } dns_dbtype_t;
143
144 typedef enum {
145         dns_notifytype_no = 0,
146         dns_notifytype_yes = 1,
147         dns_notifytype_explicit = 2
148 } dns_notifytype_t;
149
150 typedef enum {
151         dns_dialuptype_no = 0,
152         dns_dialuptype_yes = 1,
153         dns_dialuptype_notify = 2,
154         dns_dialuptype_notifypassive = 3,
155         dns_dialuptype_refresh = 4,
156         dns_dialuptype_passive = 5
157 } dns_dialuptype_t;
158
159 /*
160  * These are generated by gen.c.
161  */
162 #include <dns/enumtype.h>       /* Provides dns_rdatatype_t. */
163 #include <dns/enumclass.h>      /* Provides dns_rdataclass_t. */
164
165 /*
166  * rcodes.
167  */
168 enum {
169         /*
170          * Standard rcodes.
171          */
172         dns_rcode_noerror = 0,
173 #define dns_rcode_noerror               ((dns_rcode_t)dns_rcode_noerror)
174         dns_rcode_formerr = 1,
175 #define dns_rcode_formerr               ((dns_rcode_t)dns_rcode_formerr)
176         dns_rcode_servfail = 2,
177 #define dns_rcode_servfail              ((dns_rcode_t)dns_rcode_servfail)
178         dns_rcode_nxdomain = 3,
179 #define dns_rcode_nxdomain              ((dns_rcode_t)dns_rcode_nxdomain)
180         dns_rcode_notimp = 4,
181 #define dns_rcode_notimp                ((dns_rcode_t)dns_rcode_notimp)
182         dns_rcode_refused = 5,
183 #define dns_rcode_refused               ((dns_rcode_t)dns_rcode_refused)
184         dns_rcode_yxdomain = 6,
185 #define dns_rcode_yxdomain              ((dns_rcode_t)dns_rcode_yxdomain)
186         dns_rcode_yxrrset = 7,
187 #define dns_rcode_yxrrset               ((dns_rcode_t)dns_rcode_yxrrset)
188         dns_rcode_nxrrset = 8,
189 #define dns_rcode_nxrrset               ((dns_rcode_t)dns_rcode_nxrrset)
190         dns_rcode_notauth = 9,
191 #define dns_rcode_notauth               ((dns_rcode_t)dns_rcode_notauth)
192         dns_rcode_notzone = 10,
193 #define dns_rcode_notzone               ((dns_rcode_t)dns_rcode_notzone)
194         /*
195          * Extended rcodes.
196          */
197         dns_rcode_badvers = 16
198 #define dns_rcode_badvers               ((dns_rcode_t)dns_rcode_badvers)
199 };
200
201 /*
202  * TSIG errors.
203  */
204 enum {
205         dns_tsigerror_badsig = 16,
206         dns_tsigerror_badkey = 17,
207         dns_tsigerror_badtime = 18,
208         dns_tsigerror_badmode = 19,
209         dns_tsigerror_badname = 20,
210         dns_tsigerror_badalg = 21
211 };
212
213 /*
214  * Opcodes.
215  */
216 enum {
217         dns_opcode_query = 0,
218 #define dns_opcode_query                ((dns_opcode_t)dns_opcode_query)
219         dns_opcode_iquery = 1,
220 #define dns_opcode_iquery               ((dns_opcode_t)dns_opcode_iquery)
221         dns_opcode_status = 2,
222 #define dns_opcode_status               ((dns_opcode_t)dns_opcode_status)
223         dns_opcode_notify = 4,
224 #define dns_opcode_notify               ((dns_opcode_t)dns_opcode_notify)
225         dns_opcode_update = 5           /* dynamic update */
226 #define dns_opcode_update               ((dns_opcode_t)dns_opcode_update)
227 };
228
229 /*
230  * Trust levels.  Must be kept in sync with trustnames[] in masterdump.c.
231  */
232 enum {
233         /* Sentinel value; no data should have this trust level. */
234         dns_trust_none = 0,
235 #define dns_trust_none                  ((dns_trust_t)dns_trust_none)
236
237         /* Subject to DNSSEC validation but has not yet been validated */
238         dns_trust_pending = 1,
239 #define dns_trust_pending               ((dns_trust_t)dns_trust_pending)
240
241         /* Received in the additional section of a response. */
242         dns_trust_additional = 2,
243 #define dns_trust_additional            ((dns_trust_t)dns_trust_additional)
244
245         /* Received in a referral response. */ 
246         dns_trust_glue = 3,
247 #define dns_trust_glue                  ((dns_trust_t)dns_trust_glue)
248
249         /* Answser from a non-authoritative server */
250         dns_trust_answer = 4,
251 #define dns_trust_answer                ((dns_trust_t)dns_trust_answer)
252
253         /*  Received in the authority section as part of an
254             authoritative response */
255         dns_trust_authauthority = 5,
256 #define dns_trust_authauthority         ((dns_trust_t)dns_trust_authauthority)
257
258         /* Answser from an authoritative server */
259         dns_trust_authanswer = 6,
260 #define dns_trust_authanswer            ((dns_trust_t)dns_trust_authanswer)
261
262         /* Successfully DNSSEC validated */     
263         dns_trust_secure = 7,
264 #define dns_trust_secure                ((dns_trust_t)dns_trust_secure)
265
266         /* This server is authoritative */
267         dns_trust_ultimate = 8
268 #define dns_trust_ultimate              ((dns_trust_t)dns_trust_ultimate)
269 };
270
271 /*
272  * Name checking severites.
273  */
274 typedef enum {
275         dns_severity_ignore,
276         dns_severity_warn,
277         dns_severity_fail
278 } dns_severity_t;
279
280 /*
281  * Functions.
282  */
283 typedef void
284 (*dns_loaddonefunc_t)(void *, isc_result_t);
285
286 typedef isc_result_t
287 (*dns_addrdatasetfunc_t)(void *, dns_name_t *, dns_rdataset_t *);
288
289 typedef isc_result_t
290 (*dns_additionaldatafunc_t)(void *, dns_name_t *, dns_rdatatype_t);
291
292 typedef isc_result_t
293 (*dns_digestfunc_t)(void *, isc_region_t *);
294
295 typedef void
296 (*dns_xfrindone_t)(dns_zone_t *, isc_result_t);
297
298 typedef void
299 (*dns_updatecallback_t)(void *, isc_result_t, dns_message_t *);
300
301 typedef int 
302 (*dns_rdatasetorderfunc_t)(dns_rdata_t *rdata, void *arg);
303
304 #endif /* DNS_TYPES_H */