This file contains functions to enable RPZ service. More...
#include "config.h"
#include "services/rpz.h"
#include "util/config_file.h"
#include "sldns/wire2str.h"
#include "sldns/str2wire.h"
#include "util/data/dname.h"
#include "util/net_help.h"
#include "util/log.h"
#include "util/locks.h"
#include "util/regional.h"
#include "util/data/msgencode.h"
#include "services/cache/dns.h"
#include "iterator/iterator.h"
#include "iterator/iter_delegpt.h"
#include "daemon/worker.h"
Data Structures | |
struct | matched_delegation_point |
Typedefs | |
typedef struct resp_addr | rpz_aclnode_type |
Functions | |
const char * | rpz_action_to_string (enum rpz_action a) |
string for RPZ action enum More... | |
static enum rpz_action | rpz_config_to_action (char *a) |
RPZ action enum for config string. | |
static const char * | rpz_trigger_to_string (enum rpz_trigger r) |
string for RPZ trigger enum | |
static uint8_t * | get_tld_label (uint8_t *dname, size_t maxdnamelen) |
Get the label that is just before the root label. More... | |
static int | rpz_type_ignored (uint16_t rr_type) |
The RR types that are to be ignored. More... | |
static enum rpz_action | rpz_rr_to_action (uint16_t rr_type, uint8_t *rdatawl, size_t rdatalen) |
Classify RPZ action for RR type/rdata. More... | |
static enum localzone_type | rpz_action_to_localzone_type (enum rpz_action a) |
enum respip_action | rpz_action_to_respip_action (enum rpz_action a) |
Classify respip action for RPZ action. More... | |
static enum rpz_action | localzone_type_to_rpz_action (enum localzone_type lzt) |
enum rpz_action | respip_action_to_rpz_action (enum respip_action a) |
static enum rpz_trigger | rpz_dname_to_trigger (uint8_t *dname, size_t dname_len) |
Get RPZ trigger for dname. More... | |
static struct clientip_synthesized_rrset * | rpz_clientip_synthesized_set_create (void) |
static void | rpz_clientip_synthesized_rr_delete (rbnode_type *n, void *ATTR_UNUSED(arg)) |
static void | rpz_clientip_synthesized_set_delete (struct clientip_synthesized_rrset *set) |
void | rpz_delete (struct rpz *r) |
Delete RPZ. More... | |
int | rpz_clear (struct rpz *r) |
Clear local-zones and respip data in RPZ, used after reloading file or AXFR/HTTP transfer. More... | |
void | rpz_finish_config (struct rpz *r) |
Prepare RPZ after processing feed content. More... | |
static struct ub_packed_rrset_key * | new_cname_override (struct regional *region, uint8_t *ct, size_t ctlen) |
new rrset containing CNAME override, does not yet contain a dname | |
static void | delete_cname_override (struct rpz *r) |
delete the cname override | |
static int | rpz_apply_cfg_elements (struct rpz *r, struct config_auth *p) |
Apply rpz config elements to the rpz structure, false on failure. | |
struct rpz * | rpz_create (struct config_auth *p) |
Create RPZ. More... | |
int | rpz_config (struct rpz *r, struct config_auth *p) |
Change config on rpz, after reload. More... | |
static size_t | strip_dname_origin (uint8_t *dname, size_t dnamelen, size_t originlen, uint8_t *newdname, size_t maxnewdnamelen) |
Remove RPZ zone name from dname Copy dname to newdname, without the originlen number of trailing bytes. | |
static void | rpz_insert_local_zones_trigger (struct local_zones *lz, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
static void | rpz_log_dname (char const *msg, uint8_t *dname, size_t dname_len) |
static void | rpz_insert_qname_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
static int | rpz_strip_nsdname_suffix (uint8_t *dname, size_t maxdnamelen, uint8_t **stripdname, size_t *stripdnamelen) |
static void | rpz_insert_nsdname_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
static int | rpz_insert_ipaddr_based_trigger (struct respip_set *set, struct sockaddr_storage *addr, socklen_t addrlen, int net, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
static struct clientip_synthesized_rr * | rpz_clientip_ensure_entry (struct clientip_synthesized_rrset *set, struct sockaddr_storage *addr, socklen_t addrlen, int net) |
static void | rpz_report_rrset_error (const char *msg, uint8_t *rr, size_t rr_len) |
static struct local_rrset * | rpz_clientip_new_rrset (struct regional *region, struct clientip_synthesized_rr *raddr, uint16_t rrtype, uint16_t rrclass) |
static int | rpz_clientip_enter_rr (struct regional *region, struct clientip_synthesized_rr *raddr, uint16_t rrtype, uint16_t rrclass, time_t ttl, uint8_t *rdata, size_t rdata_len) |
static int | rpz_clientip_insert_trigger_rr (struct clientip_synthesized_rrset *set, struct sockaddr_storage *addr, socklen_t addrlen, int net, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
static int | rpz_insert_clientip_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
static int | rpz_insert_nsip_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
static int | rpz_insert_response_ip_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rrtype, uint16_t rrclass, uint32_t ttl, uint8_t *rdata, size_t rdata_len, uint8_t *rr, size_t rr_len) |
Insert RR into RPZ's respip_set. | |
int | rpz_insert_rr (struct rpz *r, uint8_t *azname, size_t aznamelen, uint8_t *dname, size_t dnamelen, uint16_t rr_type, uint16_t rr_class, uint32_t rr_ttl, uint8_t *rdatawl, size_t rdatalen, uint8_t *rr, size_t rr_len) |
Create policy from RR and add to this RPZ. More... | |
static struct local_zone * | rpz_find_zone (struct local_zones *zones, uint8_t *qname, size_t qname_len, uint16_t qclass, int only_exact, int wr, int zones_keep_lock) |
Find RPZ local-zone by qname. More... | |
static struct local_rrset * | rpz_find_synthesized_rrset (uint16_t qtype, struct clientip_synthesized_rr *data, int alias_ok) |
Find entry for RR type in the list of rrsets for the clientip. | |
static int | rpz_data_delete_rr (struct local_zone *z, uint8_t *policydname, size_t policydnamelen, uint16_t rr_type, uint8_t *rdata, size_t rdatalen) |
Remove RR from RPZ's local-data. More... | |
static int | rpz_rrset_delete_rr (struct resp_addr *raddr, uint16_t rr_type, uint8_t *rdata, size_t rdatalen) |
Remove RR from RPZ's respip set. More... | |
static void | rpz_remove_local_zones_trigger (struct local_zones *zones, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rr_type, uint16_t rr_class, uint8_t *rdatawl, size_t rdatalen) |
Remove RR from rpz localzones structure. | |
static void | rpz_remove_qname_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rr_type, uint16_t rr_class, uint8_t *rdatawl, size_t rdatalen) |
Remove RR from RPZ's local-zone. | |
static void | rpz_remove_response_ip_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rr_type, uint8_t *rdatawl, size_t rdatalen) |
static void | del_local_rrset_from_list (struct local_rrset **list_head, uint16_t dtype) |
find and remove type from list of local_rrset entries | |
static int | rpz_remove_clientip_rr (struct clientip_synthesized_rr *node, uint16_t rr_type, uint8_t *rdatawl, size_t rdatalen) |
Delete client-ip trigger RR from its RRset and perhaps also the rrset from the linked list. More... | |
static void | rpz_clientip_remove_trigger_rr (struct clientip_synthesized_rrset *set, struct sockaddr_storage *addr, socklen_t addrlen, int net, enum rpz_action a, uint16_t rr_type, uint8_t *rdatawl, size_t rdatalen) |
remove trigger RR from clientip_syntheized set tree. | |
static void | rpz_remove_clientip_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rr_type, uint8_t *rdatawl, size_t rdatalen) |
Remove clientip trigger RR from RPZ. | |
static void | rpz_remove_nsip_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rr_type, uint8_t *rdatawl, size_t rdatalen) |
Remove nsip trigger RR from RPZ. | |
static void | rpz_remove_nsdname_trigger (struct rpz *r, uint8_t *dname, size_t dnamelen, enum rpz_action a, uint16_t rr_type, uint16_t rr_class, uint8_t *rdatawl, size_t rdatalen) |
Remove nsdname trigger RR from RPZ. | |
void | rpz_remove_rr (struct rpz *r, uint8_t *azname, size_t aznamelen, uint8_t *dname, size_t dnamelen, uint16_t rr_type, uint16_t rr_class, uint8_t *rdatawl, size_t rdatalen) |
Delete policy matching RR, used for IXFR. More... | |
static void | log_rpz_apply (char *trigger, uint8_t *dname, struct addr_tree_node *addrnode, enum rpz_action a, struct query_info *qinfo, struct comm_reply *repinfo, struct module_qstate *ms, char *log_name) |
print log information for an applied RPZ policy. More... | |
static struct clientip_synthesized_rr * | rpz_ipbased_trigger_lookup (struct clientip_synthesized_rrset *set, struct sockaddr_storage *addr, socklen_t addrlen, char *triggername) |
static struct clientip_synthesized_rr * | rpz_resolve_client_action_and_zone (struct auth_zones *az, struct query_info *qinfo, struct comm_reply *repinfo, uint8_t *taglist, size_t taglen, struct ub_server_stats *stats, struct local_zone **z_out, struct auth_zone **a_out, struct rpz **r_out) |
static int | rpz_is_udp_query (struct comm_reply *repinfo) |
static int | rpz_local_encode (struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, struct ub_packed_rrset_key *rrset, int ansec, int rcode, struct ub_packed_rrset_key *soa_rrset) |
encode answer consisting of 1 rrset | |
static struct ub_packed_rrset_key * | make_soa_ubrrset (struct auth_zone *auth_zone, struct auth_rrset *soa, struct regional *temp) |
allocate SOA record ubrrsetkey in region | |
static void | rpz_apply_clientip_localdata_action (struct clientip_synthesized_rr *raddr, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, sldns_buffer *buf, struct regional *temp, struct auth_zone *auth_zone) |
static int | rpz_apply_cname_override_action (struct rpz *r, struct query_info *qinfo, struct regional *temp) |
Apply the cname override action, during worker request callback. More... | |
static int | rpz_add_soa (struct reply_info *rep, struct module_qstate *ms, struct auth_zone *az) |
add additional section SOA record to the reply. More... | |
static struct dns_msg * | rpz_dns_msg_new (struct regional *region) |
static struct dns_msg * | rpz_synthesize_nodata (struct rpz *ATTR_UNUSED(r), struct module_qstate *ms, struct query_info *qinfo, struct auth_zone *az) |
static struct dns_msg * | rpz_synthesize_nxdomain (struct rpz *r, struct module_qstate *ms, struct query_info *qinfo, struct auth_zone *az) |
static struct dns_msg * | rpz_synthesize_localdata_from_rrset (struct rpz *ATTR_UNUSED(r), struct module_qstate *ms, struct query_info *qi, struct local_rrset *rrset, struct auth_zone *az) |
static struct dns_msg * | rpz_synthesize_nsip_localdata (struct rpz *r, struct module_qstate *ms, struct query_info *qi, struct clientip_synthesized_rr *data, struct auth_zone *az) |
static struct local_rrset * | local_data_find_type (struct local_data *data, uint16_t type, int alias_ok) |
static struct dns_msg * | rpz_synthesize_nsdname_localdata (struct rpz *r, struct module_qstate *ms, struct query_info *qi, struct local_zone *z, struct matched_delegation_point const *match, struct auth_zone *az) |
static struct dns_msg * | rpz_synthesize_qname_localdata_msg (struct rpz *r, struct module_qstate *ms, struct query_info *qinfo, struct local_zone *z, struct auth_zone *az) |
static struct dns_msg * | rpz_synthesize_cname_override_msg (struct rpz *r, struct module_qstate *ms, struct query_info *qinfo) |
Synthesize a CNAME message for RPZ action override. | |
static int | rpz_synthesize_qname_localdata (struct module_env *env, struct rpz *r, struct local_zone *z, enum localzone_type lzt, struct query_info *qinfo, struct edns_data *edns, sldns_buffer *buf, struct regional *temp, struct comm_reply *repinfo, struct ub_server_stats *stats) |
static struct clientip_synthesized_rr * | rpz_delegation_point_ipbased_trigger_lookup (struct rpz *rpz, struct iter_qstate *is) |
static struct dns_msg * | rpz_apply_nsip_trigger (struct module_qstate *ms, struct query_info *qchase, struct rpz *r, struct clientip_synthesized_rr *raddr, struct auth_zone *az) |
static struct dns_msg * | rpz_apply_nsdname_trigger (struct module_qstate *ms, struct query_info *qchase, struct rpz *r, struct local_zone *z, struct matched_delegation_point const *match, struct auth_zone *az) |
static struct local_zone * | rpz_delegation_point_zone_lookup (struct delegpt *dp, struct local_zones *zones, uint16_t qclass, struct matched_delegation_point *match) |
struct dns_msg * | rpz_callback_from_iterator_module (struct module_qstate *ms, struct iter_qstate *is) |
Callback to process when the iterator module is about to send queries. More... | |
struct dns_msg * | rpz_callback_from_iterator_cname (struct module_qstate *ms, struct iter_qstate *is) |
Callback to process when the iterator module has followed a cname. More... | |
static int | rpz_apply_maybe_clientip_trigger (struct auth_zones *az, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct comm_reply *repinfo, uint8_t *taglist, size_t taglen, struct ub_server_stats *stats, sldns_buffer *buf, struct regional *temp, struct local_zone **z_out, struct auth_zone **a_out, struct rpz **r_out, int *passthru) |
int | rpz_callback_from_worker_request (struct auth_zones *az, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, sldns_buffer *buf, struct regional *temp, struct comm_reply *repinfo, uint8_t *taglist, size_t taglen, struct ub_server_stats *stats, int *passthru) |
Walk over the RPZ zones to find and apply a QNAME trigger policy. More... | |
void | rpz_enable (struct rpz *r) |
Enable RPZ. More... | |
void | rpz_disable (struct rpz *r) |
Disable RPZ. More... | |
This file contains functions to enable RPZ service.
const char* rpz_action_to_string | ( | enum rpz_action | a | ) |
string for RPZ action enum
String for RPZ action enum.
Referenced by log_rpz_apply(), and respip_inform_print().
|
static |
Get the label that is just before the root label.
dname | dname to work on |
maxdnamelen | maximum length of the dname |
|
static |
The RR types that are to be ignored.
DNSSEC RRs at the apex, and SOA and NS are ignored.
Referenced by rpz_insert_rr(), and rpz_remove_rr().
|
static |
Classify RPZ action for RR type/rdata.
rr_type | the RR type |
rdatawl | RDATA with 2 bytes length |
rdatalen | the length of rdatawl (including its 2 bytes length) |
Referenced by rpz_insert_rr(), and rpz_remove_rr().
enum respip_action rpz_action_to_respip_action | ( | enum rpz_action | a | ) |
Classify respip action for RPZ action.
a | RPZ action |
References LDNS_RR_TYPE_DNAME, LDNS_RR_TYPE_NS, and LDNS_RR_TYPE_SOA.
|
static |
Get RPZ trigger for dname.
dname | dname containing RPZ trigger |
dname_len | length of the dname |
Referenced by rpz_insert_rr().
void rpz_delete | ( | struct rpz * | r | ) |
Delete RPZ.
r | RPZ struct to delete |
References local_zones_delete(), and respip_set_delete().
Referenced by auth_zone_delete().
int rpz_clear | ( | struct rpz * | r | ) |
Clear local-zones and respip data in RPZ, used after reloading file or AXFR/HTTP transfer.
r | RPZ to use |
References local_zones_delete(), and respip_set_delete().
Referenced by apply_axfr(), apply_http(), and auth_zone_read_zonefile().
void rpz_finish_config | ( | struct rpz * | r | ) |
Prepare RPZ after processing feed content.
r | RPZ to use |
References addr_tree_init_parents(), and clientip_synthesized_rrset::lock.
Referenced by auth_zone_read_zonefile(), and xfr_process_chunk_list().
struct rpz* rpz_create | ( | struct config_auth * | p | ) |
Create RPZ.
RPZ must be added to linked list after creation.
References local_zones_create(), regional_create_custom(), and respip_set_create().
Referenced by auth_zones_cfg().
int rpz_config | ( | struct rpz * | r, |
struct config_auth * | p | ||
) |
Change config on rpz, after reload.
r | the rpz structure. |
p | the config that was read. |
References delete_cname_override(), and rpz_apply_cfg_elements().
int rpz_insert_rr | ( | struct rpz * | r, |
uint8_t * | azname, | ||
size_t | aznamelen, | ||
uint8_t * | dname, | ||
size_t | dnamelen, | ||
uint16_t | rr_type, | ||
uint16_t | rr_class, | ||
uint32_t | rr_ttl, | ||
uint8_t * | rdatawl, | ||
size_t | rdatalen, | ||
uint8_t * | rr, | ||
size_t | rr_len | ||
) |
Create policy from RR and add to this RPZ.
r | the rpz to add the policy to. |
azname | dname of the auth-zone |
aznamelen | the length of the auth-zone name |
dname | dname of the RR |
dnamelen | length of the dname |
rr_type | RR type of the RR |
rr_class | RR class of the RR |
rr_ttl | TTL of the RR |
rdatawl | rdata of the RR, prepended with the rdata size |
rdatalen | length if the RR, including the prepended rdata size |
rr | the complete RR, for logging purposes |
rr_len | the length of the complete RR |
References dname_str(), dname_subdomain_c(), log_assert, log_err(), rpz_dname_to_trigger(), rpz_rr_to_action(), rpz_type_ignored(), sldns_wire2str_dname(), and strip_dname_origin().
Referenced by az_insert_rr().
|
static |
Find RPZ local-zone by qname.
zones | local-zone tree |
qname | qname |
qname_len | length of qname |
qclass | qclass |
only_exact | if 1 only exact (non wildcard) matches are returned |
wr | get write lock for local-zone if 1, read lock if 0 |
zones_keep_lock | if set do not release the r->local_zones lock, this makes the caller of this function responsible for releasing the lock. |
References dname_count_labels(), dname_count_size_labels(), dname_get_shared_topdomain(), LDNS_MAX_DOMAINLEN, LDNS_RR_CLASS_IN, local_zones_find_le(), local_zones::lock, local_zone::lock, and local_zone::name.
Referenced by rpz_callback_from_iterator_cname(), and rpz_remove_local_zones_trigger().
|
static |
Remove RR from RPZ's local-data.
z | local-zone for RPZ, holding write lock |
policydname | dname of RR to remove |
policydnamelen | length of policydname |
rr_type | RR type of RR to remove |
rdata | rdata of RR to remove |
rdatalen | length of rdata |
References packed_rrset_data::count, dname_count_labels(), local_rrset_remove_rr(), local_zone_find_data(), local_rrset::next, packed_rrset_find_rr(), and local_data::rrsets.
|
static |
Remove RR from RPZ's respip set.
raddr | respip node |
rr_type | RR type of RR to remove |
rdata | rdata of RR to remove |
rdatalen | length of rdata |
References packed_rrset_data::count, resp_addr::data, lruhash_entry::data, ub_packed_rrset_key::entry, local_rrset_remove_rr(), packed_rrset_find_rr(), ub_packed_rrset_key::rk, and packed_rrset_key::type.
|
static |
Delete client-ip trigger RR from its RRset and perhaps also the rrset from the linked list.
Returns if the local data is empty and the node can be deleted too, or not.
References packed_rrset_data::count, clientip_synthesized_rr::data, lruhash_entry::data, del_local_rrset_from_list(), ub_packed_rrset_key::entry, local_rrset_remove_rr(), packed_rrset_find_rr(), rpz_find_synthesized_rrset(), and local_rrset::rrset.
void rpz_remove_rr | ( | struct rpz * | r, |
uint8_t * | azname, | ||
size_t | aznamelen, | ||
uint8_t * | dname, | ||
size_t | dnamelen, | ||
uint16_t | rr_type, | ||
uint16_t | rr_class, | ||
uint8_t * | rdatawl, | ||
size_t | rdatalen | ||
) |
Delete policy matching RR, used for IXFR.
r | the rpz to add the policy to. |
azname | dname of the auth-zone |
aznamelen | the length of the auth-zone name |
dname | dname of the RR |
dnamelen | length of the dname |
rr_type | RR type of the RR |
rr_class | RR class of the RR |
rdatawl | rdata of the RR, prepended with the rdata size |
rdatalen | length if the RR, including the prepended rdata size |
References dname_subdomain_c(), LDNS_MAX_DOMAINLEN, rpz_rr_to_action(), and rpz_type_ignored().
Referenced by az_remove_rr().
|
static |
print log information for an applied RPZ policy.
Based on local-zone's lz_inform_print(). The repinfo contains the reply address. If it is NULL, the module state is used to report the first IP address (if any). The dname is used, for the applied rpz, if NULL, addrnode is used.
References addr_to_str(), comm_reply::client_addr, comm_reply::client_addrlen, dname_str(), LDNS_MAX_DOMAINLEN, log_nametypeclass(), module_qstate::mesh_info, query_info::qclass, query_info::qname, query_info::qtype, mesh_reply::query_reply, mesh_state::reply_list, and rpz_action_to_string().
|
static |
Apply the cname override action, during worker request callback.
false on failure.
References packed_rrset_key::dname, packed_rrset_key::dname_len, query_info::local_alias, query_info::qname, query_info::qname_len, regional_alloc_zero(), respip_copy_rrset(), ub_packed_rrset_key::rk, and local_rrset::rrset.
|
static |
add additional section SOA record to the reply.
Since this gets fed into the normal iterator answer creation, it gets minimal-responses applied to it, that can remove the additional SOA again.
References reply_info::ar_numrrsets, auth_zone_get_soa_rrset(), make_soa_ubrrset(), module_qstate::region, regional_alloc_zero(), reply_info::rrset_count, and reply_info::rrsets.
struct dns_msg* rpz_callback_from_iterator_module | ( | struct module_qstate * | qstate, |
struct iter_qstate * | iq | ||
) |
Callback to process when the iterator module is about to send queries.
Checks for nsip and nsdname triggers.
qstate | the query state. |
iq | iterator module query state. |
References module_env::auth_zones, module_qstate::client_info, module_qstate::env, auth_zone::lock, match(), auth_zone::rpz, auth_zone::rpz_az_next, auth_zones::rpz_first, auth_zones::rpz_lock, module_qstate::rpz_passthru, taglist_intersect(), VERB_ALGO, and verbose().
struct dns_msg* rpz_callback_from_iterator_cname | ( | struct module_qstate * | qstate, |
struct iter_qstate * | iq | ||
) |
Callback to process when the iterator module has followed a cname.
There can be a qname trigger for the new query name.
qstate | the query state. |
iq | iterator module query state. |
References module_env::auth_zones, module_qstate::client_info, module_qstate::env, auth_zone::lock, iter_qstate::qchase, query_info::qclass, query_info::qname, query_info::qname_len, auth_zone::rpz, auth_zone::rpz_az_next, rpz_find_zone(), auth_zones::rpz_first, auth_zones::rpz_lock, module_qstate::rpz_passthru, taglist_intersect(), VERB_ALGO, and verbose().
int rpz_callback_from_worker_request | ( | struct auth_zones * | az, |
struct module_env * | env, | ||
struct query_info * | qinfo, | ||
struct edns_data * | edns, | ||
sldns_buffer * | buf, | ||
struct regional * | temp, | ||
struct comm_reply * | repinfo, | ||
uint8_t * | taglist, | ||
size_t | taglen, | ||
struct ub_server_stats * | stats, | ||
int * | passthru | ||
) |
Walk over the RPZ zones to find and apply a QNAME trigger policy.
az | auth_zones struct, containing first RPZ item and RPZ lock |
env | module env |
qinfo | qinfo containing qname and qtype |
edns | edns data |
buf | buffer to write answer to |
temp | scratchpad |
repinfo | reply info |
taglist | taglist to lookup. |
taglen | length of taglist. |
stats | worker stats struct |
passthru | returns if the query can passthru further rpz processing. |
void rpz_enable | ( | struct rpz * | r | ) |
void rpz_disable | ( | struct rpz * | r | ) |