|
Electroneum
|

Go to the source code of this file.
Classes | |
| struct | val_neg_cache |
| struct | val_neg_zone |
| struct | val_neg_data |
Functions | |
| struct val_neg_cache * | val_neg_create (struct config_file *cfg, size_t maxiter) |
| size_t | val_neg_get_mem (struct val_neg_cache *neg) |
| void | neg_cache_delete (struct val_neg_cache *neg) |
| int | val_neg_data_compare (const void *a, const void *b) |
| int | val_neg_zone_compare (const void *a, const void *b) |
| void | val_neg_addreply (struct val_neg_cache *neg, struct reply_info *rep) |
| void | val_neg_addreferral (struct val_neg_cache *neg, struct reply_info *rep, uint8_t *zone) |
| int | val_neg_dlvlookup (struct val_neg_cache *neg, uint8_t *qname, size_t len, uint16_t qclass, struct rrset_cache *rrset_cache, time_t now) |
| struct dns_msg * | val_neg_getmsg (struct val_neg_cache *neg, struct query_info *qinfo, struct regional *region, struct rrset_cache *rrset_cache, struct sldns_buffer *buf, time_t now, int addsoa, uint8_t *topname, struct config_file *cfg) |
| void | neg_insert_data (struct val_neg_cache *neg, struct val_neg_zone *zone, struct ub_packed_rrset_key *nsec) |
| void | neg_delete_data (struct val_neg_cache *neg, struct val_neg_data *el) |
| struct val_neg_zone * | neg_find_zone (struct val_neg_cache *neg, uint8_t *nm, size_t len, uint16_t dclass) |
| struct val_neg_zone * | neg_create_zone (struct val_neg_cache *neg, uint8_t *nm, size_t nm_len, uint16_t dclass) |
| void | val_neg_zone_take_inuse (struct val_neg_zone *zone) |
This file contains helper functions for the validator module. The functions help with aggressive negative caching. This creates new denials of existence, and proofs for absence of types from cached NSEC records.
Definition in file val_neg.h.
| void neg_cache_delete | ( | struct val_neg_cache * | neg | ) |
Destroy negative cache. There must no longer be any other threads.
| neg | negative cache. |
| struct val_neg_zone* neg_create_zone | ( | struct val_neg_cache * | neg, |
| uint8_t * | nm, | ||
| size_t | nm_len, | ||
| uint16_t | dclass | ||
| ) |
Create a new zone. Does not do locking.
| neg | negative cache |
| nm | what to look for. |
| nm_len | length of name. |
| dclass | class of zone, host order. |
| void neg_delete_data | ( | struct val_neg_cache * | neg, |
| struct val_neg_data * | el | ||
| ) |
Delete a data element from the negative cache. May delete other data elements to keep tree coherent, or only mark the element as 'not in use'. Does not do locking.
| neg | negative cache. |
| el | data element to delete. |
| struct val_neg_zone* neg_find_zone | ( | struct val_neg_cache * | neg, |
| uint8_t * | nm, | ||
| size_t | len, | ||
| uint16_t | dclass | ||
| ) |
Find the given zone, from the SOA owner name and class Does not do locking.
| neg | negative cache |
| nm | what to look for. |
| len | length of nm |
| dclass | class to look for. |
| void neg_insert_data | ( | struct val_neg_cache * | neg, |
| struct val_neg_zone * | zone, | ||
| struct ub_packed_rrset_key * | nsec | ||
| ) |
Insert data into the data tree of a zone Does not do locking.
| neg | negative cache |
| zone | zone to insert into |
| nsec | record to insert. |
| void val_neg_addreferral | ( | struct val_neg_cache * | neg, |
| struct reply_info * | rep, | ||
| uint8_t * | zone | ||
| ) |
Insert NSECs from this referral into the negative cache for reference.
| neg | negative cache |
| rep | referral reply with NS, NSECs. |
| zone | bailiwick for the referral. Errors are ignored, means that storage is omitted. |
| void val_neg_addreply | ( | struct val_neg_cache * | neg, |
| struct reply_info * | rep | ||
| ) |
Insert NSECs from this message into the negative cache for reference.
| neg | negative cache |
| rep | reply with NSECs. Errors are ignored, means that storage is omitted. |
| struct val_neg_cache* val_neg_create | ( | struct config_file * | cfg, |
| size_t | maxiter | ||
| ) |
Create negative cache
| cfg | config options. |
| maxiter | max nsec3 iterations allowed. |
| int val_neg_data_compare | ( | const void * | a, |
| const void * | b | ||
| ) |
Comparison function for rbtree val neg data elements
| int val_neg_dlvlookup | ( | struct val_neg_cache * | neg, |
| uint8_t * | qname, | ||
| size_t | len, | ||
| uint16_t | qclass, | ||
| struct rrset_cache * | rrset_cache, | ||
| time_t | now | ||
| ) |
Perform a DLV style lookup During the lookup, we could find out that data has expired. In that case the neg_cache entries are removed, and lookup fails.
| neg | negative cache. |
| qname | name to look for |
| len | length of qname. |
| qclass | class to look in. |
| rrset_cache | the rrset cache, for NSEC lookups. |
| now | current time for ttl checks. |
| size_t val_neg_get_mem | ( | struct val_neg_cache * | neg | ) |
see how much memory is in use by the negative cache.
| neg | negative cache |
| struct dns_msg* val_neg_getmsg | ( | struct val_neg_cache * | neg, |
| struct query_info * | qinfo, | ||
| struct regional * | region, | ||
| struct rrset_cache * | rrset_cache, | ||
| struct sldns_buffer * | buf, | ||
| time_t | now, | ||
| int | addsoa, | ||
| uint8_t * | topname, | ||
| struct config_file * | cfg | ||
| ) |
For the given query, try to get a reply out of the negative cache. The reply still needs to be validated.
| neg | negative cache. |
| qinfo | query |
| region | where to allocate reply. |
| rrset_cache | rrset cache. |
| buf | temporary buffer. |
| now | to check TTLs against. |
| addsoa | if true, produce result for external consumption. if false, do not add SOA - for unbound-internal consumption. |
| topname | do not look higher than this name, so that the result cannot be taken from a zone above the current trust anchor. Which could happen with multiple islands of trust. if NULL, then no trust anchor is used, but also the algorithm becomes more conservative, especially for opt-out zones, since the receiver may have a trust-anchor below the optout and thus the optout cannot be used to create a proof from the negative cache. |
| cfg | config options. |
| int val_neg_zone_compare | ( | const void * | a, |
| const void * | b | ||
| ) |
Comparison function for rbtree val neg zone elements
| void val_neg_zone_take_inuse | ( | struct val_neg_zone * | zone | ) |
take a zone into use. increases counts of parents. Does not do locking.
| zone | zone to take into use. |