infra_cache
if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen,
if(!infra_set_lame(qstate->env->infra_cache,
if(!infra_set_lame(qstate->env->infra_cache,
ctx->env->infra_cache = infra_adjust(ctx->env->infra_cache, cfg);
if(!ctx->env->infra_cache)
infra_delete(ctx->env->infra_cache);
w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
static void infra_ip_create_ratedata(struct infra_cache* infra,
int infra_ratelimit_inc(struct infra_cache* infra, uint8_t* name,
void infra_ratelimit_dec(struct infra_cache* infra, uint8_t* name,
int infra_ratelimit_exceeded(struct infra_cache* infra, uint8_t* name,
infra_get_mem(struct infra_cache* infra)
int infra_ip_ratelimit_inc(struct infra_cache* infra,
int infra_wait_limit_allowed(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_inc(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_dec(struct infra_cache* infra, struct comm_reply* rep,
struct infra_cache*
struct infra_cache* infra = (struct infra_cache*)calloc(1,
sizeof(struct infra_cache));
infra_delete(struct infra_cache* infra)
struct infra_cache*
infra_adjust(struct infra_cache* infra, struct config_file* cfg)
infra_lookup_nottl(struct infra_cache* infra, struct sockaddr_storage* addr,
data_entry_init(struct infra_cache* infra, struct lruhash_entry* e,
new_entry(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_set_lame(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_update_tcp_works(struct infra_cache* infra,
infra_rtt_update(struct infra_cache* infra, struct sockaddr_storage* addr,
long long infra_get_host_rto(struct infra_cache* infra,
infra_edns_update(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_get_lame_rtt(struct infra_cache* infra,
int infra_find_ratelimit(struct infra_cache* infra, uint8_t* name,
static struct lruhash_entry* infra_find_ratedata(struct infra_cache* infra,
static struct lruhash_entry* infra_find_ip_ratedata(struct infra_cache* infra,
static void infra_create_ratedata(struct infra_cache* infra,
struct infra_cache* infra_create(struct config_file* cfg);
void infra_delete(struct infra_cache* infra);
struct infra_cache* infra_adjust(struct infra_cache* infra,
struct lruhash_entry* infra_lookup_nottl(struct infra_cache* infra,
int infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
int infra_set_lame(struct infra_cache* infra,
int infra_rtt_update(struct infra_cache* infra, struct sockaddr_storage* addr,
void infra_update_tcp_works(struct infra_cache* infra,
int infra_edns_update(struct infra_cache* infra,
int infra_get_lame_rtt(struct infra_cache* infra,
long long infra_get_host_rto(struct infra_cache* infra,
int infra_ratelimit_inc(struct infra_cache* infra, uint8_t* name,
void infra_ratelimit_dec(struct infra_cache* infra, uint8_t* name,
int infra_ratelimit_exceeded(struct infra_cache* infra, uint8_t* name,
int infra_find_ratelimit(struct infra_cache* infra, uint8_t* name,
int infra_ip_ratelimit_inc(struct infra_cache* infra,
size_t infra_get_mem(struct infra_cache* infra);
int infra_wait_limit_allowed(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_inc(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_dec(struct infra_cache* infra, struct comm_reply* rep,
infra_wait_limit_dec(mesh->env->infra_cache,
infra_wait_limit_dec(m->s.env->infra_cache, &r->query_reply,
infra_wait_limit_dec(mstate->s.env->infra_cache,
infra_wait_limit_dec(mstate->s.env->infra_cache,
infra_wait_limit_dec(mesh->env->infra_cache,
infra_wait_limit_dec(mstate->s.env->infra_cache,
infra_wait_limit_dec(mstate->s.env->infra_cache,
if(!infra_wait_limit_allowed(mesh->env->infra_cache, rep,
infra_wait_limit_inc(mesh->env->infra_cache, rep, *mesh->env->now,
int do_ip6, size_t num_tcp, int dscp, struct infra_cache* infra,
if(!infra_ratelimit_inc(env->infra_cache, zone,
infra_ratelimit_dec(env->infra_cache,
infra_ratelimit_dec(env->infra_cache,
struct infra_cache* infra;
int do_ip4, int do_ip6, size_t num_tcp, int dscp, struct infra_cache* infra,
struct infra_cache;
struct infra_cache* infra_cache;
entry_ttl = infra_get_host_rto(worker->env.infra_cache,
if(!infra_get_lame_rtt(worker->env.infra_cache,
if(infra_host(worker->env.infra_cache, &a->addr, a->addrlen,
if((daemon->env->infra_cache = infra_adjust(daemon->env->infra_cache,
infra_delete(daemon->env->infra_cache);
slabhash_clear(worker->env.infra_cache->hosts);
slabhash_traverse(worker->env.infra_cache->hosts, 1, &infra_del_host,
struct infra_cache* infra;
arg.infra = worker->env.infra_cache;
struct infra_cache* infra;
a.infra = worker->env.infra_cache;
a.infra = worker->env.infra_cache;
slabhash_adjust_size(env->infra_cache->hosts, inframem);
slabhash_adjust_size(env->infra_cache->domain_rates,
slabhash_adjust_size(env->infra_cache->client_ip_rates,
struct infra_cache* infra = env->infra_cache;
s->svr.infra_cache_count = (long long)count_slabhash_entries(worker->env.infra_cache->hosts);
infra = infra_get_mem(worker->env.infra_cache);
if(!infra_ip_ratelimit_inc(worker->env.infra_cache, addr, addrlen,
(unsigned)infra_get_mem(worker->env.infra_cache),
worker->daemon->env->infra_cache, worker->rndstate,
(unsigned)infra_get_mem(worker->env.infra_cache),
if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen,
if(!infra_set_lame(qstate->env->infra_cache,
if(!infra_set_lame(qstate->env->infra_cache,
ctx->env->infra_cache = infra_adjust(ctx->env->infra_cache, cfg);
if(!ctx->env->infra_cache)
infra_delete(ctx->env->infra_cache);
w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
static void infra_ip_create_ratedata(struct infra_cache* infra,
int infra_ratelimit_inc(struct infra_cache* infra, uint8_t* name,
void infra_ratelimit_dec(struct infra_cache* infra, uint8_t* name,
int infra_ratelimit_exceeded(struct infra_cache* infra, uint8_t* name,
infra_get_mem(struct infra_cache* infra)
int infra_ip_ratelimit_inc(struct infra_cache* infra,
int infra_wait_limit_allowed(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_inc(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_dec(struct infra_cache* infra, struct comm_reply* rep,
struct infra_cache*
struct infra_cache* infra = (struct infra_cache*)calloc(1,
sizeof(struct infra_cache));
infra_delete(struct infra_cache* infra)
struct infra_cache*
infra_adjust(struct infra_cache* infra, struct config_file* cfg)
infra_lookup_nottl(struct infra_cache* infra, struct sockaddr_storage* addr,
data_entry_init(struct infra_cache* infra, struct lruhash_entry* e,
new_entry(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_set_lame(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_update_tcp_works(struct infra_cache* infra,
infra_rtt_update(struct infra_cache* infra, struct sockaddr_storage* addr,
long long infra_get_host_rto(struct infra_cache* infra,
infra_edns_update(struct infra_cache* infra, struct sockaddr_storage* addr,
infra_get_lame_rtt(struct infra_cache* infra,
int infra_find_ratelimit(struct infra_cache* infra, uint8_t* name,
static struct lruhash_entry* infra_find_ratedata(struct infra_cache* infra,
static struct lruhash_entry* infra_find_ip_ratedata(struct infra_cache* infra,
static void infra_create_ratedata(struct infra_cache* infra,
struct infra_cache* infra_create(struct config_file* cfg);
void infra_delete(struct infra_cache* infra);
struct infra_cache* infra_adjust(struct infra_cache* infra,
struct lruhash_entry* infra_lookup_nottl(struct infra_cache* infra,
int infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
int infra_set_lame(struct infra_cache* infra,
int infra_rtt_update(struct infra_cache* infra, struct sockaddr_storage* addr,
void infra_update_tcp_works(struct infra_cache* infra,
int infra_edns_update(struct infra_cache* infra,
int infra_get_lame_rtt(struct infra_cache* infra,
long long infra_get_host_rto(struct infra_cache* infra,
int infra_ratelimit_inc(struct infra_cache* infra, uint8_t* name,
void infra_ratelimit_dec(struct infra_cache* infra, uint8_t* name,
int infra_ratelimit_exceeded(struct infra_cache* infra, uint8_t* name,
int infra_find_ratelimit(struct infra_cache* infra, uint8_t* name,
int infra_ip_ratelimit_inc(struct infra_cache* infra,
size_t infra_get_mem(struct infra_cache* infra);
int infra_wait_limit_allowed(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_inc(struct infra_cache* infra, struct comm_reply* rep,
void infra_wait_limit_dec(struct infra_cache* infra, struct comm_reply* rep,
infra_wait_limit_dec(mesh->env->infra_cache,
infra_wait_limit_dec(m->s.env->infra_cache, &r->query_reply,
infra_wait_limit_dec(mstate->s.env->infra_cache,
infra_wait_limit_dec(mstate->s.env->infra_cache,
infra_wait_limit_dec(mesh->env->infra_cache,
infra_wait_limit_dec(mstate->s.env->infra_cache,
infra_wait_limit_dec(mstate->s.env->infra_cache,
if(!infra_wait_limit_allowed(mesh->env->infra_cache, rep,
infra_wait_limit_inc(mesh->env->infra_cache, rep, *mesh->env->now,
int do_ip6, size_t num_tcp, int dscp, struct infra_cache* infra,
if(!infra_ratelimit_inc(env->infra_cache, zone,
infra_ratelimit_dec(env->infra_cache,
infra_ratelimit_dec(env->infra_cache,
struct infra_cache* infra;
int do_ip4, int do_ip6, size_t num_tcp, int dscp, struct infra_cache* infra,
struct infra_cache;
struct infra_cache* infra,
struct infra_cache;
struct infra_cache* infra;
struct infra_cache* slab;
static struct infra_data* infra_lookup_host(struct infra_cache* infra,
static void test_keep_probing(struct infra_cache* slab,
struct infra_cache* infra_cache;