resolver.c File Reference

#include <config.h>
#include <ctype.h>
#include <isc/counter.h>
#include <isc/log.h>
#include <isc/platform.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/random.h>
#include <isc/socket.h>
#include <isc/stats.h>
#include <isc/task.h>
#include <isc/timer.h>
#include <isc/util.h>
#include <isc/hmacsha.h>
#include <dns/acl.h>
#include <dns/adb.h>
#include <dns/badcache.h>
#include <dns/cache.h>
#include <dns/db.h>
#include <dns/dispatch.h>
#include <dns/ds.h>
#include <dns/edns.h>
#include <dns/events.h>
#include <dns/forward.h>
#include <dns/keytable.h>
#include <dns/log.h>
#include <dns/message.h>
#include <dns/ncache.h>
#include <dns/nsec.h>
#include <dns/nsec3.h>
#include <dns/opcode.h>
#include <dns/peer.h>
#include <dns/rbt.h>
#include <dns/rcode.h>
#include <dns/rdata.h>
#include <dns/rdataclass.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatastruct.h>
#include <dns/rdatatype.h>
#include <dns/resolver.h>
#include <dns/result.h>
#include <dns/rootns.h>
#include <dns/stats.h>
#include <dns/tsig.h>
#include <dns/validator.h>

Go to the source code of this file.

Data Structures

struct  query
struct  tried
struct  fetchctx
struct  dns_valarg_t
struct  dns_fetch
struct  fctxbucket
struct  alternate
struct  dns_resolver

Defines

#define RTRACE(m)   do { UNUSED(m); } while (0)
#define RRTRACE(r, m)   do { UNUSED(r); UNUSED(m); } while (0)
#define FCTXTRACE(m)   do { UNUSED(m); } while (0)
#define FCTXTRACE2(m1, m2)   do { UNUSED(m1); UNUSED(m2); } while (0)
#define FCTXTRACE3(m1, res)   do { UNUSED(m1); UNUSED(res); } while (0)
#define FCTXTRACE4(m1, m2, res)   do { UNUSED(m1); UNUSED(m2); UNUSED(res); } while (0)
#define FTRACE(m)   do { UNUSED(m); } while (0)
#define QTRACE(m)   do { UNUSED(m); } while (0)
#define US_PER_SEC   1000000U
#define MAX_SINGLE_QUERY_TIMEOUT   9U
#define MAX_SINGLE_QUERY_TIMEOUT_US   (MAX_SINGLE_QUERY_TIMEOUT*US_PER_SEC)
#define MINIMUM_QUERY_TIMEOUT   (MAX_SINGLE_QUERY_TIMEOUT + 1U)
#define DEFAULT_QUERY_TIMEOUT   MINIMUM_QUERY_TIMEOUT
#define MAXIMUM_QUERY_TIMEOUT   30
#define DEFAULT_RECURSION_DEPTH   7
#define DEFAULT_MAX_QUERIES   75
#define RECV_BUFFER_SIZE   4096
 Maximum EDNS0 input packet size.
#define MAX_EDNS0_TIMEOUTS   3
 This defines the maximum number of timeouts we will permit before we disable EDNS0 on the query.
#define DNS_RESOLVER_BADCACHESIZE   1021
#define DNS_RESOLVER_BADCACHETTL(fctx)   (((fctx)->res->lame_ttl > 30 ) ? (fctx)->res->lame_ttl : 30)
#define QUERY_MAGIC   ISC_MAGIC('Q', '!', '!', '!')
#define VALID_QUERY(query)   ISC_MAGIC_VALID(query, QUERY_MAGIC)
#define RESQUERY_ATTR_CANCELED   0x02
#define RESQUERY_CONNECTING(q)   ((q)->connects > 0)
#define RESQUERY_CANCELED(q)
#define RESQUERY_SENDING(q)   ((q)->sends > 0)
#define FCTX_MAGIC   ISC_MAGIC('F', '!', '!', '!')
#define VALID_FCTX(fctx)   ISC_MAGIC_VALID(fctx, FCTX_MAGIC)
#define FCTX_ATTR_HAVEANSWER   0x0001
#define FCTX_ATTR_GLUING   0x0002
#define FCTX_ATTR_ADDRWAIT   0x0004
#define FCTX_ATTR_SHUTTINGDOWN   0x0008
#define FCTX_ATTR_WANTCACHE   0x0010
#define FCTX_ATTR_WANTNCACHE   0x0020
#define FCTX_ATTR_NEEDEDNS0   0x0040
#define FCTX_ATTR_TRIEDFIND   0x0080
#define FCTX_ATTR_TRIEDALT   0x0100
#define HAVE_ANSWER(f)
#define GLUING(f)
#define ADDRWAIT(f)
#define SHUTTINGDOWN(f)
#define WANTCACHE(f)   (((f)->attributes & FCTX_ATTR_WANTCACHE) != 0)
#define WANTNCACHE(f)   (((f)->attributes & FCTX_ATTR_WANTNCACHE) != 0)
#define NEEDEDNS0(f)   (((f)->attributes & FCTX_ATTR_NEEDEDNS0) != 0)
#define TRIEDFIND(f)   (((f)->attributes & FCTX_ATTR_TRIEDFIND) != 0)
#define TRIEDALT(f)   (((f)->attributes & FCTX_ATTR_TRIEDALT) != 0)
#define DNS_FETCH_MAGIC   ISC_MAGIC('F', 't', 'c', 'h')
#define DNS_FETCH_VALID(fetch)   ISC_MAGIC_VALID(fetch, DNS_FETCH_MAGIC)
#define RES_MAGIC   ISC_MAGIC('R', 'e', 's', '!')
#define VALID_RESOLVER(res)   ISC_MAGIC_VALID(res, RES_MAGIC)
#define FCTX_ADDRINFO_MARK   0x0001
 Private addrinfo flags. These must not conflict with DNS_FETCHOPT_NOEDNS0 (0x008) which we also use as an addrinfo flag.
#define FCTX_ADDRINFO_FORWARDER   0x1000
#define FCTX_ADDRINFO_TRIED   0x2000
#define FCTX_ADDRINFO_EDNSOK   0x4000
#define FCTX_ADDRINFO_NOSIT   0x8000
#define UNMARKED(a)
#define ISFORWARDER(a)
#define TRIED(a)
#define NOSIT(a)
#define EDNSOK(a)
#define NXDOMAIN(r)   (((r)->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0)
#define NEGATIVE(r)   (((r)->attributes & DNS_RDATASETATTR_NEGATIVE) != 0)
#define fctx_stopidletimer   fctx_starttimer
#define CACHE(r)   (((r)->attributes & DNS_RDATASETATTR_CACHE) != 0)
#define ANSWER(r)   (((r)->attributes & DNS_RDATASETATTR_ANSWER) != 0)
#define ANSWERSIG(r)   (((r)->attributes & DNS_RDATASETATTR_ANSWERSIG) != 0)
#define EXTERNAL(r)   (((r)->attributes & DNS_RDATASETATTR_EXTERNAL) != 0)
#define CHAINING(r)   (((r)->attributes & DNS_RDATASETATTR_CHAINING) != 0)
#define CHASE(r)   (((r)->attributes & DNS_RDATASETATTR_CHASE) != 0)
#define CHECKNAMES(r)   (((r)->attributes & DNS_RDATASETATTR_CHECKNAMES) != 0)
#define NXND(x)   ((x) == ISC_R_SUCCESS)
#define CHECK_FOR_GLUE_IN_ANSWER   0
#define LOOK_FOR_NS_IN_ANSWER   0x1
#define LOOK_FOR_GLUE_IN_ANSWER   0x2

Typedefs

typedef struct fetchctx fetchctx_t
typedef struct query resquery_t
typedef struct fctxbucket fctxbucket_t
typedef struct alternate alternate_t

Enumerations

enum  fetchstate { fetchstate_init = 0, fetchstate_active, fetchstate_done }
enum  badnstype_t { badns_unreachable = 0, badns_response, badns_validation }

Functions

static void destroy (dns_resolver_t *res)
static void empty_bucket (dns_resolver_t *res)
static isc_result_t resquery_send (resquery_t *query)
static void resquery_response (isc_task_t *task, isc_event_t *event)
static void resquery_connected (isc_task_t *task, isc_event_t *event)
static void fctx_try (fetchctx_t *fctx, isc_boolean_t retrying, isc_boolean_t badcache)
static void fctx_destroy (fetchctx_t *fctx)
static isc_boolean_t fctx_unlink (fetchctx_t *fctx)
static isc_result_t ncache_adderesult (dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node, dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t maxttl, isc_boolean_t optout, isc_boolean_t secure, dns_rdataset_t *ardataset, isc_result_t *eresultp)
static void validated (isc_task_t *task, isc_event_t *event)
static isc_boolean_t maybe_destroy (fetchctx_t *fctx, isc_boolean_t locked)
static void add_bad (fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, isc_result_t reason, badnstype_t badtype)
static isc_result_t findnoqname (fetchctx_t *fctx, dns_name_t *name, dns_rdatatype_t type, dns_name_t **noqname)
static void fctx_increference (fetchctx_t *fctx)
static isc_boolean_t fctx_decreference (fetchctx_t *fctx)
static void inc_stats (dns_resolver_t *res, isc_statscounter_t counter)
 Increment resolver-related statistics counters.
static void dec_stats (dns_resolver_t *res, isc_statscounter_t counter)
static isc_result_t valcreate (fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, dns_name_t *name, dns_rdatatype_t type, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset, unsigned int valoptions, isc_task_t *task)
static isc_boolean_t rrsig_fromchildzone (fetchctx_t *fctx, dns_rdataset_t *rdataset)
static isc_boolean_t fix_mustbedelegationornxdomain (dns_message_t *message, fetchctx_t *fctx)
static isc_result_t fctx_starttimer (fetchctx_t *fctx)
static void fctx_stoptimer (fetchctx_t *fctx)
static isc_result_t fctx_startidletimer (fetchctx_t *fctx, isc_interval_t *interval)
static void resquery_destroy (resquery_t **queryp)
static void fctx_cancelquery (resquery_t **queryp, dns_dispatchevent_t **deventp, isc_time_t *finish, isc_boolean_t no_response)
static void fctx_cancelqueries (fetchctx_t *fctx, isc_boolean_t no_response)
static void fctx_cleanupfinds (fetchctx_t *fctx)
static void fctx_cleanupaltfinds (fetchctx_t *fctx)
static void fctx_cleanupforwaddrs (fetchctx_t *fctx)
static void fctx_cleanupaltaddrs (fetchctx_t *fctx)
static void fctx_stopeverything (fetchctx_t *fctx, isc_boolean_t no_response)
static void fctx_sendevents (fetchctx_t *fctx, isc_result_t result, int line)
static void log_edns (fetchctx_t *fctx)
static void fctx_done (fetchctx_t *fctx, isc_result_t result, int line)
static void process_sendevent (resquery_t *query, isc_event_t *event)
static void resquery_udpconnected (isc_task_t *task, isc_event_t *event)
static void resquery_senddone (isc_task_t *task, isc_event_t *event)
static isc_result_t fctx_addopt (dns_message_t *message, unsigned int version, isc_uint16_t udpsize, dns_ednsopt_t *ednsopts, size_t count)
static void fctx_setretryinterval (fetchctx_t *fctx, unsigned int rtt)
static isc_result_t fctx_query (fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, unsigned int options)
static isc_boolean_t bad_edns (fetchctx_t *fctx, isc_sockaddr_t *address)
static void add_bad_edns (fetchctx_t *fctx, isc_sockaddr_t *address)
static struct triedtriededns (fetchctx_t *fctx, isc_sockaddr_t *address)
static void add_triededns (fetchctx_t *fctx, isc_sockaddr_t *address)
static struct triedtriededns512 (fetchctx_t *fctx, isc_sockaddr_t *address)
static void add_triededns512 (fetchctx_t *fctx, isc_sockaddr_t *address)
static isc_result_t issecuredomain (dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, isc_stdtime_t now, isc_boolean_t checknta, isc_boolean_t *issecure)
static isc_boolean_t wouldvalidate (fetchctx_t *fctx)
static void fctx_finddone (isc_task_t *task, isc_event_t *event)
static isc_boolean_t bad_server (fetchctx_t *fctx, isc_sockaddr_t *address)
static isc_boolean_t mark_bad (fetchctx_t *fctx)
static void sort_adbfind (dns_adbfind_t *find)
static void sort_finds (dns_adbfindlist_t *findlist)
static void findname (fetchctx_t *fctx, dns_name_t *name, in_port_t port, unsigned int options, unsigned int flags, isc_stdtime_t now, isc_boolean_t *need_alternate)
static isc_boolean_t isstrictsubdomain (dns_name_t *name1, dns_name_t *name2)
static isc_result_t fctx_getaddresses (fetchctx_t *fctx, isc_boolean_t badcache)
static void possibly_mark (fetchctx_t *fctx, dns_adbaddrinfo_t *addr)
static dns_adbaddrinfo_tfctx_nextaddress (fetchctx_t *fctx)
static void fctx_timeout (isc_task_t *task, isc_event_t *event)
static void fctx_shutdown (fetchctx_t *fctx)
static void fctx_doshutdown (isc_task_t *task, isc_event_t *event)
static void fctx_start (isc_task_t *task, isc_event_t *event)
static isc_result_t fctx_join (fetchctx_t *fctx, isc_task_t *task, isc_sockaddr_t *client, dns_messageid_t id, isc_taskaction_t action, void *arg, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset, dns_fetch_t *fetch)
static void log_ns_ttl (fetchctx_t *fctx, const char *where)
static isc_result_t fctx_create (dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, dns_name_t *domain, dns_rdataset_t *nameservers, unsigned int options, unsigned int bucketnum, unsigned int depth, isc_counter_t *qc, fetchctx_t **fctxp)
static isc_boolean_t is_lame (fetchctx_t *fctx)
static void log_lame (fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo)
static void log_formerr (fetchctx_t *fctx, const char *format,...)
static isc_result_t same_question (fetchctx_t *fctx)
static void clone_results (fetchctx_t *fctx)
static void fctx_log (void *arg, int level, const char *fmt,...)
static isc_result_t cache_name (fetchctx_t *fctx, dns_name_t *name, dns_adbaddrinfo_t *addrinfo, isc_stdtime_t now)
static isc_result_t cache_message (fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, isc_stdtime_t now)
static isc_result_t ncache_message (fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, dns_rdatatype_t covers, isc_stdtime_t now)
static void mark_related (dns_name_t *name, dns_rdataset_t *rdataset, isc_boolean_t external, isc_boolean_t gluing)
static isc_result_t check_section (void *arg, dns_name_t *addname, dns_rdatatype_t type, dns_section_t section)
static isc_result_t check_related (void *arg, dns_name_t *addname, dns_rdatatype_t type)
static void chase_additional (fetchctx_t *fctx)
static isc_result_t cname_target (dns_rdataset_t *rdataset, dns_name_t *tname)
static isc_result_t dname_target (fetchctx_t *fctx, dns_rdataset_t *rdataset, dns_name_t *qname, dns_name_t *oname, dns_fixedname_t *fixeddname)
static isc_boolean_t is_answeraddress_allowed (dns_view_t *view, dns_name_t *name, dns_rdataset_t *rdataset)
static isc_boolean_t is_answertarget_allowed (dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, dns_name_t *tname, dns_name_t *domain)
static void trim_ns_ttl (fetchctx_t *fctx, dns_name_t *name, dns_rdataset_t *rdataset)
static isc_result_t noanswer_response (fetchctx_t *fctx, dns_name_t *oqname, unsigned int look_in_options)
static isc_result_t answer_response (fetchctx_t *fctx)
static void resume_dslookup (isc_task_t *task, isc_event_t *event)
static void checknamessection (dns_message_t *message, dns_section_t section)
static void checknames (dns_message_t *message)
static void log_nsid (isc_buffer_t *opt, size_t nsid_len, resquery_t *query, int level, isc_mem_t *mctx)
static isc_boolean_t iscname (fetchctx_t *fctx)
static isc_boolean_t betterreferral (fetchctx_t *fctx)
static void process_opt (resquery_t *query, dns_rdataset_t *opt)
static void send_shutdown_events (dns_resolver_t *res)
static void spillattimer_countdown (isc_task_t *task, isc_event_t *event)
isc_result_t dns_resolver_create (dns_view_t *view, isc_taskmgr_t *taskmgr, unsigned int ntasks, unsigned int ndisp, isc_socketmgr_t *socketmgr, isc_timermgr_t *timermgr, unsigned int options, dns_dispatchmgr_t *dispatchmgr, dns_dispatch_t *dispatchv4, dns_dispatch_t *dispatchv6, dns_resolver_t **resp)
 Create a resolver.
static void prime_done (isc_task_t *task, isc_event_t *event)
void dns_resolver_prime (dns_resolver_t *res)
 Prime resolver.
void dns_resolver_freeze (dns_resolver_t *res)
 Freeze resolver.
void dns_resolver_attach (dns_resolver_t *source, dns_resolver_t **targetp)
void dns_resolver_whenshutdown (dns_resolver_t *res, isc_task_t *task, isc_event_t **eventp)
 Send '*eventp' to 'task' when 'res' has completed shutdown.
