Lines Matching defs:resolver

59 #include <dns/resolver.h>
577 * Increment resolver-related statistics counters.
683 * the delegation-only assumption. Once the resolver learns the
1042 * them and let the event handlers finish the cleanup. The resolver
1683 * a dispatch for it here. Otherwise we use the resolver's
3258 * resolver's forwarders (if any).
4285 * resolver to ensure that this task doesn't go away while we are
4755 * true if the resolver is exiting and this is the last fctx in the bucket.
7725 FCTXTRACE("resolver shutting down");
8776 * Caller must be holding the resolver lock.
8857 * Create a resolver.
9095 "resolver priming query complete");
9156 * no resolver locks. No one else will try to start it
9195 * Freeze resolver.
9681 dns_resolver_dispatchmgr(dns_resolver_t *resolver) {
9682 REQUIRE(VALID_RESOLVER(resolver));
9683 return (resolver->dispatchmgr);
9687 dns_resolver_dispatchv4(dns_resolver_t *resolver) {
9688 REQUIRE(VALID_RESOLVER(resolver));
9689 return (dns_dispatchset_get(resolver->dispatches4));
9693 dns_resolver_dispatchv6(dns_resolver_t *resolver) {
9694 REQUIRE(VALID_RESOLVER(resolver));
9695 return (dns_dispatchset_get(resolver->dispatches6));
9699 dns_resolver_socketmgr(dns_resolver_t *resolver) {
9700 REQUIRE(VALID_RESOLVER(resolver));
9701 return (resolver->socketmgr);
9705 dns_resolver_taskmgr(dns_resolver_t *resolver) {
9706 REQUIRE(VALID_RESOLVER(resolver));
9707 return (resolver->taskmgr);
9711 dns_resolver_getlamettl(dns_resolver_t *resolver) {
9712 REQUIRE(VALID_RESOLVER(resolver));
9713 return (resolver->lame_ttl);
9717 dns_resolver_setlamettl(dns_resolver_t *resolver, isc_uint32_t lame_ttl) {
9718 REQUIRE(VALID_RESOLVER(resolver));
9719 resolver->lame_ttl = lame_ttl;
9723 dns_resolver_nrunning(dns_resolver_t *resolver) {
9725 LOCK(&resolver->nlock);
9726 n = resolver->nfctx;
9727 UNLOCK(&resolver->nlock);
9732 dns_resolver_addalternate(dns_resolver_t *resolver, isc_sockaddr_t *alt,
9737 REQUIRE(VALID_RESOLVER(resolver));
9738 REQUIRE(!resolver->frozen);
9741 a = isc_mem_get(resolver->mctx, sizeof(*a));
9751 result = dns_name_dup(name, resolver->mctx, &a->_u._n.name);
9753 isc_mem_put(resolver->mctx, a, sizeof(*a));
9758 ISC_LIST_APPEND(resolver->alternates, a, link);
9764 dns_resolver_setudpsize(dns_resolver_t *resolver, isc_uint16_t udpsize) {
9765 REQUIRE(VALID_RESOLVER(resolver));
9766 resolver->udpsize = udpsize;
9770 dns_resolver_getudpsize(dns_resolver_t *resolver) {
9771 REQUIRE(VALID_RESOLVER(resolver));
9772 return (resolver->udpsize);
9776 dns_resolver_flushbadcache(dns_resolver_t *resolver, dns_name_t *name) {
9778 dns_badcache_flushname(resolver->badcache, name);
9780 dns_badcache_flush(resolver->badcache);
9784 dns_resolver_flushbadnames(dns_resolver_t *resolver, dns_name_t *name) {
9785 dns_badcache_flushtree(resolver->badcache, name);
9789 dns_resolver_addbadcache(dns_resolver_t *resolver, dns_name_t *name,
9796 (void) dns_badcache_add(resolver->badcache, name, type,
9802 dns_resolver_getbadcache(dns_resolver_t *resolver, dns_name_t *name,
9805 return (dns_badcache_find(resolver->badcache, name, type, NULL, now));
9809 dns_resolver_printbadcache(dns_resolver_t *resolver, FILE *fp) {
9810 (void) dns_badcache_print(resolver->badcache, "Bad cache", fp);
9822 dns_resolver_reset_algorithms(dns_resolver_t *resolver) {
9824 REQUIRE(VALID_RESOLVER(resolver));
9827 RWLOCK(&resolver->alglock, isc_rwlocktype_write);
9829 if (resolver->algorithms != NULL)
9830 dns_rbt_destroy(&resolver->algorithms);
9832 RWUNLOCK(&resolver->alglock, isc_rwlocktype_write);
9837 dns_resolver_disable_algorithm(dns_resolver_t *resolver, dns_name_t *name,
9852 REQUIRE(VALID_RESOLVER(resolver));
9857 RWLOCK(&resolver->alglock, isc_rwlocktype_write);
9859 if (resolver->algorithms == NULL) {
9860 result = dns_rbt_create(resolver->mctx, free_algorithm,
9861 resolver->mctx, &resolver->algorithms);
9869 result = dns_rbt_addnode(resolver->algorithms, name, &node);
9884 tmp = isc_mem_get(resolver->mctx, len);
9898 isc_mem_put(resolver->mctx, algorithms,
9906 RWUNLOCK(&resolver->alglock, isc_rwlocktype_write);
9912 dns_resolver_algorithm_supported(dns_resolver_t *resolver, dns_name_t *name,
9921 REQUIRE(VALID_RESOLVER(resolver));
9930 RWLOCK(&resolver->alglock, isc_rwlocktype_read);
9932 if (resolver->algorithms == NULL)
9934 result = dns_rbt_findname(resolver->algorithms, name, 0, NULL, &data);
9944 RWUNLOCK(&resolver->alglock, isc_rwlocktype_read);
9961 dns_resolver_reset_ds_digests(dns_resolver_t *resolver) {
9963 REQUIRE(VALID_RESOLVER(resolver));
9966 RWLOCK(&resolver->alglock, isc_rwlocktype_write);
9968 if (resolver->digests != NULL)
9969 dns_rbt_destroy(&resolver->digests);
9971 RWUNLOCK(&resolver->alglock, isc_rwlocktype_write);
9976 dns_resolver_disable_ds_digest(dns_resolver_t *resolver, dns_name_t *name,
9990 REQUIRE(VALID_RESOLVER(resolver));
9995 RWLOCK(&resolver->alglock, isc_rwlocktype_write);
9997 if (resolver->digests == NULL) {
9998 result = dns_rbt_create(resolver->mctx, free_digest,
9999 resolver->mctx, &resolver->digests);
10007 result = dns_rbt_addnode(resolver->digests, name, &node);
10019 tmp = isc_mem_get(resolver->mctx, len);
10033 isc_mem_put(resolver->mctx, digests,
10041 RWUNLOCK(&resolver->alglock, isc_rwlocktype_write);
10047 dns_resolver_ds_digest_supported(dns_resolver_t *resolver, dns_name_t *name,
10056 REQUIRE(VALID_RESOLVER(resolver));
10059 RWLOCK(&resolver->alglock, isc_rwlocktype_read);
10061 if (resolver->digests == NULL)
10063 result = dns_rbt_findname(resolver->digests, name, 0, NULL, &data);
10073 RWUNLOCK(&resolver->alglock, isc_rwlocktype_read);
10081 dns_resolver_resetmustbesecure(dns_resolver_t *resolver) {
10083 REQUIRE(VALID_RESOLVER(resolver));
10086 RWLOCK(&resolver->mbslock, isc_rwlocktype_write);
10088 if (resolver->mustbesecure != NULL)
10089 dns_rbt_destroy(&resolver->mustbesecure);
10091 RWUNLOCK(&resolver->mbslock, isc_rwlocktype_write);
10098 dns_resolver_setmustbesecure(dns_resolver_t *resolver, dns_name_t *name,
10103 REQUIRE(VALID_RESOLVER(resolver));
10106 RWLOCK(&resolver->mbslock, isc_rwlocktype_write);
10108 if (resolver->mustbesecure == NULL) {
10109 result = dns_rbt_create(resolver->mctx, NULL, NULL,
10110 &resolver->mustbesecure);
10114 result = dns_rbt_addname(resolver->mustbesecure, name,
10118 RWUNLOCK(&resolver->mbslock, isc_rwlocktype_write);
10124 dns_resolver_getmustbesecure(dns_resolver_t *resolver, dns_name_t *name) {
10129 REQUIRE(VALID_RESOLVER(resolver));
10132 RWLOCK(&resolver->mbslock, isc_rwlocktype_read);
10134 if (resolver->mustbesecure == NULL)
10136 result = dns_rbt_findname(resolver->mustbesecure, name, 0, NULL, &data);
10141 RWUNLOCK(&resolver->mbslock, isc_rwlocktype_read);
10147 dns_resolver_getclientsperquery(dns_resolver_t *resolver, isc_uint32_t *cur,
10150 REQUIRE(VALID_RESOLVER(resolver));
10152 LOCK(&resolver->lock);
10154 *cur = resolver->spillat;
10156 *min = resolver->spillatmin;
10158 *max = resolver->spillatmax;
10159 UNLOCK(&resolver->lock);
10163 dns_resolver_setclientsperquery(dns_resolver_t *resolver, isc_uint32_t min,
10166 REQUIRE(VALID_RESOLVER(resolver));
10168 LOCK(&resolver->lock);
10169 resolver->spillatmin = resolver->spillat = min;
10170 resolver->spillatmax = max;
10171 UNLOCK(&resolver->lock);
10175 dns_resolver_setfetchesperzone(dns_resolver_t *resolver, isc_uint32_t clients)
10177 REQUIRE(VALID_RESOLVER(resolver));
10179 LOCK(&resolver->lock);
10180 resolver->zspill = clients;
10181 UNLOCK(&resolver->lock);
10186 dns_resolver_getzeronosoattl(dns_resolver_t *resolver) {
10187 REQUIRE(VALID_RESOLVER(resolver));
10189 return (resolver->zero_no_soa_ttl);
10193 dns_resolver_setzeronosoattl(dns_resolver_t *resolver, isc_boolean_t state) {
10194 REQUIRE(VALID_RESOLVER(resolver));
10196 resolver->zero_no_soa_ttl = state;
10200 dns_resolver_getoptions(dns_resolver_t *resolver) {
10201 REQUIRE(VALID_RESOLVER(resolver));
10203 return (resolver->options);
10207 dns_resolver_gettimeout(dns_resolver_t *resolver) {
10208 REQUIRE(VALID_RESOLVER(resolver));
10210 return (resolver->query_timeout);
10214 dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int seconds) {
10215 REQUIRE(VALID_RESOLVER(resolver));
10224 resolver->query_timeout = seconds;
10228 dns_resolver_setquerydscp4(dns_resolver_t *resolver, isc_dscp_t dscp) {
10229 REQUIRE(VALID_RESOLVER(resolver));
10231 resolver->querydscp4 = dscp;
10235 dns_resolver_getquerydscp4(dns_resolver_t *resolver) {
10236 REQUIRE(VALID_RESOLVER(resolver));
10237 return (resolver->querydscp4);
10241 dns_resolver_setquerydscp6(dns_resolver_t *resolver, isc_dscp_t dscp) {
10242 REQUIRE(VALID_RESOLVER(resolver));
10244 resolver->querydscp6 = dscp;
10248 dns_resolver_getquerydscp6(dns_resolver_t *resolver) {
10249 REQUIRE(VALID_RESOLVER(resolver));
10250 return (resolver->querydscp6);
10254 dns_resolver_setmaxdepth(dns_resolver_t *resolver, unsigned int maxdepth) {
10255 REQUIRE(VALID_RESOLVER(resolver));
10256 resolver->maxdepth = maxdepth;
10260 dns_resolver_getmaxdepth(dns_resolver_t *resolver) {
10261 REQUIRE(VALID_RESOLVER(resolver));
10262 return (resolver->maxdepth);
10266 dns_resolver_setmaxqueries(dns_resolver_t *resolver, unsigned int queries) {
10267 REQUIRE(VALID_RESOLVER(resolver));
10268 resolver->maxqueries = queries;
10272 dns_resolver_getmaxqueries(dns_resolver_t *resolver) {
10273 REQUIRE(VALID_RESOLVER(resolver));
10274 return (resolver->maxqueries);
10278 dns_resolver_dumpfetches(dns_resolver_t *resolver,
10283 REQUIRE(VALID_RESOLVER(resolver));
10289 LOCK(&resolver->dbuckets[i].lock);
10290 for (fc = ISC_LIST_HEAD(resolver->dbuckets[i].list);
10298 UNLOCK(&resolver->dbuckets[i].lock);
10303 dns_resolver_setquotaresponse(dns_resolver_t *resolver,
10306 REQUIRE(VALID_RESOLVER(resolver));
10310 resolver->quotaresp[which] = resp;
10314 dns_resolver_getquotaresponse(dns_resolver_t *resolver, dns_quotatype_t which)
10316 REQUIRE(VALID_RESOLVER(resolver));
10319 return (resolver->quotaresp[which]);