unbound: iterator/iter_delegpt.h File Reference

unbound 0.1

Data Structures | Functions
iter_delegpt.h File Reference

This file implements the Delegation Point. More...

`#include "util/log.h"`

## Data Structures
struct | delegpt
| Delegation Point. More...
struct | delegpt_ns
| Nameservers for a delegation point. More...
struct | delegpt_addr
| Address of target nameserver in delegation point. More...

## Functions
struct delegpt * | delegpt_create (struct regional *regional)
| Create new delegation point.
struct delegpt * | delegpt_copy (struct delegpt *dp, struct regional *regional)
| Create a copy of a delegation point.
int | delegpt_set_name (struct delegpt *dp, struct regional *regional, uint8_t *name)
| Set name of delegation point.
int | delegpt_add_ns (struct delegpt *dp, struct regional *regional, uint8_t *name, uint8_t lame, char *tls_auth_name, int port)
| Add a name to the delegation point.
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.
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 *additions)
| Add target address to the delegation point.
int | delegpt_add_rrset_A (struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame, int *additions)
| Add A RRset to delegpt.
int | delegpt_add_rrset_AAAA (struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame, int *additions)
| Add AAAA RRset to delegpt.
int | delegpt_add_rrset (struct delegpt *dp, struct regional *regional, struct ub_packed_rrset_key *rrset, uint8_t lame, int *additions)
| Add any RRset to delegpt.
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, int port, int *additions)
| Add address to the delegation point.
struct delegpt_ns * | delegpt_find_ns (struct delegpt *dp, uint8_t *name, size_t namelen)
| Find NS record in name list of delegation point.
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.
void | delegpt_log (enum verbosity_value v, struct delegpt *dp)
| Print the delegation point to the log.
void | delegpt_count_ns (struct delegpt *dp, size_t *numns, size_t *missing)
| count NS and number missing for logging
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
void | delegpt_add_unused_targets (struct delegpt *dp)
| Add all usable targets to the result list.
size_t | delegpt_count_missing_targets (struct delegpt *dp, int *alllame)
| Count number of missing targets.
size_t | delegpt_count_targets (struct delegpt *dp)
| count total number of targets in dp
struct delegpt * | delegpt_from_message (struct dns_msg *msg, struct regional *regional)
| Create new delegation point from a dns message.
void | delegpt_mark_neg (struct delegpt_ns *ns, uint16_t qtype)
| Mark negative return in delegation point for specific nameserver.
void | delegpt_add_neg_msg (struct delegpt *dp, struct msgreply_entry *msg)
| Add negative message to delegation point.
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.
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.
struct delegpt * | delegpt_create_mlc (uint8_t *name)
| create malloced delegation point, with the given name
void | delegpt_free_mlc (struct delegpt *dp)
| free malloced delegation point.
int | delegpt_set_name_mlc (struct delegpt *dp, uint8_t *name)
| Set name of delegation point.
int | delegpt_add_ns_mlc (struct delegpt *dp, uint8_t *name, uint8_t lame, char *tls_auth_name, int port)
| add a name to malloced delegation point.
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 port)
| add an address to a malloced delegation point.
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.
size_t | delegpt_get_mem (struct delegpt *dp)
| get memory in use by dp

## Detailed Description

This file implements the Delegation Point.

It contains a list of name servers and their addresses if known.

## Function Documentation

## ◆ delegpt_create()

struct delegpt * delegpt_create | ( | struct regional * | regional | ) |

Create new delegation point.

Parameters

  regional | where to allocate it.

Returns
  new delegation point or NULL on error.

References regional_alloc().

Referenced by delegpt_copy(), delegpt_from_message(), and dns_cache_find_delegation().

## ◆ delegpt_copy()

struct delegpt * delegpt_copy | ( | struct delegpt * | dp,
|  | struct regional * | regional
| ) |  |

Create a copy of a delegation point.

Parameters

  dp | delegation point to copy.
  regional | where to allocate it.

Returns
  new delegation point or NULL on error.

References delegpt_addr::addr, delegpt_addr::addrlen, delegpt::bogus, delegpt_addr::bogus, delegpt_ns::cache_lookup_count, delegpt_add_addr(), delegpt_add_ns(), delegpt_create(), delegpt_set_name(), delegpt_ns::done_pside4, delegpt_ns::done_pside6, delegpt_ns::got4, delegpt_ns::got6, delegpt::has_parent_side_NS, delegpt_ns::lame, delegpt_addr::lame, delegpt::name, delegpt_ns::name, delegpt_ns::next, delegpt_addr::next_target, delegpt::nslist, delegpt_ns::port, delegpt_ns::resolved, delegpt::ssl_upstream, delegpt::target_list, delegpt::tcp_upstream, delegpt_ns::tls_auth_name, and delegpt_addr::tls_auth_name.

