resolver.h File Reference

This is the BIND 9 resolver, the module responsible for resolving DNS requests by iteratively querying authoritative servers and following referrals. This is a "full resolver", not to be confused with the stub resolvers most people associate with the word "resolver". The full resolver is part of the caching name server or resolver daemon the stub resolver talks to. More...

#include <isc/lang.h>
#include <isc/socket.h>
#include <dns/types.h>
#include <dns/fixedname.h>

Go to the source code of this file.

Data Structures

struct  dns_fetchevent
 A dns_fetchevent_t is sent when a 'fetch' completes. Any of 'db', 'node', 'rdataset', and 'sigrdataset' may be bound. It is the receiver's responsibility to detach before freeing the event. More...

Defines

#define DNS_RESOLVER_H   1
#define DNS_FETCHOPT_TCP   0x001
 Use TCP.
#define DNS_FETCHOPT_UNSHARED   0x002
 See below.
#define DNS_FETCHOPT_RECURSIVE   0x004
 Set RD?
#define DNS_FETCHOPT_NOEDNS0   0x008
 Do not use EDNS.
#define DNS_FETCHOPT_FORWARDONLY   0x010
 Only use forwarders.
#define DNS_FETCHOPT_NOVALIDATE   0x020
 Disable validation.
#define DNS_FETCHOPT_EDNS512   0x040
 Advertise a 512 byte UDP buffer.
#define DNS_FETCHOPT_WANTNSID   0x080
 Request NSID.
#define DNS_FETCHOPT_PREFETCH   0x100
 Do prefetch.
#define DNS_FETCHOPT_NOCDFLAG   0x200
 Don't set CD flag.
#define DNS_FETCHOPT_NONTA   0x400
 Ignore NTA table.
#define DNS_FETCHOPT_EDNSVERSIONSET   0x00800000
#define DNS_FETCHOPT_EDNSVERSIONMASK   0xff000000
#define DNS_FETCHOPT_EDNSVERSIONSHIFT   24
#define DNS_RESOLVER_QRYRTTCLASS0   10
#define DNS_RESOLVER_QRYRTTCLASS0STR   "10"
#define DNS_RESOLVER_QRYRTTCLASS1   100
#define DNS_RESOLVER_QRYRTTCLASS1STR   "100"
#define DNS_RESOLVER_QRYRTTCLASS2   500
#define DNS_RESOLVER_QRYRTTCLASS2STR   "500"
#define DNS_RESOLVER_QRYRTTCLASS3   800
#define DNS_RESOLVER_QRYRTTCLASS3STR   "800"
#define DNS_RESOLVER_QRYRTTCLASS4   1600
#define DNS_RESOLVER_QRYRTTCLASS4STR   "1600"
#define DNS_RESOLVER_CHECKNAMES   0x01
#define DNS_RESOLVER_CHECKNAMESFAIL   0x02

Typedefs

typedef ISC_LANG_BEGINDECLS
struct dns_fetchevent 
dns_fetchevent_t

Functions

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.
void dns_resolver_freeze (dns_resolver_t *res)
 Freeze resolver.
void dns_resolver_prime (dns_resolver_t *res)
 Prime 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.
void dns_resolver_shutdown (dns_resolver_t *res)
 Start the shutdown process for 'res'.
void dns_resolver_attach (dns_resolver_t *source, dns_resolver_t **targetp)
void dns_resolver_detach (dns_resolver_t **resp)
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, isc_uint16_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, isc_uint16_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)
 Recurse to answer a question.
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_reset_algorithms (dns_resolver_t *resolver)
 Clear the disabled DNSSEC algorithms.
void dns_resolver_reset_ds_digests (dns_resolver_t *resolver)
 Clear the disabled DS/DLV digest types.
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_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_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.
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_settimeout (dns_resolver_t *resolver, unsigned int seconds)
 Set the length of time the resolver will work on a query, in seconds.
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_setclientsperquery (dns_resolver_t *resolver, isc_uint32_t min, isc_uint32_t max)
void dns_resolver_getclientsperquery (dns_resolver_t *resolver, isc_uint32_t *cur, 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)
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_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_printbadcache (dns_resolver_t *resolver, FILE *fp)
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)


Detailed Description

This is the BIND 9 resolver, the module responsible for resolving DNS requests by iteratively querying authoritative servers and following referrals. This is a "full resolver", not to be confused with the stub resolvers most people associate with the word "resolver". The full resolver is part of the caching name server or resolver daemon the stub resolver talks to.

MP:

Reliability: Resources: Security: Standards:

Definition in file resolver.h.


Define Documentation

#define DNS_RESOLVER_H   1

Definition at line 21 of file resolver.h.

#define DNS_FETCHOPT_TCP   0x001

Use TCP.

Definition at line 90 of file resolver.h.

Referenced by fctx_query(), notify_send_toaddr(), resquery_response(), resquery_send(), and start_fetch().

