|
unbound
0.1
|
#include "services/localzone.h"#include "util/locks.h"#include "util/log.h"#include "util/config_file.h"#include "services/authzone.h"#include "sldns/sbuffer.h"#include "daemon/stats.h"#include "respip/respip.h"Data Structures | |
| struct | rpz |
| RPZ containing policies. More... | |
Enumerations | |
| enum | rpz_trigger { RPZ_QNAME_TRIGGER = 0, RPZ_CLIENT_IP_TRIGGER, RPZ_RESPONSE_IP_TRIGGER, RPZ_NSDNAME_TRIGGER, RPZ_NSIP_TRIGGER, RPZ_INVALID_TRIGGER } |
| RPZ triggers, only the QNAME trigger is currently supported in Unbound. | |
| enum | rpz_action { RPZ_NXDOMAIN_ACTION = 0, RPZ_NODATA_ACTION, RPZ_PASSTHRU_ACTION, RPZ_DROP_ACTION, RPZ_TCP_ONLY_ACTION, RPZ_INVALID_ACTION, RPZ_LOCAL_DATA_ACTION, RPZ_DISABLED_ACTION, RPZ_NO_OVERRIDE_ACTION, RPZ_CNAME_OVERRIDE_ACTION } |
| RPZ actions. | |
Functions | |
| 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... | |
| void | rpz_remove_rr (struct rpz *r, 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... | |
| int | rpz_apply_qname_trigger (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) |
| Walk over the RPZ zones to find and apply a QNAME trigger policy. More... | |
| 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... | |
| struct rpz * | rpz_create (struct config_auth *p) |
| Create RPZ. More... | |
| const char * | rpz_action_to_string (enum rpz_action a) |
| String for RPZ action enum. More... | |
| enum rpz_action | respip_action_to_rpz_action (enum respip_action a) |
| void | rpz_finish_config (struct rpz *r) |
| Prepare RPZ after procesing feed content. More... | |
| enum respip_action | rpz_action_to_respip_action (enum rpz_action a) |
| Classify respip action for RPZ action. More... | |
This file contains functions to enable RPZ service.
| 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_subdomain_c(), log_assert, log_err(), rpz_dname_to_trigger(), rpz_rr_to_action(), and strip_dname_origin().
Referenced by az_insert_rr().
| void rpz_remove_rr | ( | struct rpz * | r, |
| 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. |
| 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 LDNS_MAX_DOMAINLEN, and rpz_rr_to_action().
Referenced by az_remove_rr().
| int rpz_apply_qname_trigger | ( | 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 | ||
| ) |
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 | lenth of taglist. |
| stats | worker stats struct |
References auth_zone::lock, 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, and taglist_intersect().
| void rpz_delete | ( | struct rpz * | r | ) |
Delete RPZ.
| r | RPZ struct to delete |
References local_zones_delete(), regional_destroy(), 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_create(), local_zones_delete(), respip_set_create(), and respip_set_delete().
Referenced by apply_axfr(), apply_http(), and auth_zone_read_zonefile().
| struct rpz* rpz_create | ( | struct config_auth * | p | ) |
Create RPZ.
RPZ must be added to linked list after creation.
References local_zones_create(), memdup(), regional_create_custom(), respip_set_create(), config_auth::rpz_action_override, rpz_config_to_action(), config_auth::rpz_taglist, and config_auth::rpz_taglistlen.
Referenced by auth_zones_cfg().
| const char* rpz_action_to_string | ( | enum rpz_action | a | ) |
String for RPZ action enum.
| a | RPZ action to get string for |
String for RPZ action enum.
Referenced by log_rpz_apply(), and respip_inform_print().
| void rpz_finish_config | ( | struct rpz * | r | ) |
Prepare RPZ after procesing feed content.
| r | RPZ to use |
References addr_tree_init_parents().
Referenced by auth_zone_read_zonefile(), and xfr_process_chunk_list().
| enum respip_action rpz_action_to_respip_action | ( | enum rpz_action | a | ) |
Classify respip action for RPZ action.
| a | RPZ action |
Referenced by rpz_insert_response_ip_trigger().
1.8.18