|
unbound 0.1
|
This file contains functions to assist the iterator module. More...
#include "config.h"#include "iterator/iter_donotq.h"#include "util/regional.h"#include "util/log.h"#include "util/config_file.h"#include "util/net_help.h"Functions | |
| struct iter_donotq * | donotq_create (void) |
| Create donotqueryaddresses structure. | |
| void | donotq_delete (struct iter_donotq *dq) |
| Delete donotqueryaddresses structure. | |
| static int | donotq_insert (struct iter_donotq *dq, struct sockaddr_storage *addr, socklen_t addrlen, int net) |
| insert new address into donotq structure | |
| static int | donotq_str_cfg (struct iter_donotq *dq, const char *str) |
| apply donotq string | |
| static int | read_donotq (struct iter_donotq *dq, struct config_file *cfg) |
| read donotq config | |
| int | donotq_apply_cfg (struct iter_donotq *dq, 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. | |
This file contains functions to assist the iterator module.
The donotqueryaddresses are stored and looked up. These addresses (like 127.0.0.1) must not be used to send queries to, and can be discarded immediately from the server selection.
| struct iter_donotq * donotq_create | ( | void | ) |
Create donotqueryaddresses structure.
References donotq_create(), donotq_delete(), iter_donotq::region, and regional_create().
Referenced by donotq_create(), fr_construct_from_config(), and iter_apply_cfg().
| void donotq_delete | ( | struct iter_donotq * | donotq | ) |
Delete donotqueryaddresses structure.
| donotq | to delete. |
References donotq_delete(), iter_donotq::region, and regional_destroy().
Referenced by donotq_create(), donotq_delete(), fr_construct_clear(), and iter_deinit().
|
static |
insert new address into donotq structure
References addr_tree_node::addr, addr_tree_insert(), addr_tree_node::addrlen, donotq_insert(), addr_tree_node::net, addr_tree_node::node, iter_donotq::region, regional_alloc(), iter_donotq::tree, VERB_QUERY, and verbose().
Referenced by donotq_insert(), and donotq_str_cfg().
|
static |
apply donotq string
References donotq_insert(), donotq_str_cfg(), log_err(), netblockstrtoaddr(), VERB_ALGO, and verbose().
Referenced by donotq_apply_cfg(), donotq_str_cfg(), and read_donotq().
|
static |
read donotq config
References donotq_str_cfg(), config_file::donotqueryaddrs, log_assert, config_strlist::next, read_donotq(), and config_strlist::str.
Referenced by donotq_apply_cfg(), and read_donotq().
| int donotq_apply_cfg | ( | struct iter_donotq * | donotq, |
| struct config_file * | cfg ) |
Process donotqueryaddresses config.
| donotq | where to store. |
| cfg | config options. |
References addr_tree_init(), addr_tree_init_parents(), config_file::do_ip6, donotq_apply_cfg(), donotq_str_cfg(), config_file::donotquery_localhost, read_donotq(), iter_donotq::region, regional_free_all(), and iter_donotq::tree.
Referenced by donotq_apply_cfg(), fr_construct_from_config(), and 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 addr_tree_lookup(), donotq_lookup(), and iter_donotq::tree.
Referenced by donotq_lookup(), and iter_filter_unsuitable().
| size_t donotq_get_mem | ( | struct iter_donotq * | donotq | ) |
Get memory used by donotqueryaddresses structure.
| donotq | structure for address storage. |
References donotq_get_mem(), iter_donotq::region, and regional_get_mem().
Referenced by donotq_get_mem(), and iter_get_mem().