types.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2015  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 1998-2003  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 #ifndef DNS_TYPES_H
00019 #define DNS_TYPES_H 1
00020 
00021 /*! \file dns/types.h
00022  * \brief
00023  * Including this file gives you type declarations suitable for use in
00024  * .h files, which lets us avoid circular type reference problems.
00025  * \brief
00026  * To actually use a type or get declarations of its methods, you must
00027  * include the appropriate .h file too.
00028  */
00029 
00030 #include <stdio.h>
00031 
00032 #include <isc/types.h>
00033 
00034 typedef struct dns_acache                       dns_acache_t;
00035 typedef struct dns_acacheentry                  dns_acacheentry_t;
00036 typedef struct dns_acachestats                  dns_acachestats_t;
00037 typedef struct dns_acl                          dns_acl_t;
00038 typedef struct dns_aclelement                   dns_aclelement_t;
00039 typedef struct dns_aclenv                       dns_aclenv_t;
00040 typedef struct dns_adb                          dns_adb_t;
00041 typedef struct dns_adbaddrinfo                  dns_adbaddrinfo_t;
00042 typedef ISC_LIST(dns_adbaddrinfo_t)             dns_adbaddrinfolist_t;
00043 typedef struct dns_adbentry                     dns_adbentry_t;
00044 typedef struct dns_adbfind                      dns_adbfind_t;
00045 typedef ISC_LIST(dns_adbfind_t)                 dns_adbfindlist_t;
00046 typedef struct dns_badcache                     dns_badcache_t;
00047 typedef struct dns_byaddr                       dns_byaddr_t;
00048 typedef struct dns_client                       dns_client_t;
00049 typedef void                                    dns_clientrestrans_t;
00050 typedef void                                    dns_clientreqtrans_t;
00051 typedef void                                    dns_clientupdatetrans_t;
00052 typedef struct dns_cache                        dns_cache_t;
00053 typedef isc_uint16_t                            dns_cert_t;
00054 typedef struct dns_compress                     dns_compress_t;
00055 typedef struct dns_db                           dns_db_t;
00056 typedef struct dns_dbimplementation             dns_dbimplementation_t;
00057 typedef struct dns_dbiterator                   dns_dbiterator_t;
00058 typedef void                                    dns_dbload_t;
00059 typedef void                                    dns_dbnode_t;
00060 typedef struct dns_dbtable                      dns_dbtable_t;
00061 typedef void                                    dns_dbversion_t;
00062 typedef struct dns_dlzimplementation            dns_dlzimplementation_t;
00063 typedef struct dns_dlzdb                        dns_dlzdb_t;
00064 typedef ISC_LIST(dns_dlzdb_t)                   dns_dlzdblist_t;
00065 typedef struct dns_sdlzimplementation           dns_sdlzimplementation_t;
00066 typedef struct dns_decompress                   dns_decompress_t;
00067 typedef struct dns_dispatch                     dns_dispatch_t;
00068 typedef struct dns_dispatchevent                dns_dispatchevent_t;
00069 typedef struct dns_dispatchlist                 dns_dispatchlist_t;
00070 typedef struct dns_dispatchset                  dns_dispatchset_t;
00071 typedef struct dns_dispatchmgr                  dns_dispatchmgr_t;
00072 typedef struct dns_dispentry                    dns_dispentry_t;
00073 typedef struct dns_dns64                        dns_dns64_t;
00074 typedef ISC_LIST(dns_dns64_t)                   dns_dns64list_t;
00075 typedef struct dns_dnsseckey                    dns_dnsseckey_t;
00076 typedef ISC_LIST(dns_dnsseckey_t)               dns_dnsseckeylist_t;
00077 typedef isc_uint8_t                             dns_dsdigest_t;
00078 typedef struct dns_dumpctx                      dns_dumpctx_t;
00079 typedef struct dns_ednsopt                      dns_ednsopt_t;
00080 typedef struct dns_fetch                        dns_fetch_t;
00081 typedef struct dns_fixedname                    dns_fixedname_t;
00082 typedef struct dns_forwarders                   dns_forwarders_t;
00083 typedef struct dns_forwarder                    dns_forwarder_t;
00084 typedef struct dns_fwdtable                     dns_fwdtable_t;
00085 typedef struct dns_iptable                      dns_iptable_t;
00086 typedef isc_uint32_t                            dns_iterations_t;
00087 typedef isc_uint16_t                            dns_keyflags_t;
00088 typedef struct dns_keynode                      dns_keynode_t;
00089 typedef ISC_LIST(dns_keynode_t)                 dns_keynodelist_t;
00090 typedef struct dns_keytable                     dns_keytable_t;
00091 typedef isc_uint16_t                            dns_keytag_t;
00092 typedef struct dns_loadctx                      dns_loadctx_t;
00093 typedef struct dns_loadmgr                      dns_loadmgr_t;
00094 typedef struct dns_masterrawheader              dns_masterrawheader_t;
00095 typedef struct dns_message                      dns_message_t;
00096 typedef isc_uint16_t                            dns_messageid_t;
00097 typedef isc_region_t                            dns_label_t;
00098 typedef struct dns_lookup                       dns_lookup_t;
00099 typedef struct dns_name                         dns_name_t;
00100 typedef ISC_LIST(dns_name_t)                    dns_namelist_t;
00101 typedef struct dns_nta                          dns_nta_t;
00102 typedef struct dns_ntatable                     dns_ntatable_t;
00103 typedef isc_uint16_t                            dns_opcode_t;
00104 typedef unsigned char                           dns_offsets_t[128];
00105 typedef struct dns_order                        dns_order_t;
00106 typedef struct dns_peer                         dns_peer_t;
00107 typedef struct dns_peerlist                     dns_peerlist_t;
00108 typedef struct dns_portlist                     dns_portlist_t;
00109 typedef struct dns_rbt                          dns_rbt_t;
00110 typedef isc_uint16_t                            dns_rcode_t;
00111 typedef struct dns_rdata                        dns_rdata_t;
00112 typedef struct dns_rdatacallbacks               dns_rdatacallbacks_t;
00113 typedef isc_uint16_t                            dns_rdataclass_t;
00114 typedef struct dns_rdatalist                    dns_rdatalist_t;
00115 typedef struct dns_rdataset                     dns_rdataset_t;
00116 typedef ISC_LIST(dns_rdataset_t)                dns_rdatasetlist_t;
00117 typedef struct dns_rdatasetiter                 dns_rdatasetiter_t;
00118 typedef isc_uint16_t                            dns_rdatatype_t;
00119 typedef struct dns_request                      dns_request_t;
00120 typedef struct dns_requestmgr                   dns_requestmgr_t;
00121 typedef struct dns_resolver                     dns_resolver_t;
00122 typedef struct dns_sdbimplementation            dns_sdbimplementation_t;
00123 typedef isc_uint8_t                             dns_secalg_t;
00124 typedef isc_uint8_t                             dns_secproto_t;
00125 typedef struct dns_signature                    dns_signature_t;
00126 typedef struct dns_ssurule                      dns_ssurule_t;
00127 typedef struct dns_ssutable                     dns_ssutable_t;
00128 typedef struct dns_stats                        dns_stats_t;
00129 typedef isc_uint32_t                            dns_rdatastatstype_t;
00130 typedef struct dns_tkeyctx                      dns_tkeyctx_t;
00131 typedef isc_uint16_t                            dns_trust_t;
00132 typedef struct dns_tsec                         dns_tsec_t;
00133 typedef struct dns_tsig_keyring                 dns_tsig_keyring_t;
00134 typedef struct dns_tsigkey                      dns_tsigkey_t;
00135 typedef isc_uint32_t                            dns_ttl_t;
00136 typedef struct dns_update_state                 dns_update_state_t;
00137 typedef struct dns_validator                    dns_validator_t;
00138 typedef struct dns_view                         dns_view_t;
00139 typedef ISC_LIST(dns_view_t)                    dns_viewlist_t;
00140 typedef struct dns_zone                         dns_zone_t;
00141 typedef ISC_LIST(dns_zone_t)                    dns_zonelist_t;
00142 typedef struct dns_zonemgr                      dns_zonemgr_t;
00143 typedef struct dns_zt                           dns_zt_t;
00144 
00145 /*
00146  * If we are not using GSSAPI, define the types we use as opaque types here.
00147  */
00148 #ifndef GSSAPI
00149 typedef struct not_defined_gss_cred_id *gss_cred_id_t;
00150 typedef struct not_defined_gss_ctx *gss_ctx_id_t;
00151 #endif
00152 typedef struct dst_gssapi_signverifyctx dst_gssapi_signverifyctx_t;
00153 
00154 typedef enum {
00155         dns_hash_sha1 = 1
00156 } dns_hash_t;
00157 
00158 typedef enum {
00159         dns_fwdpolicy_none = 0,
00160         dns_fwdpolicy_first = 1,
00161         dns_fwdpolicy_only = 2
00162 } dns_fwdpolicy_t;
00163 
00164 typedef enum {
00165         dns_namereln_none = 0,
00166         dns_namereln_contains = 1,
00167         dns_namereln_subdomain = 2,
00168         dns_namereln_equal = 3,
00169         dns_namereln_commonancestor = 4
00170 } dns_namereln_t;
00171 
00172 typedef enum {
00173         dns_one_answer, dns_many_answers
00174 } dns_transfer_format_t;
00175 
00176 typedef enum {
00177         dns_dbtype_zone = 0, dns_dbtype_cache = 1, dns_dbtype_stub = 3
00178 } dns_dbtype_t;
00179 
00180 typedef enum {
00181         dns_notifytype_no = 0,
00182         dns_notifytype_yes = 1,
00183         dns_notifytype_explicit = 2,
00184         dns_notifytype_masteronly = 3
00185 } dns_notifytype_t;
00186 
00187 typedef enum {
00188         dns_dialuptype_no = 0,
00189         dns_dialuptype_yes = 1,
00190         dns_dialuptype_notify = 2,
00191         dns_dialuptype_notifypassive = 3,
00192         dns_dialuptype_refresh = 4,
00193         dns_dialuptype_passive = 5
00194 } dns_dialuptype_t;
00195 
00196 typedef enum {
00197         dns_masterformat_none = 0,
00198         dns_masterformat_text = 1,
00199         dns_masterformat_raw  = 2,
00200         dns_masterformat_map = 3
00201 } dns_masterformat_t;
00202 
00203 typedef enum {
00204         dns_aaaa_ok = 0,
00205         dns_aaaa_filter = 1,
00206         dns_aaaa_break_dnssec = 2
00207 } dns_aaaa_t;
00208 
00209 /*
00210  * These are generated by gen.c.
00211  */
00212 #include <dns/enumtype.h>       /* Provides dns_rdatatype_t. */
00213 #include <dns/enumclass.h>      /* Provides dns_rdataclass_t. */
00214 
00215 /*%
00216  * rcodes.
00217  */
00218 enum {
00219         /*
00220          * Standard rcodes.
00221          */
00222         dns_rcode_noerror = 0,
00223 #define dns_rcode_noerror               ((dns_rcode_t)dns_rcode_noerror)
00224         dns_rcode_formerr = 1,
00225 #define dns_rcode_formerr               ((dns_rcode_t)dns_rcode_formerr)
00226         dns_rcode_servfail = 2,
00227 #define dns_rcode_servfail              ((dns_rcode_t)dns_rcode_servfail)
00228         dns_rcode_nxdomain = 3,
00229 #define dns_rcode_nxdomain              ((dns_rcode_t)dns_rcode_nxdomain)
00230         dns_rcode_notimp = 4,
00231 #define dns_rcode_notimp                ((dns_rcode_t)dns_rcode_notimp)
00232         dns_rcode_refused = 5,
00233 #define dns_rcode_refused               ((dns_rcode_t)dns_rcode_refused)
00234         dns_rcode_yxdomain = 6,
00235 #define dns_rcode_yxdomain              ((dns_rcode_t)dns_rcode_yxdomain)
00236         dns_rcode_yxrrset = 7,
00237 #define dns_rcode_yxrrset               ((dns_rcode_t)dns_rcode_yxrrset)
00238         dns_rcode_nxrrset = 8,
00239 #define dns_rcode_nxrrset               ((dns_rcode_t)dns_rcode_nxrrset)
00240         dns_rcode_notauth = 9,
00241 #define dns_rcode_notauth               ((dns_rcode_t)dns_rcode_notauth)
00242         dns_rcode_notzone = 10,
00243 #define dns_rcode_notzone               ((dns_rcode_t)dns_rcode_notzone)
00244         /*
00245          * Extended rcodes.
00246          */
00247         dns_rcode_badvers = 16
00248 #define dns_rcode_badvers               ((dns_rcode_t)dns_rcode_badvers)
00249 };
00250 
00251 /*%
00252  * TSIG errors.
00253  */
00254 enum {
00255         dns_tsigerror_badsig = 16,
00256         dns_tsigerror_badkey = 17,
00257         dns_tsigerror_badtime = 18,
00258         dns_tsigerror_badmode = 19,
00259         dns_tsigerror_badname = 20,
00260         dns_tsigerror_badalg = 21,
00261         dns_tsigerror_badtrunc = 22
00262 };
00263 
00264 /*%
00265  * Opcodes.
00266  */
00267 enum {
00268         dns_opcode_query = 0,
00269 #define dns_opcode_query                ((dns_opcode_t)dns_opcode_query)
00270         dns_opcode_iquery = 1,
00271 #define dns_opcode_iquery               ((dns_opcode_t)dns_opcode_iquery)
00272         dns_opcode_status = 2,
00273 #define dns_opcode_status               ((dns_opcode_t)dns_opcode_status)
00274         dns_opcode_notify = 4,
00275 #define dns_opcode_notify               ((dns_opcode_t)dns_opcode_notify)
00276         dns_opcode_update = 5           /* dynamic update */
00277 #define dns_opcode_update               ((dns_opcode_t)dns_opcode_update)
00278 };
00279 
00280 /*%
00281  * Trust levels.  Must be kept in sync with trustnames[] in masterdump.c.
00282  */
00283 enum {
00284         /* Sentinel value; no data should have this trust level. */
00285         dns_trust_none = 0,
00286 #define dns_trust_none                  ((dns_trust_t)dns_trust_none)
00287 
00288         /*%
00289          * Subject to DNSSEC validation but has not yet been validated
00290          * dns_trust_pending_additional (from the additional section).
00291          */
00292         dns_trust_pending_additional = 1,
00293 #define dns_trust_pending_additional \
00294                  ((dns_trust_t)dns_trust_pending_additional)
00295 
00296         dns_trust_pending_answer = 2,
00297 #define dns_trust_pending_answer        ((dns_trust_t)dns_trust_pending_answer)
00298 
00299         /*% Received in the additional section of a response. */
00300         dns_trust_additional = 3,
00301 #define dns_trust_additional            ((dns_trust_t)dns_trust_additional)
00302 
00303         /* Received in a referral response. */
00304         dns_trust_glue = 4,
00305 #define dns_trust_glue                  ((dns_trust_t)dns_trust_glue)
00306 
00307         /* Answer from a non-authoritative server */
00308         dns_trust_answer = 5,
00309 #define dns_trust_answer                ((dns_trust_t)dns_trust_answer)
00310 
00311         /*  Received in the authority section as part of an
00312             authoritative response */
00313         dns_trust_authauthority = 6,
00314 #define dns_trust_authauthority         ((dns_trust_t)dns_trust_authauthority)
00315 
00316         /* Answer from an authoritative server */
00317         dns_trust_authanswer = 7,
00318 #define dns_trust_authanswer            ((dns_trust_t)dns_trust_authanswer)
00319 
00320         /* Successfully DNSSEC validated */
00321         dns_trust_secure = 8,
00322 #define dns_trust_secure                ((dns_trust_t)dns_trust_secure)
00323 
00324         /* This server is authoritative */
00325         dns_trust_ultimate = 9
00326 #define dns_trust_ultimate              ((dns_trust_t)dns_trust_ultimate)
00327 };
00328 
00329 #define DNS_TRUST_PENDING(x)            ((x) == dns_trust_pending_answer || \
00330                                          (x) == dns_trust_pending_additional)
00331 #define DNS_TRUST_ADDITIONAL(x)         ((x) == dns_trust_additional || \
00332                                          (x) == dns_trust_pending_additional)
00333 #define DNS_TRUST_GLUE(x)               ((x) == dns_trust_glue)
00334 #define DNS_TRUST_ANSWER(x)             ((x) == dns_trust_answer)
00335 
00336 
00337 /*%
00338  * Name checking severities.
00339  */
00340 typedef enum {
00341         dns_severity_ignore,
00342         dns_severity_warn,
00343         dns_severity_fail
00344 } dns_severity_t;
00345 
00346 /*%
00347  * DNS Serial Number Update Method.
00348  *
00349  * \li  _none:          Keep the current serial.
00350  * \li  _increment:     Add one to the current serial, skipping 0.
00351  * \li  _unixtime:      Set to the seconds since 00:00 Jan 1, 1970,
00352  *                      if possible.
00353  * \li  _date:          Set to today's date in YYYYMMDDVV format:
00354  *                      (Year, Month, Day, Version)
00355  */
00356 typedef enum {
00357         dns_updatemethod_none = 0,
00358         dns_updatemethod_increment,
00359         dns_updatemethod_unixtime,
00360         dns_updatemethod_date
00361 } dns_updatemethod_t;
00362 
00363 /*
00364  * Functions.
00365  */
00366 typedef void
00367 (*dns_dumpdonefunc_t)(void *, isc_result_t);
00368 
00369 typedef void
00370 (*dns_loaddonefunc_t)(void *, isc_result_t);
00371 
00372 typedef void
00373 (*dns_rawdatafunc_t)(dns_zone_t *, dns_masterrawheader_t *);
00374 
00375 typedef isc_result_t
00376 (*dns_addrdatasetfunc_t)(void *, dns_name_t *, dns_rdataset_t *);
00377 
00378 typedef isc_result_t
00379 (*dns_additionaldatafunc_t)(void *, dns_name_t *, dns_rdatatype_t);
00380 
00381 typedef isc_result_t
00382 (*dns_digestfunc_t)(void *, isc_region_t *);
00383 
00384 typedef void
00385 (*dns_xfrindone_t)(dns_zone_t *, isc_result_t);
00386 
00387 typedef void
00388 (*dns_updatecallback_t)(void *, isc_result_t, dns_message_t *);
00389 
00390 typedef int
00391 (*dns_rdatasetorderfunc_t)(const dns_rdata_t *, const void *);
00392 
00393 typedef isc_boolean_t
00394 (*dns_checkmxfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *);
00395 
00396 typedef isc_boolean_t
00397 (*dns_checksrvfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *);
00398 
00399 typedef isc_boolean_t
00400 (*dns_checknsfunc_t)(dns_zone_t *, dns_name_t *, dns_name_t *,
00401                      dns_rdataset_t *, dns_rdataset_t *);
00402 
00403 typedef isc_boolean_t
00404 (*dns_isselffunc_t)(dns_view_t *, dns_tsigkey_t *, isc_sockaddr_t *,
00405                     isc_sockaddr_t *, dns_rdataclass_t, void *);
00406 
00407 typedef isc_result_t
00408 (*dns_deserializefunc_t)(void *, FILE *, off_t);
00409 
00410 typedef void
00411 (*dns_nseclog_t)(void *val, int , const char *, ...);
00412 
00413 #endif /* DNS_TYPES_H */

Generated on Tue Apr 28 17:41:04 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha