2007-05-23 05:34:01 -04:00
|
|
|
/*
|
|
|
|
|
* iterator/iter_utils.h - iterative resolver module utility functions.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2007, NLnet Labs. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* This software is open source.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
|
|
|
|
*
|
|
|
|
|
* Redistributions of source code must retain the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
|
*
|
|
|
|
|
* Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* Neither the name of the NLNET LABS nor the names of its contributors may
|
|
|
|
|
* be used to endorse or promote products derived from this software without
|
|
|
|
|
* specific prior written permission.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
2014-02-07 08:28:39 -05:00
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
|
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
|
|
|
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2007-05-23 05:34:01 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \file
|
|
|
|
|
*
|
|
|
|
|
* This file contains functions to assist the iterator module.
|
|
|
|
|
* Configuration options. Forward zones.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef ITERATOR_ITER_UTILS_H
|
|
|
|
|
#define ITERATOR_ITER_UTILS_H
|
2007-10-23 04:30:21 -04:00
|
|
|
#include "iterator/iter_resptype.h"
|
2013-12-03 04:11:16 -05:00
|
|
|
struct sldns_buffer;
|
2007-05-23 05:34:01 -04:00
|
|
|
struct iter_env;
|
2009-12-15 04:10:04 -05:00
|
|
|
struct iter_hints;
|
|
|
|
|
struct iter_forwards;
|
2007-05-23 05:34:01 -04:00
|
|
|
struct config_file;
|
2007-05-31 08:51:36 -04:00
|
|
|
struct module_env;
|
|
|
|
|
struct delegpt_addr;
|
|
|
|
|
struct delegpt;
|
2007-10-18 16:31:43 -04:00
|
|
|
struct regional;
|
2007-06-01 08:05:48 -04:00
|
|
|
struct msg_parse;
|
2007-07-19 05:25:55 -04:00
|
|
|
struct ub_randstate;
|
2007-07-19 11:16:39 -04:00
|
|
|
struct query_info;
|
|
|
|
|
struct reply_info;
|
2007-07-26 05:29:21 -04:00
|
|
|
struct module_qstate;
|
2009-10-06 04:31:47 -04:00
|
|
|
struct sock_list;
|
2010-02-17 11:50:04 -05:00
|
|
|
struct ub_packed_rrset_key;
|
2021-02-15 08:40:48 -05:00
|
|
|
struct module_stack;
|
|
|
|
|
struct outside_network;
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
struct iter_nat64;
|
2007-05-23 05:34:01 -04:00
|
|
|
|
2022-09-21 05:10:38 -04:00
|
|
|
/* max number of lookups in the cache for target nameserver names.
|
|
|
|
|
* This stops, for large delegations, N*N lookups in the cache. */
|
|
|
|
|
#define ITERATOR_NAME_CACHELOOKUP_MAX 3
|
|
|
|
|
/* max number of lookups in the cache for parentside glue for nameserver names
|
|
|
|
|
* This stops, for larger delegations, N*N lookups in the cache.
|
|
|
|
|
* It is a little larger than the nonpside max, so it allows a couple extra
|
|
|
|
|
* lookups of parent side glue. */
|
|
|
|
|
#define ITERATOR_NAME_CACHELOOKUP_MAX_PSIDE 5
|
|
|
|
|
|
2007-05-23 05:34:01 -04:00
|
|
|
/**
|
|
|
|
|
* Process config options and set iterator module state.
|
|
|
|
|
* Sets default values if no config is found.
|
|
|
|
|
* @param iter_env: iterator module state.
|
|
|
|
|
* @param cfg: config options.
|
|
|
|
|
* @return 0 on error.
|
|
|
|
|
*/
|
|
|
|
|
int iter_apply_cfg(struct iter_env* iter_env, struct config_file* cfg);
|
|
|
|
|
|
2007-05-31 08:51:36 -04:00
|
|
|
/**
|
|
|
|
|
* Select a valid, nice target to send query to.
|
|
|
|
|
* Sorting and removing unsuitable targets is combined.
|
2025-11-01 10:10:27 -04:00
|
|
|
* Adds records to the infra cache if not already there.
|
2007-05-31 08:51:36 -04:00
|
|
|
*
|
|
|
|
|
* @param iter_env: iterator module global state, with ip6 enabled and
|
|
|
|
|
* do-not-query-addresses.
|
|
|
|
|
* @param env: environment with infra cache (lameness, rtt info).
|
|
|
|
|
* @param dp: delegation point with result list.
|
|
|
|
|
* @param name: zone name (for lameness check).
|
|
|
|
|
* @param namelen: length of name.
|
2008-06-25 05:39:57 -04:00
|
|
|
* @param qtype: query type that we want to send.
|
2010-05-04 04:39:04 -04:00
|
|
|
* @param dnssec_lame: set to 1, if a known dnssec-lame server is selected
|
2007-10-23 08:37:18 -04:00
|
|
|
* these are not preferred, but are used as a last resort.
|
2008-10-13 05:11:42 -04:00
|
|
|
* @param chase_to_rd: set to 1 if a known recursion lame server is selected
|
|
|
|
|
* these are not preferred, but are used as a last resort.
|
2009-07-21 09:52:39 -04:00
|
|
|
* @param open_target: number of currently outstanding target queries.
|
|
|
|
|
* If we wait for these, perhaps more server addresses become available.
|
2009-10-06 04:31:47 -04:00
|
|
|
* @param blacklist: the IP blacklist to use.
|
2018-04-09 09:27:28 -04:00
|
|
|
* @param prefetch: if not 0, prefetch is in use for this query.
|
|
|
|
|
* This means the query can have different timing, because prefetch is
|
|
|
|
|
* not waited upon by the downstream client, and thus a good time to
|
|
|
|
|
* perform exploration of other targets.
|
2007-05-31 08:51:36 -04:00
|
|
|
* @return best target or NULL if no target.
|
|
|
|
|
* if not null, that target is removed from the result list in the dp.
|
|
|
|
|
*/
|
|
|
|
|
struct delegpt_addr* iter_server_selection(struct iter_env* iter_env,
|
|
|
|
|
struct module_env* env, struct delegpt* dp, uint8_t* name,
|
2010-05-04 04:39:04 -04:00
|
|
|
size_t namelen, uint16_t qtype, int* dnssec_lame,
|
2018-04-09 09:27:28 -04:00
|
|
|
int* chase_to_rd, int open_target, struct sock_list* blacklist,
|
|
|
|
|
time_t prefetch);
|
2007-05-31 08:51:36 -04:00
|
|
|
|
2007-06-01 08:05:48 -04:00
|
|
|
/**
|
2007-10-18 16:31:43 -04:00
|
|
|
* Allocate dns_msg from parsed msg, in regional.
|
2007-06-01 08:52:07 -04:00
|
|
|
* @param pkt: packet.
|
2007-10-18 16:31:43 -04:00
|
|
|
* @param msg: parsed message (cleaned and ready for regional allocation).
|
|
|
|
|
* @param regional: regional to use for allocation.
|
2007-06-01 08:05:48 -04:00
|
|
|
* @return newly allocated dns_msg, or NULL on memory error.
|
|
|
|
|
*/
|
2013-12-03 04:11:16 -05:00
|
|
|
struct dns_msg* dns_alloc_msg(struct sldns_buffer* pkt, struct msg_parse* msg,
|
2007-10-18 16:31:43 -04:00
|
|
|
struct regional* regional);
|
2007-06-01 08:05:48 -04:00
|
|
|
|
2007-06-04 08:22:38 -04:00
|
|
|
/**
|
2007-10-18 16:31:43 -04:00
|
|
|
* Copy a dns_msg to this regional.
|
|
|
|
|
* @param from: dns message, also in regional.
|
|
|
|
|
* @param regional: regional to use for allocation.
|
2007-06-04 08:22:38 -04:00
|
|
|
* @return newly allocated dns_msg, or NULL on memory error.
|
|
|
|
|
*/
|
2007-10-18 16:31:43 -04:00
|
|
|
struct dns_msg* dns_copy_msg(struct dns_msg* from, struct regional* regional);
|
2007-06-04 08:22:38 -04:00
|
|
|
|
2007-06-01 16:24:33 -04:00
|
|
|
/**
|
|
|
|
|
* Allocate a dns_msg with malloc/alloc structure and store in dns cache.
|
|
|
|
|
* @param env: environment, with alloc structure and dns cache.
|
2007-07-19 11:16:39 -04:00
|
|
|
* @param qinf: query info, the query for which answer is stored.
|
|
|
|
|
* @param rep: reply in dns_msg from dns_alloc_msg for example.
|
2007-06-01 16:24:33 -04:00
|
|
|
* @param is_referral: If true, then the given message to be stored is a
|
|
|
|
|
* referral. The cache implementation may use this as a hint.
|
2010-01-08 10:59:36 -05:00
|
|
|
* @param leeway: prefetch TTL leeway to expire old rrsets quicker.
|
2012-02-16 06:04:53 -05:00
|
|
|
* @param pside: true if dp is parentside, thus message is 'fresh' and NS
|
|
|
|
|
* can be prefetch-updates.
|
2012-01-10 04:42:32 -05:00
|
|
|
* @param region: to copy modified (cache is better) rrs back to.
|
2014-11-18 10:15:57 -05:00
|
|
|
* @param flags: with BIT_CD for dns64 AAAA translated queries.
|
2022-08-01 07:24:40 -04:00
|
|
|
* @param qstarttime: time of query start.
|
2024-11-05 04:39:27 -05:00
|
|
|
* @param is_valrec: if the query is validation recursion and does not get
|
2021-02-18 05:39:06 -05:00
|
|
|
* return void, because we are not interested in alloc errors,
|
2012-06-28 10:18:41 -04:00
|
|
|
* the iterator and validator can operate on the results in their
|
|
|
|
|
* scratch space (the qstate.region) and are not dependent on the cache.
|
|
|
|
|
* It is useful to log the alloc failure (for the server operator),
|
|
|
|
|
* but the query resolution can continue without cache storage.
|
2007-06-01 16:24:33 -04:00
|
|
|
*/
|
2012-06-28 10:18:41 -04:00
|
|
|
void iter_dns_store(struct module_env* env, struct query_info* qinf,
|
2013-08-20 08:23:42 -04:00
|
|
|
struct reply_info* rep, int is_referral, time_t leeway, int pside,
|
2024-11-05 04:39:27 -05:00
|
|
|
struct regional* region, uint16_t flags, time_t qstarttime,
|
|
|
|
|
int is_valrec);
|
2007-06-01 16:24:33 -04:00
|
|
|
|
2007-07-19 05:25:55 -04:00
|
|
|
/**
|
|
|
|
|
* Select randomly with n/m probability.
|
|
|
|
|
* For shuffle NS records for address fetching.
|
|
|
|
|
* @param rnd: random table
|
|
|
|
|
* @param n: probability.
|
|
|
|
|
* @param m: divisor for probability.
|
|
|
|
|
* @return true with n/m probability.
|
|
|
|
|
*/
|
|
|
|
|
int iter_ns_probability(struct ub_randstate* rnd, int n, int m);
|
|
|
|
|
|
2007-07-26 05:29:21 -04:00
|
|
|
/**
|
|
|
|
|
* Mark targets that result in a dependency cycle as done, so they
|
|
|
|
|
* will not get selected as targets.
|
|
|
|
|
* @param qstate: query state.
|
|
|
|
|
* @param dp: delegpt to mark ns in.
|
|
|
|
|
*/
|
|
|
|
|
void iter_mark_cycle_targets(struct module_qstate* qstate, struct delegpt* dp);
|
|
|
|
|
|
2009-09-17 10:36:06 -04:00
|
|
|
/**
|
2010-05-28 10:15:29 -04:00
|
|
|
* Mark targets that result in a dependency cycle as done, so they
|
|
|
|
|
* will not get selected as targets. For the parent-side lookups.
|
|
|
|
|
* @param qstate: query state.
|
|
|
|
|
* @param dp: delegpt to mark ns in.
|
2009-09-17 10:36:06 -04:00
|
|
|
*/
|
2010-05-28 10:15:29 -04:00
|
|
|
void iter_mark_pside_cycle_targets(struct module_qstate* qstate,
|
|
|
|
|
struct delegpt* dp);
|
2009-09-17 10:36:06 -04:00
|
|
|
|
2007-09-19 08:17:42 -04:00
|
|
|
/**
|
|
|
|
|
* See if delegation is useful or offers immediately no targets for
|
|
|
|
|
* further recursion.
|
2008-09-23 06:55:36 -04:00
|
|
|
* @param qinfo: query name and type
|
|
|
|
|
* @param qflags: query flags with RD flag
|
2007-09-19 08:17:42 -04:00
|
|
|
* @param dp: delegpt to check.
|
2022-02-25 04:27:56 -05:00
|
|
|
* @param supports_ipv4: if we support ipv4 for lookups to the target.
|
|
|
|
|
* if not, then the IPv4 addresses are useless.
|
|
|
|
|
* @param supports_ipv6: if we support ipv6 for lookups to the target.
|
|
|
|
|
* if not, then the IPv6 addresses are useless.
|
2023-05-01 12:23:13 -04:00
|
|
|
* @param use_nat64: if we support NAT64 for lookups to the target.
|
|
|
|
|
* if yes, IPv4 addresses are useful even if we don't support IPv4.
|
2010-08-13 04:41:49 -04:00
|
|
|
* @return true if dp is useless.
|
2007-09-19 08:17:42 -04:00
|
|
|
*/
|
2023-05-01 12:23:13 -04:00
|
|
|
int iter_dp_is_useless(struct query_info* qinfo, uint16_t qflags,
|
2022-07-23 14:26:20 -04:00
|
|
|
struct delegpt* dp, int supports_ipv4, int supports_ipv6,
|
|
|
|
|
int use_nat64);
|
2007-09-19 08:17:42 -04:00
|
|
|
|
2016-03-17 10:01:59 -04:00
|
|
|
/**
|
2018-03-21 10:34:17 -04:00
|
|
|
* See if qname has DNSSEC needs. This is true if there is a trust anchor above
|
|
|
|
|
* it. Whether there is an insecure delegation to the data is unknown.
|
2016-03-17 10:01:59 -04:00
|
|
|
* @param env: environment with anchors.
|
|
|
|
|
* @param qinfo: query name and class.
|
|
|
|
|
* @return true if trust anchor above qname, false if no anchor or insecure
|
|
|
|
|
* point above qname.
|
|
|
|
|
*/
|
2018-03-21 10:34:17 -04:00
|
|
|
int iter_qname_indicates_dnssec(struct module_env* env,
|
2016-03-17 10:01:59 -04:00
|
|
|
struct query_info *qinfo);
|
|
|
|
|
|
2007-10-22 11:25:37 -04:00
|
|
|
/**
|
|
|
|
|
* See if delegation is expected to have DNSSEC information (RRSIGs) in
|
|
|
|
|
* its answers, or not. Inspects delegation point (name), trust anchors,
|
|
|
|
|
* and delegation message (DS RRset) to determine this.
|
|
|
|
|
* @param env: module env with trust anchors.
|
|
|
|
|
* @param dp: delegation point.
|
|
|
|
|
* @param msg: delegation message, with DS if a secure referral.
|
2007-10-23 04:30:21 -04:00
|
|
|
* @param dclass: class of query.
|
2017-11-14 05:01:44 -05:00
|
|
|
* @return 1 if dnssec is expected, 0 if not or insecure point above qname.
|
2007-10-22 11:25:37 -04:00
|
|
|
*/
|
|
|
|
|
int iter_indicates_dnssec(struct module_env* env, struct delegpt* dp,
|
2011-09-12 07:28:14 -04:00
|
|
|
struct dns_msg* msg, uint16_t dclass);
|
2007-10-22 11:25:37 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See if a message contains DNSSEC.
|
|
|
|
|
* This is examined by looking for RRSIGs. With DNSSEC a valid answer,
|
|
|
|
|
* nxdomain, nodata, referral or cname reply has RRSIGs in answer or auth
|
|
|
|
|
* sections, sigs on answer data, SOA, DS, or NSEC/NSEC3 records.
|
|
|
|
|
* @param msg: message to examine.
|
|
|
|
|
* @return true if DNSSEC information was found.
|
|
|
|
|
*/
|
|
|
|
|
int iter_msg_has_dnssec(struct dns_msg* msg);
|
|
|
|
|
|
2007-10-23 04:30:21 -04:00
|
|
|
/**
|
|
|
|
|
* See if a message is known to be from a certain zone.
|
|
|
|
|
* This looks for SOA or NS rrsets, for answers.
|
|
|
|
|
* For referrals, when one label is delegated, the zone is detected.
|
|
|
|
|
* Does not look at signatures.
|
|
|
|
|
* @param msg: the message to inspect.
|
|
|
|
|
* @param dp: delegation point with zone name to look for.
|
|
|
|
|
* @param type: type of message.
|
|
|
|
|
* @param dclass: class of query.
|
|
|
|
|
* @return true if message is certain to be from zone in dp->name.
|
|
|
|
|
* false if not sure (empty msg), or not from the zone.
|
|
|
|
|
*/
|
|
|
|
|
int iter_msg_from_zone(struct dns_msg* msg, struct delegpt* dp,
|
|
|
|
|
enum response_type type, uint16_t dclass);
|
|
|
|
|
|
2008-10-06 10:46:22 -04:00
|
|
|
/**
|
|
|
|
|
* Check if two replies are equal
|
|
|
|
|
* For fallback procedures
|
|
|
|
|
* @param p: reply one. The reply has rrset data pointers in region.
|
|
|
|
|
* Does not check rrset-IDs
|
|
|
|
|
* @param q: reply two
|
2013-10-31 11:09:26 -04:00
|
|
|
* @param region: scratch buffer.
|
2008-10-06 10:46:22 -04:00
|
|
|
* @return if one and two are equal.
|
|
|
|
|
*/
|
2013-10-31 11:09:26 -04:00
|
|
|
int reply_equal(struct reply_info* p, struct reply_info* q, struct regional* region);
|
2008-10-06 10:46:22 -04:00
|
|
|
|
2015-01-30 04:35:38 -05:00
|
|
|
/**
|
|
|
|
|
* Remove unused bits from the reply if possible.
|
|
|
|
|
* So that caps-for-id (0x20) fallback is more likely to be successful.
|
|
|
|
|
* This removes like, the additional section, and NS record in the authority
|
|
|
|
|
* section if those records are gratuitous (not for a referral).
|
|
|
|
|
* @param rep: the reply to strip stuff out of.
|
|
|
|
|
*/
|
|
|
|
|
void caps_strip_reply(struct reply_info* rep);
|
|
|
|
|
|
2015-03-04 03:30:17 -05:00
|
|
|
/**
|
|
|
|
|
* see if reply has a 'useful' rcode for capsforid comparison, so
|
|
|
|
|
* not SERVFAIL or REFUSED, and thus NOERROR or NXDOMAIN.
|
|
|
|
|
* @param rep: reply to check.
|
|
|
|
|
* @return true if the rcode is a bad type of message.
|
|
|
|
|
*/
|
|
|
|
|
int caps_failed_rcode(struct reply_info* rep);
|
|
|
|
|
|
2009-12-08 08:37:59 -05:00
|
|
|
/**
|
2017-09-15 10:29:28 -04:00
|
|
|
* Store parent-side rrset in separate rrset cache entries for later
|
2010-05-28 10:15:29 -04:00
|
|
|
* last-resort * lookups in case the child-side versions of this information
|
|
|
|
|
* fails.
|
2009-12-08 08:37:59 -05:00
|
|
|
* @param env: environment with cache, time, ...
|
2010-05-28 10:15:29 -04:00
|
|
|
* @param rrset: the rrset to store (copied).
|
|
|
|
|
* Failure to store is logged, but otherwise ignored.
|
2009-12-08 08:37:59 -05:00
|
|
|
*/
|
2010-05-28 10:15:29 -04:00
|
|
|
void iter_store_parentside_rrset(struct module_env* env,
|
|
|
|
|
struct ub_packed_rrset_key* rrset);
|
2009-12-08 08:37:59 -05:00
|
|
|
|
|
|
|
|
/**
|
2010-05-28 10:15:29 -04:00
|
|
|
* Store parent-side NS records from a referral message
|
|
|
|
|
* @param env: environment with cache, time, ...
|
|
|
|
|
* @param rep: response with NS rrset.
|
|
|
|
|
* Failure to store is logged, but otherwise ignored.
|
|
|
|
|
*/
|
|
|
|
|
void iter_store_parentside_NS(struct module_env* env, struct reply_info* rep);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Store parent-side negative element, the parentside rrset does not exist,
|
|
|
|
|
* creates an rrset with empty rdata in the rrset cache with PARENTSIDE flag.
|
|
|
|
|
* @param env: environment with cache, time, ...
|
|
|
|
|
* @param qinfo: the identity of the rrset that is missing.
|
|
|
|
|
* @param rep: delegation response or answer response, to glean TTL from.
|
|
|
|
|
* (malloc) failure is logged but otherwise ignored.
|
|
|
|
|
*/
|
|
|
|
|
void iter_store_parentside_neg(struct module_env* env,
|
|
|
|
|
struct query_info* qinfo, struct reply_info* rep);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add parent NS record if that exists in the cache. This is both new
|
|
|
|
|
* information and acts like a timeout throttle on retries.
|
2009-12-08 08:37:59 -05:00
|
|
|
* @param env: query env with rrset cache and time.
|
2010-05-28 10:15:29 -04:00
|
|
|
* @param dp: delegation point to store result in. Also this dp is used to
|
|
|
|
|
* see which NS name is needed.
|
2009-12-08 08:37:59 -05:00
|
|
|
* @param region: region to alloc result in.
|
2010-05-28 10:15:29 -04:00
|
|
|
* @param qinfo: pertinent information, the qclass.
|
2009-12-08 08:37:59 -05:00
|
|
|
* @return false on malloc failure.
|
2010-05-28 10:15:29 -04:00
|
|
|
* if true, the routine worked and if such cached information
|
|
|
|
|
* existed dp->has_parent_side_NS is set true.
|
|
|
|
|
*/
|
|
|
|
|
int iter_lookup_parent_NS_from_cache(struct module_env* env,
|
|
|
|
|
struct delegpt* dp, struct regional* region, struct query_info* qinfo);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add parent-side glue if that exists in the cache. This is both new
|
|
|
|
|
* information and acts like a timeout throttle on retries to fetch them.
|
|
|
|
|
* @param env: query env with rrset cache and time.
|
|
|
|
|
* @param dp: delegation point to store result in. Also this dp is used to
|
|
|
|
|
* see which NS name is needed.
|
|
|
|
|
* @param region: region to alloc result in.
|
|
|
|
|
* @param qinfo: pertinent information, the qclass.
|
|
|
|
|
* @return: true, it worked, no malloc failures, and new addresses (lame)
|
|
|
|
|
* have been added, giving extra options as query targets.
|
2009-12-08 08:37:59 -05:00
|
|
|
*/
|
2010-05-28 10:15:29 -04:00
|
|
|
int iter_lookup_parent_glue_from_cache(struct module_env* env,
|
|
|
|
|
struct delegpt* dp, struct regional* region, struct query_info* qinfo);
|
2009-12-08 08:37:59 -05:00
|
|
|
|
2009-12-15 04:10:04 -05:00
|
|
|
/**
|
|
|
|
|
* Lookup next root-hint or root-forward entry.
|
|
|
|
|
* @param hints: the hints.
|
|
|
|
|
* @param fwd: the forwards.
|
|
|
|
|
* @param c: the class to start searching at. 0 means find first one.
|
|
|
|
|
* @return false if no classes found, true if found and returned in c.
|
|
|
|
|
*/
|
|
|
|
|
int iter_get_next_root(struct iter_hints* hints, struct iter_forwards* fwd,
|
|
|
|
|
uint16_t* c);
|
|
|
|
|
|
2010-02-17 11:50:04 -05:00
|
|
|
/**
|
|
|
|
|
* Remove DS records that are inappropriate before they are cached.
|
|
|
|
|
* @param msg: the response to scrub.
|
2010-02-18 04:47:08 -05:00
|
|
|
* @param ns: RRSET that is the NS record for the referral.
|
|
|
|
|
* if NULL, then all DS records are removed from the authority section.
|
|
|
|
|
* @param z: zone name that the response is from.
|
2010-02-17 11:50:04 -05:00
|
|
|
*/
|
2010-02-18 04:47:08 -05:00
|
|
|
void iter_scrub_ds(struct dns_msg* msg, struct ub_packed_rrset_key* ns,
|
|
|
|
|
uint8_t* z);
|
2010-02-17 11:50:04 -05:00
|
|
|
|
2019-04-18 11:09:15 -04:00
|
|
|
/**
|
|
|
|
|
* Prepare an NXDOMAIN message to be used for a subdomain answer by removing all
|
|
|
|
|
* RRs from the ANSWER section.
|
|
|
|
|
* @param msg: the response to scrub.
|
|
|
|
|
*/
|
|
|
|
|
void iter_scrub_nxdomain(struct dns_msg* msg);
|
|
|
|
|
|
2010-04-26 10:59:44 -04:00
|
|
|
/**
|
|
|
|
|
* Remove query attempts from all available ips. For 0x20.
|
|
|
|
|
* @param dp: delegpt.
|
|
|
|
|
* @param d: decrease.
|
2019-06-12 12:51:26 -04:00
|
|
|
* @param outbound_msg_retry: number of retries of outgoing queries
|
2010-04-26 10:59:44 -04:00
|
|
|
*/
|
2021-09-08 09:07:11 -04:00
|
|
|
void iter_dec_attempts(struct delegpt* dp, int d, int outbound_msg_retry);
|
2010-04-26 10:59:44 -04:00
|
|
|
|
2010-06-11 10:09:56 -04:00
|
|
|
/**
|
|
|
|
|
* Add retry counts from older delegpt to newer delegpt.
|
|
|
|
|
* Does not waste time on timeout'd (or other failing) addresses.
|
|
|
|
|
* @param dp: new delegationpoint.
|
|
|
|
|
* @param old: old delegationpoint.
|
2019-06-12 12:51:26 -04:00
|
|
|
* @param outbound_msg_retry: number of retries of outgoing queries
|
2010-06-11 10:09:56 -04:00
|
|
|
*/
|
2019-06-12 12:51:26 -04:00
|
|
|
void iter_merge_retry_counts(struct delegpt* dp, struct delegpt* old,
|
2021-09-08 09:07:11 -04:00
|
|
|
int outbound_msg_retry);
|
2010-06-11 10:09:56 -04:00
|
|
|
|
2012-03-19 11:44:21 -04:00
|
|
|
/**
|
|
|
|
|
* See if a DS response (type ANSWER) is too low: a nodata answer with
|
|
|
|
|
* a SOA record in the authority section at-or-below the qchase.qname.
|
2012-03-21 11:01:01 -04:00
|
|
|
* Also returns true if we are not sure (i.e. empty message, CNAME nosig).
|
2012-03-19 11:44:21 -04:00
|
|
|
* @param msg: the response.
|
2012-03-21 11:01:01 -04:00
|
|
|
* @param dp: the dp name is used to check if the RRSIG gives a clue that
|
|
|
|
|
* it was originated from the correct nameserver.
|
2012-03-19 11:44:21 -04:00
|
|
|
* @return true if too low.
|
|
|
|
|
*/
|
2012-03-21 11:01:01 -04:00
|
|
|
int iter_ds_toolow(struct dns_msg* msg, struct delegpt* dp);
|
2012-03-19 11:44:21 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See if delegpt can go down a step to the qname or not
|
|
|
|
|
* @param qinfo: the query name looked up.
|
|
|
|
|
* @param dp: checked if the name can go lower to the qname
|
|
|
|
|
* @return true if can go down, false if that would not be possible.
|
|
|
|
|
* the current response seems to be the one and only, best possible, response.
|
|
|
|
|
*/
|
|
|
|
|
int iter_dp_cangodown(struct query_info* qinfo, struct delegpt* dp);
|
|
|
|
|
|
2018-11-27 05:29:14 -05:00
|
|
|
/**
|
|
|
|
|
* Lookup if no_cache is set in stub or fwd.
|
|
|
|
|
* @param qstate: query state with env with hints and fwds.
|
|
|
|
|
* @param qinf: query name to lookup for.
|
2021-04-13 07:52:57 -04:00
|
|
|
* @param retdpname: returns NULL or the deepest enclosing name of fwd or stub.
|
|
|
|
|
* This is the name under which the closest lookup is going to happen.
|
|
|
|
|
* Used for NXDOMAIN checks, above that it is an nxdomain from a
|
|
|
|
|
* different server and zone. You can pass NULL to not get it.
|
|
|
|
|
* @param retdpnamelen: returns the length of the dpname.
|
2024-01-04 10:53:02 -05:00
|
|
|
* @param dpname_storage: this is where the dpname buf is stored, if any.
|
|
|
|
|
* So that caller can manage the buffer.
|
|
|
|
|
* @param dpname_storage_len: size of dpname_storage buffer.
|
2018-11-27 05:29:14 -05:00
|
|
|
* @return true if no_cache is set in stub or fwd.
|
|
|
|
|
*/
|
|
|
|
|
int iter_stub_fwd_no_cache(struct module_qstate *qstate,
|
2024-01-04 10:53:02 -05:00
|
|
|
struct query_info *qinf, uint8_t** retdpname, size_t* retdpnamelen,
|
|
|
|
|
uint8_t* dpname_storage, size_t dpname_storage_len);
|
2018-11-27 05:29:14 -05:00
|
|
|
|
2021-02-15 08:40:48 -05:00
|
|
|
/**
|
|
|
|
|
* Set support for IP4 and IP6 depending on outgoing interfaces
|
|
|
|
|
* in the outside network. If none, no support, so no use to lookup
|
|
|
|
|
* the AAAA and then attempt to use it if there is no outgoing-interface
|
|
|
|
|
* for it.
|
|
|
|
|
* @param mods: modstack to find iterator module in.
|
|
|
|
|
* @param env: module env, find iterator module (if one) in there.
|
|
|
|
|
* @param outnet: outside network structure.
|
|
|
|
|
*/
|
|
|
|
|
void iterator_set_ip46_support(struct module_stack* mods,
|
|
|
|
|
struct module_env* env, struct outside_network* outnet);
|
|
|
|
|
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
/**
|
|
|
|
|
* Read config string that represents the target fetch policy.
|
|
|
|
|
* @param target_fetch_policy: alloced on return.
|
|
|
|
|
* @param max_dependency_depth: set on return.
|
|
|
|
|
* @param str: the config string
|
|
|
|
|
* @return false on failure.
|
|
|
|
|
*/
|
|
|
|
|
int read_fetch_policy(int** target_fetch_policy, int* max_dependency_depth,
|
|
|
|
|
const char* str);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create caps exempt data structure.
|
|
|
|
|
* @return NULL on failure.
|
|
|
|
|
*/
|
|
|
|
|
struct rbtree_type* caps_white_create(void);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete caps exempt data structure.
|
|
|
|
|
* @param caps_white: caps exempt tree.
|
|
|
|
|
*/
|
|
|
|
|
void caps_white_delete(struct rbtree_type* caps_white);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Apply config caps whitelist items to name tree
|
|
|
|
|
* @param ntree: caps exempt tree.
|
|
|
|
|
* @param cfg: config with options.
|
|
|
|
|
*/
|
|
|
|
|
int caps_white_apply_cfg(struct rbtree_type* ntree, struct config_file* cfg);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Apply config for nat64
|
|
|
|
|
* @param nat64: the nat64 state.
|
|
|
|
|
* @param cfg: config with options.
|
|
|
|
|
* @return false on failure.
|
|
|
|
|
*/
|
|
|
|
|
int nat64_apply_cfg(struct iter_nat64* nat64, struct config_file* cfg);
|
|
|
|
|
|
2024-10-09 09:28:55 -04:00
|
|
|
/**
|
|
|
|
|
* Limit NSEC and NSEC3 TTL in response, RFC9077
|
|
|
|
|
* @param msg: dns message, the SOA record ttl is used to restrict ttls
|
|
|
|
|
* of NSEC and NSEC3 RRsets. If no SOA record, nothing happens.
|
|
|
|
|
*/
|
|
|
|
|
void limit_nsec_ttl(struct dns_msg* msg);
|
|
|
|
|
|
2024-11-05 04:39:27 -05:00
|
|
|
/**
|
|
|
|
|
* Make the response minimal. Removed authority and additional section,
|
|
|
|
|
* that works when there is an answer in the answer section.
|
|
|
|
|
* @param rep: reply to modify.
|
|
|
|
|
*/
|
|
|
|
|
void iter_make_minimal(struct reply_info* rep);
|
|
|
|
|
|
2007-05-23 05:34:01 -04:00
|
|
|
#endif /* ITERATOR_ITER_UTILS_H */
|