Electroneum
acl_list.h File Reference
Include dependency graph for acl_list.h:

Go to the source code of this file.

Classes

struct  acl_list
 
struct  acl_addr
 

Enumerations

enum  acl_access {
  acl_deny = 0 , acl_refuse , acl_deny_non_local , acl_refuse_non_local ,
  acl_allow , acl_allow_snoop , acl_allow_setrd
}
 

Functions

struct acl_listacl_list_create (void)
 
void acl_list_delete (struct acl_list *acl)
 
int acl_list_apply_cfg (struct acl_list *acl, struct config_file *cfg, struct views *v)
 
enum acl_access acl_get_control (struct acl_addr *acl)
 
struct acl_addracl_addr_lookup (struct acl_list *acl, struct sockaddr_storage *addr, socklen_t addrlen)
 
size_t acl_list_get_mem (struct acl_list *acl)
 

Detailed Description

This file keeps track of the list of clients that are allowed to access the server.

Definition in file acl_list.h.

Enumeration Type Documentation

◆ acl_access

enum acl_access

Enumeration of access control options for an address range. Allow or deny access.

Enumerator
acl_deny 

disallow any access whatsoever, drop it

acl_refuse 

disallow access, send a polite 'REFUSED' reply

acl_deny_non_local 

disallow any access to zones that aren't local, drop it

acl_refuse_non_local 

disallow access to zones that aren't local, 'REFUSED' reply

acl_allow 

allow full access for recursion (+RD) queries

acl_allow_snoop 

allow full access for all queries, recursion and cache snooping

acl_allow_setrd 

allow full access for recursion queries and set RD flag regardless of request

Definition at line 54 of file acl_list.h.

54  {
56  acl_deny = 0,
58  acl_refuse,
64  acl_allow,
69 };
@ acl_deny
Definition: acl_list.h:56
@ acl_deny_non_local
Definition: acl_list.h:60
@ acl_allow
Definition: acl_list.h:64
@ acl_refuse_non_local
Definition: acl_list.h:62
@ acl_allow_setrd
Definition: acl_list.h:68
@ acl_allow_snoop
Definition: acl_list.h:66
@ acl_refuse
Definition: acl_list.h:58

Function Documentation

◆ acl_addr_lookup()

struct acl_addr* acl_addr_lookup ( struct acl_list acl,
struct sockaddr_storage addr,
socklen_t  addrlen 
)

Lookup address to see its acl structure

Parameters
aclstructure for address storage.
addraddress to check
addrlenlength of addr.
Returns
: acl structure from this address.

◆ acl_get_control()

enum acl_access acl_get_control ( struct acl_addr acl)

Lookup access control status for acl structure.

Parameters
aclstructure for acl storage.
Returns
: what to do with message from this address.

◆ acl_list_apply_cfg()

int acl_list_apply_cfg ( struct acl_list acl,
struct config_file cfg,
struct views v 
)

Process access control config.

Parameters
aclwhere to store.
cfgconfig options.
vviews structure
Returns
0 on error.

◆ acl_list_create()

struct acl_list* acl_list_create ( void  )

Create acl structure

Returns
new structure or NULL on error.

◆ acl_list_delete()

void acl_list_delete ( struct acl_list acl)

Delete acl structure.

Parameters
aclto delete.

◆ acl_list_get_mem()

size_t acl_list_get_mem ( struct acl_list acl)

Get memory used by acl structure.

Parameters
aclstructure for address storage.
Returns
bytes in use.