subnet-whitelist.h File Reference

Keep track of the white listed servers and domain names for subnet option. More...

Data Structures

struct  ecs_whitelist
 ecs_whitelist structure More...
 

Functions

struct ecs_whitelistecs_whitelist_create (void)
 Create ecs_whitelist structure. More...
 
void ecs_whitelist_delete (struct ecs_whitelist *whitelist)
 Delete ecs_whitelist structure. More...
 
int ecs_whitelist_apply_cfg (struct ecs_whitelist *whitelist, struct config_file *cfg)
 Process ecs_whitelist config. More...
 
int ecs_is_whitelisted (struct ecs_whitelist *whitelist, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *qname, size_t qname_len, uint16_t qclass)
 See if an address or domain is whitelisted. More...
 
size_t ecs_whitelist_get_mem (struct ecs_whitelist *whitelist)
 Get memory used by ecs_whitelist structure. More...
 

Detailed Description

Keep track of the white listed servers and domain names for subnet option.

Based on acl_list.c|h

Function Documentation

◆ ecs_whitelist_create()

struct ecs_whitelist* ecs_whitelist_create ( void  )

Create ecs_whitelist structure.

Returns
new structure or NULL on error.

◆ ecs_whitelist_delete()

void ecs_whitelist_delete ( struct ecs_whitelist whitelist)

Delete ecs_whitelist structure.

Parameters
whitelistto delete.

◆ ecs_whitelist_apply_cfg()

int ecs_whitelist_apply_cfg ( struct ecs_whitelist whitelist,
struct config_file cfg 
)

Process ecs_whitelist config.

Parameters
whitelistwhere to store.
cfgconfig options.
Returns
0 on error.

◆ ecs_is_whitelisted()

int ecs_is_whitelisted ( struct ecs_whitelist whitelist,
struct sockaddr_storage *  addr,
socklen_t  addrlen,
uint8_t *  qname,
size_t  qname_len,
uint16_t  qclass 
)

See if an address or domain is whitelisted.

Parameters
whiteliststructure for address storage.
addraddress to check
addrlenlength of addr.
qnamedname in query
qname_lenlength of dname
qclassclass in query
Returns
: true if the address is whitelisted for subnet option.

◆ ecs_whitelist_get_mem()

size_t ecs_whitelist_get_mem ( struct ecs_whitelist whitelist)

Get memory used by ecs_whitelist structure.

Parameters
whiteliststructure for address storage.
Returns
bytes in use.