|
unbound 0.1
|
This file helps the server keep out queries from outside sources, that should not be answered. More...
#include "config.h"#include "daemon/acl_list.h"#include "util/regional.h"#include "util/log.h"#include "util/config_file.h"#include "util/net_help.h"#include "services/localzone.h"#include "services/listen_dnsport.h"#include "sldns/str2wire.h"Functions | |
| struct acl_list * | acl_list_create (void) |
| Create acl structure. | |
| void | acl_list_delete (struct acl_list *acl) |
| Delete acl structure. | |
| static struct acl_addr * | acl_list_insert (struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen, int net, enum acl_access control, int complain_duplicates) |
| insert new address into acl_list structure | |
| static int | parse_acl_access (const char *str, enum acl_access *control) |
| parse str to acl_access enum | |
| static int | acl_list_str_cfg (struct acl_list *acl, const char *str, const char *s2, int complain_duplicates) |
| apply acl_list string | |
| static struct acl_addr * | acl_find_or_create_str2addr (struct acl_list *acl, const char *str, int is_interface, int port) |
| find or create node (NULL on parse or error) | |
| static struct acl_addr * | acl_find_or_create (struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen, enum acl_access control) |
| find or create node (NULL on error) | |
| static int | acl_interface_str_cfg (struct acl_list *acl_interface, const char *iface, const char *s2, int port) |
| apply acl_interface string | |
| struct acl_addr * | acl_interface_insert (struct acl_list *acl_interface, struct sockaddr_storage *addr, socklen_t addrlen, enum acl_access control) |
| Insert interface in the acl_list. | |
| static int | acl_list_tags_cfg (struct acl_list *acl, const char *str, uint8_t *bitmap, size_t bitmaplen, int is_interface, int port) |
| apply acl_tag string | |
| static int | acl_list_view_cfg (struct acl_list *acl, const char *str, const char *str2, struct views *vs, int is_interface, int port) |
| apply acl_view string | |
| static int | acl_list_tag_action_cfg (struct acl_list *acl, struct config_file *cfg, const char *str, const char *tag, const char *action, int is_interface, int port) |
| apply acl_tag_action string | |
| static int | check_data (const char *data, const struct config_strlist *head) |
| check wire data parse | |
| static int | acl_list_tag_data_cfg (struct acl_list *acl, struct config_file *cfg, const char *str, const char *tag, const char *data, int is_interface, int port) |
| apply acl_tag_data string | |
| static int | read_acl_list (struct acl_list *acl, struct config_str2list *acls) |
| read acl_list config | |
| static int | read_acl_view (struct acl_list *acl, struct config_str2list **acl_view, struct views *v) |
| read acl view config | |
| static int | read_acl_tags (struct acl_list *acl, struct config_strbytelist **acl_tags) |
| read acl tags config | |
| static int | read_acl_tag_actions (struct acl_list *acl, struct config_file *cfg, struct config_str3list **acl_tag_actions) |
| read acl tag actions config | |
| static int | read_acl_tag_datas (struct acl_list *acl, struct config_file *cfg, struct config_str3list **acl_tag_datas) |
| read acl tag datas config | |
| int | acl_list_apply_cfg (struct acl_list *acl, struct config_file *cfg, struct views *v) |
| Process access control config. | |
| void | acl_interface_init (struct acl_list *acl_interface) |
| Initialise (also clean) the acl_interface struct. | |
| static int | read_acl_interface_action (struct acl_list *acl_interface, struct config_str2list *acls, int port) |
| static int | read_acl_interface_view (struct acl_list *acl_interface, struct config_str2list **acl_view, struct views *v, int port) |
| read acl view config for interface | |
| static int | read_acl_interface_tags (struct acl_list *acl_interface, struct config_strbytelist **acl_tags, int port) |
| read acl tags config for interface | |
| static int | read_acl_interface_tag_actions (struct acl_list *acl_interface, struct config_file *cfg, struct config_str3list **acl_tag_actions, int port) |
| read acl tag actions config for interface | |
| static int | read_acl_interface_tag_datas (struct acl_list *acl_interface, struct config_file *cfg, struct config_str3list **acl_tag_datas, int port) |
| read acl tag datas config for interface | |
| int | acl_interface_apply_cfg (struct acl_list *acl_interface, struct config_file *cfg, struct views *v) |
| Process interface control config. | |
| enum acl_access | acl_get_control (struct acl_addr *acl) |
| Lookup access control status for acl structure. | |
| struct acl_addr * | acl_addr_lookup (struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen) |
| Lookup address to see its acl structure. | |
| size_t | acl_list_get_mem (struct acl_list *acl) |
| Get memory used by acl structure. | |
| const char * | acl_access_to_str (enum acl_access acl) |
| void | log_acl_action (const char *action, struct sockaddr_storage *addr, socklen_t addrlen, enum acl_access acl, struct acl_addr *acladdr) |
| void | acl_list_swap_tree (struct acl_list *acl, struct acl_list *data) |
| Swap internal tree with preallocated entries. | |
This file helps the server keep out queries from outside sources, that should not be answered.
| struct acl_list * acl_list_create | ( | void | ) |
Create acl structure.
References acl_list_create(), acl_list_delete(), acl_list::region, and regional_create().
Referenced by acl_list_create(), daemon_init(), and fr_construct_from_config().
| void acl_list_delete | ( | struct acl_list * | acl | ) |
Delete acl structure.
| acl | to delete. |
References acl_list_delete(), acl_list::region, and regional_destroy().
Referenced by acl_list_create(), acl_list_delete(), daemon_delete(), daemon_init(), and fr_construct_clear().
|
static |
insert new address into acl_list structure
References acl_list_insert(), addr_tree_insert(), acl_addr::control, acl_addr::node, addr_tree_node::node, acl_list::region, regional_alloc_zero(), acl_list::tree, VERB_QUERY, and verbose().
Referenced by acl_find_or_create(), acl_find_or_create_str2addr(), acl_list_insert(), and acl_list_str_cfg().
|
static |
parse str to acl_access enum
References acl_allow, acl_allow_cookie, acl_allow_setrd, acl_allow_snoop, acl_deny, acl_deny_non_local, acl_refuse, acl_refuse_non_local, acl_addr::control, log_err(), and parse_acl_access().
Referenced by acl_interface_str_cfg(), acl_list_str_cfg(), and parse_acl_access().
|
static |
apply acl_list string
References acl_list_insert(), acl_list_str_cfg(), log_err(), netblockstrtoaddr(), and parse_acl_access().
Referenced by acl_list_apply_cfg(), acl_list_str_cfg(), and read_acl_list().
|
static |
find or create node (NULL on parse or error)
References acl_allow, acl_find_or_create_str2addr(), acl_list_insert(), addr_tree_find(), extstrtoaddr(), log_err(), netblockstrtoaddr(), acl_addr::node, str_is_ip6(), and acl_list::tree.
Referenced by acl_find_or_create_str2addr(), acl_interface_str_cfg(), acl_list_tag_action_cfg(), acl_list_tag_data_cfg(), acl_list_tags_cfg(), and acl_list_view_cfg().
|
static |
find or create node (NULL on error)
References acl_find_or_create(), acl_list_insert(), addr_is_ip6(), addr_tree_find(), acl_addr::control, log_err(), acl_addr::node, and acl_list::tree.
Referenced by acl_find_or_create(), and acl_interface_insert().
|
static |
apply acl_interface string
References acl_find_or_create_str2addr(), acl_interface_str_cfg(), acl_addr::control, log_err(), acl_addr::node, and parse_acl_access().
Referenced by acl_interface_str_cfg().
| struct acl_addr * acl_interface_insert | ( | struct acl_list * | acl_interface, |
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen, | ||
| enum acl_access | control ) |
Insert interface in the acl_list.
This should happen when the listening interface is setup.
| acl_interface | acl_list to insert to. |
| addr | interface IP. |
| addrlen | length of the interface IP. |
| control | acl_access. |
References acl_find_or_create(), acl_interface_insert(), acl_addr::control, and acl_addr::node.
Referenced by acl_interface_insert(), and setup_acl_for_ports().
|
static |
apply acl_tag string
References acl_find_or_create_str2addr(), acl_list_tags_cfg(), log_err(), acl_addr::node, acl_list::region, and regional_alloc_init().
Referenced by acl_list_tags_cfg(), read_acl_interface_tags(), and read_acl_tags().
|
static |
apply acl_view string
References acl_find_or_create_str2addr(), acl_list_view_cfg(), log_err(), acl_addr::node, and views_find_view().
Referenced by acl_list_view_cfg(), read_acl_interface_view(), and read_acl_view().
|
static |
apply acl_tag_action string
References acl_find_or_create_str2addr(), acl_list_tag_action_cfg(), find_tag_id(), local_zone_str2type(), log_err(), acl_addr::node, config_file::num_tags, acl_list::region, and regional_alloc_zero().
Referenced by acl_list_tag_action_cfg(), read_acl_interface_tag_actions(), and read_acl_tag_actions().
|
static |
check wire data parse
References check_data(), LDNS_RR_BUF_SIZE, LDNS_RR_TYPE_CNAME, log_err(), sldns_get_errorstr_parse(), sldns_str2wire_rr_buf(), sldns_wirerr_get_type(), and config_strlist::str.
Referenced by acl_list_tag_data_cfg(), check_data(), check_data(), and checkzonetree().
|
static |
apply acl_tag_data string
References acl_find_or_create_str2addr(), acl_list_tag_data_cfg(), cfg_region_strlist_insert(), check_data(), find_tag_id(), log_err(), acl_addr::node, config_file::num_tags, acl_list::region, regional_alloc_zero(), regional_strdup(), acl_addr::tag_datas, and acl_addr::tag_datas_size.
Referenced by acl_list_tag_data_cfg(), read_acl_interface_tag_datas(), and read_acl_tag_datas().
|
static |
read acl_list config
References acl_list_str_cfg(), log_assert, config_str2list::next, read_acl_list(), config_str2list::str, and config_str2list::str2.
Referenced by acl_list_apply_cfg(), and read_acl_list().
|
static |
read acl view config
References acl_list_view_cfg(), config_deldblstrlist(), log_assert, config_str2list::next, read_acl_view(), config_str2list::str, and config_str2list::str2.
Referenced by acl_list_apply_cfg(), and read_acl_view().
|
static |
read acl tags config
References acl_list_tags_cfg(), config_del_strbytelist(), log_assert, config_strbytelist::next, read_acl_tags(), config_strbytelist::str, and config_strbytelist::str2.
Referenced by acl_list_apply_cfg(), and read_acl_tags().
|
static |
read acl tag actions config
References acl_list_tag_action_cfg(), config_deltrplstrlist(), log_assert, config_str3list::next, read_acl_tag_actions(), config_str3list::str, config_str3list::str2, and config_str3list::str3.
Referenced by acl_list_apply_cfg(), and read_acl_tag_actions().
|
static |
read acl tag datas config
References acl_list_tag_data_cfg(), config_deltrplstrlist(), log_assert, config_str3list::next, read_acl_tag_datas(), config_str3list::str, config_str3list::str2, and config_str3list::str3.
Referenced by acl_list_apply_cfg(), and read_acl_tag_datas().
| int acl_list_apply_cfg | ( | struct acl_list * | acl, |
| struct config_file * | cfg, | ||
| struct views * | v ) |
Process access control config.
| acl | where to store. |
| cfg | config options. |
| v | views structure |
References acl_list_apply_cfg(), acl_list_str_cfg(), config_file::acl_tag_actions, config_file::acl_tag_datas, config_file::acl_tags, config_file::acl_view, config_file::acls, addr_tree_init(), addr_tree_init_parents(), config_file::do_ip6, read_acl_list(), read_acl_tag_actions(), read_acl_tag_datas(), read_acl_tags(), read_acl_view(), acl_list::region, regional_free_all(), and acl_list::tree.
Referenced by acl_list_apply_cfg(), daemon_fork(), and fr_construct_from_config().
| void acl_interface_init | ( | struct acl_list * | acl_interface | ) |
Initialise (also clean) the acl_interface struct.
| acl_interface | where to store. |
References acl_interface_init(), addr_tree_addrport_init(), acl_list::region, regional_free_all(), and acl_list::tree.
Referenced by acl_interface_init(), ct_acl_interface_setup_ports(), and daemon_open_shared_ports().
|
static |
read acl view config for interface
References acl_list_view_cfg(), config_del_strarray(), config_deldblstrlist(), log_assert, config_str2list::next, read_acl_interface_view(), resolve_interface_names(), config_str2list::str, and config_str2list::str2.
Referenced by acl_interface_apply_cfg(), and read_acl_interface_view().
|
static |
read acl tags config for interface
References acl_list_tags_cfg(), config_del_strarray(), config_del_strbytelist(), log_assert, config_strbytelist::next, read_acl_interface_tags(), resolve_interface_names(), config_strbytelist::str, and config_strbytelist::str2.
Referenced by acl_interface_apply_cfg(), and read_acl_interface_tags().
|
static |
read acl tag actions config for interface
References acl_list_tag_action_cfg(), config_del_strarray(), config_deltrplstrlist(), log_assert, config_str3list::next, read_acl_interface_tag_actions(), resolve_interface_names(), config_str3list::str, config_str3list::str2, and config_str3list::str3.
Referenced by acl_interface_apply_cfg(), and read_acl_interface_tag_actions().
|
static |
read acl tag datas config for interface
References acl_list_tag_data_cfg(), config_del_strarray(), config_deltrplstrlist(), log_assert, config_str3list::next, read_acl_interface_tag_datas(), resolve_interface_names(), config_str3list::str, config_str3list::str2, and config_str3list::str3.
Referenced by acl_interface_apply_cfg(), and read_acl_interface_tag_datas().
| int acl_interface_apply_cfg | ( | struct acl_list * | acl_interface, |
| struct config_file * | cfg, | ||
| struct views * | v ) |
Process interface control config.
| acl_interface | where to store. |
| cfg | config options. |
| v | views structure |
References acl_interface_apply_cfg(), addr_tree_init_parents(), config_file::interface_actions, config_file::interface_tag_actions, config_file::interface_tag_datas, config_file::interface_tags, config_file::interface_view, config_file::port, read_acl_interface_tag_actions(), read_acl_interface_tag_datas(), read_acl_interface_tags(), read_acl_interface_view(), and acl_list::tree.
Referenced by acl_interface_apply_cfg(), daemon_fork(), and fr_construct_from_config().
| enum acl_access acl_get_control | ( | struct acl_addr * | acl | ) |
Lookup access control status for acl structure.
| acl | structure for acl storage. |
References acl_deny, acl_get_control(), and acl_addr::control.
Referenced by acl_get_control().
| struct acl_addr * acl_addr_lookup | ( | struct acl_list * | acl, |
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen ) |
Lookup address to see its acl structure.
| acl | structure for address storage. |
| addr | address to check |
| addrlen | length of addr. |
References acl_addr_lookup(), addr_tree_lookup(), and acl_list::tree.
Referenced by acl_addr_lookup().
| size_t acl_list_get_mem | ( | struct acl_list * | acl | ) |
Get memory used by acl structure.
| acl | structure for address storage. |
References acl_list_get_mem(), acl_list::region, and regional_get_mem().
Referenced by acl_list_get_mem(), fr_printmem(), and worker_mem_report().
Swap internal tree with preallocated entries.
| acl | the acl structure. |
| data | the data structure used to take elements from. This contains the old elements on return. |
References acl_list_swap_tree(), regional::data, acl_list::region, and acl_list::tree.
Referenced by acl_list_swap_tree(), and fr_reload_config().