Referenced by forward_request(), generate_dnskey_prefetch(), generate_ns_check(), generate_parentside_target_query(), prime_root(), prime_stub(), and processInitRequest().

## ◆ delegpt_set_name()

int delegpt_set_name | ( | struct delegpt * | dp,
|  | struct regional * | regional,
|  | uint8_t * | name
| ) |  |

Set name of delegation point.

Parameters

  dp | delegation point.
  regional | where to allocate the name copy.
  name | name to use.

Returns
  false on error.

References dname_count_size_labels(), delegpt::dp_type_mlc, log_assert, delegpt::name, delegpt::namelabs, delegpt::namelen, and regional_alloc_init().

Referenced by delegpt_copy(), delegpt_from_message(), and dns_cache_find_delegation().

## ◆ delegpt_add_ns()

int delegpt_add_ns | ( | struct delegpt * | dp,
|  | struct regional * | regional,
|  | uint8_t * | name,
|  | uint8_t | lame,
|  | char * | tls_auth_name,
|  | int | port
| ) |  |

Add a name to the delegation point.

Parameters

  dp | delegation point.
  regional | where to allocate the info.
  name | domain name in wire format.
  lame | name is lame, disprefer it.
  tls_auth_name | TLS authentication name (or NULL).
  port | port to use for resolved addresses.

Returns
  false on error.

References delegpt_ns::cache_lookup_count, delegpt_find_ns(), dname_count_size_labels(), delegpt_ns::done_pside4, delegpt_ns::done_pside6, delegpt::dp_type_mlc, delegpt_ns::got4, delegpt_ns::got6, delegpt_ns::lame, log_assert, delegpt_ns::name, delegpt_ns::namelen, delegpt_ns::next, delegpt::nslist, delegpt_ns::port, regional_alloc(), regional_alloc_init(), regional_strdup(), delegpt_ns::resolved, and delegpt_ns::tls_auth_name.

Referenced by delegpt_copy(), delegpt_rrset_add_ns(), processLastResort(), and processTargetResponse().

## ◆ delegpt_rrset_add_ns()

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.

Parameters

  dp | delegation point.
  regional | where to allocate the info.
  ns_rrset | NS rrset.
  lame | rrset is lame, disprefer it.

Returns
  0 on alloc error.

References delegpt::bogus, packed_rrset_data::count, lruhash_entry::data, delegpt_add_ns(), dname_valid(), delegpt::dp_type_mlc, ub_packed_rrset_key::entry, log_assert, packed_rrset_data::rr_data, packed_rrset_data::rr_len, sec_status_bogus, and packed_rrset_data::security.

Referenced by delegpt_add_rrset(), delegpt_from_message(), dns_cache_find_delegation(), and iter_lookup_parent_NS_from_cache().

## ◆ delegpt_add_target()

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 * | additions
| ) |  |

Add target address to the delegation point.

Parameters

  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.
  additions | will be set to 1 if a new address is added

Returns
  false on error.

References addr_is_ip6(), delegpt_add_addr(), delegpt_find_ns(), delegpt_ns::done_pside4, delegpt_ns::done_pside6, delegpt::dp_type_mlc, delegpt_ns::got4, delegpt_ns::got6, delegpt_ns::lame, log_assert, delegpt_ns::name, delegpt_ns::namelen, delegpt_ns::port, delegpt_ns::resolved, and delegpt_ns::tls_auth_name.

Referenced by delegpt_add_rrset_A(), and delegpt_add_rrset_AAAA().

## ◆ delegpt_add_rrset_A()

int delegpt_add_rrset_A | ( | struct delegpt * | dp,
|  | struct regional * | regional,
|  | struct ub_packed_rrset_key * | rrset,
|  | uint8_t | lame,
|  | int * | additions
| ) |  |

Add A RRset to delegpt.

Parameters

  dp | delegation point.
  regional | where to allocate the info.
  rrset | RRset A to add.
  lame | rrset is lame, disprefer it.
  additions | will be set to 1 if a new address is added

Returns
  0 on alloc error.

References packed_rrset_data::count, lruhash_entry::data, delegpt_add_target(), packed_rrset_key::dname, packed_rrset_key::dname_len, delegpt::dp_type_mlc, ub_packed_rrset_key::entry, INET_SIZE, log_assert, ub_packed_rrset_key::rk, packed_rrset_data::rr_data, packed_rrset_data::rr_len, sec_status_bogus, and packed_rrset_data::security.

