#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"
Functions | |
int | acl_list_cmp (const void *k1, const void *k2) |
compare two acl list entries | |
struct acl_list * | acl_list_create () |
Create acl structure. | |
void | acl_list_delete (struct acl_list *acl) |
Delete acl structure. | |
static int | 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 | acl_list_str_cfg (struct acl_list *acl, const char *str, const char *s2, int complain_duplicates) |
apply acl_list string | |
static int | read_acl_list (struct acl_list *acl, struct config_file *cfg) |
read acl_list config | |
static void | acl_list_init_parents (struct acl_list *acl) |
initialise parent pointers in the tree | |
int | acl_list_apply_cfg (struct acl_list *acl, struct config_file *cfg) |
Process access control config. | |
enum acl_access | acl_list_lookup (struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen) |
Lookup address to see its access control status. | |
size_t | acl_list_get_mem (struct acl_list *acl) |
Get memory used by acl structure. |
struct acl_list* acl_list_create | ( | ) | [read] |
Create acl structure.
References acl_list_delete(), acl_list::region, and regional_create().
Referenced by daemon_init().
void acl_list_delete | ( | struct acl_list * | acl | ) |
Delete acl structure.
acl,: | to delete. |
References acl_list::region, regional_destroy(), and acl_list::tree.
Referenced by acl_list_create(), and daemon_delete().
int acl_list_apply_cfg | ( | struct acl_list * | acl, | |
struct config_file * | cfg | |||
) |
Process access control config.
acl,: | where to store. | |
cfg,: | config options. |
References acl_list_cmp(), acl_list_init_parents(), acl_list_str_cfg(), config_file::do_ip6, rbtree_create(), read_acl_list(), acl_list::region, regional_free_all(), and acl_list::tree.
Referenced by daemon_fork().
enum acl_access acl_list_lookup | ( | struct acl_list * | acl, | |
struct sockaddr_storage * | addr, | |||
socklen_t | addrlen | |||
) |
Lookup address to see its access control status.
acl,: | structure for address storage. | |
addr,: | address to check | |
addrlen,: | length of addr. |
References acl_deny, acl_addr::addr, addr_in_common(), addr_is_ip6(), acl_addr::addrlen, acl_addr::control, rbnode_t::key, acl_addr::net, acl_addr::node, acl_addr::parent, rbtree_find_less_equal(), and acl_list::tree.
Referenced by worker_handle_request().
size_t acl_list_get_mem | ( | struct acl_list * | acl | ) |
Get memory used by acl structure.
acl,: | structure for address storage. |
References acl_list::region, and regional_get_mem().