Functions
acl_list.c File Reference

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"

Functions

struct acl_listacl_list_create (void)
 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
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.

Detailed Description

This file helps the server keep out queries from outside sources, that should not be answered.


Function Documentation

struct acl_list* acl_list_create ( void  ) [read]

Create acl structure.

Returns:
new structure or NULL on error.

References acl_list::region, regional_create(), and acl_list_delete().

Referenced by daemon_init().

void acl_list_delete ( struct acl_list acl)

Delete acl structure.

Parameters:
acl,:to delete.

References regional_destroy(), and acl_list::region.

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.

Parameters:
acl,:where to store.
cfg,:config options.
Returns:
0 on error.

References regional_free_all(), acl_list::region, addr_tree_init(), acl_list::tree, read_acl_list(), acl_list_str_cfg(), config_file::do_ip6, and addr_tree_init_parents().

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.

Parameters:
acl,:structure for address storage.
addr,:address to check
addrlen,:length of addr.
Returns:
: what to do with message from this address.

References addr_tree_lookup(), acl_list::tree, acl_addr::control, and acl_deny.

Referenced by worker_handle_request().

size_t acl_list_get_mem ( struct acl_list acl)

Get memory used by acl structure.

Parameters:
acl,:structure for address storage.
Returns:
bytes in use.

References regional_get_mem(), and acl_list::region.

Referenced by worker_mem_report().