00001 /* 00002 * Copyright (C) 2004, 2005, 2007, 2010, 2011, 2013-2015 Internet Systems Consortium, Inc. ("ISC") 00003 * Copyright (C) 1999-2002 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 NAMED_QUERY_H 00019 #define NAMED_QUERY_H 1 00020 00021 /*! \file */ 00022 00023 #include <isc/types.h> 00024 #include <isc/buffer.h> 00025 #include <isc/netaddr.h> 00026 00027 #include <dns/rdataset.h> 00028 #include <dns/rpz.h> 00029 #include <dns/types.h> 00030 00031 #include <named/types.h> 00032 00033 /*% nameserver database version structure */ 00034 typedef struct ns_dbversion { 00035 dns_db_t *db; 00036 dns_dbversion_t *version; 00037 isc_boolean_t acl_checked; 00038 isc_boolean_t queryok; 00039 ISC_LINK(struct ns_dbversion) link; 00040 } ns_dbversion_t; 00041 00042 /*% nameserver query structure */ 00043 struct ns_query { 00044 unsigned int attributes; 00045 unsigned int restarts; 00046 isc_boolean_t timerset; 00047 dns_name_t * qname; 00048 dns_name_t * origqname; 00049 dns_rdatatype_t qtype; 00050 unsigned int dboptions; 00051 unsigned int fetchoptions; 00052 dns_db_t * gluedb; 00053 dns_db_t * authdb; 00054 dns_zone_t * authzone; 00055 isc_boolean_t authdbset; 00056 isc_boolean_t isreferral; 00057 isc_mutex_t fetchlock; 00058 dns_fetch_t * fetch; 00059 dns_fetch_t * prefetch; 00060 dns_rpz_st_t * rpz_st; 00061 isc_bufferlist_t namebufs; 00062 ISC_LIST(ns_dbversion_t) activeversions; 00063 ISC_LIST(ns_dbversion_t) freeversions; 00064 dns_rdataset_t * dns64_aaaa; 00065 dns_rdataset_t * dns64_sigaaaa; 00066 isc_boolean_t * dns64_aaaaok; 00067 unsigned int dns64_aaaaoklen; 00068 unsigned int dns64_options; 00069 unsigned int dns64_ttl; 00070 struct { 00071 dns_db_t * db; 00072 dns_zone_t * zone; 00073 dns_dbnode_t * node; 00074 dns_rdatatype_t qtype; 00075 dns_name_t * fname; 00076 dns_fixedname_t fixed; 00077 isc_result_t result; 00078 dns_rdataset_t * rdataset; 00079 dns_rdataset_t * sigrdataset; 00080 isc_boolean_t authoritative; 00081 } redirect; 00082 00083 }; 00084 00085 #define NS_QUERYATTR_RECURSIONOK 0x0001 00086 #define NS_QUERYATTR_CACHEOK 0x0002 00087 #define NS_QUERYATTR_PARTIALANSWER 0x0004 00088 #define NS_QUERYATTR_NAMEBUFUSED 0x0008 00089 #define NS_QUERYATTR_RECURSING 0x0010 00090 #define NS_QUERYATTR_CACHEGLUEOK 0x0020 00091 #define NS_QUERYATTR_QUERYOKVALID 0x0040 00092 #define NS_QUERYATTR_QUERYOK 0x0080 00093 #define NS_QUERYATTR_WANTRECURSION 0x0100 00094 #define NS_QUERYATTR_SECURE 0x0200 00095 #define NS_QUERYATTR_NOAUTHORITY 0x0400 00096 #define NS_QUERYATTR_NOADDITIONAL 0x0800 00097 #define NS_QUERYATTR_CACHEACLOKVALID 0x1000 00098 #define NS_QUERYATTR_CACHEACLOK 0x2000 00099 #define NS_QUERYATTR_DNS64 0x4000 00100 #define NS_QUERYATTR_DNS64EXCLUDE 0x8000 00101 #define NS_QUERYATTR_RRL_CHECKED 0x10000 00102 #define NS_QUERYATTR_REDIRECT 0x20000 00103 00104 isc_result_t 00105 ns_query_init(ns_client_t *client); 00106 00107 void 00108 ns_query_free(ns_client_t *client); 00109 00110 void 00111 ns_query_start(ns_client_t *client); 00112 00113 void 00114 ns_query_cancel(ns_client_t *client); 00115 00116 #endif /* NAMED_QUERY_H */