#include "util/rbtree.h"
Data Structures | |
struct | iter_donotq |
Iterator donotqueryaddresses structure. More... | |
struct | iter_donotq_addr |
Iterator donotquery address. More... | |
Functions | |
struct iter_donotq * | donotq_create () |
Create donotqueryaddresses structure. | |
void | donotq_delete (struct iter_donotq *donotq) |
Delete donotqueryaddresses structure. | |
int | donotq_apply_cfg (struct iter_donotq *donotq, struct config_file *cfg) |
Process donotqueryaddresses config. | |
int | donotq_lookup (struct iter_donotq *donotq, struct sockaddr_storage *addr, socklen_t addrlen) |
See if an address is blocked. | |
size_t | donotq_get_mem (struct iter_donotq *donotq) |
Get memory used by donotqueryaddresses structure. | |
int | donotq_cmp (const void *k1, const void *k2) |
compare two donotq entries |
Keep track of the donotquery addresses and lookup fast.
struct iter_donotq* donotq_create | ( | ) | [read] |
Create donotqueryaddresses structure.
References donotq_delete(), iter_donotq::region, and regional_create().
Referenced by iter_apply_cfg().
void donotq_delete | ( | struct iter_donotq * | donotq | ) |
Delete donotqueryaddresses structure.
donotq,: | to delete. |
References iter_donotq::region, regional_destroy(), and iter_donotq::tree.
Referenced by donotq_create(), and iter_deinit().
int donotq_apply_cfg | ( | struct iter_donotq * | donotq, | |
struct config_file * | cfg | |||
) |
Process donotqueryaddresses config.
donotq,: | where to store. | |
cfg,: | config options. |
References config_file::do_ip6, donotq_cmp(), donotq_init_parents(), donotq_str_cfg(), config_file::donotquery_localhost, rbtree_create(), read_donotq(), and iter_donotq::tree.
Referenced by iter_apply_cfg().
int donotq_lookup | ( | struct iter_donotq * | donotq, | |
struct sockaddr_storage * | addr, | |||
socklen_t | addrlen | |||
) |
See if an address is blocked.
donotq,: | structure for address storage. | |
addr,: | address to check | |
addrlen,: | length of addr. |
References iter_donotq_addr::addr, addr_in_common(), addr_is_ip6(), iter_donotq_addr::addrlen, rbnode_t::key, iter_donotq_addr::net, iter_donotq_addr::node, iter_donotq_addr::parent, rbtree_find_less_equal(), and iter_donotq::tree.
Referenced by iter_filter_unsuitable().
size_t donotq_get_mem | ( | struct iter_donotq * | donotq | ) |
Get memory used by donotqueryaddresses structure.
donotq,: | structure for address storage. |
References iter_donotq::region, and regional_get_mem().
Referenced by iter_get_mem().