Lines Matching refs:env

110 	sldns_buffer* buf = qstate->env->scratch_buffer;  in subnet_ecs_opt_list_append()
137 qstate->env->cfg->client_subnet_opcode, in subnet_ecs_opt_list_append()
154 sn_env = (struct subnet_env*)qstate->env->modinfo[id]; in ecs_whitelist_check()
164 qstate->env->cfg->client_subnet_always_forward) || in ecs_whitelist_check()
172 qstate->env->cfg->client_subnet_opcode)) { in ecs_whitelist_check()
190 qstate->env->cfg->client_subnet_opcode)) { in ecs_whitelist_check()
192 qstate->env->cfg->client_subnet_opcode); in ecs_whitelist_check()
209 subnetmod_init(struct module_env *env, int id) in subnetmod_init() argument
218 env->modinfo[id] = (void*)sn_env; in subnetmod_init()
222 if(env->cfg->serve_expired) in subnetmod_init()
226 if(env->cfg->prefetch) in subnetmod_init()
231 sn_env->subnet_msg_cache = slabhash_create(env->cfg->msg_cache_slabs, in subnetmod_init()
232 HASH_DEFAULT_STARTARRAY, env->cfg->msg_cache_size, in subnetmod_init()
239 env->modinfo[id] = NULL; in subnetmod_init()
245 !ecs_whitelist_apply_cfg(sn_env->whitelist, env->cfg)) { in subnetmod_init()
249 env->modinfo[id] = NULL; in subnetmod_init()
254 env->cfg->client_subnet_opcode); in subnetmod_init()
256 env->unique_mesh = 1; in subnetmod_init()
257 if(!edns_register_option(env->cfg->client_subnet_opcode, in subnetmod_init()
258 env->cfg->client_subnet_always_forward /* bypass cache */, in subnetmod_init()
259 1 /* no aggregation */, env)) { in subnetmod_init()
264 env->modinfo[id] = NULL; in subnetmod_init()
268 env, id); in subnetmod_init()
270 inplace_cb_edns_back_parsed, NULL, env, id); in subnetmod_init()
272 inplace_cb_query_response, NULL, env, id); in subnetmod_init()
278 subnetmod_deinit(struct module_env *env, int id) in subnetmod_deinit() argument
281 if(!env || !env->modinfo[id]) in subnetmod_deinit()
283 sn_env = (struct subnet_env*)env->modinfo[id]; in subnetmod_deinit()
285 inplace_cb_delete(env, inplace_cb_edns_back_parsed, id); in subnetmod_deinit()
286 inplace_cb_delete(env, inplace_cb_query, id); in subnetmod_deinit()
287 inplace_cb_delete(env, inplace_cb_query_response, id); in subnetmod_deinit()
292 env->modinfo[id] = NULL; in subnetmod_deinit()
309 struct subnet_env *env = (struct subnet_env *)envptr; in delfunc() local
310 reply_info_parsedelete(elem, &env->alloc); in delfunc()
336 struct subnet_env *env, struct config_file* cfg) in get_tree() argument
343 &sizefunc, env, cfg->max_ecs_tree_size_ipv4); in get_tree()
349 &sizefunc, env, cfg->max_ecs_tree_size_ipv6); in get_tree()
362 struct subnet_env *sne = qstate->env->modinfo[id]; in update_cache()
407 if (!(tree = get_tree(lru_entry->data, edns, sne, qstate->env->cfg))) { in update_cache()
426 reply_info_set_ttls(rep, *qstate->env->now); in update_cache()
436 rep->ttl, *qstate->env->now, only_match_scope_zero); in update_cache()
454 struct module_env *env = qstate->env; in lookup_and_reply() local
455 struct subnet_env *sne = (struct subnet_env*)env->modinfo[id]; in lookup_and_reply()
479 ecs->subnet_source_mask, *env->now); in lookup_and_reply()
486 (struct reply_info *)node->elem, qstate->region, *env->now, 0, in lookup_and_reply()
487 env->scratch); in lookup_and_reply()
504 if (prefetch && *qstate->env->now >= ((struct reply_info *)node->elem)->prefetch_ttl) { in lookup_and_reply()
528 struct subnet_env *sne = qstate->env->modinfo[id]; in eval_response()
596 qstate->env->cfg->client_subnet_opcode); in eval_response()
613 if(qstate->env->cfg->serve_expired) { in eval_response()
614 msg_cache_remove(qstate->env, qstate->qinfo.qname, in eval_response()
618 if(qstate->env->cachedb_enabled) in eval_response()
633 qstate->env->cfg->max_client_subnet_ipv4) { in eval_response()
635 qstate->env->cfg->max_client_subnet_ipv4; in eval_response()
639 qstate->env->cfg->max_client_subnet_ipv6) { in eval_response()
641 qstate->env->cfg->max_client_subnet_ipv6; in eval_response()
731 qstate->env->cfg->client_subnet_opcode); in ecs_query_response()
781 qstate->env->cfg->client_subnet_opcode)) && in ecs_edns_back_parsed()
807 struct subnet_env *sne = qstate->env->modinfo[id]; in subnetmod_operate()
828 qstate->env->cfg->client_subnet_opcode))) { in subnetmod_operate()
842 &sq->ecs_client_in, qstate->env->cfg); in subnetmod_operate()
847 &sq->ecs_client_in, qstate->env->cfg); in subnetmod_operate()
862 sq->ecs_client_in.subnet_source_mask < qstate->env->cfg->min_client_subnet_ipv4) || in subnetmod_operate()
864 sq->ecs_client_in.subnet_source_mask < qstate->env->cfg->min_client_subnet_ipv6))) { in subnetmod_operate()
874 qstate->env->cfg->prefetch)) { in subnetmod_operate()
887 qstate->env->cfg-> in subnetmod_operate()
902 qstate->env->cfg->max_client_subnet_ipv4) in subnetmod_operate()
904 qstate->env->cfg->max_client_subnet_ipv4; in subnetmod_operate()
907 qstate->env->cfg->max_client_subnet_ipv6) in subnetmod_operate()
909 qstate->env->cfg->max_client_subnet_ipv6; in subnetmod_operate()
918 qstate->env->cfg->client_subnet_always_forward && in subnetmod_operate()
942 qstate->env->cfg-> in subnetmod_operate()
985 subnetmod_get_mem(struct module_env *env, int id) in subnetmod_get_mem() argument
987 struct subnet_env *sn_env = env->modinfo[id]; in subnetmod_get_mem()