void dns_resolver_shutdown (dns_resolver_t *res)
 Start the shutdown process for 'res'.
void dns_resolver_detach (dns_resolver_t **resp)
static isc_boolean_t fctx_match (fetchctx_t *fctx, dns_name_t *name, dns_rdatatype_t type, unsigned int options)
static void log_fetch (dns_name_t *name, dns_rdatatype_t type)
isc_result_t dns_resolver_createfetch (dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, dns_name_t *domain, dns_rdataset_t *nameservers, dns_forwarders_t *forwarders, unsigned int options, isc_task_t *task, isc_taskaction_t action, void *arg, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset, dns_fetch_t **fetchp)
isc_result_t dns_resolver_createfetch2 (dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, dns_name_t *domain, dns_rdataset_t *nameservers, dns_forwarders_t *forwarders, isc_sockaddr_t *client, dns_messageid_t id, unsigned int options, isc_task_t *task, isc_taskaction_t action, void *arg, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset, dns_fetch_t **fetchp)
isc_result_t dns_resolver_createfetch3 (dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, dns_name_t *domain, dns_rdataset_t *nameservers, dns_forwarders_t *forwarders, isc_sockaddr_t *client, dns_messageid_t id, unsigned int options, unsigned int depth, isc_counter_t *qc, isc_task_t *task, isc_taskaction_t action, void *arg, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset, dns_fetch_t **fetchp)
void dns_resolver_cancelfetch (dns_fetch_t *fetch)
 Cancel 'fetch'.
void dns_resolver_destroyfetch (dns_fetch_t **fetchp)
 Destroy 'fetch'.
void dns_resolver_logfetch (dns_fetch_t *fetch, isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_boolean_t duplicateok)
 Dump a log message on internal state at the completion of given 'fetch'. 'lctx', 'category', 'module', and 'level' are used to write the log message. By default, only one log message is written even if the corresponding fetch context serves multiple clients; if 'duplicateok' is true the suppression is disabled and the message can be written every time this function is called.
dns_dispatchmgr_tdns_resolver_dispatchmgr (dns_resolver_t *resolver)
dns_dispatch_tdns_resolver_dispatchv4 (dns_resolver_t *resolver)
dns_dispatch_tdns_resolver_dispatchv6 (dns_resolver_t *resolver)
isc_socketmgr_tdns_resolver_socketmgr (dns_resolver_t *resolver)
isc_taskmgr_tdns_resolver_taskmgr (dns_resolver_t *resolver)
isc_uint32_t dns_resolver_getlamettl (dns_resolver_t *resolver)
 Get the resolver's lame-ttl. zero => no lame processing.
void dns_resolver_setlamettl (dns_resolver_t *resolver, isc_uint32_t lame_ttl)
 Set the resolver's lame-ttl. zero => no lame processing.
unsigned int dns_resolver_nrunning (dns_resolver_t *resolver)
 Return the number of currently running resolutions in this resolver. This is may be less than the number of outstanding fetches due to multiple identical fetches, or more than the number of of outstanding fetches due to the fact that resolution can continue even though a fetch has been canceled.
isc_result_t dns_resolver_addalternate (dns_resolver_t *resolver, isc_sockaddr_t *alt, dns_name_t *name, in_port_t port)
 Add alternate addresses to be tried in the event that the nameservers for a zone are not available in the address families supported by the operating system.
void dns_resolver_setudpsize (dns_resolver_t *resolver, isc_uint16_t udpsize)
 Set the EDNS UDP buffer size advertised by the server.
isc_uint16_t dns_resolver_getudpsize (dns_resolver_t *resolver)
 Get the current EDNS UDP buffer size.
void dns_resolver_flushbadcache (dns_resolver_t *resolver, dns_name_t *name)
 Flush the bad cache of all entries at 'name' if 'name' is non NULL. Flush the entire bad cache if 'name' is NULL.
void dns_resolver_flushbadnames (dns_resolver_t *resolver, dns_name_t *name)
 Flush the bad cache of all entries at or below 'name'.
void dns_resolver_addbadcache (dns_resolver_t *resolver, dns_name_t *name, dns_rdatatype_t type, isc_time_t *expire)
 Add a entry to the bad cache for <name,type> that will expire at 'expire'.
isc_boolean_t dns_resolver_getbadcache (dns_resolver_t *resolver, dns_name_t *name, dns_rdatatype_t type, isc_time_t *now)
 Check to see if there is a unexpired entry in the bad cache for <name,type>.
void dns_resolver_printbadcache (dns_resolver_t *resolver, FILE *fp)
static void free_algorithm (void *node, void *arg)
void dns_resolver_reset_algorithms (dns_resolver_t *resolver)
 Clear the disabled DNSSEC algorithms.
isc_result_t dns_resolver_disable_algorithm (dns_resolver_t *resolver, dns_name_t *name, unsigned int alg)
 Mark the given DNSSEC algorithm as disabled and below 'name'. Valid algorithms are less than 256.
isc_boolean_t dns_resolver_algorithm_supported (dns_resolver_t *resolver, dns_name_t *name, unsigned int alg)
 Check if the given algorithm is supported by this resolver. This checks whether the algorithm has been disabled via dns_resolver_disable_algorithm(), then checks the underlying crypto libraries if it was not specifically disabled.
static void free_digest (void *node, void *arg)
void dns_resolver_reset_ds_digests (dns_resolver_t *resolver)
 Clear the disabled DS/DLV digest types.
isc_result_t dns_resolver_disable_ds_digest (dns_resolver_t *resolver, dns_name_t *name, unsigned int digest_type)
 Mark the given DS/DLV digest type as disabled and below 'name'. Valid types are less than 256.
isc_boolean_t dns_resolver_ds_digest_supported (dns_resolver_t *resolver, dns_name_t *name, unsigned int digest_type)
 Check if the given digest type is supported by this resolver. This checks whether the digest type has been disabled via dns_resolver_disable_ds_digest(), then checks the underlying crypto libraries if it was not specifically disabled.
void dns_resolver_resetmustbesecure (dns_resolver_t *resolver)
isc_result_t dns_resolver_setmustbesecure (dns_resolver_t *resolver, dns_name_t *name, isc_boolean_t value)
isc_boolean_t dns_resolver_getmustbesecure (dns_resolver_t *resolver, dns_name_t *name)
void dns_resolver_getclientsperquery (dns_resolver_t *resolver, isc_uint32_t *cur, isc_uint32_t *min, isc_uint32_t *max)
void dns_resolver_setclientsperquery (dns_resolver_t *resolver, isc_uint32_t min, isc_uint32_t max)
isc_boolean_t dns_resolver_getzeronosoattl (dns_resolver_t *resolver)
void dns_resolver_setzeronosoattl (dns_resolver_t *resolver, isc_boolean_t state)
unsigned int dns_resolver_getoptions (dns_resolver_t *resolver)
unsigned int dns_resolver_gettimeout (dns_resolver_t *resolver)
 Get the current length of time the resolver will work on a query, in seconds.
void dns_resolver_settimeout (dns_resolver_t *resolver, unsigned int seconds)
 Set the length of time the resolver will work on a query, in seconds.
void dns_resolver_setquerydscp4 (dns_resolver_t *resolver, isc_dscp_t dscp)
 Print out the contents of the bad cache to 'fp'.
isc_dscp_t dns_resolver_getquerydscp4 (dns_resolver_t *resolver)
void dns_resolver_setquerydscp6 (dns_resolver_t *resolver, isc_dscp_t dscp)
isc_dscp_t dns_resolver_getquerydscp6 (dns_resolver_t *resolver)
void dns_resolver_setmaxdepth (dns_resolver_t *resolver, unsigned int maxdepth)
 Get and set the DSCP values for the resolver's IPv4 and IPV6 query sources.
unsigned int dns_resolver_getmaxdepth (dns_resolver_t *resolver)
void dns_resolver_setmaxqueries (dns_resolver_t *resolver, unsigned int queries)
 Get and set how many NS indirections will be followed when looking for nameserver addresses.
unsigned int dns_resolver_getmaxqueries (dns_resolver_t *resolver)

Variables

static isc_boolean_t yes = ISC_TRUE
static isc_boolean_t no = ISC_FALSE


Detailed Description

Definition in file resolver.c.


Define Documentation

#define RTRACE (  )     do { UNUSED(m); } while (0)

Definition at line 130 of file resolver.c.

Referenced by destroy(), dns_resolver_create(), dns_resolver_detach(), dns_resolver_prime(), dns_resolver_shutdown(), and empty_bucket().

#define RRTRACE ( r,
 )     do { UNUSED(r); UNUSED(m); } while (0)

Definition at line 131 of file resolver.c.

Referenced by dns_resolver_attach().

#define FCTXTRACE (  )     do { UNUSED(m); } while (0)

Definition at line 132 of file resolver.c.

Referenced by add_bad(), answer_response(), cache_message(), clone_results(), fctx_cancelqueries(), fctx_cancelquery(), fctx_create(), fctx_destroy(), fctx_done(), fctx_doshutdown(), fctx_finddone(), fctx_getaddresses(), fctx_join(), fctx_query(), fctx_sendevents(), fctx_shutdown(), fctx_start(), fctx_stopeverything(), fctx_timeout(), fctx_try(), fctx_unlink(), findnoqname(), ncache_message(), noanswer_response(), resquery_connected(), resquery_response(), and resume_dslookup().

#define FCTXTRACE2 ( m1,
m2   )     do { UNUSED(m1); UNUSED(m2); } while (0)

Definition at line 133 of file resolver.c.

Referenced by possibly_mark(), and resquery_response().

#define FCTXTRACE3 ( m1,
res   )     do { UNUSED(m1); UNUSED(res); } while (0)

Definition at line 134 of file resolver.c.

Referenced by process_sendevent(), resquery_connected(), and resquery_response().

#define FCTXTRACE4 ( m1,
m2,
res   )     do { UNUSED(m1); UNUSED(m2); UNUSED(res); } while (0)

Definition at line 135 of file resolver.c.

Referenced by resquery_response().

#define FTRACE (  )     do { UNUSED(m); } while (0)

Definition at line 137 of file resolver.c.

Referenced by dns_resolver_cancelfetch(), dns_resolver_createfetch3(), and dns_resolver_destroyfetch().

#define QTRACE (  )     do { UNUSED(m); } while (0)

Definition at line 138 of file resolver.c.

Referenced by fctx_query(), resquery_connected(), resquery_response(), resquery_send(), resquery_senddone(), and resquery_udpconnected().

#define US_PER_SEC   1000000U

Definition at line 141 of file resolver.c.

Referenced by dns_resolver_logfetch(), and fctx_setretryinterval().

#define MAX_SINGLE_QUERY_TIMEOUT   9U

Definition at line 145 of file resolver.c.

#define MAX_SINGLE_QUERY_TIMEOUT_US   (MAX_SINGLE_QUERY_TIMEOUT*US_PER_SEC)

Definition at line 146 of file resolver.c.

Referenced by fctx_cancelquery(), and fctx_setretryinterval().

#define MINIMUM_QUERY_TIMEOUT   (MAX_SINGLE_QUERY_TIMEOUT + 1U)

Definition at line 151 of file resolver.c.

Referenced by dns_resolver_settimeout().

#define DEFAULT_QUERY_TIMEOUT   MINIMUM_QUERY_TIMEOUT

Definition at line 155 of file resolver.c.

Referenced by dns_resolver_create(), and dns_resolver_settimeout().

#define MAXIMUM_QUERY_TIMEOUT   30

Definition at line 159 of file resolver.c.

Referenced by dns_resolver_settimeout().

#define DEFAULT_RECURSION_DEPTH   7

Definition at line 164 of file resolver.c.

Referenced by dns_resolver_create().

#define DEFAULT_MAX_QUERIES   75

Definition at line 169 of file resolver.c.

Referenced by dns_resolver_create().

#define RECV_BUFFER_SIZE   4096

Maximum EDNS0 input packet size.

Definition at line 175 of file resolver.c.

Referenced by client_create(), client_udprecv(), dns_resolver_create(), and exit_check().

#define MAX_EDNS0_TIMEOUTS   3

This defines the maximum number of timeouts we will permit before we disable EDNS0 on the query.

Definition at line 181 of file resolver.c.

Referenced by resquery_send().

#define DNS_RESOLVER_BADCACHESIZE   1021

Definition at line 183 of file resolver.c.

Referenced by dns_resolver_create().

#define DNS_RESOLVER_BADCACHETTL ( fctx   )     (((fctx)->res->lame_ttl > 30 ) ? (fctx)->res->lame_ttl : 30)

Definition at line 184 of file resolver.c.

Referenced by fctx_getaddresses().

#define QUERY_MAGIC   ISC_MAGIC('Q', '!', '!', '!')

Definition at line 223 of file resolver.c.

Referenced by fctx_query().

#define VALID_QUERY ( query   )     ISC_MAGIC_VALID(query, QUERY_MAGIC)

Definition at line 224 of file resolver.c.

Referenced by resquery_connected(), and resquery_response().

#define RESQUERY_ATTR_CANCELED   0x02

Definition at line 226 of file resolver.c.

Referenced by fctx_cancelquery(), and resquery_send().

#define RESQUERY_CONNECTING (  )     ((q)->connects > 0)

Definition at line 228 of file resolver.c.

Referenced by fctx_cancelquery(), and resquery_udpconnected().

#define RESQUERY_CANCELED (  ) 

Value:

(((q)->attributes & \
                                          RESQUERY_ATTR_CANCELED) != 0)

Definition at line 229 of file resolver.c.

Referenced by fctx_cancelquery(), process_sendevent(), and resquery_connected().

#define RESQUERY_SENDING (  )     ((q)->sends > 0)

Definition at line 231 of file resolver.c.

Referenced by fctx_cancelquery(), and resquery_senddone().

#define FCTX_MAGIC   ISC_MAGIC('F', '!', '!', '!')

Definition at line 364 of file resolver.c.

Referenced by fctx_create().

#define VALID_FCTX ( fctx   )     ISC_MAGIC_VALID(fctx, FCTX_MAGIC)

Definition at line 365 of file resolver.c.

Referenced by check_section(), dns_resolver_cancelfetch(), dns_resolver_destroyfetch(), dns_resolver_logfetch(), fctx_decreference(), fctx_destroy(), fctx_doshutdown(), fctx_finddone(), fctx_increference(), fctx_start(), fctx_timeout(), fctx_unlink(), resquery_response(), and resume_dslookup().

#define FCTX_ATTR_HAVEANSWER   0x0001

Definition at line 367 of file resolver.c.

Referenced by cache_name(), fctx_sendevents(), and ncache_message().

#define FCTX_ATTR_GLUING   0x0002

Definition at line 368 of file resolver.c.

Referenced by noanswer_response().

#define FCTX_ATTR_ADDRWAIT   0x0004

Definition at line 369 of file resolver.c.

Referenced by fctx_done(), fctx_doshutdown(), fctx_finddone(), fctx_timeout(), fctx_try(), process_sendevent(), and resquery_connected().

#define FCTX_ATTR_SHUTTINGDOWN   0x0008

Definition at line 370 of file resolver.c.

Referenced by fctx_doshutdown(), and fctx_start().

#define FCTX_ATTR_WANTCACHE   0x0010

Definition at line 371 of file resolver.c.

Referenced by answer_response(), cache_message(), noanswer_response(), and resquery_response().

#define FCTX_ATTR_WANTNCACHE   0x0020

Definition at line 372 of file resolver.c.

Referenced by ncache_message(), noanswer_response(), and resquery_response().

#define FCTX_ATTR_NEEDEDNS0   0x0040

Definition at line 373 of file resolver.c.

#define FCTX_ATTR_TRIEDFIND   0x0080

Definition at line 374 of file resolver.c.

Referenced by fctx_nextaddress().

#define FCTX_ATTR_TRIEDALT   0x0100

Definition at line 375 of file resolver.c.

Referenced by fctx_nextaddress().

#define HAVE_ANSWER (  ) 

Value:

(((f)->attributes & FCTX_ATTR_HAVEANSWER) != \
                                 0)

Definition at line 377 of file resolver.c.

Referenced by fctx_sendevents(), ncache_message(), and resquery_response().

#define GLUING (  ) 

Value:

(((f)->attributes & FCTX_ATTR_GLUING) != \
                                 0)

Definition at line 379 of file resolver.c.

Referenced by check_section().

#define ADDRWAIT (  ) 

Value:

(((f)->attributes & FCTX_ATTR_ADDRWAIT) != \
                                 0)

Definition at line 381 of file resolver.c.

Referenced by fctx_finddone(), and fctx_try().

#define SHUTTINGDOWN (  ) 

Value:

(((f)->attributes & FCTX_ATTR_SHUTTINGDOWN) \
                                 != 0)

Definition at line 383 of file resolver.c.

Referenced by fctx_decreference(), fctx_finddone(), lwdclientmgr_destroy(), lwdclientmgr_shutdown_callback(), maybe_destroy(), and ns_lwdclient_startrecv().

#define WANTCACHE (  )     (((f)->attributes & FCTX_ATTR_WANTCACHE) != 0)

