|
Electroneum
|

Go to the source code of this file.
Classes | |
| struct | auth_zones |
| struct | auth_zone |
| struct | auth_data |
| struct | auth_rrset |
| struct | auth_xfer |
| struct | auth_nextprobe |
| struct | auth_probe |
| struct | auth_transfer |
| struct | auth_addr |
| struct | auth_master |
| struct | auth_chunk |
Functions | |
| struct auth_zones * | auth_zones_create (void) |
| int | auth_zones_apply_cfg (struct auth_zones *az, struct config_file *cfg, int setup) |
| void | auth_xfer_pickup_initial (struct auth_zones *az, struct module_env *env) |
| void | auth_zones_cleanup (struct auth_zones *az) |
| void | auth_zones_delete (struct auth_zones *az) |
| int | auth_zone_write_file (struct auth_zone *z, const char *fname) |
| int | auth_zones_lookup (struct auth_zones *az, struct query_info *qinfo, struct regional *region, struct dns_msg **msg, int *fallback, uint8_t *dp_nm, size_t dp_nmlen) |
| int | auth_zones_answer (struct auth_zones *az, struct module_env *env, struct query_info *qinfo, struct edns_data *edns, struct sldns_buffer *buf, struct regional *temp) |
| struct auth_zone * | auth_zones_find_zone (struct auth_zones *az, uint8_t *name, size_t name_len, uint16_t dclass) |
| struct auth_zone * | auth_zone_find (struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass) |
| struct auth_xfer * | auth_xfer_find (struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass) |
| struct auth_zone * | auth_zone_create (struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass) |
| int | auth_zone_set_zonefile (struct auth_zone *z, char *zonefile) |
| int | auth_zone_set_fallback (struct auth_zone *z, char *fallbackstr) |
| int | auth_zones_can_fallback (struct auth_zones *az, uint8_t *nm, size_t nmlen, uint16_t dclass) |
| int | auth_zones_notify (struct auth_zones *az, struct module_env *env, uint8_t *nm, size_t nmlen, uint16_t dclass, struct sockaddr_storage *addr, socklen_t addrlen, int has_serial, uint32_t serial, int *refused) |
| int | auth_zone_parse_notify_serial (struct sldns_buffer *pkt, uint32_t *serial) |
| int | auth_zone_read_zonefile (struct auth_zone *z) |
| int | auth_zone_get_serial (struct auth_zone *z, uint32_t *serial) |
| int | auth_zone_cmp (const void *z1, const void *z2) |
| int | auth_data_cmp (const void *z1, const void *z2) |
| int | auth_xfer_cmp (const void *z1, const void *z2) |
| struct auth_xfer * | auth_xfer_create (struct auth_zones *az, struct auth_zone *z) |
| int | xfer_set_masters (struct auth_master **list, struct config_auth *c, int with_http) |
| void | auth_xfer_timer (void *arg) |
| int | auth_xfer_probe_udp_callback (struct comm_point *c, void *arg, int err, struct comm_reply *repinfo) |
| int | auth_xfer_transfer_tcp_callback (struct comm_point *c, void *arg, int err, struct comm_reply *repinfo) |
| int | auth_xfer_transfer_http_callback (struct comm_point *c, void *arg, int err, struct comm_reply *repinfo) |
| void | auth_xfer_probe_timer_callback (void *arg) |
| void | auth_xfer_probe_lookup_callback (void *arg, int rcode, struct sldns_buffer *buf, enum sec_status sec, char *why_bogus) |
| void | auth_xfer_transfer_lookup_callback (void *arg, int rcode, struct sldns_buffer *buf, enum sec_status sec, char *why_bogus) |
| int | compare_serial (uint32_t a, uint32_t b) |
This file contains the functions for an authority zone. This zone is queried by the iterator, just like a stub or forward zone, but then the data is locally held.
Definition in file authzone.h.
| int auth_data_cmp | ( | const void * | z1, |
| const void * | z2 | ||
| ) |
compare auth_data for sorted rbtree
| int auth_xfer_cmp | ( | const void * | z1, |
| const void * | z2 | ||
| ) |
compare auth_xfer for sorted rbtree
| struct auth_xfer* auth_xfer_create | ( | struct auth_zones * | az, |
| struct auth_zone * | z | ||
| ) |
Create auth_xfer structure. Caller must have wrlock on az. Returns locked xfer zone.
| az | zones structure. |
| z | zone with name and class |
| struct auth_xfer* auth_xfer_find | ( | struct auth_zones * | az, |
| uint8_t * | nm, | ||
| size_t | nmlen, | ||
| uint16_t | dclass | ||
| ) |
find an xfer zone by name (exact match by name or NULL returned)
| void auth_xfer_pickup_initial | ( | struct auth_zones * | az, |
| struct module_env * | env | ||
| ) |
initial pick up of worker timeouts, ties events to worker event loop
| az | auth zones structure |
| env | worker env, of first worker that receives the events (if any) in its eventloop. |
| void auth_xfer_probe_lookup_callback | ( | void * | arg, |
| int | rcode, | ||
| struct sldns_buffer * | buf, | ||
| enum sec_status | sec, | ||
| char * | why_bogus | ||
| ) |
mesh callback for task_probe on lookup of host names
| void auth_xfer_probe_timer_callback | ( | void * | arg | ) |
xfer probe timeout callback, part of task_probe
| int auth_xfer_probe_udp_callback | ( | struct comm_point * | c, |
| void * | arg, | ||
| int | err, | ||
| struct comm_reply * | repinfo | ||
| ) |
callback for commpoint udp replies to task_probe
| void auth_xfer_timer | ( | void * | arg | ) |
xfer nextprobe timeout callback, this is part of task_nextprobe
| int auth_xfer_transfer_http_callback | ( | struct comm_point * | c, |
| void * | arg, | ||
| int | err, | ||
| struct comm_reply * | repinfo | ||
| ) |
callback for task_transfer http connections
| void auth_xfer_transfer_lookup_callback | ( | void * | arg, |
| int | rcode, | ||
| struct sldns_buffer * | buf, | ||
| enum sec_status | sec, | ||
| char * | why_bogus | ||
| ) |
mesh callback for task_transfer on lookup of host names
| int auth_xfer_transfer_tcp_callback | ( | struct comm_point * | c, |
| void * | arg, | ||
| int | err, | ||
| struct comm_reply * | repinfo | ||
| ) |
callback for task_transfer tcp connections
| int auth_zone_cmp | ( | const void * | z1, |
| const void * | z2 | ||
| ) |
compare auth_zones for sorted rbtree
| struct auth_zone* auth_zone_create | ( | struct auth_zones * | az, |
| uint8_t * | nm, | ||
| size_t | nmlen, | ||
| uint16_t | dclass | ||
| ) |
create an auth zone. returns wrlocked zone. caller must have wrlock on az. returns NULL on malloc failure
| struct auth_zone* auth_zone_find | ( | struct auth_zones * | az, |
| uint8_t * | nm, | ||
| size_t | nmlen, | ||
| uint16_t | dclass | ||
| ) |
find an auth zone by name (exact match by name or NULL returned)
find serial number of zone or false if none (no SOA record)
| int auth_zone_parse_notify_serial | ( | struct sldns_buffer * | pkt, |
| uint32_t * | serial | ||
| ) |
process notify packet and read serial number from SOA. returns 0 if no soa record in the notify
| int auth_zone_read_zonefile | ( | struct auth_zone * | z | ) |
read auth zone from zonefile. caller must lock zone. false on failure
| int auth_zone_set_fallback | ( | struct auth_zone * | z, |
| char * | fallbackstr | ||
| ) |
set auth zone fallback. caller must have lock on zone. fallbackstr is "yes" or "no". false on parse failure.
| int auth_zone_set_zonefile | ( | struct auth_zone * | z, |
| char * | zonefile | ||
| ) |
set auth zone zonefile string. caller must have lock on zone
| int auth_zone_write_file | ( | struct auth_zone * | z, |
| const char * | fname | ||
| ) |
Write auth zone data to file, in zonefile format.
| int auth_zones_answer | ( | struct auth_zones * | az, |
| struct module_env * | env, | ||
| struct query_info * | qinfo, | ||
| struct edns_data * | edns, | ||
| struct sldns_buffer * | buf, | ||
| struct regional * | temp | ||
| ) |
Answer query from auth zone. Create authoritative answer.
| az | auth zones structure. |
| env | the module environment. |
| qinfo | query info (parsed). |
| edns | edns info (parsed). |
| buf | buffer with query ID and flags, also for reply. |
| temp | temporary storage region. |
| int auth_zones_apply_cfg | ( | struct auth_zones * | az, |
| struct config_file * | cfg, | ||
| int | setup | ||
| ) |
Apply configuration to auth zones. Reads zonefiles.
| az | auth zones structure |
| cfg | config to apply. |
| setup | if true, also sets up values in the auth zones structure |
| int auth_zones_can_fallback | ( | struct auth_zones * | az, |
| uint8_t * | nm, | ||
| size_t | nmlen, | ||
| uint16_t | dclass | ||
| ) |
see if the auth zone for the name can fallback
| az | auth zones |
| nm | name of delegation point. |
| nmlen | length of nm. |
| dclass | class of zone to look for. |
| void auth_zones_cleanup | ( | struct auth_zones * | az | ) |
Cleanup auth zones. This removes all events from event bases. Stops the xfr tasks. But leaves zone data.
| az | auth zones structure. |
| struct auth_zones* auth_zones_create | ( | void | ) |
Create auth zones structure
| void auth_zones_delete | ( | struct auth_zones * | az | ) |
Delete auth zones structure
| struct auth_zone* auth_zones_find_zone | ( | struct auth_zones * | az, |
| uint8_t * | name, | ||
| size_t | name_len, | ||
| uint16_t | dclass | ||
| ) |
Find the auth zone that is above the given qname. Return NULL when there is no auth_zone above the give name, otherwise returns the closest auth_zone above the qname that pertains to it.
| az | auth zones structure. |
| name | query to look up for. |
| name_len | length of name. |
| dclass | class of zone to find. |
| int auth_zones_lookup | ( | struct auth_zones * | az, |
| struct query_info * | qinfo, | ||
| struct regional * | region, | ||
| struct dns_msg ** | msg, | ||
| int * | fallback, | ||
| uint8_t * | dp_nm, | ||
| size_t | dp_nmlen | ||
| ) |
Use auth zones to lookup the answer to a query. The query is from the iterator. And the auth zones attempts to provide the answer instead of going to the internet.
| az | auth zones structure. |
| qinfo | query info to lookup. |
| region | region to use to allocate the reply in. |
| msg | reply is stored here (if one). |
| fallback | if true, fallback to making a query to the internet. |
| dp_nm | name of delegation point to look for. This zone is used to answer the query. If the dp_nm is not found, fallback is set to true and false returned. |
| dp_nmlen | length of dp_nm. |
| int auth_zones_notify | ( | struct auth_zones * | az, |
| struct module_env * | env, | ||
| uint8_t * | nm, | ||
| size_t | nmlen, | ||
| uint16_t | dclass, | ||
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen, | ||
| int | has_serial, | ||
| uint32_t | serial, | ||
| int * | refused | ||
| ) |
process notify for auth zones. first checks the access list. Then processes the notify. This starts the probe sequence or it notes the serial number (if any)
| az | auth zones structure. |
| env | module env of the worker that is handling the notify. it will pick up the task probe (or transfer), unless already in progress by another worker. |
| nm | name of the zone. Uncompressed. from query. |
| nmlen | length of name. |
| dclass | class of zone. |
| addr | source address of notify |
| addrlen | length of addr. |
| has_serial | if true, the notify has a serial attached. |
| serial | the serial number, if has_serial is true. |
| refused | is set to true on failure to note refused access. |
| int xfer_set_masters | ( | struct auth_master ** | list, |
| struct config_auth * | c, | ||
| int | with_http | ||
| ) |
Set masters in auth xfer structure from config.
| list | pointer to start of list. The malloced list is returned here. |
| c | the config items to copy over. |
| with_http | if true, http urls are also included, before the masters. |