unbound 0.1
subnetmod.h File Reference

subnet module for unbound. More...

Data Structures

struct  subnet_env
 Global state for the subnet module. More...
struct  subnet_msg_cache_data
struct  subnet_qstate

Functions

void subnet_data_delete (void *d, void *ATTR_UNUSED(arg))
size_t msg_cache_sizefunc (void *k, void *d)
struct module_func_block * subnetmod_get_funcblock (void)
 Get the module function block.
int subnetmod_init (struct module_env *env, int id)
 subnet module init
void subnetmod_deinit (struct module_env *env, int id)
 subnet module deinit
void subnetmod_operate (struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
 subnet module operate on a query
void subnetmod_inform_super (struct module_qstate *qstate, int id, struct module_qstate *super)
 subnet module
void subnetmod_clear (struct module_qstate *qstate, int id)
 subnet module cleanup query state
size_t subnetmod_get_mem (struct module_env *env, int id)
 subnet module alloc size routine
size_t unittest_wrapper_subnetmod_sizefunc (void *elemptr)
 Wrappers for static functions to unit test.
int ecs_whitelist_check (struct query_info *qinfo, uint16_t flags, struct module_qstate *qstate, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct regional *region, int id, void *cbargs)
 Whitelist check, called just before query is sent upstream.
int ecs_edns_back_parsed (struct module_qstate *qstate, int id, void *cbargs)
 Check whether response from server contains ECS record, if so, skip cache store.
int ecs_query_response (struct module_qstate *qstate, struct dns_msg *response, int id, void *cbargs)
 Remove ECS record from back_out when query resulted in REFUSED response.
void subnet_markdel (void *key)
 mark subnet msg to be deleted
void subnet_ecs_opt_list_append (struct ecs_data *ecs, struct edns_option **list, struct module_qstate *qstate, struct regional *region)
 Add ecs struct to edns list, after parsing it to wire format.
void subnet_option_from_ss (struct sockaddr_storage *ss, struct ecs_data *ecs, struct config_file *cfg)
 Create ecs_data from the sockaddr_storage information.

Detailed Description

subnet module for unbound.

Function Documentation

◆ subnetmod_get_funcblock()

struct module_func_block * subnetmod_get_funcblock ( void )

Get the module function block.

Returns
: function block with function pointers to module methods.

References subnetmod_get_funcblock().

Referenced by module_funcs_avail(), and subnetmod_get_funcblock().

◆ subnetmod_init()

int subnetmod_init ( struct module_env * env,
int id )

subnet module init

References subnetmod_init().

Referenced by fptr_whitelist_mod_init(), and subnetmod_init().

◆ subnetmod_deinit()

void subnetmod_deinit ( struct module_env * env,
int id )

subnet module deinit

References subnetmod_deinit().

Referenced by fptr_whitelist_mod_deinit(), and subnetmod_deinit().

◆ subnetmod_operate()

void subnetmod_operate ( struct module_qstate * qstate,
enum module_ev event,
int id,
struct outbound_entry * outbound )

subnet module operate on a query

References subnetmod_operate().

Referenced by fptr_whitelist_mod_operate(), and subnetmod_operate().

◆ subnetmod_inform_super()

void subnetmod_inform_super ( struct module_qstate * qstate,
int id,
struct module_qstate * super )

◆ subnetmod_clear()

void subnetmod_clear ( struct module_qstate * qstate,
int id )

subnet module cleanup query state

References subnetmod_clear().

Referenced by fptr_whitelist_mod_clear(), and subnetmod_clear().

◆ subnetmod_get_mem()

size_t subnetmod_get_mem ( struct module_env * env,
int id )

subnet module alloc size routine

References subnetmod_get_mem().

Referenced by fptr_whitelist_mod_get_mem(), and subnetmod_get_mem().

◆ unittest_wrapper_subnetmod_sizefunc()

size_t unittest_wrapper_subnetmod_sizefunc ( void * elemptr)

Wrappers for static functions to unit test.

References unittest_wrapper_subnetmod_sizefunc().

Referenced by unittest_wrapper_subnetmod_sizefunc().

◆ ecs_whitelist_check()

int ecs_whitelist_check ( struct query_info * qinfo,
uint16_t flags,
struct module_qstate * qstate,
struct sockaddr_storage * addr,
socklen_t addrlen,
uint8_t * zone,
size_t zonelen,
struct regional * region,
int id,
void * cbargs )

Whitelist check, called just before query is sent upstream.

References ecs_whitelist_check().

Referenced by ecs_whitelist_check(), and fptr_whitelist_inplace_cb_query().

◆ ecs_edns_back_parsed()

int ecs_edns_back_parsed ( struct module_qstate * qstate,
int id,
void * cbargs )

Check whether response from server contains ECS record, if so, skip cache store.

Called just after parsing EDNS data from server.

References ecs_edns_back_parsed().

Referenced by ecs_edns_back_parsed(), and fptr_whitelist_inplace_cb_edns_back_parsed().

◆ ecs_query_response()

int ecs_query_response ( struct module_qstate * qstate,
struct dns_msg * response,
int id,
void * cbargs )

Remove ECS record from back_out when query resulted in REFUSED response.

References ecs_query_response().

Referenced by ecs_query_response(), and fptr_whitelist_inplace_cb_query_response().

◆ subnet_markdel()

void subnet_markdel ( void * key)

mark subnet msg to be deleted

References subnet_markdel().

Referenced by fptr_whitelist_hash_markdelfunc(), and subnet_markdel().

◆ subnet_ecs_opt_list_append()

void subnet_ecs_opt_list_append ( struct ecs_data * ecs,
struct edns_option ** list,
struct module_qstate * qstate,
struct regional * region )

Add ecs struct to edns list, after parsing it to wire format.

References subnet_ecs_opt_list_append().

Referenced by subnet_ecs_opt_list_append().

◆ subnet_option_from_ss()

void subnet_option_from_ss ( struct sockaddr_storage * ss,
struct ecs_data * ecs,
struct config_file * cfg )

Create ecs_data from the sockaddr_storage information.

References subnet_option_from_ss().

Referenced by subnet_option_from_ss().