Definition at line 385 of file resolver.c.

Referenced by resquery_response().

#define WANTNCACHE (  )     (((f)->attributes & FCTX_ATTR_WANTNCACHE) != 0)

Definition at line 386 of file resolver.c.

Referenced by resquery_response().

#define NEEDEDNS0 (  )     (((f)->attributes & FCTX_ATTR_NEEDEDNS0) != 0)

Definition at line 387 of file resolver.c.

Referenced by resquery_send().

#define TRIEDFIND (  )     (((f)->attributes & FCTX_ATTR_TRIEDFIND) != 0)

Definition at line 388 of file resolver.c.

Referenced by fctx_cancelquery().

#define TRIEDALT (  )     (((f)->attributes & FCTX_ATTR_TRIEDALT) != 0)

Definition at line 389 of file resolver.c.

Referenced by fctx_cancelquery().

#define DNS_FETCH_MAGIC   ISC_MAGIC('F', 't', 'c', 'h')

Definition at line 402 of file resolver.c.

Referenced by fctx_join().

#define DNS_FETCH_VALID ( fetch   )     ISC_MAGIC_VALID(fetch, DNS_FETCH_MAGIC)

Definition at line 403 of file resolver.c.

Referenced by dns_resolver_cancelfetch(), dns_resolver_destroyfetch(), and dns_resolver_logfetch().

#define RES_MAGIC   ISC_MAGIC('R', 'e', 's', '!')

Definition at line 484 of file resolver.c.

Referenced by dns_resolver_create().

#define VALID_RESOLVER ( res   )     ISC_MAGIC_VALID(res, RES_MAGIC)

Definition at line 485 of file resolver.c.

Referenced by dns_resolver_addalternate(), dns_resolver_algorithm_supported(), dns_resolver_attach(), dns_resolver_createfetch3(), dns_resolver_detach(), dns_resolver_disable_algorithm(), dns_resolver_disable_ds_digest(), dns_resolver_dispatchmgr(), dns_resolver_dispatchv4(), dns_resolver_dispatchv6(), dns_resolver_ds_digest_supported(), dns_resolver_freeze(), dns_resolver_getclientsperquery(), dns_resolver_getlamettl(), dns_resolver_getmaxdepth(), dns_resolver_getmaxqueries(), dns_resolver_getmustbesecure(), dns_resolver_getoptions(), dns_resolver_getquerydscp4(), dns_resolver_getquerydscp6(), dns_resolver_gettimeout(), dns_resolver_getudpsize(), dns_resolver_getzeronosoattl(), dns_resolver_prime(), dns_resolver_reset_algorithms(), dns_resolver_reset_ds_digests(), dns_resolver_resetmustbesecure(), dns_resolver_setclientsperquery(), dns_resolver_setlamettl(), dns_resolver_setmaxdepth(), dns_resolver_setmaxqueries(), dns_resolver_setmustbesecure(), dns_resolver_setquerydscp4(), dns_resolver_setquerydscp6(), dns_resolver_settimeout(), dns_resolver_setudpsize(), dns_resolver_setzeronosoattl(), dns_resolver_shutdown(), dns_resolver_socketmgr(), dns_resolver_taskmgr(), dns_resolver_whenshutdown(), prime_done(), and spillattimer_countdown().

#define FCTX_ADDRINFO_MARK   0x0001

Private addrinfo flags. These must not conflict with DNS_FETCHOPT_NOEDNS0 (0x008) which we also use as an addrinfo flag.

Definition at line 491 of file resolver.c.

Referenced by fctx_nextaddress(), mark_bad(), and possibly_mark().

#define FCTX_ADDRINFO_FORWARDER   0x1000

Definition at line 492 of file resolver.c.

Referenced by fctx_getaddresses(), and findname().

#define FCTX_ADDRINFO_TRIED   0x2000

Definition at line 493 of file resolver.c.

Referenced by fctx_cancelquery().

#define FCTX_ADDRINFO_EDNSOK   0x4000

Definition at line 494 of file resolver.c.

Referenced by resquery_response(), and resquery_send().

#define FCTX_ADDRINFO_NOSIT   0x8000

Definition at line 495 of file resolver.c.

Referenced by resquery_response().

#define UNMARKED (  ) 

Value:

(((a)->flags & FCTX_ADDRINFO_MARK) \
                                         == 0)

Definition at line 497 of file resolver.c.

Referenced by fctx_cancelquery(), and fctx_nextaddress().

#define ISFORWARDER (  ) 

Value:

(((a)->flags & \
                                         FCTX_ADDRINFO_FORWARDER) != 0)

Definition at line 499 of file resolver.c.

Referenced by add_bad(), fctx_query(), noanswer_response(), resquery_response(), and resquery_send().

#define TRIED (  ) 

Value:

(((a)->flags & \
                                         FCTX_ADDRINFO_TRIED) != 0)

Definition at line 501 of file resolver.c.

Referenced by fctx_cancelquery().

#define NOSIT (  ) 

Value:

(((a)->flags & \
                                         FCTX_ADDRINFO_NOSIT) != 0)

Definition at line 503 of file resolver.c.

Referenced by resquery_response(), and resquery_send().

#define EDNSOK (  ) 

Value:

(((a)->flags & \
                                         FCTX_ADDRINFO_EDNSOK) != 0)

Definition at line 505 of file resolver.c.

Referenced by fctx_cancelquery(), resquery_response(), and resquery_send().

#define NXDOMAIN ( r   )     (((r)->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0)

Definition at line 509 of file resolver.c.

#define NEGATIVE ( r   )     (((r)->attributes & DNS_RDATASETATTR_NEGATIVE) != 0)

Definition at line 510 of file resolver.c.

#define fctx_stopidletimer   fctx_starttimer

Definition at line 818 of file resolver.c.

Referenced by fctx_query(), process_sendevent(), resquery_connected(), and resquery_response().

#define CACHE ( r   )     (((r)->attributes & DNS_RDATASETATTR_CACHE) != 0)

Definition at line 4402 of file resolver.c.

Referenced by cache_name(), and mark_related().

#define ANSWER ( r   )     (((r)->attributes & DNS_RDATASETATTR_ANSWER) != 0)

Definition at line 4403 of file resolver.c.

Referenced by cache_name().

#define ANSWERSIG ( r   )     (((r)->attributes & DNS_RDATASETATTR_ANSWERSIG) != 0)

Definition at line 4404 of file resolver.c.

Referenced by cache_name().

#define EXTERNAL ( r   )     (((r)->attributes & DNS_RDATASETATTR_EXTERNAL) != 0)

Definition at line 4405 of file resolver.c.

Referenced by cache_name().

#define CHAINING ( r   )     (((r)->attributes & DNS_RDATASETATTR_CHAINING) != 0)

Definition at line 4406 of file resolver.c.

Referenced by cache_name().

#define CHASE ( r   )     (((r)->attributes & DNS_RDATASETATTR_CHASE) != 0)

Definition at line 4407 of file resolver.c.

Referenced by chase_additional().

#define CHECKNAMES ( r   )     (((r)->attributes & DNS_RDATASETATTR_CHECKNAMES) != 0)

Definition at line 4408 of file resolver.c.

Referenced by cache_name().

#define NXND (  )     ((x) == ISC_R_SUCCESS)

Referenced by findnoqname().

#define CHECK_FOR_GLUE_IN_ANSWER   0

Definition at line 5815 of file resolver.c.

#define LOOK_FOR_NS_IN_ANSWER   0x1

Definition at line 6082 of file resolver.c.

Referenced by noanswer_response(), and resquery_response().

#define LOOK_FOR_GLUE_IN_ANSWER   0x2

Definition at line 6083 of file resolver.c.

Referenced by noanswer_response(), and resquery_response().


Typedef Documentation

typedef struct fetchctx fetchctx_t

Definition at line 187 of file resolver.c.

typedef struct query resquery_t

typedef struct fctxbucket fctxbucket_t

typedef struct alternate alternate_t


Enumeration Type Documentation

enum fetchstate

Enumerator:
fetchstate_init  Start event has not run yet.
fetchstate_active 
fetchstate_done  FETCHDONE events posted.

Definition at line 233 of file resolver.c.

enum badnstype_t

Enumerator:
badns_unreachable 
badns_response 
badns_validation 

Definition at line 239 of file resolver.c.


Function Documentation

static void destroy ( dns_resolver_t res  )  [static]

Definition at line 8257 of file resolver.c.

References alternate::_n, alternate::_u, dns_resolver::buckets, DESTROYLOCK, dns_resolver::dispatches4, dns_resolver::dispatches6, dns_badcache_destroy(), dns_dispatchset_destroy(), dns_name_free(), dns_resolver_reset_algorithms(), dns_resolver_reset_ds_digests(), dns_resolver_resetmustbesecure(), INSIST, alternate::isaddress, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_UNLINK, isc_mem_detach(), isc_mem_put, isc_rwlock_destroy(), isc_task_detach(), isc_task_shutdown(), isc_timer_detach(), fctxbucket::lock, dns_resolver::lock, dns_resolver::magic, dns_resolver::mctx, dns_resolver::nbuckets, dns_resolver::nlock, dns_resolver::primelock, REQUIRE, RTRACE, and fctxbucket::task.

static void empty_bucket ( dns_resolver_t res  )  [static]

Definition at line 8327 of file resolver.c.

References INSIST, dns_resolver::lock, LOCK, RTRACE, send_shutdown_events(), and UNLOCK.

Referenced by dns_resolver_destroyfetch(), fctx_doshutdown(), fctx_finddone(), fctx_start(), resquery_destroy(), and resume_dslookup().

static isc_result_t resquery_send ( resquery_t query  )  [static]

Definition at line 1918 of file resolver.c.

References add_triededns(), add_triededns512(), query::addrinfo, query::attributes, isc_socketevent::attributes, fetchctx::bucketnum, dns_resolver::buckets, query::buffer, dns_ednsopt::code, query::connects, tried::count, query::data, query::dispatch, query::dispentry, dns_view::dlv, dns_adb_changeflags(), dns_adb_getsit(), dns_adb_getudpsize(), dns_adb_noedns(), dns_adb_probesize2(), dns_compress_init(), dns_compress_invalidate(), dns_dispatch_addresponse2(), dns_dispatch_getentrysocket(), dns_dispatch_getsocket(), dns_dispatch_removeresponse(), DNS_EDNS_VERSION, DNS_EDNSOPTIONS, DNS_FETCHOPT_EDNS512, DNS_FETCHOPT_EDNSVERSIONMASK, DNS_FETCHOPT_EDNSVERSIONSET, DNS_FETCHOPT_EDNSVERSIONSHIFT, DNS_FETCHOPT_NOCDFLAG, DNS_FETCHOPT_NOEDNS0, DNS_FETCHOPT_NONTA, DNS_FETCHOPT_NOVALIDATE, DNS_FETCHOPT_RECURSIVE, DNS_FETCHOPT_TCP, DNS_FETCHOPT_WANTNSID, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_PACKETS, dns_master_style_comment, dns_message_addname(), dns_message_getquerytsig(), dns_message_gettempname(), dns_message_gettemprdataset(), dns_message_gettsigkey(), DNS_MESSAGE_INTENTRENDER, dns_message_logfmtpacket2(), dns_message_puttempname(), dns_message_puttemprdataset(), dns_message_renderbegin(), dns_message_renderend(), dns_message_rendersection(), dns_message_reset(), dns_message_settsigkey(), DNS_MESSAGEFLAG_CD, DNS_MESSAGEFLAG_RD, dns_name_clone(), dns_name_init(), dns_opcode_query, DNS_OPT_NSID, DNS_OPT_SIT, dns_peer_getednsversion(), dns_peer_getrequestnsid(), dns_peer_getrequestsit(), dns_peer_getsupportedns(), dns_peer_getudpsize(), dns_peerlist_peerbyaddr(), DNS_R_SERVFAIL, dns_rdataset_init(), dns_rdataset_makequestion(), DNS_SECTION_ADDITIONAL, DNS_SECTION_QUESTION, dns_tsigkey_attach(), dns_tsigkey_detach(), dns_view_getpeertsig(), isc_socketevent::dscp, query::dscp, EDNSOK, ednsopts, query::ednsversion, dns_view::enablevalidation, query::exclusivesocket, query::fctx, fctx_addopt(), FCTX_ADDRINFO_EDNSOK, dns_adbaddrinfo::flags, query::id, inc_stats(), INSIST, isc_buffer_add, isc_buffer_init, isc_buffer_putuint16, isc_buffer_usedregion, ISC_EVENT_INIT, ISC_FALSE, ISC_LIST_APPEND, ISC_LOG_DEBUG, isc_netaddr_fromsockaddr(), ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_socket_connect(), isc_socket_dscp(), isc_socket_sendto2(), ISC_SOCKEVENT_SENDDONE, ISC_SOCKEVENTATTR_DSCP, ISC_TF, isc_time_seconds(), ISC_TRUE, ISFORWARDER, issecuredomain(), isc_region::length, dns_ednsopt::length, MAX_EDNS0_TIMEOUTS, dns_resolver::mctx, fetchctx::name, NEEDEDNS0, NOSIT, query::options, dns_view::peers, QTRACE, r, dns_resolver::rdclass, dns_view::requestnsid, dns_view::requestsit, fetchctx::res, RESQUERY_ATTR_CANCELED, resquery_response(), resquery_senddone(), resquery_udpconnected(), query::sendevent, query::sends, sock, dns_adbaddrinfo::sockaddr, dns_resolver::socketmgr, query::start, fctxbucket::task, triededns(), triededns512(), query::tsig, query::tsigkey, fetchctx::type, query::udpsize, dns_ednsopt::value, version, dns_resolver::view, and wouldvalidate().

Referenced by fctx_query(), and resquery_connected().

static void resquery_response ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 7336 of file resolver.c.