Referenced by cache_fill_missing(), delegpt_add_rrset(), delegpt_from_message(), find_add_addrs(), and iter_lookup_parent_glue_from_cache().

## ◆ delegpt_add_rrset_AAAA()

int delegpt_add_rrset_AAAA | ( | struct delegpt * | dp,
|  | struct regional * | regional,
|  | struct ub_packed_rrset_key * | rrset,
|  | uint8_t | lame,
|  | int * | additions
| ) |  |

Add AAAA RRset to delegpt.

Parameters

  dp | delegation point.
  regional | where to allocate the info.
  rrset | RRset AAAA to add.
  lame | rrset is lame, disprefer it.
  additions | will be set to 1 if a new address is added

Returns
  0 on alloc error.

References packed_rrset_data::count, lruhash_entry::data, delegpt_add_target(), packed_rrset_key::dname, packed_rrset_key::dname_len, delegpt::dp_type_mlc, ub_packed_rrset_key::entry, INET6_SIZE, log_assert, ub_packed_rrset_key::rk, packed_rrset_data::rr_data, packed_rrset_data::rr_len, sec_status_bogus, and packed_rrset_data::security.

Referenced by cache_fill_missing(), delegpt_add_rrset(), delegpt_from_message(), find_add_addrs(), and iter_lookup_parent_glue_from_cache().

## ◆ delegpt_add_rrset()

int delegpt_add_rrset | ( | struct delegpt * | dp,
|  | struct regional * | regional,
|  | struct ub_packed_rrset_key * | rrset,
|  | uint8_t | lame,
|  | int * | additions
| ) |  |

Add any RRset to delegpt.

Does not check for duplicates added.

Parameters

  dp | delegation point.
  regional | where to allocate the info.
  rrset | RRset to add, NS, A, AAAA.
  lame | rrset is lame, disprefer it.
  additions | will be set to 1 if a new address is added

Returns
  0 on alloc error.

References delegpt_add_rrset_A(), delegpt_add_rrset_AAAA(), delegpt_rrset_add_ns(), LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, LDNS_RR_TYPE_NS, log_warn(), ub_packed_rrset_key::rk, and packed_rrset_key::type.

Referenced by processTargetResponse().

## ◆ delegpt_add_addr()

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,
|  | int | port,
|  | int * | additions
| ) |  |

Add address to the delegation point.

No servername is associated or checked.

Parameters

  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).
  port | the port to use; if -1 the port is taken from addr.
  additions | will be set to 1 if a new address is added

Returns
  false on error.

References delegpt_addr::addr, delegpt_addr::addrlen, delegpt_addr::attempts, delegpt_addr::bogus, delegpt_find_addr(), delegpt_addr::dnsseclame, delegpt::dp_type_mlc, delegpt_addr::lame, log_assert, delegpt_addr::next_result, delegpt_addr::next_target, delegpt_addr::next_usable, regional_alloc(), regional_strdup(), sockaddr_store_port(), delegpt::target_list, delegpt_addr::tls_auth_name, and delegpt::usable_list.

Referenced by delegpt_add_target(), delegpt_copy(), and processLastResort().

## ◆ delegpt_find_ns()

struct delegpt_ns * delegpt_find_ns | ( | struct delegpt * | dp,
|  | uint8_t * | name,
|  | size_t | namelen
| ) |  |

Find NS record in name list of delegation point.

Parameters

  dp | delegation point.
  name | name of nameserver to look for, uncompressed wireformat.
  namelen | length of name.

Returns
  the ns structure or NULL if not found.

References delegpt_ns::name, delegpt_ns::namelen, delegpt_ns::next, delegpt::nslist, and query_dname_compare().

Referenced by delegpt_add_neg_msg(), delegpt_add_ns(), delegpt_add_ns_mlc(), delegpt_add_target(), delegpt_add_target_mlc(), error_supers(), iter_dp_is_useless(), and processTargetResponse().

## ◆ delegpt_find_addr()

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.

Parameters

  dp | delegation point.
  addr | address
  addrlen | length of addr

Returns
  the addr structure or NULL if not found.

References delegpt_addr::addr, delegpt_addr::addrlen, delegpt_addr::next_target, sockaddr_cmp_addr(), and delegpt::target_list.

Referenced by delegpt_add_addr(), delegpt_add_addr_mlc(), iter_merge_retry_counts(), and processQueryResponse().

