Lines Matching refs:env
134 msg = slabhash_get_mem(worker->env.msg_cache); in worker_mem_report()
135 rrset = slabhash_get_mem(&worker->env.rrset_cache->table); in worker_mem_report()
136 infra = infra_get_mem(worker->env.infra_cache); in worker_mem_report()
137 mesh = mesh_get_mem(worker->env.mesh); in worker_mem_report()
140 anch = anchors_get_mem(worker->env.anchors); in worker_mem_report()
143 for(i=0; i<worker->env.mesh->mods.num; i++) { in worker_mem_report()
144 fptr_ok(fptr_whitelist_mod_get_mem(worker->env.mesh-> in worker_mem_report()
146 if(strcmp(worker->env.mesh->mods.mod[i]->name, "validator")==0) in worker_mem_report()
147 val += (*worker->env.mesh->mods.mod[i]->get_mem) in worker_mem_report()
148 (&worker->env, i); in worker_mem_report()
150 else if(strcmp(worker->env.mesh->mods.mod[i]->name, in worker_mem_report()
152 subnet += (*worker->env.mesh->mods.mod[i]->get_mem) in worker_mem_report()
153 (&worker->env, i); in worker_mem_report()
155 else iter += (*worker->env.mesh->mods.mod[i]->get_mem) in worker_mem_report()
156 (&worker->env, i); in worker_mem_report()
162 + sizeof(*worker->env.scratch_buffer) in worker_mem_report()
163 + sldns_buffer_capacity(worker->env.scratch_buffer); in worker_mem_report()
164 if(worker->daemon->env->fwds) in worker_mem_report()
165 log_info("forwards=%u", (unsigned)forwards_get_mem(worker->env.fwds)); in worker_mem_report()
166 if(worker->daemon->env->hints) in worker_mem_report()
167 log_info("hints=%u", (unsigned)hints_get_mem(worker->env.hints)); in worker_mem_report()
204 for(i=0; i<worker->env.mesh->mods.num; i++) { in worker_mem_report()
205 fptr_ok(fptr_whitelist_mod_get_mem(worker->env.mesh-> in worker_mem_report()
207 if(strcmp(worker->env.mesh->mods.mod[i]->name, "validator")==0) in worker_mem_report()
208 val += (*worker->env.mesh->mods.mod[i]->get_mem) in worker_mem_report()
209 (&worker->env, i); in worker_mem_report()
211 else if(strcmp(worker->env.mesh->mods.mod[i]->name, in worker_mem_report()
213 subnet += (*worker->env.mesh->mods.mod[i]->get_mem) in worker_mem_report()
214 (&worker->env, i); in worker_mem_report()
220 (unsigned)slabhash_get_mem(worker->env.msg_cache), in worker_mem_report()
221 (unsigned)slabhash_get_mem(&worker->env.rrset_cache->table), in worker_mem_report()
222 (unsigned)infra_get_mem(worker->env.infra_cache), in worker_mem_report()
226 (unsigned)slabhash_get_mem(worker->env.msg_cache), in worker_mem_report()
227 (unsigned)slabhash_get_mem(&worker->env.rrset_cache->table), in worker_mem_report()
228 (unsigned)infra_get_mem(worker->env.infra_cache), in worker_mem_report()
248 struct worker* worker = e->qstate->env->worker; in worker_handle_service_reply()
253 mesh_report_reply(worker->env.mesh, e, reply_info, error); in worker_handle_service_reply()
265 mesh_report_reply(worker->env.mesh, e, reply_info, in worker_handle_service_reply()
270 mesh_report_reply(worker->env.mesh, e, reply_info, NETEVENT_NOERROR); in worker_handle_service_reply()
283 if(worker->err_limit_time == *worker->env.now) { in worker_err_ratelimit()
289 worker->err_limit_time = *worker->env.now; in worker_err_ratelimit()
480 time_t timenow = *worker->env.now; in answer_norec_from_cache()
482 int must_validate = (!has_cd_bit || worker->env.cfg->ignore_cd) in answer_norec_from_cache()
483 && worker->env.need_to_validate; in answer_norec_from_cache()
487 dp = dns_cache_find_delegation(&worker->env, qinfo->qname, in answer_norec_from_cache()
510 if(!inplace_cb_reply_servfail_call(&worker->env, qinfo, NULL, in answer_norec_from_cache()
512 worker->env.now_tv)) in answer_norec_from_cache()
515 if(worker->env.cfg->ede && in answer_norec_from_cache()
531 if(worker->env.cfg->val_clean_additional) in answer_norec_from_cache()
548 if(worker->env.cfg->disable_edns_do && (edns->bits & EDNS_DO)) in answer_norec_from_cache()
550 if(!inplace_cb_reply_cache_call(&worker->env, qinfo, NULL, msg->rep, in answer_norec_from_cache()
552 worker->env.now_tv)) in answer_norec_from_cache()
557 if(worker->env.cfg->ede && has_cd_bit && in answer_norec_from_cache()
568 if(!inplace_cb_reply_servfail_call(&worker->env, qinfo, NULL, NULL, in answer_norec_from_cache()
570 worker->env.now_tv)) in answer_norec_from_cache()
651 time_t timenow = *worker->env.now; in answer_from_cache()
656 int must_validate = (!has_cd_bit || worker->env.cfg->ignore_cd) in answer_from_cache()
657 && worker->env.need_to_validate; in answer_from_cache()
663 if(worker->env.cfg->serve_expired && in answer_from_cache()
668 (!worker->env.cfg->serve_expired_client_timeout || in answer_from_cache()
671 && !(worker->env.cachedb_enabled && in answer_from_cache()
672 worker->env.cfg->cachedb_check_when_serve_expired) in answer_from_cache()
711 if(worker->env.cfg->disable_edns_do && (edns->bits & EDNS_DO)) in answer_from_cache()
713 if(!inplace_cb_reply_servfail_call(&worker->env, qinfo, NULL, rep, in answer_from_cache()
715 worker->env.now_tv)) in answer_from_cache()
718 if(worker->env.cfg->ede && rep->reason_bogus != LDNS_EDE_NONE) { in answer_from_cache()
725 rrset_array_unlock_touch(worker->env.rrset_cache, in answer_from_cache()
753 if(worker->env.cfg->disable_edns_do && (edns->bits & EDNS_DO)) in answer_from_cache()
759 &encode_rep, worker->env.auth_zones)) { in answer_from_cache()
764 worker->env.auth_zones)) { in answer_from_cache()
785 worker->env.cfg->ede_serve_expired && worker->env.cfg->ede) { in answer_from_cache()
792 worker->env.cfg->ede && has_cd_bit && in answer_from_cache()
798 if(!inplace_cb_reply_cache_call(&worker->env, qinfo, NULL, encode_rep, in answer_from_cache()
800 worker->env.now_tv)) in answer_from_cache()
806 if(!inplace_cb_reply_servfail_call(&worker->env, qinfo, in answer_from_cache()
808 worker->scratchpad, worker->env.now_tv)) in answer_from_cache()
816 rrset_array_unlock_touch(worker->env.rrset_cache, worker->scratchpad, in answer_from_cache()
822 rrset_array_unlock_touch(worker->env.rrset_cache, in answer_from_cache()
849 if(modstack_find(&worker->env.mesh->mods, "subnetcache") != -1 in reply_and_prefetch()
850 && worker->env.unique_mesh) { in reply_and_prefetch()
851 mesh_new_prefetch(worker->env.mesh, qinfo, flags, leeway + in reply_and_prefetch()
861 mesh_new_prefetch(worker->env.mesh, qinfo, flags, leeway + in reply_and_prefetch()
886 if(!inplace_cb_reply_local_call(&worker->env, NULL, NULL, NULL, in chaos_replystr()
888 worker->env.now_tv)) in chaos_replystr()
951 if(!w->env.need_to_validate) { in chaos_trustanchor()
958 lock_basic_lock(&w->env.anchors->lock); in chaos_trustanchor()
959 RBTREE_FOR(ta, struct trust_anchor*, w->env.anchors->tree) { in chaos_trustanchor()
985 lock_basic_unlock(&w->env.anchors->lock); in chaos_trustanchor()
1004 struct config_file* cfg = w->env.cfg; in answer_chaos()
1071 if(!w->env.auth_zones) return; in answer_notify()
1073 if(auth_zones_notify(w->env.auth_zones, &w->env, qinfo->qname, in answer_notify()
1339 if(!infra_ip_ratelimit_inc(worker->env.infra_cache, addr, addrlen, in check_ip_ratelimit()
1340 *worker->env.now, has_cookie, in check_ip_ratelimit()
1341 worker->env.cfg->ip_ratelimit_backoff, pkt)) { in check_ip_ratelimit()
1343 if(!has_cookie && worker->env.cfg->ip_ratelimit_factor != 0 && in check_ip_ratelimit()
1344 ub_random_max(worker->env.rnd, in check_ip_ratelimit()
1345 worker->env.cfg->ip_ratelimit_factor) == 0) { in check_ip_ratelimit()
1396 if (worker->env.cfg->sock_queue_timeout && timeval_isset(&c->recv_tv)) { in worker_handle_request()
1397 timeval_subtract(&wait_time, worker->env.now_tv, &c->recv_tv); in worker_handle_request()
1402 (long long)(worker->env.cfg->sock_queue_timeout * 1000000)) { in worker_handle_request()
1462 ((worker->env.cfg->sock_queue_timeout && timeval_isset(&c->recv_tv))?&c->recv_tv:NULL)); in worker_handle_request()
1468 worker->env.cfg->ede, 1, &check_result)) != -1) { in worker_handle_request()
1475 worker->env.cfg->ede, 0, &check_result)) != -1) { in worker_handle_request()
1496 pre_edns_ip_ratelimit = !worker->env.cfg->do_answer_cookie in worker_handle_request()
1528 if(worker->env.cfg->log_queries) { in worker_handle_request()
1570 c->buffer, &edns, worker->env.cfg, c, repinfo, in worker_handle_request()
1571 (worker->env.now ? *worker->env.now : time(NULL)), in worker_handle_request()
1706 if(local_zones_answer(worker->daemon->local_zones, &worker->env, &qinfo, in worker_handle_request()
1719 if(worker->env.auth_zones && in worker_handle_request()
1720 rpz_callback_from_worker_request(worker->env.auth_zones, in worker_handle_request()
1721 &worker->env, &qinfo, &edns, c->buffer, worker->scratchpad, in worker_handle_request()
1731 if(worker->env.auth_zones && in worker_handle_request()
1732 auth_zones_answer(worker->env.auth_zones, &worker->env, in worker_handle_request()
1750 worker->env.cfg->ede, &check_result)) != -1) in worker_handle_request()
1769 if(worker->env.cfg->ede) { in worker_handle_request()
1830 if(!edns_bypass_cache_stage(edns.opt_list_in, &worker->env)) { in worker_handle_request()
1834 if((e=slabhash_lookup(worker->env.msg_cache, h, lookup_qinfo, 0))) { in worker_handle_request()
1847 if((worker->env.cfg->prefetch && in worker_handle_request()
1848 *worker->env.now >= rep->prefetch_ttl) || in worker_handle_request()
1849 (worker->env.cfg->serve_expired && in worker_handle_request()
1850 *worker->env.now > rep->ttl)) { in worker_handle_request()
1852 time_t leeway = rep->ttl - *worker->env.now; in worker_handle_request()
1853 if(rep->ttl < *worker->env.now) in worker_handle_request()
1924 mesh_new_client(worker->env.mesh, &qinfo, cinfo, in worker_handle_request()
1956 if(worker->env.cfg->log_replies) in worker_handle_request()
1968 (worker->env.cfg->log_destaddr?(void*)repinfo->c->socket->addr:NULL), in worker_handle_request()
1974 (worker->env.cfg->log_destaddr?(void*)repinfo->c->socket->addr:NULL), in worker_handle_request()
2025 if(worker->env.cfg->stat_interval > 0) { in worker_restart_timer()
2028 tv.tv_sec = worker->env.cfg->stat_interval; in worker_restart_timer()
2039 mesh_stats(worker->env.mesh, "mesh has"); in worker_stat_timer_cb()
2057 tv.tv_sec = (time_t)autr_probe_timer(&worker->env); in worker_probe_timer_cb()
2061 comm_timer_set(worker->env.probe_timer, &tv); in worker_probe_timer_cb()
2177 dtenv, worker->daemon->doq_table, worker->env.rnd, in worker_init()
2189 worker->daemon->env->infra_cache, worker->rndstate, in worker_init()
2203 iterator_set_ip46_support(&worker->daemon->mods, worker->daemon->env, in worker_init()
2230 worker->env = *worker->daemon->env; in worker_init()
2231 comm_base_timept(worker->base, &worker->env.now, &worker->env.now_tv); in worker_init()
2232 worker->env.worker = worker; in worker_init()
2233 worker->env.worker_base = worker->base; in worker_init()
2234 worker->env.send_query = &worker_send_query; in worker_init()
2235 worker->env.alloc = worker->alloc; in worker_init()
2236 worker->env.outnet = worker->back; in worker_init()
2237 worker->env.rnd = worker->rndstate; in worker_init()
2243 worker->env.scratch = regional_create_custom(cfg->msg_buffer_size); in worker_init()
2244 if(!worker->env.scratch) { in worker_init()
2249 worker->env.mesh = mesh_create(&worker->daemon->mods, &worker->env); in worker_init()
2250 if(!worker->env.mesh) { in worker_init()
2256 worker->env.mesh->use_response_ip = worker->daemon->use_response_ip; in worker_init()
2257 worker->env.mesh->use_rpz = worker->daemon->use_rpz; in worker_init()
2259 worker->env.detach_subs = &mesh_detach_subs; in worker_init()
2260 worker->env.attach_sub = &mesh_attach_sub; in worker_init()
2261 worker->env.add_sub = &mesh_add_sub; in worker_init()
2262 worker->env.kill_sub = &mesh_state_delete; in worker_init()
2263 worker->env.detect_cycle = &mesh_detect_cycle; in worker_init()
2264 worker->env.scratch_buffer = sldns_buffer_new(cfg->msg_buffer_size); in worker_init()
2265 if(!worker->env.scratch_buffer) { in worker_init()
2271 if(autr_get_num_anchors(worker->env.anchors) > 0 in worker_init()
2279 worker->env.probe_timer = comm_timer_create(worker->base, in worker_init()
2281 if(!worker->env.probe_timer) { in worker_init()
2285 comm_timer_set(worker->env.probe_timer, &tv); in worker_init()
2289 if(worker->env.auth_zones in worker_init()
2294 auth_xfer_pickup_initial(worker->env.auth_zones, &worker->env); in worker_init()
2295 auth_zones_pickup_zonemd_verify(worker->env.auth_zones, in worker_init()
2296 &worker->env); in worker_init()
2314 if(worker->env.cfg->stat_interval > 0) { in worker_init()
2316 worker->env.cfg->stat_interval); in worker_init()
2334 if(worker->env.mesh && verbosity >= VERB_OPS) { in worker_delete()
2336 mesh_stats(worker->env.mesh, "mesh has"); in worker_delete()
2340 mesh_delete(worker->env.mesh); in worker_delete()
2341 sldns_buffer_free(worker->env.scratch_buffer); in worker_delete()
2347 comm_timer_delete(worker->env.probe_timer); in worker_delete()
2367 regional_destroy(worker->env.scratch); in worker_delete()
2379 struct worker* worker = q->env->worker; in worker_send_query()
2388 worker_handle_service_reply, e, worker->back->udp_buff, q->env, in worker_send_query()
2400 slabhash_clear(&worker->env.rrset_cache->table); in worker_alloc_cleanup()
2401 slabhash_clear(worker->env.msg_cache); in worker_alloc_cleanup()
2406 server_stats_init(&worker->stats, worker->env.cfg); in worker_stats_clear()
2407 mesh_stats_clear(worker->env.mesh); in worker_stats_clear()