References add_bad(), add_bad_edns(), query::addrinfo, answer_response(), badns_response, badns_unreachable, betterreferral(), dns_dispatchevent::buffer, cache_message(), chase_additional(), checknames, dns_message::counts, dns_adb_changeflags(), dns_adb_getsit(), dns_adb_marklame(), dns_adb_plainresponse(), dns_adb_setudpsize(), DNS_DBFIND_NOEXACT, DNS_EDNS_VERSION, DNS_EVENT_DISPATCH, DNS_FETCHOPT_EDNSVERSIONMASK, DNS_FETCHOPT_EDNSVERSIONSET, DNS_FETCHOPT_EDNSVERSIONSHIFT, DNS_FETCHOPT_NOEDNS0, DNS_FETCHOPT_TCP, DNS_FETCHOPT_UNSHARED, dns_fixedname_init, dns_fixedname_name, dns_lctx, DNS_LOGCATEGORY_DELEGATION_ONLY, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_PACKETS, DNS_LOGMODULE_RESOLVER, dns_master_style_comment, dns_message_checksig(), dns_message_getopt(), dns_message_logfmtpacket2(), dns_message_logpacket2(), dns_message_parse(), dns_message_setquerytsig(), dns_message_settsigkey(), DNS_MESSAGEFLAG_AA, DNS_MESSAGEFLAG_QR, DNS_MESSAGEFLAG_TC, dns_name_countlabels(), dns_name_dup(), dns_name_equal(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_free(), dns_name_getlabelsequence(), dns_name_init(), dns_name_issubdomain(), dns_opcode_query, DNS_R_BADVERS, DNS_R_CHASEDSSERVERS, DNS_R_DELEGATION, DNS_R_FORMERR, DNS_R_LAME, DNS_R_REMOTEFORMERR, DNS_R_SERVFAIL, DNS_R_TRUNCATEDTCP, DNS_R_UNEXPECTEDOPCODE, DNS_R_UNEXPECTEDRCODE, DNS_R_YXDOMAIN, dns_rcode_badvers, dns_rcode_formerr, dns_rcode_noerror, dns_rcode_notimp, dns_rcode_nxdomain, dns_rcode_refused, dns_rcode_servfail, dns_rcode_totext(), dns_rcode_yxdomain, dns_rdataclass_format(), dns_rdatatype_atparent(), dns_rdatatype_format(), DNS_RESOLVER_CHECKNAMES, dns_resolver_createfetch(), dns_resstatscounter_badvers, dns_resstatscounter_edns0fail, dns_resstatscounter_formerr, dns_resstatscounter_lame, dns_resstatscounter_nxdomain, dns_resstatscounter_othererror, dns_resstatscounter_refused, dns_resstatscounter_responsev4, dns_resstatscounter_responsev6, dns_resstatscounter_retry, dns_resstatscounter_servfail, dns_resstatscounter_truncated, DNS_SECTION_ANSWER, DNS_SECTION_AUTHORITY, dns_view_findzonecut(), dns_view_isdelegationonly(), EDNSOK, query::ednsversion, query::exclusivesocket, query::fctx, FCTX_ADDRINFO_EDNSOK, FCTX_ADDRINFO_NOSIT, FCTX_ATTR_WANTCACHE, FCTX_ATTR_WANTNCACHE, fctx_cancelqueries(), fctx_cancelquery(), fctx_cleanupaltaddrs(), fctx_cleanupaltfinds(), fctx_cleanupfinds(), fctx_cleanupforwaddrs(), fctx_done(), fctx_increference(), fctx_query(), fctx_stopidletimer, fctx_try(), FCTXTRACE, FCTXTRACE2, FCTXTRACE3, FCTXTRACE4, finish, fix_mustbedelegationornxdomain(), dns_message::flags, HAVE_ANSWER, inc_stats(), INSIST, is_lame(), isc_buffer_init, isc_buffer_usedlength, ISC_FALSE, ISC_LOG_DEBUG, ISC_LOG_ERROR, ISC_LOG_NOTICE, isc_log_write(), ISC_R_CANCELED, ISC_R_CONNREFUSED, ISC_R_EOF, ISC_R_HOSTUNREACH, ISC_R_NETUNREACH, ISC_R_SHUTTINGDOWN, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_result_totext(), isc_sockaddr_format(), ISC_SOCKADDR_FORMATSIZE, isc_sockaddr_pf(), isc_stdtime_get(), isc_timer_touch(), ISC_TRUE, iscname(), ISFORWARDER, dns_resolver::lame_ttl, log_formerr(), log_lame(), LOOK_FOR_GLUE_IN_ANSWER, LOOK_FOR_NS_IN_ANSWER, fetchctx::mctx, dns_resolver::mctx, fetchctx::name, namebuf, ncache_message(), noanswer_response(), NOSIT, dns_message::opcode, fetchctx::options, dns_resolver::options, query::options, process_opt(), QTRACE, dns_message::question_ok, dns_message::rcode, dns_resolver::rdclass, REQUIRE, fetchctx::res, dns_dispatchevent::result, resume_dslookup(), same_question(), dns_message::sitbad, dns_adbaddrinfo::sockaddr, TIME_NOW, query::tsig, query::tsigkey, dns_rdataset::ttl, fetchctx::type, VALID_FCTX, VALID_QUERY, version, dns_resolver::view, WANTCACHE, and WANTNCACHE.

Referenced by resquery_send().

static void resquery_connected ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 2414 of file resolver.c.

References query::addrinfo, query::connects, query::dispatch, query::dispatchmgr, dns_dispatch_createtcp(), DNS_DISPATCHATTR_CONNECTED, DNS_DISPATCHATTR_IPV4, DNS_DISPATCHATTR_IPV6, DNS_DISPATCHATTR_MAKEQUERY, DNS_DISPATCHATTR_PRIVATE, DNS_DISPATCHATTR_TCP, query::fctx, FCTX_ATTR_ADDRWAIT, fctx_cancelquery(), fctx_done(), fctx_startidletimer(), fctx_stopidletimer, fctx_try(), FCTXTRACE, FCTXTRACE3, isc_event_free(), ISC_FALSE, isc_interval_set(), ISC_R_ADDRNOTAVAIL, ISC_R_CONNECTIONRESET, ISC_R_CONNREFUSED, ISC_R_HOSTUNREACH, ISC_R_NETUNREACH, ISC_R_NOPERM, ISC_R_SUCCESS, isc_sockaddr_pf(), isc_socket_detach(), ISC_SOCKEVENT_CONNECT, ISC_TRUE, QTRACE, REQUIRE, fetchctx::res, RESQUERY_CANCELED, resquery_destroy(), resquery_send(), isc_socketevent::result, dns_adbaddrinfo::sockaddr, dns_resolver::taskmgr, query::tcpsocket, UNUSED, and VALID_QUERY.

Referenced by fctx_query().

static void fctx_try ( fetchctx_t fctx,
isc_boolean_t  retrying,
isc_boolean_t  badcache 
) [static]

Definition at line 3434 of file resolver.c.

References ADDRWAIT, dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_countlabels(), DNS_R_SERVFAIL, DNS_R_WAIT, dns_resstatscounter_retry, FCTX_ATTR_ADDRWAIT, fctx_cancelqueries(), fctx_cleanupaltaddrs(), fctx_cleanupaltfinds(), fctx_cleanupfinds(), fctx_cleanupforwaddrs(), fctx_done(), fctx_getaddresses(), fctx_nextaddress(), fctx_query(), FCTXTRACE, inc_stats(), fetchctx::info, isc_counter_increment(), isc_counter_used(), ISC_LOG_DEBUG, isc_log_write(), ISC_R_SUCCESS, ISC_TRUE, fetchctx::options, REQUIRE, and fetchctx::res.

Referenced by fctx_finddone(), fctx_start(), fctx_timeout(), process_sendevent(), resquery_connected(), resquery_response(), and resume_dslookup().

static void fctx_destroy ( fetchctx_t fctx  )  [static]

Definition at line 3548 of file resolver.c.

References dns_adb_detach(), dns_db_detach(), dns_message_destroy(), dns_name_countlabels(), dns_name_free(), dns_rdataset_disassociate(), dns_rdataset_isassociated(), FCTXTRACE, fetchstate_done, fetchstate_init, fetchctx::info, isc_counter_detach(), ISC_LINK_LINKED, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_free, isc_mem_put, isc_mem_putanddetach, isc_timer_detach(), fetchctx::mctx, fetchctx::name, fetchctx::references, REQUIRE, fetchctx::state, and VALID_FCTX.

Referenced by dns_resolver_createfetch3(), fctx_decreference(), fctx_doshutdown(), fctx_finddone(), fctx_start(), and maybe_destroy().

static isc_boolean_t fctx_unlink ( fetchctx_t fctx  )  [static]

Definition at line 3509 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, dec_stats(), dns_resstatscounter_nfetch, FCTXTRACE, fetchstate_done, fetchstate_init, ISC_FALSE, ISC_LIST_EMPTY, ISC_LIST_UNLINK, ISC_TRUE, LOCK, dns_resolver::nlock, fetchctx::references, REQUIRE, fetchctx::res, fetchctx::state, UNLOCK, and VALID_FCTX.

Referenced by dns_resolver_createfetch3(), fctx_decreference(), fctx_doshutdown(), fctx_finddone(), fctx_start(), and maybe_destroy().

static isc_result_t ncache_adderesult ( dns_message_t message,
dns_db_t cache,
dns_dbnode_t node,
dns_rdatatype_t  covers,
isc_stdtime_t  now,
dns_ttl_t  maxttl,
isc_boolean_t  optout,
isc_boolean_t  secure,
dns_rdataset_t ardataset,
isc_result_t eresultp 
) [static]

Definition at line 5502 of file resolver.c.

References dns_ncache_add(), dns_ncache_addoptout(), DNS_R_NCACHENXDOMAIN, DNS_R_NCACHENXRRSET, DNS_R_UNCHANGED, dns_rdataset_disassociate(), dns_rdataset_init(), dns_rdataset_isassociated(), ISC_R_SUCCESS, NEGATIVE, and NXDOMAIN.

Referenced by ncache_message().

static void validated ( isc_task_t task,
isc_event_t event 
) [static]

static isc_boolean_t maybe_destroy ( fetchctx_t fctx,
isc_boolean_t  locked 
) [static]

Definition at line 4422 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, dns_validator_cancel(), fctx_destroy(), fctx_unlink(), ISC_FALSE, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_TRUE, fctxbucket::lock, LOCK, fetchctx::references, REQUIRE, fetchctx::res, SHUTTINGDOWN, and UNLOCK.

static void add_bad ( fetchctx_t fctx,
dns_adbaddrinfo_t addrinfo,
isc_result_t  reason,
badnstype_t  badtype 
) [static]

Definition at line 2706 of file resolver.c.

References bad_server(), badns_response, badns_unreachable, badns_validation, dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, dns_opcode_totext(), DNS_R_LAME, DNS_R_UNEXPECTEDOPCODE, DNS_R_UNEXPECTEDRCODE, dns_rcode_servfail, dns_rcode_totext(), dns_rdataclass_format(), dns_rdatatype_format(), dns_result_totext(), FCTXTRACE, isc_buffer_init, isc_buffer_usedlength, ISC_LIST_INITANDAPPEND, ISC_LOG_INFO, isc_log_write(), isc_mem_get, isc_sockaddr_format(), ISC_SOCKADDR_FORMATSIZE, ISFORWARDER, fetchctx::mctx, fetchctx::name, namebuf, dns_resolver::rdclass, fetchctx::res, dns_adbaddrinfo::sockaddr, and fetchctx::type.

Referenced by process_sendevent(), and resquery_response().

static isc_result_t findnoqname ( fetchctx_t fctx,
dns_name_t name,
dns_rdatatype_t  type,
dns_name_t **  noqname 
) [inline, static]

Definition at line 4882 of file resolver.c.

References dns_rdataset::covers, dns_fixedname_init, dns_fixedname_name, dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), dns_name_countlabels(), dns_nsec3_noexistnodata(), dns_nsec_noexistnodata(), DNS_RDATA_INIT, dns_rdata_tostruct(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_next(), DNS_SECTION_AUTHORITY, fctx_log(), FCTXTRACE, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOMORE, ISC_R_NOTFOUND, ISC_R_SUCCESS, NXND, REQUIRE, RUNTIME_CHECK, and dns_rdataset::type.

Referenced by cache_name().

static void fctx_increference ( fetchctx_t fctx  )  [static]

Definition at line 6991 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, fctxbucket::lock, LOCK, fetchctx::references, REQUIRE, fetchctx::res, UNLOCK, and VALID_FCTX.

Referenced by fctx_query(), and resquery_response().

static isc_boolean_t fctx_decreference ( fetchctx_t fctx  )  [static]

Definition at line 7000 of file resolver.c.

References fctx_destroy(), fctx_shutdown(), fctx_unlink(), INSIST, ISC_FALSE, ISC_LIST_EMPTY, fetchctx::references, REQUIRE, SHUTTINGDOWN, and VALID_FCTX.

Referenced by dns_resolver_destroyfetch(), resquery_destroy(), and resume_dslookup().

static void inc_stats ( dns_resolver_t res,
isc_statscounter_t  counter 
) [inline, static]

Increment resolver-related statistics counters.

Definition at line 543 of file resolver.c.

References isc_stats_increment(), dns_view::resstats, and dns_resolver::view.

static void dec_stats ( dns_resolver_t res,
isc_statscounter_t  counter 
) [inline, static]

Definition at line 549 of file resolver.c.

References isc_stats_decrement(), dns_view::resstats, and dns_resolver::view.

static isc_result_t valcreate ( fetchctx_t fctx,
dns_adbaddrinfo_t addrinfo,
dns_name_t name,
dns_rdatatype_t  type,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset,
unsigned int  valoptions,
isc_task_t task 
) [static]

Definition at line 555 of file resolver.c.

References dns_valarg_t::addrinfo, dns_resstatscounter_val, dns_validator_create(), DNS_VALIDATOR_DEFER, dns_valarg_t::fctx, inc_stats(), INSIST, ISC_LIST_APPEND, ISC_LIST_EMPTY, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, fetchctx::mctx, fetchctx::res, validated, and dns_resolver::view.

Referenced by cache_name(), and ncache_message().

static isc_boolean_t rrsig_fromchildzone ( fetchctx_t fctx,
dns_rdataset_t rdataset 
) [static]

Definition at line 591 of file resolver.c.

References dns_name_fullcompare(), dns_namereln_subdomain, DNS_RDATA_INIT, dns_rdata_reset(), dns_rdata_tostruct(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_next(), ISC_FALSE, ISC_R_SUCCESS, ISC_TRUE, and RUNTIME_CHECK.

Referenced by fix_mustbedelegationornxdomain().

static isc_boolean_t fix_mustbedelegationornxdomain ( dns_message_t message,
fetchctx_t fctx 
) [static]

Definition at line 615 of file resolver.c.

References dns_message::counts, dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), dns_name_equal(), dns_name_issubdomain(), dns_rcode_nxdomain, DNS_SECTION_ADDITIONAL, DNS_SECTION_ANSWER, DNS_SECTION_AUTHORITY, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, ISC_TRUE, fetchctx::name, name, dns_message::rcode, rrsig_fromchildzone(), dns_rdataset::type, and fetchctx::type.

Referenced by resquery_response().

static isc_result_t fctx_starttimer ( fetchctx_t fctx  )  [inline, static]

Definition at line 772 of file resolver.c.

References isc_timer_reset(), isc_timertype_once, and ISC_TRUE.

Referenced by fctx_start(), and fctx_timeout().

static void fctx_stoptimer ( fetchctx_t fctx  )  [inline, static]

Definition at line 785 of file resolver.c.

References ISC_R_SUCCESS, isc_result_totext(), isc_timer_reset(), isc_timertype_inactive, ISC_TRUE, and UNEXPECTED_ERROR.

Referenced by fctx_stopeverything().

static isc_result_t fctx_startidletimer ( fetchctx_t fctx,
isc_interval_t interval 
) [inline, static]

Definition at line 805 of file resolver.c.

References ISC_FALSE, isc_timer_reset(), and isc_timertype_once.

Referenced by fctx_query(), and resquery_connected().

static void resquery_destroy ( resquery_t **  queryp  )  [inline, static]

Definition at line 821 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, empty_bucket(), query::fctx, fctx_decreference(), INSIST, ISC_LINK_LINKED, isc_mem_put, fctxbucket::lock, LOCK, query::magic, query::mctx, REQUIRE, fetchctx::res, query::tcpsocket, and UNLOCK.

Referenced by fctx_cancelquery(), process_sendevent(), and resquery_connected().

static void fctx_cancelquery ( resquery_t **  queryp,
dns_dispatchevent_t **  deventp,
isc_time_t finish,
isc_boolean_t  no_response 
) [static]

Definition at line 853 of file resolver.c.

References query::addrinfo, query::attributes, query::dispatch, query::dispentry, dns_adb_adjustsrtt(), dns_adb_agesrtt(), dns_adb_changeflags(), dns_adb_ednsto(), DNS_ADB_RTTADJDEFAULT, DNS_ADB_RTTADJREPLACE, dns_adb_timeout(), dns_dispatch_detach(), dns_dispatch_getentrysocket(), dns_dispatch_getsocket(), dns_dispatch_removeresponse(), DNS_FETCHOPT_NOEDNS0, DNS_RESOLVER_QRYRTTCLASS0, DNS_RESOLVER_QRYRTTCLASS1, DNS_RESOLVER_QRYRTTCLASS2, DNS_RESOLVER_QRYRTTCLASS3, DNS_RESOLVER_QRYRTTCLASS4, dns_resstatscounter_queryrtt0, dns_resstatscounter_queryrtt1, dns_resstatscounter_queryrtt2, dns_resstatscounter_queryrtt3, dns_resstatscounter_queryrtt4, dns_resstatscounter_queryrtt5, dns_tsigkey_detach(), EDNSOK, query::exclusivesocket, query::fctx, FCTX_ADDRINFO_TRIED, FCTXTRACE, inc_stats(), INSIST, isc_buffer_free(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_random_get(), ISC_SOCKCANCEL_CONNECT, ISC_SOCKCANCEL_SEND, isc_socket_cancel(), isc_stdtime_get(), isc_time_microdiff(), dns_adbfind::list, MAX_SINGLE_QUERY_TIMEOUT_US, now, query::options, REQUIRE, fetchctx::res, RESQUERY_ATTR_CANCELED, RESQUERY_CANCELED, RESQUERY_CONNECTING, resquery_destroy(), RESQUERY_SENDING, sock, dns_adbaddrinfo::srtt, query::start, query::tcpsocket, TRIED, TRIEDALT, TRIEDFIND, query::tsig, query::tsigkey, query::udpsize, and UNMARKED.

Referenced by fctx_cancelqueries(), fctx_timeout(), process_sendevent(), resquery_connected(), and resquery_response().

static void fctx_cancelqueries ( fetchctx_t fctx,
isc_boolean_t  no_response 
) [static]

Definition at line 1055 of file resolver.c.

References fctx_cancelquery(), FCTXTRACE, ISC_LIST_HEAD, and ISC_LIST_NEXT.

Referenced by fctx_stopeverything(), fctx_try(), and resquery_response().

static void fctx_cleanupfinds ( fetchctx_t fctx  )  [static]

Definition at line 1069 of file resolver.c.

References dns_adb_destroyfind(), ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, and REQUIRE.

Referenced by fctx_stopeverything(), fctx_try(), and resquery_response().

static void fctx_cleanupaltfinds ( fetchctx_t fctx  )  [static]

Definition at line 1085 of file resolver.c.

References dns_adb_destroyfind(), ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, and REQUIRE.

Referenced by fctx_stopeverything(), fctx_try(), and resquery_response().

static void fctx_cleanupforwaddrs ( fetchctx_t fctx  )  [static]

Definition at line 1101 of file resolver.c.

References dns_adb_freeaddrinfo(), ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, and REQUIRE.

Referenced by fctx_stopeverything(), fctx_try(), and resquery_response().

static void fctx_cleanupaltaddrs ( fetchctx_t fctx  )  [static]

Definition at line 1116 of file resolver.c.

References dns_adb_freeaddrinfo(), ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, and REQUIRE.

Referenced by fctx_stopeverything(), fctx_try(), and resquery_response().

static void fctx_stopeverything ( fetchctx_t fctx,
isc_boolean_t  no_response 
) [inline, static]

Definition at line 1131 of file resolver.c.

References fctx_cancelqueries(), fctx_cleanupaltaddrs(), fctx_cleanupaltfinds(), fctx_cleanupfinds(), fctx_cleanupforwaddrs(), fctx_stoptimer(), and FCTXTRACE.

Referenced by fctx_done(), and fctx_doshutdown().

static void fctx_sendevents ( fetchctx_t fctx,
isc_result_t  result,
int  line 
) [inline, static]

Definition at line 1142 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, DNS_R_NCACHENXDOMAIN, DNS_R_NCACHENXRRSET, dns_rdataset_isassociated(), FCTX_ATTR_HAVEANSWER, FCTXTRACE, fetchstate_done, HAVE_ANSWER, INSIST, ISC_EVENT_PTR, ISC_FALSE, isc_interval_set(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, ISC_LOG_NOTICE, isc_log_write(), ISC_R_SUCCESS, isc_task_sendanddetach(), isc_time_microdiff(), isc_timer_reset(), isc_timertype_ticker, ISC_TRUE, dns_resolver::lock, LOCK, NEGATIVE, now, REQUIRE, fetchctx::res, RUNTIME_CHECK, fetchctx::spilled, fetchctx::state, TIME_NOW, fetchctx::type, and UNLOCK.

Referenced by fctx_done(), fctx_doshutdown(), and fctx_start().

static void log_edns ( fetchctx_t fctx  )  [inline, static]

Definition at line 1228 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_EDNS_DISABLED, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, fetchctx::info, ISC_LOG_INFO, and isc_log_write().

Referenced by fctx_done().

static void fctx_done ( fetchctx_t fctx,
isc_result_t  result,
int  line 
) [static]

Log any deferred EDNS timeout messages.

Definition at line 1248 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, FCTX_ATTR_ADDRWAIT, fctx_sendevents(), fctx_stopeverything(), FCTXTRACE, fetchstate_done, ISC_FALSE, ISC_R_SUCCESS, ISC_TRUE, fctxbucket::lock, LOCK, log_edns(), REQUIRE, fetchctx::res, fetchctx::state, and UNLOCK.

Referenced by fctx_finddone(), fctx_start(), fctx_timeout(), fctx_try(), process_sendevent(), resquery_connected(), resquery_response(), and resume_dslookup().

static void process_sendevent ( resquery_t query,
isc_event_t event 
) [static]

Definition at line 1279 of file resolver.c.

References add_bad(), query::addrinfo, badns_unreachable, query::connects, query::fctx, FCTX_ATTR_ADDRWAIT, fctx_cancelquery(), fctx_done(), fctx_stopidletimer, fctx_try(), FCTXTRACE3, isc_event_free(), ISC_FALSE, ISC_R_ADDRNOTAVAIL, ISC_R_CONNREFUSED, ISC_R_HOSTUNREACH, ISC_R_NETUNREACH, ISC_R_NOPERM, ISC_R_SUCCESS, isc_socket_detach(), ISC_SOCKEVENT_CONNECT, ISC_TRUE, RESQUERY_CANCELED, resquery_destroy(), isc_socketevent::result, query::sends, and query::tcpsocket.

Referenced by resquery_senddone(), and resquery_udpconnected().

static void resquery_udpconnected ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 1352 of file resolver.c.

References query::connects, INSIST, ISC_SOCKEVENT_CONNECT, process_sendevent(), QTRACE, REQUIRE, RESQUERY_CONNECTING, and UNUSED.

Referenced by resquery_send().

static void resquery_senddone ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 1369 of file resolver.c.

References INSIST, ISC_SOCKEVENT_SENDDONE, process_sendevent(), QTRACE, REQUIRE, RESQUERY_SENDING, query::sends, and UNUSED.

Referenced by resquery_send().

static isc_result_t fctx_addopt ( dns_message_t message,
unsigned int  version,
isc_uint16_t  udpsize,
dns_ednsopt_t ednsopts,
size_t  count 
) [inline, static]

Definition at line 1394 of file resolver.c.

References dns_message_buildopt(), dns_message_setopt(), DNS_MESSAGEEXTFLAG_DO, and ISC_R_SUCCESS.

Referenced by resquery_send().

static void fctx_setretryinterval ( fetchctx_t fctx,
unsigned int  rtt 
) [inline, static]

Definition at line 1408 of file resolver.c.

References isc_interval_set(), MAX_SINGLE_QUERY_TIMEOUT_US, and US_PER_SEC.

Referenced by fctx_query().

static isc_result_t fctx_query ( fetchctx_t fctx,
dns_adbaddrinfo_t addrinfo,
unsigned int  options 
) [static]

Definition at line 1450 of file resolver.c.

References query::addrinfo, AF_INET6, query::attributes, fetchctx::bucketnum, dns_resolver::buckets, query::connects, query::dispatch, dns_dispatchset::dispatches, dns_resolver::dispatches4, dns_resolver::dispatches6, dns_resolver::dispatchmgr, query::dispatchmgr, query::dispentry, dns_dispatch_attach(), dns_dispatch_detach(), dns_dispatch_getlocaladdress(), dns_dispatch_getudp(), DNS_DISPATCHATTR_IPV4, DNS_DISPATCHATTR_IPV6, DNS_DISPATCHATTR_TCP, DNS_DISPATCHATTR_UDP, DNS_FETCHOPT_TCP, DNS_MESSAGE_INTENTPARSE, dns_message_reset(), dns_peer_getforcetcp(), dns_peer_getquerydscp(), dns_peer_getquerysource(), dns_peerlist_peerbyaddr(), dns_rdatatypestats_increment(), dns_resolver_dispatchv4(), dns_resolver_dispatchv6(), dns_resolver_getquerydscp4(), dns_resolver_getquerydscp6(), dns_resstatscounter_queryv4, dns_resstatscounter_queryv6, dns_adbaddrinfo::dscp, query::dscp, query::exclusivesocket, dns_resolver::exclusivev4, dns_resolver::exclusivev6, query::fctx, fctx_increference(), fctx_setretryinterval(), fctx_startidletimer(), fctx_stopidletimer, FCTXTRACE, inc_stats(), INSIST, ISC_FALSE, ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_EMPTY, isc_mem_get, isc_mem_put, isc_netaddr_fromsockaddr(), ISC_R_NOMEMORY, ISC_R_NOTIMPLEMENTED, ISC_R_SUCCESS, isc_sockaddr_pf(), isc_sockaddr_setport(), isc_socket_bind(), isc_socket_connect(), isc_socket_create(), isc_socket_detach(), isc_socket_dscp(), isc_sockettype_tcp, ISC_TRUE, ISFORWARDER, query::magic, query::mctx, fetchctx::mctx, query::options, dns_view::peers, PF_INET6, QTRACE, QUERY_MAGIC, fetchctx::res, resquery_connected(), resquery_send(), dns_view::resquerystats, RUNTIME_CHECK, query::sends, dns_adbaddrinfo::sockaddr, dns_resolver::socketmgr, dns_adbaddrinfo::srtt, query::start, fctxbucket::task, dns_resolver::taskmgr, query::tcpsocket, TIME_NOW, query::tsig, query::tsigkey, fetchctx::type, and dns_resolver::view.

Referenced by fctx_try(), and resquery_response().

static isc_boolean_t bad_edns ( fetchctx_t fctx,
isc_sockaddr_t address 
) [static]

Definition at line 1702 of file resolver.c.

References ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, isc_sockaddr_equal(), and ISC_TRUE.

Referenced by add_bad_edns().

static void add_bad_edns ( fetchctx_t fctx,
isc_sockaddr_t address 
) [static]

Definition at line 1716 of file resolver.c.

References bad_edns(), ISC_LIST_INITANDAPPEND, isc_mem_get, and fetchctx::mctx.

Referenced by resquery_response().

static struct tried* triededns ( fetchctx_t fctx,
isc_sockaddr_t address 
) [static, read]

Definition at line 1731 of file resolver.c.

References tried::addr, ISC_LIST_HEAD, ISC_LIST_NEXT, and isc_sockaddr_equal().

Referenced by add_triededns(), and resquery_send().

static void add_triededns ( fetchctx_t fctx,
isc_sockaddr_t address 
) [static]

Definition at line 1745 of file resolver.c.

References tried::addr, tried::count, ISC_LIST_INITANDAPPEND, isc_mem_get, fetchctx::mctx, and triededns().

Referenced by resquery_send().

static struct tried* triededns512 ( fetchctx_t fctx,
isc_sockaddr_t address 
) [static, read]

Definition at line 1764 of file resolver.c.

References tried::addr, ISC_LIST_HEAD, ISC_LIST_NEXT, and isc_sockaddr_equal().

Referenced by add_triededns512(), and resquery_send().

static void add_triededns512 ( fetchctx_t fctx,
isc_sockaddr_t address 
) [static]

Definition at line 1778 of file resolver.c.

References tried::addr, tried::count, ISC_LIST_INITANDAPPEND, isc_mem_get, fetchctx::mctx, and triededns512().

Referenced by resquery_send().

static isc_result_t issecuredomain ( dns_view_t view,
dns_name_t name,
dns_rdatatype_t  type,
isc_stdtime_t  now,
isc_boolean_t  checknta,
isc_boolean_t issecure 
) [static]

Definition at line 1874 of file resolver.c.

References dns_name_countlabels(), dns_name_getlabelsequence(), dns_name_init(), dns_rdatatype_atparent(), and dns_view_issecuredomain().

Referenced by ATF_TP_ADD_TCS(), cache_name(), ncache_message(), and resquery_send().

static isc_boolean_t wouldvalidate ( fetchctx_t fctx  )  [static]

Definition at line 1898 of file resolver.c.

References dns_view::dlv, dns_view_issecuredomain(), dns_view::enablevalidation, ISC_FALSE, ISC_R_SUCCESS, isc_stdtime_get(), ISC_TRUE, fetchctx::name, now, fetchctx::res, and dns_resolver::view.

Referenced by resquery_send().

static void fctx_finddone ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 2554 of file resolver.c.

References ADDRWAIT, fetchctx::bucketnum, dns_resolver::buckets, dns_adb_destroyfind(), DNS_EVENT_ADBMOREADDRESSES, empty_bucket(), query::fctx, FCTX_ATTR_ADDRWAIT, fctx_destroy(), fctx_done(), fctx_try(), fctx_unlink(), FCTXTRACE, INSIST, isc_event_free(), ISC_FALSE, ISC_LIST_EMPTY, ISC_R_FAILURE, ISC_TRUE, fctxbucket::lock, LOCK, fetchctx::references, REQUIRE, fetchctx::res, SHUTTINGDOWN, UNLOCK, UNUSED, and VALID_FCTX.

Referenced by findname().

static isc_boolean_t bad_server ( fetchctx_t fctx,
isc_sockaddr_t address 
) [inline, static]

Definition at line 2625 of file resolver.c.

References ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, isc_sockaddr_equal(), and ISC_TRUE.

Referenced by add_bad(), and mark_bad().

static isc_boolean_t mark_bad ( fetchctx_t fctx  )  [inline, static]

Definition at line 2639 of file resolver.c.

References bad_server(), FCTX_ADDRINFO_MARK, dns_adbaddrinfo::flags, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_TRUE, dns_adbfind::list, and dns_adbaddrinfo::sockaddr.

Referenced by fctx_getaddresses().

static void sort_adbfind ( dns_adbfind_t find  )  [static]

Definition at line 2785 of file resolver.c.

References ISC_LIST_APPEND, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, ISC_LIST_UNLINK, dns_adbfind::list, and dns_adbaddrinfo::srtt.

Referenced by sort_finds().

static void sort_finds ( dns_adbfindlist_t *  findlist  )  [static]

Definition at line 2809 of file resolver.c.

References INSIST, ISC_LIST_APPEND, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, ISC_LIST_UNLINK, dns_adbfind::list, sort_adbfind(), and dns_adbaddrinfo::srtt.

Referenced by fctx_getaddresses().

static void findname ( fetchctx_t fctx,
dns_name_t name,
in_port_t  port,
unsigned int  options,
unsigned int  flags,
isc_stdtime_t  now,
isc_boolean_t need_alternate 
) [static]

Definition at line 2843 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, dns_resolver::dispatches4, dns_resolver::dispatches6, dns_adb_createfind2(), dns_adb_destroyfind(), DNS_ADBFIND_GLUEOK, DNS_ADBFIND_HINTOK, DNS_ADBFIND_LAMEPRUNED, DNS_ADBFIND_STARTATZONE, DNS_ADBFIND_WANTEVENT, DNS_FETCHOPT_UNSHARED, dns_lctx, DNS_LOGCATEGORY_CNAME, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_issubdomain(), DNS_R_ALIAS, DNS_R_NXDOMAIN, DNS_R_NXRRSET, dns_view::dstport, FCTX_ADDRINFO_FORWARDER, fctx_finddone(), dns_adbaddrinfo::flags, fetchctx::info, INSIST, ISC_LIST_APPEND, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_sockaddr_setport(), ISC_TF, ISC_TRUE, dns_adbfind::list, fetchctx::name, namebuf, dns_adbfind::options, fetchctx::options, fetchctx::res, dns_adbfind::result_v4, dns_adbfind::result_v6, dns_adbaddrinfo::sockaddr, fctxbucket::task, fetchctx::type, and dns_resolver::view.

static isc_boolean_t isstrictsubdomain ( dns_name_t name1,
dns_name_t name2 
) [static]

Definition at line 2958 of file resolver.c.

References dns_name_fullcompare(), dns_namereln_subdomain, and ISC_TF.

Referenced by betterreferral(), and fctx_getaddresses().

static isc_result_t fctx_getaddresses ( fetchctx_t fctx,
isc_boolean_t  badcache 
) [static]

Definition at line 2968 of file resolver.c.

References alternate::_n, alternate::_u, alternate::addr, dns_forwarder::addr, AF_INET6, dns_resolver::dispatches4, dns_resolver::dispatches6, dns_adb_findaddrinfo(), DNS_ADBFIND_ADDRESSMASK, DNS_ADBFIND_AVOIDFETCHES, DNS_ADBFIND_EMPTYEVENT, DNS_ADBFIND_INET, DNS_ADBFIND_INET6, DNS_ADBFIND_WANTEVENT, dns_fixedname_init, dns_fixedname_name, dns_fwdpolicy_only, dns_fwdtable_find2(), dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_countlabels(), dns_name_dup(), dns_name_free(), dns_name_getlabelsequence(), dns_name_init(), DNS_R_SERVFAIL, DNS_R_WAIT, dns_rdata_freestruct(), DNS_RDATA_INIT, dns_rdata_reset(), dns_rdata_tostruct(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_next(), dns_rdatatype_atparent(), dns_resolver_addbadcache(), DNS_RESOLVER_BADCACHETTL, dns_forwarder::dscp, dns_adbaddrinfo::dscp, FCTX_ADDRINFO_FORWARDER, FCTXTRACE, findname(), fixed, dns_adbaddrinfo::flags, dns_forwarders::fwdpolicy, dns_forwarders::fwdrs, dns_view::fwdtable, fetchctx::info, INSIST, alternate::isaddress, ISC_FALSE, isc_interval_set(), ISC_LIST_APPEND, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_INSERTBEFORE, ISC_LIST_NEXT, ISC_LOG_DEBUG, isc_log_write(), ISC_R_FAILURE, ISC_R_NOMORE, ISC_R_SUCCESS, isc_sockaddr_pf(), isc_stdtime_get(), isc_time_nowplusinterval(), isstrictsubdomain(), mark_bad(), fetchctx::mctx, fetchctx::name, name, now, fetchctx::res, sort_finds(), dns_adbaddrinfo::srtt, fetchctx::type, and dns_resolver::view.

Referenced by fctx_try().

static void possibly_mark ( fetchctx_t fctx,
dns_adbaddrinfo_t addr 
) [inline, static]

Definition at line 3229 of file resolver.c.

References dns_view::aclenv, AF_INET6, dns_resolver::dispatchmgr, dns_acl_match(), dns_dispatchmgr_getblackhole(), dns_lctx, dns_peer_getbogus(), dns_peerlist_peerbyaddr(), FCTX_ADDRINFO_MARK, FCTXTRACE2, dns_adbaddrinfo::flags, IN6_IS_ADDR_V4COMPAT, IN6_IS_ADDR_V4MAPPED, ISC_FALSE, ISC_LOG_DEBUG, isc_log_wouldlog(), isc_netaddr_format(), ISC_NETADDR_FORMATSIZE, isc_netaddr_fromsockaddr(), ISC_R_SUCCESS, isc_sockaddr_isexperimental(), isc_sockaddr_ismulticast(), ISC_TRUE, match(), dns_view::peers, fetchctx::res, isc_sockaddr::sa, isc_sockaddr::sin6, sockaddr_in6::sin6_addr, dns_adbaddrinfo::sockaddr, isc_sockaddr::type, and dns_resolver::view.

Referenced by fctx_nextaddress().

static dns_adbaddrinfo_t* fctx_nextaddress ( fetchctx_t fctx  )  [inline, static]

Definition at line 3292 of file resolver.c.

References FCTX_ADDRINFO_MARK, FCTX_ATTR_TRIEDALT, FCTX_ATTR_TRIEDFIND, dns_adbaddrinfo::flags, ISC_LIST_HEAD, ISC_LIST_NEXT, dns_adbfind::list, possibly_mark(), dns_adbaddrinfo::srtt, and UNMARKED.

Referenced by fctx_try().

static void fctx_timeout ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 3619 of file resolver.c.

References dns_resstatscounter_querytimeout, isc_timerevent::due, query::fctx, FCTX_ATTR_ADDRWAIT, fctx_cancelquery(), fctx_done(), fctx_starttimer(), fctx_try(), FCTXTRACE, inc_stats(), isc_event_free(), ISC_FALSE, ISC_LIST_HEAD, ISC_R_SUCCESS, ISC_R_TIMEDOUT, isc_time_compare(), ISC_TIMEREVENT_LIFE, ISC_TRUE, REQUIRE, fetchctx::res, query::start, UNUSED, and VALID_FCTX.

Referenced by fctx_create().

static void fctx_shutdown ( fetchctx_t fctx  )  [static]

Definition at line 3677 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, fetchctx::control_event, FCTXTRACE, fetchstate_init, isc_task_send(), ISC_TRUE, fetchctx::res, fetchctx::state, fctxbucket::task, and fetchctx::want_shutdown.

Referenced by dns_resolver_shutdown(), and fctx_decreference().

static void fctx_doshutdown ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 3709 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, dns_resolver_cancelfetch(), dns_validator_cancel(), empty_bucket(), query::fctx, FCTX_ATTR_ADDRWAIT, FCTX_ATTR_SHUTTINGDOWN, fctx_destroy(), fctx_sendevents(), fctx_stopeverything(), fctx_unlink(), FCTXTRACE, fetchstate_active, fetchstate_done, INSIST, ISC_FALSE, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_CANCELED, ISC_TRUE, fctxbucket::lock, LOCK, fetchctx::references, REQUIRE, fetchctx::res, fetchctx::state, UNLOCK, UNUSED, VALID_FCTX, and fetchctx::want_shutdown.

Referenced by fctx_start().

static void fctx_start ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 3780 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, DNS_EVENT_FETCHCONTROL, empty_bucket(), query::fctx, FCTX_ATTR_SHUTTINGDOWN, fctx_destroy(), fctx_done(), fctx_doshutdown(), fctx_sendevents(), fctx_starttimer(), fctx_try(), fctx_unlink(), FCTXTRACE, fetchstate_active, fetchstate_done, fetchstate_init, INSIST, ISC_EVENT_INIT, ISC_FALSE, ISC_LIST_EMPTY, ISC_R_CANCELED, ISC_R_SUCCESS, ISC_TRUE, fctxbucket::lock, LOCK, fetchctx::references, REQUIRE, fetchctx::res, fetchctx::state, UNLOCK, UNUSED, VALID_FCTX, and fetchctx::want_shutdown.

Referenced by dns_resolver_createfetch3().

static isc_result_t fctx_join ( fetchctx_t fctx,
isc_task_t task,
isc_sockaddr_t client,
dns_messageid_t  id,
isc_taskaction_t  action,
void *  arg,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset,
dns_fetch_t fetch 
) [inline, static]

Definition at line 3863 of file resolver.c.

References DNS_EVENT_FETCHDONE, DNS_FETCH_MAGIC, dns_fixedname_init, DNS_R_SERVFAIL, FCTXTRACE, isc_event_allocate(), ISC_LIST_APPEND, ISC_LIST_PREPEND, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_task_attach(), isc_task_detach(), dns_fetch::magic, dns_resolver::mctx, dns_fetch::private, fetchctx::references, fetchctx::res, and fetchctx::type.

Referenced by dns_resolver_createfetch3().

static void log_ns_ttl ( fetchctx_t fctx,
const char *  where 
) [inline, static]

Definition at line 3916 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, ISC_LOG_DEBUG, isc_log_write(), fetchctx::name, and namebuf.

Referenced by answer_response(), fctx_create(), noanswer_response(), and resume_dslookup().

static isc_result_t fctx_create ( dns_resolver_t res,
dns_name_t name,
dns_rdatatype_t  type,
dns_name_t domain,
dns_rdataset_t nameservers,
unsigned int  options,
unsigned int  bucketnum,
unsigned int  depth,
isc_counter_t qc,
fetchctx_t **  fctxp 
) [static]

Definition at line 3930 of file resolver.c.

References dns_view::adb, fetchctx::bucketnum, dns_resolver::buckets, dns_view::cachedb, fetchctx::cloned, dns_adb_attach(), dns_db_attach(), DNS_DBFIND_NOEXACT, dns_fixedname_init, dns_fixedname_name, dns_fwdpolicy_none, dns_fwdpolicy_only, dns_fwdtable_find2(), dns_message_create(), dns_message_destroy(), DNS_MESSAGE_INTENTPARSE, DNS_MESSAGE_INTENTRENDER, dns_name_countlabels(), dns_name_dup(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_free(), dns_name_getlabelsequence(), dns_name_init(), dns_name_issubdomain(), dns_rdataset_clone(), dns_rdataset_disassociate(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_rdatatype_atparent(), dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, dns_resstatscounter_nfetch, dns_view_findzonecut(), query::fctx, FCTX_MAGIC, fctx_timeout(), FCTXTRACE, fetchstate_init, fixed, dns_forwarders::fwdpolicy, dns_view::fwdtable, inc_stats(), fetchctx::info, INSIST, isc_counter_attach(), isc_counter_create(), isc_counter_detach(), ISC_FALSE, isc_interval_set(), ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_INIT, isc_mem_attach(), isc_mem_free, isc_mem_get, isc_mem_put, isc_mem_strdup, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_result_totext(), isc_time_nowplusinterval(), isc_timer_create(), isc_timertype_inactive, ISC_TRUE, LOCK, log_ns_ttl(), fetchctx::magic, fetchctx::mctx, dns_resolver::mctx, fetchctx::name, dns_resolver::nlock, fetchctx::options, fetchctx::references, REQUIRE, fetchctx::res, fetchctx::spilled, fetchctx::state, fctxbucket::task, TIME_NOW, dns_resolver::timermgr, fetchctx::type, UNEXPECTED_ERROR, UNLOCK, dns_resolver::view, and fetchctx::want_shutdown.

Referenced by dns_resolver_createfetch3().

static isc_boolean_t is_lame ( fetchctx_t fctx  )  [inline, static]

Definition at line 4226 of file resolver.c.

References dns_message::counts, dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), DNS_MESSAGEFLAG_AA, dns_name_fullcompare(), dns_namereln_equal, dns_namereln_subdomain, dns_rcode_noerror, dns_rcode_nxdomain, DNS_SECTION_ANSWER, DNS_SECTION_AUTHORITY, dns_message::flags, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, ISC_TRUE, name, dns_message::rcode, and dns_rdataset::type.

Referenced by resquery_response().

static void log_lame ( fetchctx_t fctx,
dns_adbaddrinfo_t addrinfo 
) [inline, static]

Definition at line 4270 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, ISC_LOG_INFO, isc_log_write(), isc_sockaddr_format(), ISC_SOCKADDR_FORMATSIZE, fetchctx::name, namebuf, and dns_adbaddrinfo::sockaddr.

Referenced by resquery_response().

static void log_formerr ( fetchctx_t fctx,
const char *  format,
  ... 
) [inline, static]

Definition at line 4285 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, fetchctx::info, ISC_LOG_NOTICE, isc_log_write(), isc_sockaddr_format(), and ISC_SOCKADDR_FORMATSIZE.

Referenced by answer_response(), dname_target(), noanswer_response(), resquery_response(), and same_question().

static isc_result_t same_question ( fetchctx_t fctx  )  [inline, static]

Definition at line 4312 of file resolver.c.

References dns_message::counts, dns_message_currentname(), dns_message_firstname(), dns_name_equal(), dns_name_format(), DNS_NAME_FORMATSIZE, DNS_R_FORMERR, dns_rdataclass_format(), DNS_RDATACLASS_FORMATSIZE, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, DNS_SECTION_QUESTION, INSIST, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, log_formerr(), fetchctx::name, name, namebuf, dns_rdataset::rdclass, dns_resolver::rdclass, fetchctx::res, dns_rdataset::type, and fetchctx::type.

Referenced by resquery_response().

static void clone_results ( fetchctx_t fctx  )  [static]

Definition at line 4358 of file resolver.c.

References fetchctx::cloned, dns_db_attach(), dns_db_attachnode(), dns_fixedname_name, dns_name_copy(), dns_rdataset_clone(), dns_rdataset_isassociated(), FCTXTRACE, INSIST, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, ISC_TRUE, and name.

Referenced by cache_name(), and ncache_message().

static void fctx_log ( void *  arg,
int  level,
const char *  fmt,
  ... 
) [static]

Definition at line 4867 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, fetchctx::info, and isc_log_write().

Referenced by findnoqname().

static isc_result_t cache_name ( fetchctx_t fctx,
dns_name_t name,
dns_adbaddrinfo_t addrinfo,
isc_stdtime_t  now 
) [inline, static]

Definition at line 5010 of file resolver.c.

References ANSWER, ANSWERSIG, dns_rdataset::attributes, dns_name::attributes, fetchctx::bucketnum, dns_resolver::buckets, CACHE, CHAINING, CHECKNAMES, clone_results(), dns_rdataset::covers, dns_view::dlv, dns_db_addrdataset(), dns_db_attach(), dns_db_detachnode(), dns_db_findnode(), dns_db_transfernode(), DNS_DBADD_FORCE, DNS_DBADD_PREFETCH, DNS_FETCHOPT_NOCDFLAG, DNS_FETCHOPT_NONTA, DNS_FETCHOPT_NOVALIDATE, DNS_FETCHOPT_PREFETCH, dns_fixedname_name, dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_copy(), dns_name_format(), DNS_NAME_FORMATSIZE, DNS_NAMEATTR_ANSWER, DNS_NAMEATTR_CHAINING, DNS_R_BADNAME, DNS_R_CNAME, DNS_R_DNAME, DNS_R_NCACHENXDOMAIN, DNS_R_NCACHENXRRSET, DNS_R_UNCHANGED, dns_rdataclass_format(), dns_rdataset_addnoqname(), dns_rdataset_isassociated(), DNS_RDATASETATTR_PREFETCH, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, DNS_RESOLVER_CHECKNAMESFAIL, dns_trust_additional, dns_trust_glue, dns_trust_pending_additional, dns_trust_pending_answer, DNS_VALIDATOR_DEFER, DNS_VALIDATOR_DLV, DNS_VALIDATOR_NOCDFLAG, DNS_VALIDATOR_NONTA, dns_view::enablevalidation, EXTERNAL, FCTX_ATTR_HAVEANSWER, findnoqname(), INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_NOTICE, isc_log_write(), ISC_MIN, ISC_R_SUCCESS, ISC_TF, ISC_TRUE, issecuredomain(), dns_view::maxcachettl, namebuf, NEGATIVE, NXDOMAIN, dns_resolver::options, fetchctx::options, POST, dns_view::prefetch_eligible, dns_rdataset::rdclass, fetchctx::res, RUNTIME_CHECK, fctxbucket::task, dns_rdataset::trust, dns_rdataset::ttl, dns_rdataset::type, fetchctx::type, valcreate(), and dns_resolver::view.

Referenced by cache_message().

static isc_result_t cache_message ( fetchctx_t fctx,
dns_adbaddrinfo_t addrinfo,
isc_stdtime_t  now 
) [inline, static]

Definition at line 5460 of file resolver.c.

References dns_name::attributes, fetchctx::bucketnum, dns_resolver::buckets, cache_name(), dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), DNS_NAMEATTR_CACHE, DNS_SECTION_ADDITIONAL, DNS_SECTION_ANSWER, FCTX_ATTR_WANTCACHE, FCTXTRACE, ISC_R_NOMORE, ISC_R_SUCCESS, fctxbucket::lock, LOCK, fetchctx::res, and UNLOCK.

Referenced by resquery_response().

static isc_result_t ncache_message ( fetchctx_t fctx,
dns_adbaddrinfo_t addrinfo,
dns_rdatatype_t  covers,
isc_stdtime_t  now 
) [inline, static]

Definition at line 5555 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, clone_results(), dns_view::dlv, dns_db_attach(), dns_db_detachnode(), dns_db_findnode(), dns_db_transfernode(), DNS_FETCHOPT_NOCDFLAG, DNS_FETCHOPT_NONTA, DNS_FETCHOPT_NOVALIDATE, dns_fixedname_name, dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), dns_name_copy(), DNS_SECTION_ANSWER, DNS_SECTION_AUTHORITY, dns_trust_pending_answer, DNS_VALIDATOR_DLV, DNS_VALIDATOR_NOCDFLAG, DNS_VALIDATOR_NONTA, dns_view::enablevalidation, FCTX_ATTR_HAVEANSWER, FCTX_ATTR_WANTNCACHE, FCTXTRACE, HAVE_ANSWER, INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOMORE, ISC_R_SUCCESS, ISC_TRUE, issecuredomain(), fctxbucket::lock, LOCK, dns_view::maxncachettl, fetchctx::name, ncache_adderesult(), fetchctx::options, POST, fetchctx::res, fctxbucket::task, dns_rdataset::trust, fetchctx::type, UNLOCK, valcreate(), and dns_resolver::view.

Referenced by resquery_response().

static void mark_related ( dns_name_t name,
dns_rdataset_t rdataset,
isc_boolean_t  external,
isc_boolean_t  gluing 
) [inline, static]

Definition at line 5719 of file resolver.c.

References dns_rdataset::attributes, dns_name::attributes, CACHE, DNS_NAMEATTR_CACHE, DNS_NAMEATTR_CHASE, DNS_RDATASETATTR_CACHE, DNS_RDATASETATTR_CHASE, DNS_RDATASETATTR_EXTERNAL, dns_trust_additional, dns_trust_glue, dns_rdataset::trust, and dns_rdataset::ttl.

Referenced by check_section().

static isc_result_t check_section ( void *  arg,
dns_name_t addname,
dns_rdatatype_t  type,
dns_section_t  section 
) [static]

Definition at line 5746 of file resolver.c.

References dns_rdataset::covers, dns_message_findname(), dns_message_findtype(), dns_name_issubdomain(), DNS_SECTION_ANSWER, GLUING, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, ISC_TF, ISC_TRUE, mark_related(), REQUIRE, dns_rdataset::type, and VALID_FCTX.

Referenced by check_related().

static isc_result_t check_related ( void *  arg,
dns_name_t addname,
dns_rdatatype_t  type 
) [static]

Definition at line 5810 of file resolver.c.

References check_section(), and DNS_SECTION_ADDITIONAL.

Referenced by answer_response(), chase_additional(), and noanswer_response().

static void chase_additional ( fetchctx_t fctx  )  [static]

Definition at line 5825 of file resolver.c.

References dns_rdataset::attributes, dns_name::attributes, CHASE, check_related(), dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), DNS_NAMEATTR_CHASE, dns_rdataset_additionaldata(), DNS_RDATASETATTR_CHASE, DNS_SECTION_ADDITIONAL, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, and ISC_TRUE.

Referenced by resquery_response().

static isc_result_t cname_target ( dns_rdataset_t rdataset,
dns_name_t tname 
) [inline, static]

Definition at line 5860 of file resolver.c.

References dns_name_clone(), dns_name_init(), dns_rdata_freestruct(), DNS_RDATA_INIT, dns_rdata_tostruct(), dns_rdataset_current(), dns_rdataset_first(), and ISC_R_SUCCESS.

Referenced by answer_response().

static isc_result_t dname_target ( fetchctx_t fctx,
dns_rdataset_t rdataset,
dns_name_t qname,
dns_name_t oname,
dns_fixedname_t fixeddname 
) [inline, static]

Definition at line 5880 of file resolver.c.

References dns_fixedname_init, dns_fixedname_name, dns_name_concatenate(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_fullcompare(), dns_name_split(), dns_namereln_subdomain, DNS_R_FORMERR, dns_rdata_freestruct(), DNS_RDATA_INIT, dns_rdata_tostruct(), dns_rdataset_current(), dns_rdataset_first(), ISC_R_SUCCESS, and log_formerr().

Referenced by answer_response().

static isc_boolean_t is_answeraddress_allowed ( dns_view_t view,
dns_name_t name,
dns_rdataset_t rdataset 
) [static]

Definition at line 5928 of file resolver.c.

References dns_view::aclenv, dns_view::answeracl_exclude, dns_rdata::data, dns_view::denyansweracl, dns_acl_match(), dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, DNS_R_PARTIALMATCH, dns_rbt_findnode(), DNS_RDATA_INIT, dns_rdata_reset(), dns_rdataclass_format(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_next(), dns_rdatatype_format(), INSIST, ISC_FALSE, ISC_LOG_NOTICE, isc_log_write(), isc_netaddr_format(), ISC_NETADDR_FORMATSIZE, isc_netaddr_fromin(), isc_netaddr_fromin6(), ISC_R_SUCCESS, ISC_TRUE, dns_rdata::length, match(), namebuf, dns_rdataset::rdclass, and dns_rdataset::type.

Referenced by answer_response().

static isc_boolean_t is_answertarget_allowed ( dns_view_t view,
dns_name_t name,
dns_rdatatype_t  type,
dns_name_t tname,
dns_name_t domain 
) [static]

Definition at line 6002 of file resolver.c.

References dns_view::answernames_exclude, dns_view::denyanswernames, dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_issubdomain(), DNS_R_PARTIALMATCH, dns_rbt_findnode(), dns_rdataclass_format(), dns_rdatatype_format(), ISC_FALSE, ISC_LOG_NOTICE, isc_log_write(), ISC_R_SUCCESS, ISC_TRUE, and dns_view::rdclass.

Referenced by answer_response().

static void trim_ns_ttl ( fetchctx_t fctx,
dns_name_t name,
dns_rdataset_t rdataset 
) [static]

Definition at line 6056 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, ISC_LOG_DEBUG, isc_log_write(), fetchctx::name, namebuf, dns_rdataset::ttl, and fetchctx::type.

Referenced by answer_response(), and noanswer_response().

static isc_result_t noanswer_response ( fetchctx_t fctx,
dns_name_t oqname,
unsigned int  look_in_options 
) [static]

Definition at line 6086 of file resolver.c.

References dns_rdataset::attributes, dns_name::attributes, check_related(), dns_message::counts, dns_rdataset::covers, dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), DNS_MESSAGEFLAG_AA, dns_name_countlabels(), dns_name_dup(), dns_name_equal(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_free(), dns_name_init(), dns_name_issubdomain(), DNS_NAMEATTR_CACHE, DNS_NAMEATTR_NCACHE, DNS_R_CHASEDSSERVERS, DNS_R_DELEGATION, DNS_R_FORMERR, dns_rcode_noerror, dns_rcode_nxdomain, dns_rdataset_additionaldata(), dns_rdataset_disassociate(), dns_rdataset_isassociated(), DNS_RDATASETATTR_CACHE, DNS_RDATASETATTR_NCACHE, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, dns_rootname, DNS_SECTION_ANSWER, DNS_SECTION_AUTHORITY, dns_trust_additional, dns_trust_answer, dns_trust_authauthority, dns_trust_glue, FCTX_ATTR_GLUING, FCTX_ATTR_WANTCACHE, FCTX_ATTR_WANTNCACHE, FCTXTRACE, dns_message::flags, INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOMORE, ISC_R_SUCCESS, ISC_TRUE, ISFORWARDER, log_formerr(), log_ns_ttl(), LOOK_FOR_GLUE_IN_ANSWER, LOOK_FOR_NS_IN_ANSWER, fetchctx::mctx, fetchctx::name, dns_message::rcode, trim_ns_ttl(), dns_rdataset::trust, dns_rdataset::ttl, dns_rdataset::type, and fetchctx::type.

Referenced by answer_response(), and resquery_response().

static isc_result_t answer_response ( fetchctx_t fctx  )  [static]

Definition at line 6527 of file resolver.c.

References dns_rdataset::attributes, dns_name::attributes, check_related(), cname_target(), dns_rdataset::covers, dname_target(), dns_fixedname_init, dns_fixedname_name, dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), DNS_MESSAGEFLAG_AA, dns_name_copy(), dns_name_equal(), dns_name_issubdomain(), DNS_NAMEATTR_ANSWER, DNS_NAMEATTR_CACHE, DNS_NAMEATTR_CHAINING, DNS_R_FORMERR, DNS_R_SERVFAIL, dns_rcode_noerror, dns_rdataset_additionaldata(), DNS_RDATASETATTR_ANSWER, DNS_RDATASETATTR_ANSWERSIG, DNS_RDATASETATTR_CACHE, DNS_RDATASETATTR_CHAINING, DNS_RDATASETATTR_EXTERNAL, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, dns_rootname, DNS_SECTION_ANSWER, DNS_SECTION_AUTHORITY, dns_trust_additional, dns_trust_answer, dns_trust_authanswer, dns_trust_authauthority, FCTX_ATTR_WANTCACHE, FCTXTRACE, dns_message::flags, INSIST, is_answeraddress_allowed(), is_answertarget_allowed(), ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOMORE, ISC_R_NOSPACE, ISC_R_SUCCESS, ISC_TF, ISC_TRUE, log_formerr(), log_ns_ttl(), fetchctx::name, noanswer_response(), POST, dns_message::rcode, fetchctx::res, trim_ns_ttl(), dns_rdataset::trust, dns_rdataset::type, fetchctx::type, and dns_resolver::view.

Referenced by resquery_response().

static void resume_dslookup ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 7030 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, cleanup(), dns_db_detach(), dns_db_detachnode(), DNS_EVENT_FETCHDONE, dns_fixedname_init, dns_fixedname_name, dns_name_copy(), dns_name_countlabels(), dns_name_dup(), dns_name_equal(), dns_name_free(), dns_name_getlabelsequence(), dns_name_init(), DNS_R_SERVFAIL, dns_rdataset_clone(), dns_rdataset_disassociate(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_resolver_createfetch(), dns_resolver_destroyfetch(), empty_bucket(), fctx_decreference(), fctx_done(), fctx_try(), FCTXTRACE, fixed, INSIST, isc_event_free(), ISC_FALSE, ISC_R_CANCELED, ISC_R_SUCCESS, ISC_TRUE, fctxbucket::lock, LOCK, log_ns_ttl(), fetchctx::mctx, fetchctx::options, fetchctx::references, REQUIRE, fetchctx::res, UNLOCK, UNUSED, and VALID_FCTX.

Referenced by resquery_response().

static void checknamessection ( dns_message_t message,
dns_section_t  section 
) [inline, static]

Definition at line 7147 of file resolver.c.

References dns_rdataset::attributes, dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), dns_rdata_checknames(), dns_rdata_checkowner(), DNS_RDATA_INIT, dns_rdata_reset(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_next(), DNS_RDATASETATTR_CHECKNAMES, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, dns_rdata::rdclass, and dns_rdata::type.

Referenced by checknames().

static void checknames ( dns_message_t message  )  [static]

Definition at line 7181 of file resolver.c.

References checknamessection(), DNS_SECTION_ADDITIONAL, DNS_SECTION_ANSWER, and DNS_SECTION_AUTHORITY.

static void log_nsid ( isc_buffer_t opt,
size_t  nsid_len,
resquery_t query,
int  level,
isc_mem_t mctx 
) [static]

Definition at line 7192 of file resolver.c.

References query::addrinfo, cleanup(), dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, hex, isc_buffer_current, isc_log_write(), isc_mem_get, isc_mem_put, isc_sockaddr_format(), ISC_SOCKADDR_FORMATSIZE, and dns_adbaddrinfo::sockaddr.

Referenced by process_opt().

static isc_boolean_t iscname ( fetchctx_t fctx  )  [static]

Definition at line 7242 of file resolver.c.

References dns_message_findname(), DNS_SECTION_ANSWER, ISC_FALSE, ISC_R_SUCCESS, ISC_TRUE, and fetchctx::name.

Referenced by resquery_response().

static isc_boolean_t betterreferral ( fetchctx_t fctx  )  [static]

Definition at line 7252 of file resolver.c.

References dns_message_currentname(), dns_message_firstname(), dns_message_nextname(), DNS_SECTION_AUTHORITY, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, ISC_TRUE, isstrictsubdomain(), and dns_rdataset::type.

Referenced by resquery_response().

static void process_opt ( resquery_t query,
dns_rdataset_t opt 
) [static]

Definition at line 7275 of file resolver.c.

References query::addrinfo, cookie, dns_rdata::data, dns_adb_setsit(), DNS_FETCHOPT_WANTNSID, DNS_OPT_NSID, DNS_OPT_SIT, dns_rdata_init(), dns_rdataset_current(), dns_rdataset_first(), query::fctx, inc_stats(), INSIST, isc_buffer_add, isc_buffer_current, isc_buffer_forward, isc_buffer_getuint16(), isc_buffer_init, isc_buffer_remaininglength, ISC_LOG_DEBUG, ISC_R_SUCCESS, dns_rdata::length, log_nsid(), dns_resolver::mctx, query::options, and fetchctx::res.

Referenced by client_request(), recv_done(), and resquery_response().

static void send_shutdown_events ( dns_resolver_t res  )  [static]

Definition at line 8307 of file resolver.c.

References ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, and isc_task_sendanddetach().

static void spillattimer_countdown ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 8341 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, INSIST, isc_event_free(), ISC_FALSE, ISC_LOG_NOTICE, isc_log_write(), ISC_R_SUCCESS, isc_timer_reset(), isc_timertype_inactive, ISC_TRUE, dns_resolver::lock, LOCK, REQUIRE, RUNTIME_CHECK, UNLOCK, UNUSED, and VALID_RESOLVER.

Referenced by dns_resolver_create().

isc_result_t dns_resolver_create ( dns_view_t view,
isc_taskmgr_t taskmgr,
unsigned int  ntasks,
unsigned int  ndisp,
isc_socketmgr_t socketmgr,
isc_timermgr_t timermgr,
unsigned int  options,
dns_dispatchmgr_t dispatchmgr,
dns_dispatch_t dispatchv4,
dns_dispatch_t dispatchv6,
dns_resolver_t **  resp 
)

Create a resolver.

Notes:

Requires:

Returns:

Definition at line 8374 of file resolver.c.

References dns_resolver::buckets, DEFAULT_MAX_QUERIES, DEFAULT_QUERY_TIMEOUT, DEFAULT_RECURSION_DEPTH, DESTROYLOCK, dns_resolver::dispatches4, dns_resolver::dispatches6, dns_resolver::dispatchmgr, dns_badcache_init(), dns_dispatch_getattributes(), DNS_DISPATCHATTR_EXCLUSIVE, dns_dispatchset_create(), dns_dispatchset_destroy(), DNS_RESOLVER_BADCACHESIZE, dns_resstatscounter_buckets, DNS_VIEW_VALID, dns_resolver::exclusivev4, dns_resolver::exclusivev6, dns_resolver::frozen, ISC_FALSE, ISC_LIST_INIT, isc_mem_attach(), isc_mem_create(), isc_mem_detach(), isc_mem_get, isc_mem_put, isc_mem_setname(), isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlock_destroy(), isc_rwlock_init(), isc_stats_set(), isc_task_create(), isc_task_detach(), isc_task_setname(), isc_task_shutdown(), ISC_TF, isc_timer_create(), isc_timer_detach(), isc_timertype_inactive, dns_resolver::lame_ttl, dns_resolver::lock, fctxbucket::lock, dns_resolver::magic, dns_resolver::mctx, dns_view::mctx, dns_resolver::nbuckets, dns_resolver::nlock, dns_resolver::options, dns_resolver::primelock, dns_resolver::querydscp4, dns_resolver::querydscp6, dns_view::rdclass, dns_resolver::rdclass, RECV_BUFFER_SIZE, REQUIRE, RES_MAGIC, dns_view::resstats, RTRACE, dns_resolver::socketmgr, spillattimer_countdown(), fctxbucket::task, dns_resolver::taskmgr, dns_resolver::timermgr, and dns_resolver::view.

Referenced by dns_view_createresolver().

static void prime_done ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 8589 of file resolver.c.

References dns_view::cache, dns_cache_attachdb(), dns_db_detach(), dns_db_detachnode(), DNS_EVENT_FETCHDONE, dns_rdataset_disassociate(), dns_rdataset_isassociated(), dns_resolver_destroyfetch(), dns_root_checkhints(), dns_view::hints, INSIST, isc_event_free(), ISC_FALSE, isc_mem_put, ISC_R_SUCCESS, dns_resolver::lock, LOCK, dns_resolver::mctx, dns_resolver::primelock, REQUIRE, UNLOCK, UNUSED, VALID_RESOLVER, and dns_resolver::view.

Referenced by dns_resolver_prime().

void dns_resolver_prime ( dns_resolver_t res  ) 

Prime resolver.

Notes:

Requires:

Definition at line 8635 of file resolver.c.

References dns_resolver::buckets, dns_rdataset_init(), dns_resolver_createfetch(), dns_rootname, dns_resolver::frozen, INSIST, ISC_FALSE, isc_mem_get, ISC_R_SUCCESS, ISC_TRUE, dns_resolver::lock, LOCK, dns_resolver::mctx, prime_done(), dns_resolver::primelock, REQUIRE, RTRACE, fctxbucket::task, UNLOCK, and VALID_RESOLVER.

Referenced by dns_view_find2().

void dns_resolver_freeze ( dns_resolver_t res  ) 

Freeze resolver.

Notes:

Requires:

Ensures:

Definition at line 8695 of file resolver.c.

References dns_resolver::frozen, ISC_TRUE, REQUIRE, and VALID_RESOLVER.

Referenced by dns_view_freeze().

void dns_resolver_attach ( dns_resolver_t source,
dns_resolver_t **  targetp 
)

Definition at line 8706 of file resolver.c.

References INSIST, dns_resolver::lock, LOCK, REQUIRE, RRTRACE, UNLOCK, and VALID_RESOLVER.

void dns_resolver_whenshutdown ( dns_resolver_t res,
isc_task_t task,
isc_event_t **  eventp 
)

Send '*eventp' to 'task' when 'res' has completed shutdown.

Notes:

Requires:

Ensures:

Definition at line 8723 of file resolver.c.

References ISC_LIST_APPEND, isc_task_attach(), isc_task_send(), dns_resolver::lock, LOCK, REQUIRE, UNLOCK, and VALID_RESOLVER.

Referenced by dns_view_createresolver().

void dns_resolver_shutdown ( dns_resolver_t res  ) 

Start the shutdown process for 'res'.

Notes:

Requires:

Definition at line 8754 of file resolver.c.

References dns_resolver::buckets, dns_resolver::dispatches4, dns_resolver::dispatches6, dns_dispatchset_cancelall(), dns_resolver::exclusivev4, dns_resolver::exclusivev6, fctx_shutdown(), INSIST, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, isc_timer_reset(), isc_timertype_inactive, ISC_TRUE, fctxbucket::lock, dns_resolver::lock, LOCK, dns_resolver::nbuckets, REQUIRE, RTRACE, RUNTIME_CHECK, send_shutdown_events(), fctxbucket::task, UNLOCK, and VALID_RESOLVER.

Referenced by dns_view_createresolver(), and view_flushanddetach().

void dns_resolver_detach ( dns_resolver_t **  resp  ) 

Definition at line 8802 of file resolver.c.

References destroy(), INSIST, ISC_FALSE, ISC_TRUE, dns_resolver::lock, LOCK, REQUIRE, RTRACE, UNLOCK, and VALID_RESOLVER.

Referenced by destroy().

static isc_boolean_t fctx_match ( fetchctx_t fctx,
dns_name_t name,
dns_rdatatype_t  type,
unsigned int  options 
) [inline, static]

Definition at line 8830 of file resolver.c.

References fetchctx::cloned, dns_name_equal(), fetchstate_done, ISC_FALSE, ISC_LIST_EMPTY, fetchctx::name, fetchctx::options, fetchctx::state, and fetchctx::type.

Referenced by dns_resolver_createfetch3().

static void log_fetch ( dns_name_t name,
dns_rdatatype_t  type 
) [inline, static]

Definition at line 8846 of file resolver.c.

References dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, dns_name_format(), DNS_NAME_FORMATSIZE, dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, ISC_LOG_DEBUG, isc_log_wouldlog(), isc_log_write(), and namebuf.

Referenced by dns_resolver_createfetch3().

isc_result_t dns_resolver_createfetch ( dns_resolver_t res,
dns_name_t name,
dns_rdatatype_t  type,
dns_name_t domain,
dns_rdataset_t nameservers,
dns_forwarders_t forwarders,
unsigned int  options,
isc_task_t task,
isc_taskaction_t  action,
void *  arg,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset,
dns_fetch_t **  fetchp 
)

Definition at line 8867 of file resolver.c.

References dns_resolver_createfetch3().

Referenced by checkbogus(), create_fetch(), dns_resolver_prime(), resquery_response(), resume_dslookup(), start_fetch(), and zone_refreshkeys().

isc_result_t dns_resolver_createfetch2 ( dns_resolver_t res,
dns_name_t name,
dns_rdatatype_t  type,
dns_name_t domain,
dns_rdataset_t nameservers,
dns_forwarders_t forwarders,
isc_sockaddr_t client,
dns_messageid_t  id,
unsigned int  options,
isc_task_t task,
isc_taskaction_t  action,
void *  arg,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset,
dns_fetch_t **  fetchp 
)

Definition at line 8884 of file resolver.c.

References dns_resolver_createfetch3().

isc_result_t dns_resolver_createfetch3 ( dns_resolver_t res,
dns_name_t name,
dns_rdatatype_t  type,
dns_name_t domain,
dns_rdataset_t nameservers,
dns_forwarders_t forwarders,
isc_sockaddr_t client,
dns_messageid_t  id,
unsigned int  options,
unsigned int  depth,
isc_counter_t qc,
isc_task_t task,
isc_taskaction_t  action,
void *  arg,
dns_rdataset_t rdataset,
dns_rdataset_t sigrdataset,
dns_fetch_t **  fetchp 
)

Definition at line 8902 of file resolver.c.

References dns_resolver::buckets, fetchctx::control_event, DNS_EVENT_FETCHCONTROL, DNS_FETCHOPT_UNSHARED, dns_name_fullhash(), DNS_R_DROP, DNS_R_DUPLICATE, dns_rdataset_isassociated(), DNS_RDATASET_VALID, fctx_create(), fctx_destroy(), fctx_join(), fctx_match(), fctx_start(), fctx_unlink(), dns_resolver::frozen, FTRACE, INSIST, ISC_EVENT_INIT, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, isc_mem_attach(), isc_mem_get, isc_mem_putanddetach, ISC_R_NOMEMORY, ISC_R_SHUTTINGDOWN, ISC_R_SUCCESS, isc_sockaddr_equal(), isc_task_send(), ISC_TRUE, fctxbucket::lock, dns_resolver::lock, LOCK, log_fetch(), dns_fetch::mctx, dns_resolver::mctx, dns_resolver::nbuckets, REQUIRE, fetchctx::spilled, fctxbucket::task, dns_rdataset::type, UNLOCK, UNUSED, and VALID_RESOLVER.

void dns_resolver_cancelfetch ( dns_fetch_t fetch  ) 

Cancel 'fetch'.

Notes:

Requires:

Definition at line 9048 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, DNS_FETCH_VALID, fetchstate_done, FTRACE, ISC_EVENT_PTR, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, ISC_R_CANCELED, isc_task_sendanddetach(), fctxbucket::lock, LOCK, dns_fetch::private, REQUIRE, fetchctx::res, fetchctx::state, UNLOCK, and VALID_FCTX.

Referenced by cancel_fetches_at_name(), checkbogus(), dns_client_cancelresolve(), dns_lookup_cancel(), dns_validator_cancel(), fctx_doshutdown(), ns_query_cancel(), and nta_detach().

void dns_resolver_destroyfetch ( dns_fetch_t **  fetchp  ) 

Destroy 'fetch'.

Requires:

Ensures:

Definition at line 9095 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, DNS_FETCH_VALID, empty_bucket(), fctx_decreference(), fetchstate_done, FTRACE, ISC_LIST_HEAD, ISC_LIST_NEXT, isc_mem_putanddetach, fctxbucket::lock, LOCK, dns_fetch::mctx, dns_fetch::private, REQUIRE, fetchctx::res, RUNTIME_CHECK, fetchctx::state, UNLOCK, and VALID_FCTX.

Referenced by client_resfind(), dlvfetched(), dns_validator_cancel(), dsfetched(), dsfetched2(), fetch_callback(), fetch_callback_validator(), fetch_done(), keyfetch_done(), lookup_find(), nta_detach(), prefetch_done(), prime_done(), query_resume(), and resume_dslookup().

void dns_resolver_logfetch ( dns_fetch_t fetch,
isc_log_t lctx,
isc_logcategory_t category,
isc_logmodule_t module,
int  level,
isc_boolean_t  duplicateok 
)

Dump a log message on internal state at the completion of given 'fetch'. 'lctx', 'category', 'module', and 'level' are used to write the log message. By default, only one log message is written even if the corresponding fetch context serves multiple clients; if 'duplicateok' is true the suppression is disabled and the message can be written every time this function is called.

Requires:

Definition at line 9141 of file resolver.c.

References fetchctx::bucketnum, dns_resolver::buckets, DNS_FETCH_VALID, dns_name_format(), DNS_NAME_FORMATSIZE, fetchctx::info, INSIST, isc_log_write(), ISC_PRINT_QUADFORMAT, isc_result_totext(), ISC_TRUE, fctxbucket::lock, LOCK, dns_fetch::private, REQUIRE, fetchctx::res, UNLOCK, US_PER_SEC, and VALID_FCTX.

Referenced by query_resume().

dns_dispatchmgr_t* dns_resolver_dispatchmgr ( dns_resolver_t resolver  ) 

Definition at line 9182 of file resolver.c.

References dns_resolver::dispatchmgr, REQUIRE, and VALID_RESOLVER.

Referenced by dns_view_createresolver().

dns_dispatch_t* dns_resolver_dispatchv4 ( dns_resolver_t resolver  ) 

Definition at line 9188 of file resolver.c.

References dns_resolver::dispatches4, dns_dispatchset_get(), REQUIRE, and VALID_RESOLVER.

Referenced by fctx_query().

dns_dispatch_t* dns_resolver_dispatchv6 ( dns_resolver_t resolver  ) 

Definition at line 9194 of file resolver.c.

References dns_resolver::dispatches6, dns_dispatchset_get(), REQUIRE, and VALID_RESOLVER.

Referenced by adjust_interfaces(), and fctx_query().

isc_socketmgr_t* dns_resolver_socketmgr ( dns_resolver_t resolver  ) 

Definition at line 9200 of file resolver.c.

References REQUIRE, dns_resolver::socketmgr, and VALID_RESOLVER.

isc_taskmgr_t* dns_resolver_taskmgr ( dns_resolver_t resolver  ) 

Definition at line 9206 of file resolver.c.

References REQUIRE, dns_resolver::taskmgr, and VALID_RESOLVER.

Referenced by dns_view_createresolver().

isc_uint32_t dns_resolver_getlamettl ( dns_resolver_t resolver  ) 

Get the resolver's lame-ttl. zero => no lame processing.

Requires:

Definition at line 9212 of file resolver.c.

References dns_resolver::lame_ttl, REQUIRE, and VALID_RESOLVER.

void dns_resolver_setlamettl ( dns_resolver_t resolver,
isc_uint32_t  lame_ttl 
)

Set the resolver's lame-ttl. zero => no lame processing.

Requires:

Definition at line 9218 of file resolver.c.

References dns_resolver::lame_ttl, REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

unsigned int dns_resolver_nrunning ( dns_resolver_t resolver  ) 

Return the number of currently running resolutions in this resolver. This is may be less than the number of outstanding fetches due to multiple identical fetches, or more than the number of of outstanding fetches due to the fact that resolution can continue even though a fetch has been canceled.

Definition at line 9224 of file resolver.c.

References LOCK, dns_resolver::nlock, and UNLOCK.

isc_result_t dns_resolver_addalternate ( dns_resolver_t resolver,
isc_sockaddr_t alt,
dns_name_t name,
in_port_t  port 
)

Add alternate addresses to be tried in the event that the nameservers for a zone are not available in the address families supported by the operating system.

Require:

Definition at line 9233 of file resolver.c.

References alternate::_n, alternate::_u, alternate::addr, dns_name_dup(), dns_name_init(), dns_resolver::frozen, alternate::isaddress, ISC_FALSE, ISC_LINK_INIT, ISC_LIST_APPEND, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_TRUE, dns_resolver::mctx, REQUIRE, and VALID_RESOLVER.

Referenced by configure_alternates().

void dns_resolver_setudpsize ( dns_resolver_t resolver,
isc_uint16_t  udpsize 
)

Set the EDNS UDP buffer size advertised by the server.

Definition at line 9265 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

isc_uint16_t dns_resolver_getudpsize ( dns_resolver_t resolver  ) 

Get the current EDNS UDP buffer size.

Definition at line 9271 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

Referenced by ns_client_addopt(), ns_query(), and soa_query().

void dns_resolver_flushbadcache ( dns_resolver_t resolver,
dns_name_t name 
)

Flush the bad cache of all entries at 'name' if 'name' is non NULL. Flush the entire bad cache if 'name' is NULL.

Requires:

Definition at line 9277 of file resolver.c.

References dns_badcache_flush(), and dns_badcache_flushname().

Referenced by dns_view_flushcache2(), and dns_view_flushnode().

void dns_resolver_flushbadnames ( dns_resolver_t resolver,
dns_name_t name 
)

Flush the bad cache of all entries at or below 'name'.

Requires:

Definition at line 9285 of file resolver.c.

References dns_badcache_flushtree().

Referenced by dns_view_flushnode().

void dns_resolver_addbadcache ( dns_resolver_t resolver,
dns_name_t name,
dns_rdatatype_t  type,
isc_time_t expire 
)

Add a entry to the bad cache for <name,type> that will expire at 'expire'.

Requires:

Definition at line 9290 of file resolver.c.

References dns_badcache_add(), and ISC_FALSE.

Referenced by fctx_getaddresses().

isc_boolean_t dns_resolver_getbadcache ( dns_resolver_t resolver,
dns_name_t name,
dns_rdatatype_t  type,
isc_time_t now 
)

Check to see if there is a unexpired entry in the bad cache for <name,type>.

Requires:

Definition at line 9298 of file resolver.c.

References dns_badcache_find().

Referenced by view_find().

void dns_resolver_printbadcache ( dns_resolver_t resolver,
FILE *  fp 
)

Definition at line 9305 of file resolver.c.

References dns_badcache_print().

Referenced by dns_view_dumpdbtostream(), and dumpdone().

static void free_algorithm ( void *  node,
void *  arg 
) [static]

Definition at line 9310 of file resolver.c.

References algorithms, and isc_mem_put.

Referenced by dns_resolver_disable_algorithm().

void dns_resolver_reset_algorithms ( dns_resolver_t resolver  ) 

Clear the disabled DNSSEC algorithms.

Definition at line 9318 of file resolver.c.

References dns_rbt_destroy(), isc_rwlocktype_write, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by configure_view(), and destroy().

isc_result_t dns_resolver_disable_algorithm ( dns_resolver_t resolver,
dns_name_t name,
unsigned int  alg 
)

Mark the given DNSSEC algorithm as disabled and below 'name'. Valid algorithms are less than 256.

Returns:

Definition at line 9333 of file resolver.c.

References algorithms, cleanup(), dns_rbtnode::data, dns_rbt_addnode(), dns_rbt_create(), free_algorithm(), isc_mem_get, isc_mem_put, ISC_R_EXISTS, ISC_R_NOMEMORY, ISC_R_RANGE, ISC_R_SUCCESS, isc_rwlocktype_write, dns_resolver::mctx, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by disable_algorithms().

isc_boolean_t dns_resolver_algorithm_supported ( dns_resolver_t resolver,
dns_name_t name,
unsigned int  alg 
)

Check if the given algorithm is supported by this resolver. This checks whether the algorithm has been disabled via dns_resolver_disable_algorithm(), then checks the underlying crypto libraries if it was not specifically disabled.

Definition at line 9408 of file resolver.c.

References algorithms, DNS_R_PARTIALMATCH, dns_rbt_findname(), dst_algorithm_supported(), ISC_FALSE, ISC_R_SUCCESS, isc_rwlocktype_read, ISC_TRUE, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by check_ds(), dlv_algorithm_supported(), dlv_validatezonekey(), validate(), and validatezonekey().

static void free_digest ( void *  node,
void *  arg 
) [static]

Definition at line 9442 of file resolver.c.

References isc_mem_put.

Referenced by dns_resolver_disable_ds_digest().

void dns_resolver_reset_ds_digests ( dns_resolver_t resolver  ) 

Clear the disabled DS/DLV digest types.

Definition at line 9450 of file resolver.c.

References dns_rbt_destroy(), isc_rwlocktype_write, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by configure_view(), and destroy().

isc_result_t dns_resolver_disable_ds_digest ( dns_resolver_t resolver,
dns_name_t name,
unsigned int  digest_type 
)

Mark the given DS/DLV digest type as disabled and below 'name'. Valid types are less than 256.

Returns:

Definition at line 9465 of file resolver.c.

References cleanup(), dns_rbtnode::data, dns_rbt_addnode(), dns_rbt_create(), free_digest(), isc_mem_get, isc_mem_put, ISC_R_EXISTS, ISC_R_NOMEMORY, ISC_R_RANGE, ISC_R_SUCCESS, isc_rwlocktype_write, dns_resolver::mctx, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by disable_ds_digests().

isc_boolean_t dns_resolver_ds_digest_supported ( dns_resolver_t resolver,
dns_name_t name,
unsigned int  digest_type 
)

Check if the given digest type is supported by this resolver. This checks whether the digest type has been disabled via dns_resolver_disable_ds_digest(), then checks the underlying crypto libraries if it was not specifically disabled.

Definition at line 9536 of file resolver.c.

References DNS_R_PARTIALMATCH, dns_rbt_findname(), dst_ds_digest_supported(), ISC_FALSE, ISC_R_SUCCESS, isc_rwlocktype_read, ISC_TRUE, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by check_ds(), dlv_algorithm_supported(), dlv_validatezonekey(), and validatezonekey().

void dns_resolver_resetmustbesecure ( dns_resolver_t resolver  ) 

Definition at line 9570 of file resolver.c.

References dns_rbt_destroy(), isc_rwlocktype_write, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by configure_view(), and destroy().

isc_result_t dns_resolver_setmustbesecure ( dns_resolver_t resolver,
dns_name_t name,
isc_boolean_t  value 
)

Definition at line 9587 of file resolver.c.

References cleanup(), dns_rbt_addname(), dns_rbt_create(), ISC_R_SUCCESS, isc_rwlocktype_write, dns_resolver::mctx, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by mustbesecure().

isc_boolean_t dns_resolver_getmustbesecure ( dns_resolver_t resolver,
dns_name_t name 
)

Definition at line 9613 of file resolver.c.

References DNS_R_PARTIALMATCH, dns_rbt_findname(), ISC_FALSE, ISC_R_SUCCESS, isc_rwlocktype_read, REQUIRE, RWLOCK, RWUNLOCK, and VALID_RESOLVER.

Referenced by dns_validator_create().

void dns_resolver_getclientsperquery ( dns_resolver_t resolver,
isc_uint32_t cur,
isc_uint32_t min,
isc_uint32_t max 
)

Definition at line 9636 of file resolver.c.

References dns_resolver::lock, LOCK, REQUIRE, UNLOCK, and VALID_RESOLVER.

void dns_resolver_setclientsperquery ( dns_resolver_t resolver,
isc_uint32_t  min,
isc_uint32_t  max 
)

Definition at line 9652 of file resolver.c.

References dns_resolver::lock, LOCK, REQUIRE, UNLOCK, and VALID_RESOLVER.

Referenced by configure_view().

isc_boolean_t dns_resolver_getzeronosoattl ( dns_resolver_t resolver  ) 

Definition at line 9664 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

Referenced by cache_reusable().

void dns_resolver_setzeronosoattl ( dns_resolver_t resolver,
isc_boolean_t  state 
)

Definition at line 9671 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

unsigned int dns_resolver_getoptions ( dns_resolver_t resolver  ) 

Definition at line 9678 of file resolver.c.

References dns_resolver::options, REQUIRE, and VALID_RESOLVER.

unsigned int dns_resolver_gettimeout ( dns_resolver_t resolver  ) 

Get the current length of time the resolver will work on a query, in seconds.

Requires:

Definition at line 9685 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

void dns_resolver_settimeout ( dns_resolver_t resolver,
unsigned int  seconds 
)

Set the length of time the resolver will work on a query, in seconds.

If timeout is 0, the default timeout will be applied.

Requires:

Definition at line 9692 of file resolver.c.

References DEFAULT_QUERY_TIMEOUT, MAXIMUM_QUERY_TIMEOUT, MINIMUM_QUERY_TIMEOUT, REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

void dns_resolver_setquerydscp4 ( dns_resolver_t resolver,
isc_dscp_t  dscp 
)

Print out the contents of the bad cache to 'fp'.

Requires:

Definition at line 9706 of file resolver.c.

References dns_resolver::querydscp4, REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

isc_dscp_t dns_resolver_getquerydscp4 ( dns_resolver_t resolver  ) 

Definition at line 9713 of file resolver.c.

References dns_resolver::querydscp4, REQUIRE, and VALID_RESOLVER.

Referenced by fctx_query().

void dns_resolver_setquerydscp6 ( dns_resolver_t resolver,
isc_dscp_t  dscp 
)

Definition at line 9719 of file resolver.c.

References dns_resolver::querydscp6, REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

isc_dscp_t dns_resolver_getquerydscp6 ( dns_resolver_t resolver  ) 

Definition at line 9726 of file resolver.c.

References dns_resolver::querydscp6, REQUIRE, and VALID_RESOLVER.

Referenced by fctx_query().

void dns_resolver_setmaxdepth ( dns_resolver_t resolver,
unsigned int  maxdepth 
)

Get and set the DSCP values for the resolver's IPv4 and IPV6 query sources.

Requires:

Definition at line 9732 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

unsigned int dns_resolver_getmaxdepth ( dns_resolver_t resolver  ) 

Definition at line 9738 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

void dns_resolver_setmaxqueries ( dns_resolver_t resolver,
unsigned int  queries 
)

Get and set how many NS indirections will be followed when looking for nameserver addresses.

Requires:

Definition at line 9744 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.

Referenced by configure_view().

unsigned int dns_resolver_getmaxqueries ( dns_resolver_t resolver  ) 

Definition at line 9750 of file resolver.c.

References REQUIRE, and VALID_RESOLVER.


Variable Documentation

isc_boolean_t yes = ISC_TRUE [static]

Definition at line 9584 of file resolver.c.

isc_boolean_t no = ISC_FALSE [static]

Definition at line 9584 of file resolver.c.


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