## ◆ delegpt_log()

void delegpt_log | ( | enum verbosity_value | v,
|  | struct delegpt * | dp
| ) |  |

Print the delegation point to the log.

For debugging.

Parameters

  v | verbosity value that is needed to emit to log.
  dp | delegation point.

References delegpt_addr::addr, delegpt_addr::addrlen, delegpt::bogus, delegpt_addr::bogus, delegpt_count_addr(), delegpt_count_ns(), dname_str(), delegpt_ns::done_pside4, delegpt_ns::done_pside6, delegpt_ns::got4, delegpt_ns::got6, delegpt::has_parent_side_NS, delegpt_ns::lame, delegpt_addr::lame, LDNS_MAX_DOMAINLEN, log_addr(), log_info(), delegpt::name, delegpt_ns::name, delegpt_ns::next, delegpt_addr::next_target, delegpt::nslist, delegpt_ns::resolved, delegpt::target_list, delegpt_addr::tls_auth_name, VERB_ALGO, and verbosity.

Referenced by prime_supers(), processInitRequest(), processQueryResponse(), processQueryTargets(), processTargetResponse(), read_forwards(), read_root_hints(), and read_stubs().

## ◆ delegpt_add_unused_targets()

void delegpt_add_unused_targets | ( | struct delegpt * | dp | ) |

Add all usable targets to the result list.

Parameters

  dp | delegation point.

References delegpt_addr::next_result, delegpt_addr::next_usable, delegpt::result_list, and delegpt::usable_list.

Referenced by processQueryTargets().

## ◆ delegpt_count_missing_targets()

size_t delegpt_count_missing_targets | ( | struct delegpt * | dp,
|  | int * | alllame
| ) |  |

Count number of missing targets.

These are ns names with no resolved flag.

Parameters

  dp | delegation point.
  alllame | if set, check if all the missing targets are lame.

Returns
  number of missing targets (or 0).

References delegpt_ns::lame, delegpt_ns::next, delegpt::nslist, and delegpt_ns::resolved.

Referenced by iter_filter_order(), processLastResort(), processQueryTargets(), and query_for_targets().

## ◆ delegpt_from_message()

struct delegpt * delegpt_from_message | ( | struct dns_msg * | msg,
|  | struct regional * | regional
| ) |  |

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.

Parameters

  msg | the dns message, referral.
  regional | where to allocate delegation point.

Returns
  new delegation point or NULL on alloc error, or if the message was not appropriate.

References reply_info::an_numrrsets, delegpt_add_rrset_A(), delegpt_add_rrset_AAAA(), delegpt_create(), delegpt_rrset_add_ns(), delegpt_set_name(), packed_rrset_key::dname, find_NS(), delegpt::has_parent_side_NS, LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, reply_info::ns_numrrsets, dns_msg::rep, ub_packed_rrset_key::rk, reply_info::rrset_count, reply_info::rrsets, and packed_rrset_key::type.

Referenced by prime_supers(), processDSNSResponse(), and processQueryResponse().

## ◆ delegpt_mark_neg()

void delegpt_mark_neg | ( | struct delegpt_ns * | ns,
|  | uint16_t | qtype
| ) |  |

Mark negative return in delegation point for specific nameserver.

sets the got4 or got6 to negative, updates the ns->resolved.

Parameters

  ns | the nameserver in the delegpt.
  qtype | A or AAAA (host order).

References delegpt_ns::got4, delegpt_ns::got6, LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, and delegpt_ns::resolved.

Referenced by delegpt_add_neg_msg(), error_supers(), and processTargetResponse().

## ◆ delegpt_add_neg_msg()

void delegpt_add_neg_msg | ( | struct delegpt * | dp,
|  | struct msgreply_entry * | msg
| ) |  |

Add negative message to delegation point.

Parameters

  dp | delegation point.
  msg | the message added, marks off A or AAAA from an NS entry.

References reply_info::an_numrrsets, lruhash_entry::data, delegpt_find_ns(), delegpt_mark_neg(), msgreply_entry::entry, reply_info::flags, FLAGS_GET_RCODE, msgreply_entry::key, query_info::qname, query_info::qname_len, and query_info::qtype.

Referenced by cache_fill_missing(), and find_add_addrs().

## ◆ delegpt_no_ipv6()

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.

Parameters

  dp | the delegation point. Updated to reflect no ipv6.

References delegpt_ns::got4, delegpt_ns::next, delegpt::nslist, and delegpt_ns::resolved.

Referenced by processQueryTargets().

## ◆ delegpt_no_ipv4()

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.

