|
Electroneum
|
#include "util/log.h"
Go to the source code of this file.
Classes | |
| struct | delegpt |
| struct | delegpt_ns |
| struct | delegpt_addr |
Functions | |
| struct delegpt * | delegpt_create (struct regional *regional) |
| struct delegpt * | delegpt_copy (struct delegpt *dp, struct regional *regional) |
| int | delegpt_set_name (struct delegpt *dp, struct regional *regional, uint8_t *name) |
| int | delegpt_add_ns (struct delegpt *dp, struct regional *regional, uint8_t *name, uint8_t lame) |
| int | delegpt_rrset_add_ns (struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *ns_rrset, uint8_t lame) |
| int | delegpt_add_target (struct delegpt *dp, struct regional *regional, uint8_t *name, size_t namelen, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame) |
| int | delegpt_add_rrset_A (struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame) |
| int | delegpt_add_rrset_AAAA (struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame) |
| int | delegpt_add_rrset (struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame) |
| int | delegpt_add_addr (struct delegpt *dp, struct regional *regional, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, char *tls_auth_name) |
| struct delegpt_ns * | delegpt_find_ns (struct delegpt *dp, uint8_t *name, size_t namelen) |
| struct delegpt_addr * | delegpt_find_addr (struct delegpt *dp, struct sockaddr_storage *addr, socklen_t addrlen) |
| void | delegpt_log (enum verbosity_value v, struct delegpt *dp) |
| void | delegpt_count_ns (struct delegpt *dp, size_t *numns, size_t *missing) |
| void | delegpt_count_addr (struct delegpt *dp, size_t *numaddr, size_t *numres, size_t *numavail) |
| void | delegpt_add_unused_targets (struct delegpt *dp) |
| size_t | delegpt_count_missing_targets (struct delegpt *dp) |
| size_t | delegpt_count_targets (struct delegpt *dp) |
| struct delegpt * | delegpt_from_message (struct dns_msg *msg, struct regional *regional) |
| void | delegpt_add_neg_msg (struct delegpt *dp, struct msgreply_entry *msg) |
| void | delegpt_no_ipv6 (struct delegpt *dp) |
| void | delegpt_no_ipv4 (struct delegpt *dp) |
| struct delegpt * | delegpt_create_mlc (uint8_t *name) |
| void | delegpt_free_mlc (struct delegpt *dp) |
| int | delegpt_set_name_mlc (struct delegpt *dp, uint8_t *name) |
| int | delegpt_add_ns_mlc (struct delegpt *dp, uint8_t *name, uint8_t lame) |
| int | delegpt_add_addr_mlc (struct delegpt *dp, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame, char *tls_auth_name) |
| int | delegpt_add_target_mlc (struct delegpt *dp, uint8_t *name, size_t namelen, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t bogus, uint8_t lame) |
| size_t | delegpt_get_mem (struct delegpt *dp) |
This file implements the Delegation Point. It contains a list of name servers and their addresses if known.
Definition in file iter_delegpt.h.
| int delegpt_add_addr | ( | struct delegpt * | dp, |
| struct regional * | regional, | ||
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen, | ||
| uint8_t | bogus, | ||
| uint8_t | lame, | ||
| char * | tls_auth_name | ||
| ) |
Add address to the delegation point. No servername is associated or checked.
| dp | delegation point. |
| regional | where to allocate the info. |
| addr | the address. |
| addrlen | the length of addr. |
| bogus | if address is bogus. |
| lame | if address is lame. |
| tls_auth_name | TLS authentication name (or NULL). |
| int delegpt_add_addr_mlc | ( | struct delegpt * | dp, |
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen, | ||
| uint8_t | bogus, | ||
| uint8_t | lame, | ||
| char * | tls_auth_name | ||
| ) |
add an address to a malloced delegation point.
| dp | must have been created with delegpt_create_mlc. |
| addr | the address. |
| addrlen | the length of addr. |
| bogus | if address is bogus. |
| lame | if address is lame. |
| tls_auth_name | TLS authentication name (or NULL). |
| void delegpt_add_neg_msg | ( | struct delegpt * | dp, |
| struct msgreply_entry * | msg | ||
| ) |
Add negative message to delegation point.
| dp | delegation point. |
| msg | the message added, marks off A or AAAA from an NS entry. |
| int delegpt_add_ns | ( | struct delegpt * | dp, |
| struct regional * | regional, | ||
| uint8_t * | name, | ||
| uint8_t | lame | ||
| ) |
Add a name to the delegation point.
| dp | delegation point. |
| regional | where to allocate the info. |
| name | domain name in wire format. |
| lame | name is lame, disprefer it. |
add a name to malloced delegation point.
| dp | must have been created with delegpt_create_mlc. |
| name | the name to add. |
| lame | the name is lame, disprefer. |
| int delegpt_add_rrset | ( | struct delegpt * | dp, |
| struct regional * | regional, | ||
| struct ub_packed_rrset_key * | rrset, | ||
| uint8_t | lame | ||
| ) |
Add any RRset to delegpt. Does not check for duplicates added.
| dp | delegation point. |
| regional | where to allocate the info. |
| rrset | RRset to add, NS, A, AAAA. |
| lame | rrset is lame, disprefer it. |
| int delegpt_add_rrset_A | ( | struct delegpt * | dp, |
| struct regional * | regional, | ||
| struct ub_packed_rrset_key * | rrset, | ||
| uint8_t | lame | ||
| ) |
Add A RRset to delegpt.
| dp | delegation point. |
| regional | where to allocate the info. |
| rrset | RRset A to add. |
| lame | rrset is lame, disprefer it. |
| int delegpt_add_rrset_AAAA | ( | struct delegpt * | dp, |
| struct regional * | regional, | ||
| struct ub_packed_rrset_key * | rrset, | ||
| uint8_t | lame | ||
| ) |
Add AAAA RRset to delegpt.
| dp | delegation point. |
| regional | where to allocate the info. |
| rrset | RRset AAAA to add. |
| lame | rrset is lame, disprefer it. |
| int delegpt_add_target | ( | struct delegpt * | dp, |
| struct regional * | regional, | ||
| uint8_t * | name, | ||
| size_t | namelen, | ||
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen, | ||
| uint8_t | bogus, | ||
| uint8_t | lame | ||
| ) |
Add target address to the delegation point.
| dp | delegation point. |
| regional | where to allocate the info. |
| name | name for which target was found (must be in nslist). This name is marked resolved. |
| namelen | length of name. |
| addr | the address. |
| addrlen | the length of addr. |
| bogus | security status for the address, pass true if bogus. |
| lame | address is lame. |
| int delegpt_add_target_mlc | ( | struct delegpt * | dp, |
| uint8_t * | name, | ||
| size_t | namelen, | ||
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen, | ||
| uint8_t | bogus, | ||
| uint8_t | lame | ||
| ) |
Add target address to the delegation point.
| dp | must have been created with delegpt_create_mlc. |
| name | name for which target was found (must be in nslist). This name is marked resolved. |
| namelen | length of name. |
| addr | the address. |
| addrlen | the length of addr. |
| bogus | security status for the address, pass true if bogus. |
| lame | address is lame. |
| void delegpt_add_unused_targets | ( | struct delegpt * | dp | ) |
Add all usable targets to the result list.
| dp | delegation point. |
Create a copy of a delegation point.
| dp | delegation point to copy. |
| regional | where to allocate it. |
| void delegpt_count_addr | ( | struct delegpt * | dp, |
| size_t * | numaddr, | ||
| size_t * | numres, | ||
| size_t * | numavail | ||
| ) |
count addresses, and number in result and available lists, for logging
| size_t delegpt_count_missing_targets | ( | struct delegpt * | dp | ) |
Count number of missing targets. These are ns names with no resolved flag.
| dp | delegation point. |
| void delegpt_count_ns | ( | struct delegpt * | dp, |
| size_t * | numns, | ||
| size_t * | missing | ||
| ) |
count NS and number missing for logging
| size_t delegpt_count_targets | ( | struct delegpt * | dp | ) |
count total number of targets in dp
Create new delegation point.
| regional | where to allocate it. |
create malloced delegation point, with the given name
| name | uncompressed wireformat of delegpt name. |
| struct delegpt_addr* delegpt_find_addr | ( | struct delegpt * | dp, |
| struct sockaddr_storage * | addr, | ||
| socklen_t | addrlen | ||
| ) |
Find address record in total list of delegation point.
| dp | delegation point. |
| addr | address |
| addrlen | length of addr |
| struct delegpt_ns* delegpt_find_ns | ( | struct delegpt * | dp, |
| uint8_t * | name, | ||
| size_t | namelen | ||
| ) |
Find NS record in name list of delegation point.
| dp | delegation point. |
| name | name of nameserver to look for, uncompressed wireformat. |
| namelen | length of name. |
| void delegpt_free_mlc | ( | struct delegpt * | dp | ) |
free malloced delegation point.
| dp | must have been created with delegpt_create_mlc, free'd. |
Create new delegation point from a dns message
Note that this method does not actually test to see if the message is an actual referral. It really is just checking to see if it can construct a delegation point, so the message could be of some other type (some ANSWER messages, some CNAME messages, generally.) Note that the resulting DelegationPoint will contain targets for all "relevant" glue (i.e., address records whose ownernames match the target of one of the NS records), so if policy dictates that some glue should be discarded beyond that, discard it before calling this method. Note that this method will find "glue" in either the ADDITIONAL section or the ANSWER section.
| msg | the dns message, referral. |
| regional | where to allocate delegation point. |
| size_t delegpt_get_mem | ( | struct delegpt * | dp | ) |
get memory in use by dp
| void delegpt_log | ( | enum verbosity_value | v, |
| struct delegpt * | dp | ||
| ) |
Print the delegation point to the log. For debugging.
| v | verbosity value that is needed to emit to log. |
| dp | delegation point. |
| void delegpt_no_ipv4 | ( | struct delegpt * | dp | ) |
Register the fact that there is no ipv4 and thus As are not going to be queried for or be useful.
| dp | the delegation point. Updated to reflect no ipv4. |
| void delegpt_no_ipv6 | ( | struct delegpt * | dp | ) |
Register the fact that there is no ipv6 and thus AAAAs are not going to be queried for or be useful.
| dp | the delegation point. Updated to reflect no ipv6. |
| int delegpt_rrset_add_ns | ( | struct delegpt * | dp, |
| struct regional * | regional, | ||
| struct ub_packed_rrset_key * | ns_rrset, | ||
| uint8_t | lame | ||
| ) |
Add NS rrset; calls add_ns repeatedly.
| dp | delegation point. |
| regional | where to allocate the info. |
| ns_rrset | NS rrset. |
| lame | rrset is lame, disprefer it. |
Set name of delegation point.
| dp | delegation point. |
| regional | where to allocate the name copy. |
| name | name to use. |