#define DNS_FETCHOPT_UNSHARED   0x002

See below.

Definition at line 91 of file resolver.h.

Referenced by dns_resolver_createfetch3(), fetch_name(), findname(), and resquery_response().

#define DNS_FETCHOPT_RECURSIVE   0x004

Set RD?

Definition at line 92 of file resolver.h.

Referenced by resquery_send().

#define DNS_FETCHOPT_NOEDNS0   0x008

Do not use EDNS.

Definition at line 93 of file resolver.h.

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

#define DNS_FETCHOPT_FORWARDONLY   0x010

Only use forwarders.

Definition at line 94 of file resolver.h.

#define DNS_FETCHOPT_NOVALIDATE   0x020

Disable validation.

Definition at line 95 of file resolver.h.

Referenced by cache_name(), fetch_name(), ncache_message(), ns_query_start(), resquery_send(), start_fetch(), and zone_refreshkeys().

#define DNS_FETCHOPT_EDNS512   0x040

Advertise a 512 byte UDP buffer.

Definition at line 96 of file resolver.h.

Referenced by resquery_send().

#define DNS_FETCHOPT_WANTNSID   0x080

Request NSID.

Definition at line 98 of file resolver.h.

Referenced by process_opt(), and resquery_send().

#define DNS_FETCHOPT_PREFETCH   0x100

Do prefetch.

Definition at line 99 of file resolver.h.

Referenced by cache_name(), and query_prefetch().

#define DNS_FETCHOPT_NOCDFLAG   0x200

Don't set CD flag.

Definition at line 100 of file resolver.h.

Referenced by cache_name(), create_fetch(), ncache_message(), resquery_send(), and start_fetch().

#define DNS_FETCHOPT_NONTA   0x400

Ignore NTA table.

Definition at line 101 of file resolver.h.

Referenced by cache_name(), checkbogus(), create_fetch(), ncache_message(), and resquery_send().

#define DNS_FETCHOPT_EDNSVERSIONSET   0x00800000

Definition at line 104 of file resolver.h.

Referenced by resquery_response(), and resquery_send().

#define DNS_FETCHOPT_EDNSVERSIONMASK   0xff000000

Definition at line 105 of file resolver.h.

Referenced by resquery_response(), and resquery_send().

#define DNS_FETCHOPT_EDNSVERSIONSHIFT   24

Definition at line 106 of file resolver.h.

Referenced by resquery_response(), and resquery_send().

#define DNS_RESOLVER_QRYRTTCLASS0   10

Definition at line 112 of file resolver.h.

Referenced by fctx_cancelquery().

#define DNS_RESOLVER_QRYRTTCLASS0STR   "10"

Definition at line 113 of file resolver.h.

Referenced by init_desc().

#define DNS_RESOLVER_QRYRTTCLASS1   100

Definition at line 114 of file resolver.h.

Referenced by fctx_cancelquery().

#define DNS_RESOLVER_QRYRTTCLASS1STR   "100"

Definition at line 115 of file resolver.h.

Referenced by init_desc().

#define DNS_RESOLVER_QRYRTTCLASS2   500

Definition at line 116 of file resolver.h.

Referenced by fctx_cancelquery().

#define DNS_RESOLVER_QRYRTTCLASS2STR   "500"

Definition at line 117 of file resolver.h.

Referenced by init_desc().

#define DNS_RESOLVER_QRYRTTCLASS3   800

Definition at line 118 of file resolver.h.

Referenced by fctx_cancelquery().

#define DNS_RESOLVER_QRYRTTCLASS3STR   "800"

Definition at line 119 of file resolver.h.

Referenced by init_desc().

#define DNS_RESOLVER_QRYRTTCLASS4   1600

Definition at line 120 of file resolver.h.

Referenced by fctx_cancelquery().

#define DNS_RESOLVER_QRYRTTCLASS4STR   "1600"

Definition at line 121 of file resolver.h.

Referenced by init_desc().

#define DNS_RESOLVER_CHECKNAMES   0x01

Definition at line 128 of file resolver.h.

Referenced by configure_view(), and resquery_response().

#define DNS_RESOLVER_CHECKNAMESFAIL   0x02

Definition at line 129 of file resolver.h.

Referenced by cache_name(), and configure_view().


Typedef Documentation

typedef ISC_LANG_BEGINDECLS struct dns_fetchevent dns_fetchevent_t


Function Documentation

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().

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_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_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_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_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().

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,
isc_uint16_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,
isc_uint16_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 
)

Recurse to answer a question.

Notes:

Requires:

Returns:

Referenced by dns_resolver_createfetch(), dns_resolver_createfetch2(), fetch_name(), query_prefetch(), and query_recurse().

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_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().

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_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_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_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().

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_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().

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_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().

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.

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.

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_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_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().

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.


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