Parameters

  dp | the delegation point. Updated to reflect no ipv4.

References delegpt_ns::got6, delegpt_ns::next, delegpt::nslist, and delegpt_ns::resolved.

Referenced by processQueryTargets().

## ◆ delegpt_create_mlc()

struct delegpt * delegpt_create_mlc | ( | uint8_t * | name | ) |

create malloced delegation point, with the given name

Parameters

  name | uncompressed wireformat of delegpt name.

Returns
  NULL on alloc failure

References dname_count_size_labels(), delegpt::dp_type_mlc, memdup(), delegpt::name, delegpt::namelabs, and delegpt::namelen.

Referenced by compile_time_root_prime(), parse_delegpt(), read_fwds_name(), read_root_hints(), and read_stubs_name().

## ◆ delegpt_free_mlc()

void delegpt_free_mlc | ( | struct delegpt * | dp | ) |

free malloced delegation point.

Parameters

  dp | must have been created with delegpt_create_mlc, free'd.

References delegpt::dp_type_mlc, log_assert, delegpt::name, delegpt_ns::name, delegpt_ns::next, delegpt_addr::next_target, delegpt::nslist, delegpt::target_list, delegpt_ns::tls_auth_name, and delegpt_addr::tls_auth_name.

Referenced by compile_time_root_prime(), do_forward_add(), do_stub_add(), forwards_insert_data(), hints_insert(), parse_delegpt(), read_forwards(), read_root_hints(), and read_stubs().

## ◆ delegpt_set_name_mlc()

int delegpt_set_name_mlc | ( | struct delegpt * | dp,
|  | uint8_t * | name
| ) |  |

Set name of delegation point.

Parameters

  dp | delegation point. malloced.
  name | name to use.

Returns
  false on error.

References dname_count_size_labels(), delegpt::dp_type_mlc, log_assert, memdup(), delegpt::name, delegpt::namelabs, and delegpt::namelen.

Referenced by read_root_hints().

## ◆ delegpt_add_ns_mlc()

int delegpt_add_ns_mlc | ( | struct delegpt * | dp,
|  | uint8_t * | name,
|  | uint8_t | lame,
|  | char * | tls_auth_name,
|  | int | port
| ) |  |

add a name to malloced delegation point.

Parameters

  dp | must have been created with delegpt_create_mlc.
  name | the name to add.
  lame | the name is lame, disprefer.
  tls_auth_name | TLS authentication name (or NULL).
  port | port to use for resolved addresses.

Returns
  false on error.

References delegpt_ns::cache_lookup_count, delegpt_find_ns(), dname_count_size_labels(), delegpt_ns::done_pside4, delegpt_ns::done_pside6, delegpt::dp_type_mlc, delegpt_ns::got4, delegpt_ns::got6, delegpt_ns::lame, log_assert, memdup(), delegpt_ns::name, delegpt_ns::namelen, delegpt_ns::next, delegpt::nslist, delegpt_ns::port, delegpt_ns::resolved, and delegpt_ns::tls_auth_name.

Referenced by ah(), parse_delegpt(), read_fwds_host(), read_root_hints(), and read_stubs_host().

## ◆ delegpt_add_addr_mlc()

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 | port
| ) |  |

add an address to a malloced delegation point.

Parameters

  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).
  port | the port to use; if -1 the port is taken from addr.

Returns
  false on error.

References delegpt_addr::addr, delegpt_addr::addrlen, delegpt_addr::attempts, delegpt_addr::bogus, delegpt_find_addr(), delegpt_addr::dnsseclame, delegpt::dp_type_mlc, delegpt_addr::lame, log_assert, delegpt_addr::next_result, delegpt_addr::next_target, delegpt_addr::next_usable, sockaddr_store_port(), delegpt::target_list, delegpt_addr::tls_auth_name, and delegpt::usable_list.

Referenced by delegpt_add_target_mlc(), parse_delegpt(), read_fwds_addr(), and read_stubs_addr().

## ◆ delegpt_add_target_mlc()

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.

Parameters

  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.

Returns
  false on error.

References addr_is_ip6(), delegpt_add_addr_mlc(), delegpt_find_ns(), delegpt_ns::done_pside4, delegpt_ns::done_pside6, delegpt::dp_type_mlc, delegpt_ns::got4, delegpt_ns::got6, delegpt_ns::lame, log_assert, delegpt_ns::name, delegpt_ns::namelen, delegpt_ns::port, delegpt_ns::resolved, and delegpt_ns::tls_auth_name.

Referenced by ah(), and read_root_hints().