unbound 0.1
remote.c File Reference

This file contains the remote control functionality for the daemon. More...

#include "config.h"
#include <ctype.h>
#include "daemon/remote.h"
#include "daemon/worker.h"
#include "daemon/daemon.h"
#include "daemon/stats.h"
#include "daemon/cachedump.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/net_help.h"
#include "util/module.h"
#include "util/ub_event.h"
#include "services/listen_dnsport.h"
#include "services/cache/rrset.h"
#include "services/cache/infra.h"
#include "services/mesh.h"
#include "services/localzone.h"
#include "services/authzone.h"
#include "services/rpz.h"
#include "util/storage/slabhash.h"
#include "util/fptr_wlist.h"
#include "util/data/dname.h"
#include "validator/validator.h"
#include "validator/val_kcache.h"
#include "validator/val_kentry.h"
#include "validator/val_anchor.h"
#include "validator/val_neg.h"
#include "iterator/iterator.h"
#include "iterator/iter_fwd.h"
#include "iterator/iter_hints.h"
#include "iterator/iter_delegpt.h"
#include "iterator/iter_utils.h"
#include "iterator/iter_donotq.h"
#include "iterator/iter_priv.h"
#include "services/outbound_list.h"
#include "services/outside_network.h"
#include "sldns/str2wire.h"
#include "sldns/parseutil.h"
#include "sldns/wire2str.h"
#include "sldns/sbuffer.h"
#include "util/timeval_func.h"
#include "util/tcp_conn_limit.h"
#include "util/edns.h"

Data Structures

struct  cache_lookup_info
 information for the domain search More...
struct  del_info
 Local info for deletion functions. More...
struct  infra_arg
 structure for argument data for dump infra host More...
struct  ratelimit_list_arg
 struct for user arg ratelimit list More...
struct  fast_reload_construct
 Structure with constructed elements for use during fast reload. More...

Macros

#define SQ   "="
 what to put on statistics lines between var and value, ": " or "="
#define MAX_CMD_STRLINE   1024
 Acceptable lengths of str lines.
#define MAX_STDIN_STRLINE   2048
#define IPC_LOOP_MAX   200
 What number of loop iterations is too much for ipc retries.
#define IPC_NOTIFICATION_WAIT   200
 Timeout in msec for ipc socket poll.
#define ip_ratelimit_list_arg   ratelimit_list_arg
#define FR_CHECK_CHANGED_CFG(desc, var, str)
 fast reload thread, check if config item has changed; thus incompatible
#define FR_CHECK_CHANGED_CFG_STR(desc, var, str)
 fast reload thread, check if config string has changed, checks NULLs.
#define FR_CHECK_CHANGED_CFG_STRLIST(desc, var, str)
 fast reload thread, check if config strlist has changed.
#define FR_CHECK_CHANGED_CFG_STR2LIST(desc, var, buff)
 fast reload thread, check if config str2list has changed.
#define FR_CHECK_CHANGED_CFG_STR3LIST(desc, var, buff)
 fast reload thread, check if config str3list has changed.

Functions

static void fr_printq_delete (struct fast_reload_printq *printq)
 fast reload printq delete
static void fr_main_perform_printout (struct fast_reload_thread *fr)
 Fast reload, the remote control thread handles that the fast reload thread has output to be printed, on the linked list that is locked.
static int fr_printq_empty (struct fast_reload_printq *printq)
 fast reload printq, returns true if the list is empty and no item
static void fr_printq_list_insert (struct fast_reload_printq *printq, struct daemon *daemon)
 fast reload printq, insert onto list
static void fr_printq_remove (struct fast_reload_printq *printq)
 fast reload printq, remove the printq when no longer needed, like the stream is closed.
static void fr_check_cmd_from_thread (struct fast_reload_thread *fr)
 Fast reload, poll for and handle cmd from fast reload thread.
static int remote_setup_ctx (struct daemon_remote *rc, struct config_file *cfg)
struct daemon_remote * daemon_remote_create (struct config_file *cfg)
 Create new remote control state for the daemon.
void daemon_remote_clear (struct daemon_remote *rc)
 remote control state to clear up.
void daemon_remote_delete (struct daemon_remote *rc)
 remote control state to delete.
static int add_open (const char *ip, int nr, struct listen_port **list, int noproto_is_err, struct config_file *cfg)
 Add and open a new control port.
struct listen_port * daemon_remote_open_ports (struct config_file *cfg)
 Open and create listening ports for remote control.
static int accept_open (struct daemon_remote *rc, int fd)
 open accept commpoint
int daemon_remote_open_accept (struct daemon_remote *rc, struct listen_port *ports, struct worker *worker)
 Setup comm points for accepting remote control connections.
void daemon_remote_stop_accept (struct daemon_remote *rc)
 Stop accept handlers for TCP (until enabled again).
void daemon_remote_start_accept (struct daemon_remote *rc)
 Stop accept handlers for TCP (until enabled again).
int remote_accept_callback (struct comm_point *c, void *arg, int err, struct comm_reply *ATTR_UNUSED(rep))
static void state_list_remove_elem (struct rc_state **list, struct comm_point *c)
 delete from list
static void clean_point (struct daemon_remote *rc, struct rc_state *s)
 decrease active count and remove commpoint from busy list
int ssl_print_text (RES *res, const char *text)
static int ssl_print_vmsg (RES *ssl, const char *format, va_list args)
 print text over the ssl connection
int ssl_printf (RES *ssl, const char *format,...)
 printf style printing to the ssl connection
int ssl_read_line (RES *res, char *buf, size_t max)
static char * skipwhite (char *str)
 skip whitespace, return new pointer into string
static void send_ok (RES *ssl)
 send the OK to the control client
static void distribute_cmd (struct daemon_remote *rc, RES *ssl, char *cmd)
 tell other processes to execute the command
static void do_stop (RES *ssl, struct worker *worker)
 do the stop command
static void do_reload (RES *ssl, struct worker *worker, int reuse_cache)
 do the reload command
static int fr_parse_options (RES *ssl, char *arg, int *fr_verb, int *fr_nopause, int *fr_drop_mesh)
 parse fast reload command options.
static void do_fast_reload (RES *ssl, struct worker *worker, struct rc_state *s, char *arg)
 do the fast_reload command
static void do_verbosity (RES *ssl, char *str)
 do the verbosity command
static int print_stats (RES *ssl, const char *nm, struct ub_stats_info *s)
 print stats from statinfo
static int print_thread_stats (RES *ssl, int i, struct ub_stats_info *s)
 print stats for one thread
static int print_longnum (RES *ssl, const char *desc, size_t x)
 print long number
static int print_mem (RES *ssl, struct worker *worker, struct daemon *daemon, struct ub_stats_info *s)
 print mem stats
static int print_uptime (RES *ssl, struct worker *worker, int reset)
 print uptime stats
static int print_hist (RES *ssl, struct ub_stats_info *s)
 print extended histogram
static int print_ext (RES *ssl, struct ub_stats_info *s, int inhibit_zero)
 print extended stats
static void do_stats (RES *ssl, struct worker *worker, int reset)
 do the stats command
static int parse_arg_name (RES *ssl, char *str, uint8_t **res, size_t *len, int *labs)
 parse commandline argument domain name
static int find_arg2 (RES *ssl, char *arg, char **arg2)
 find second argument, modifies string
static int perform_zone_add (RES *ssl, struct local_zones *zones, char *arg)
 Add a new zone.
static void do_zone_add (RES *ssl, struct local_zones *zones, char *arg)
 Do the local_zone command.
static void do_zones_add (struct daemon_remote *rc, RES *ssl, struct worker *worker)
 Do the local_zones command.
static int perform_zone_remove (RES *ssl, struct local_zones *zones, char *arg)
 Remove a zone.
static void do_zone_remove (RES *ssl, struct local_zones *zones, char *arg)
 Do the local_zone_remove command.
static void do_zones_remove (struct daemon_remote *rc, RES *ssl, struct worker *worker)
 Do the local_zones_remove command.
static int check_RR_syntax (RES *ssl, char *str, int line)
 check syntax of newly added RR
static int perform_data_add (RES *ssl, struct local_zones *zones, char *arg, int line)
 Add new RR data.
static void do_data_add (RES *ssl, struct local_zones *zones, char *arg)
 Do the local_data command.
static void do_datas_add (struct daemon_remote *rc, RES *ssl, struct worker *worker)
 Do the local_datas command.
static int perform_data_remove_rr (RES *ssl, struct local_zones *local_zones, uint8_t *rr, size_t len, size_t dname_len, char *arg)
static int perform_data_remove (RES *ssl, struct local_zones *zones, char *arg)
 Remove RR data.
static void do_data_remove (RES *ssl, struct local_zones *zones, char *arg)
 Do the local_data_remove command.
static void do_datas_remove (struct daemon_remote *rc, RES *ssl, struct worker *worker)
 Do the local_datas_remove command.
static void do_view_zone_add (RES *ssl, struct worker *worker, char *arg)
 Add a new zone to view.
static void do_view_zone_remove (RES *ssl, struct worker *worker, char *arg)
 Remove a zone from view.
static void do_view_data_add (RES *ssl, struct worker *worker, char *arg)
 Add new RR data to view.
static void do_view_datas_add (struct daemon_remote *rc, RES *ssl, struct worker *worker, char *arg)
 Add new RR data from stdin to view.
static void do_view_data_remove (RES *ssl, struct worker *worker, char *arg)
 Remove RR data from view.
static void do_view_datas_remove (struct daemon_remote *rc, RES *ssl, struct worker *worker, char *arg)
 Remove RR data from stdin from view.
static void cache_lookup_rrset (struct lruhash_entry *e, void *arg)
static void cache_lookup_msg (struct lruhash_entry *e, void *arg)
static void do_cache_lookup_domain (RES *ssl, struct worker *worker, uint8_t *nm, size_t nmlen)
 perform cache search for domain
static void do_cache_lookup (RES *ssl, struct worker *worker, char *arg)
 cache lookup of domain
static void do_lookup (RES *ssl, struct worker *worker, char *arg)
 cache lookup of nameservers
static void do_cache_remove (struct worker *worker, uint8_t *nm, size_t nmlen, uint16_t t, uint16_t c, int remcachedb)
 flush something from rrset and msg caches
static int parse_remcachedb (RES *ssl, char **arg, int *pc)
 parse '+c' option, modifies string to return remainder.
static void do_flush_type (RES *ssl, struct worker *worker, char *arg)
 flush a type
static void do_flush_stats (RES *ssl, struct worker *worker)
 flush statistics
static void infra_del_host (struct lruhash_entry *e, void *arg)
 callback to delete hosts in infra cache
static void do_flush_infra (RES *ssl, struct worker *worker, char *arg)
 flush infra cache
static void do_flush_requestlist (RES *ssl, struct worker *worker)
 flush requestlist
static void zone_del_rrset (struct lruhash_entry *e, void *arg)
 callback to delete rrsets in a zone
static void zone_del_msg (struct lruhash_entry *e, void *arg)
 callback to delete messages in a zone
static void zone_del_kcache (struct lruhash_entry *e, void *arg)
 callback to delete keys in zone
static void do_flush_zone (RES *ssl, struct worker *worker, char *arg)
 remove all rrsets and keys from zone from cache
static void bogus_del_rrset (struct lruhash_entry *e, void *arg)
 callback to delete bogus rrsets
static void bogus_del_msg (struct lruhash_entry *e, void *arg)
 callback to delete bogus messages
static void bogus_del_kcache (struct lruhash_entry *e, void *arg)
 callback to delete bogus keys
static void do_flush_bogus (RES *ssl, struct worker *worker, char *arg)
 remove all bogus rrsets, msgs and keys from cache
static void negative_del_rrset (struct lruhash_entry *e, void *arg)
 callback to delete negative and servfail rrsets
static void negative_del_msg (struct lruhash_entry *e, void *arg)
 callback to delete negative and servfail messages
static void negative_del_kcache (struct lruhash_entry *e, void *arg)
 callback to delete negative key entries
static void do_flush_negative (RES *ssl, struct worker *worker, char *arg)
 remove all negative(NODATA,NXDOMAIN), and servfail messages from cache
static void do_flush_name (RES *ssl, struct worker *w, char *arg)
 remove name rrset from cache
static int ssl_print_name_dp (RES *ssl, const char *str, uint8_t *nm, uint16_t dclass, struct delegpt *dp)
 printout a delegation point info
static int print_root_fwds (RES *ssl, struct iter_forwards *fwds, uint8_t *root)
 print root forwards
static struct delegpt * parse_delegpt (RES *ssl, char *args, uint8_t *nm)
 parse args into delegpt
static void do_forward (RES *ssl, struct worker *worker, char *args)
 do the forward command
static int parse_fs_args (RES *ssl, char *args, uint8_t **nm, struct delegpt **dp, int *insecure, int *prime, int *tls)
static void do_forward_add (RES *ssl, struct worker *worker, char *args)
 do the forward_add command
static void do_forward_remove (RES *ssl, struct worker *worker, char *args)
 do the forward_remove command
static void do_stub_add (RES *ssl, struct worker *worker, char *args)
 do the stub_add command
static void do_stub_remove (RES *ssl, struct worker *worker, char *args)
 do the stub_remove command
static void do_insecure_add (RES *ssl, struct worker *worker, char *arg)
 do the insecure_add command
static void do_insecure_remove (RES *ssl, struct worker *worker, char *arg)
 do the insecure_remove command
static void do_insecure_list (RES *ssl, struct worker *worker)
static void do_status (RES *ssl, struct worker *worker)
 do the status command
static void get_mesh_age (struct mesh_state *m, char *buf, size_t len, struct module_env *env)
 get age for the mesh state
static void get_mesh_status (struct mesh_area *mesh, struct mesh_state *m, char *buf, size_t len)
 get status of a mesh state
static void do_dump_requestlist (RES *ssl, struct worker *worker)
 do the dump_requestlist command
static void dump_infra_host (struct lruhash_entry *e, void *arg)
 callback for every host element in the infra cache
static void do_dump_infra (RES *ssl, struct worker *worker)
 do the dump_infra command
static void do_log_reopen (RES *ssl, struct worker *worker)
 do the log_reopen command
static void do_auth_zone_reload (RES *ssl, struct worker *worker, char *arg)
 do the auth_zone_reload command
static void do_auth_zone_transfer (RES *ssl, struct worker *worker, char *arg)
 do the auth_zone_transfer command
static void do_set_option (RES *ssl, struct worker *worker, char *arg)
 do the set_option command
void remote_get_opt_ssl (char *line, void *arg)
 routine to printout option values over SSL
static void do_get_option (RES *ssl, struct worker *worker, char *arg)
 do the get_option command
static void do_list_forwards (RES *ssl, struct worker *worker)
 do the list_forwards command
static void do_list_stubs (RES *ssl, struct worker *worker)
 do the list_stubs command
static void do_list_auth_zones (RES *ssl, struct auth_zones *az)
 do the list_auth_zones command
static void do_list_local_zones (RES *ssl, struct local_zones *zones)
 do the list_local_zones command
static void do_list_local_data (RES *ssl, struct worker *worker, struct local_zones *zones)
 do the list_local_data command
static void do_view_list_local_zones (RES *ssl, struct worker *worker, char *arg)
 do the view_list_local_zones command
static void do_view_list_local_data (RES *ssl, struct worker *worker, char *arg)
 do the view_list_local_data command
static void rate_list (struct lruhash_entry *e, void *arg)
 list items in the ratelimit table
static void ip_rate_list (struct lruhash_entry *e, void *arg)
 list items in the ip_ratelimit table
static void do_ratelimit_list (RES *ssl, struct worker *worker, char *arg)
 do the ratelimit_list command
static void do_ip_ratelimit_list (RES *ssl, struct worker *worker, char *arg)
 do the ip_ratelimit_list command
static void do_rpz_enable_disable (RES *ssl, struct worker *worker, char *arg, int enable)
 do the rpz_enable/disable command
static void do_rpz_enable (RES *ssl, struct worker *worker, char *arg)
 do the rpz_enable command
static void do_rpz_disable (RES *ssl, struct worker *worker, char *arg)
 do the rpz_disable command
static int cookie_secret_file_dump (RES *ssl, struct worker *worker)
 Write the cookie secrets to file, returns 0 on failure.
static void do_activate_cookie_secret (RES *ssl, struct worker *worker)
 Activate cookie secret.
static void do_drop_cookie_secret (RES *ssl, struct worker *worker)
 Drop cookie secret.
static void do_add_cookie_secret (RES *ssl, struct worker *worker, char *arg)
 Add cookie secret.
static void do_print_cookie_secrets (RES *ssl, struct worker *worker)
 Print cookie secrets.
static int cmd_no_args (RES *ssl, char *cmd, char *p)
 check that there is no argument after a command that takes no arguments.
static int cmdcmp (char *p, const char *cmd, size_t len)
 check for name with end-of-string, space or tab after it
static void execute_cmd (struct daemon_remote *rc, struct rc_state *s, RES *ssl, char *cmd, struct worker *worker)
 execute a remote control command
void daemon_remote_exec (struct worker *worker)
 Handle nonthreaded remote cmd execution.
static void handle_req (struct daemon_remote *rc, struct rc_state *s, RES *res)
 handle remote control request
static int remote_handshake_later (struct daemon_remote *rc, struct rc_state *s, struct comm_point *c, int r, int r2)
 handle SSL_do_handshake changes to the file descriptor to wait for later
int remote_control_callback (struct comm_point *c, void *arg, int err, struct comm_reply *ATTR_UNUSED(rep))
static int sock_poll_timeout (int fd, int timeout, int pollin, int pollout, int *event)
 This routine polls a socket for readiness.
static const char * fr_notification_to_string (enum fast_reload_notification status)
 fast reload convert fast reload notification status to string
static int fr_poll_for_quit (struct fast_reload_thread *fr)
 fast reload, poll for notification incoming.
static void fr_send_notification (struct fast_reload_thread *fr, enum fast_reload_notification status)
 fast reload thread.
static int fr_output_text (struct fast_reload_thread *fr, const char *msg)
 fast reload thread queue up text string for output
static int fr_output_vmsg (struct fast_reload_thread *fr, const char *format, va_list args)
 fast reload thread output vmsg function
static int fr_output_printf (struct fast_reload_thread *fr, const char *format,...) ATTR_FORMAT(printf
 fast reload thread printout function, with printf arguments
static void fr_init_time (struct timeval *time_start, struct timeval *time_read, struct timeval *time_construct, struct timeval *time_reload, struct timeval *time_end)
 fast reload thread, init time counters
static int fr_read_config (struct fast_reload_thread *fr, struct config_file **newcfg)
 fast reload thread, read config
static int taglist_equal (char **tagname_a, int num_tags_a, char **tagname_b, int num_tags_b)
 Check if two taglists are equal.
static int taglist_change_at_end (char **tagname_a, int num_tags_a, char **tagname_b, int num_tags_b)
 Check the change from a to b is only new entries at the end.
static int fr_check_tag_defines (struct fast_reload_thread *fr, struct config_file *newcfg)
 fast reload thread, check tag defines.
static void fr_add_incompatible_option (const char *desc, char *str, size_t len)
 fast reload thread, add incompatible option to the explanatory string
static void fr_check_changed_cfg_strlist (struct config_strlist *cmp1, struct config_strlist *cmp2, const char *desc, char *str, size_t len)
static void fr_check_changed_cfg_str2list (struct config_str2list *cmp1, struct config_str2list *cmp2, const char *desc, char *str, size_t len)
static void fr_check_changed_cfg_str3list (struct config_str3list *cmp1, struct config_str3list *cmp2, const char *desc, char *str, size_t len)
static int fr_check_tag_datas (struct fast_reload_thread *fr, struct config_file *newcfg)
 fast reload thread, check tag datas.
static int fr_check_compat_cfg (struct fast_reload_thread *fr, struct config_file *newcfg)
 fast reload thread, check compatible config items
static int fr_check_nopause_compat_cfg (struct fast_reload_thread *fr, struct config_file *newcfg)
 fast reload thread, check nopause config items
static void fr_construct_clear (struct fast_reload_construct *ct)
 fast reload thread, clear construct information, deletes items
static size_t getmem_config_strlist (struct config_strlist *p)
 get memory for strlist
static size_t getmem_config_str2list (struct config_str2list *p)
 get memory for str2list
static size_t getmem_config_str3list (struct config_str3list *p)
 get memory for str3list
static size_t getmem_config_strbytelist (struct config_strbytelist *p)
 get memory for strbytelist
static size_t getmem_ifs (int numifs, char **ifs)
 get memory used by ifs array
static size_t getmem_config_stub (struct config_stub *p)
 get memory for config_stub
static size_t getmem_config_auth (struct config_auth *p)
 get memory for config_auth
static size_t getmem_config_view (struct config_view *p)
 get memory for config_view
static size_t config_file_getmem (struct config_file *cfg)
 get memory used by config_file item, estimate
static int fr_printmem (struct fast_reload_thread *fr, struct config_file *newcfg, struct fast_reload_construct *ct)
 fast reload thread, print memory used by construct of items.
static int ct_acl_interface_setup_ports (struct acl_list *acl_interface, struct daemon *daemon)
 fast reload thread, setup the acl_interface for the ports that the server has.
static int fr_add_auth_zone_change (struct fast_reload_thread *fr, struct auth_zone *old_z, struct auth_zone *new_z, int is_deleted, int is_added, int is_changed)
 fast reload, add new change to list of auth zones
static int xfr_auth_master_equal (struct auth_master *m1, struct auth_master *m2)
 See if auth master is equal.
static int xfr_masterlist_equal (struct auth_master *list1, struct auth_master *list2)
 See if list of auth masters is equal.
static int xfr_config_equal (struct auth_xfer *xfr1, struct auth_xfer *xfr2)
 See if configuration has changed.
static int xfr_masters_equal (struct auth_xfer *xfr1, struct auth_xfer *xfr2)
 See if the list of masters has changed.
static int auth_zones_check_changes (struct fast_reload_thread *fr, struct fast_reload_construct *ct)
 Check what has changed in auth zones, like added and deleted zones.
static int fr_check_sslctx_change (struct fast_reload_thread *fr, struct config_file *newcfg)
 Check if the sslctxs have changed.
static int ct_create_sslctxs (struct fast_reload_construct *ct, struct config_file *newcfg, struct daemon *daemon)
 Create the SSL CTXs when they have changed.
static int fr_construct_from_config (struct fast_reload_thread *fr, struct config_file *newcfg, struct fast_reload_construct *ct)
 fast reload thread, construct from config the new items
static int fr_finish_time (struct fast_reload_thread *fr, struct timeval *time_start, struct timeval *time_read, struct timeval *time_construct, struct timeval *time_reload, struct timeval *time_end)
 fast reload thread, finish timers
static void auth_zones_swap (struct auth_zones *az, struct auth_zones *data)
 Swap auth zone information.
static void void_ptr_swap (void **a, void **b)
 Swap two void*.
static void char_ptr_swap (char **a, char **b)
 Swap two char*.
static void sslctxs_swap (struct daemon *daemon, struct fast_reload_construct *ct)
 Swap and set ssl ctx information.
static void fr_adjust_cache (struct module_env *env, struct config_file *oldcfg)
 fast reload thread, adjust the cache sizes
static void fr_adjust_iter_env (struct module_env *env, struct fast_reload_construct *ct)
 fast reload thread, adjust the iterator env
static void fr_adjust_val_env (struct module_env *env, struct fast_reload_construct *ct, struct config_file *oldcfg)
 fast reload thread, adjust the validator env
static void fr_adjust_infra (struct module_env *env, struct fast_reload_construct *ct)
 fast reload thread, adjust the infra cache parameters
static int fr_reload_config (struct fast_reload_thread *fr, struct config_file *newcfg, struct fast_reload_construct *ct)
 fast reload thread, reload config with putting the new config items in place and swapping out the old items.
static void fr_poll_for_ack (struct fast_reload_thread *fr)
 fast reload, poll for ack incoming.
static int fr_reload_ipc (struct fast_reload_thread *fr, struct config_file *newcfg, struct fast_reload_construct *ct)
 fast reload thread, reload ipc communication to stop and start threads.
static int fr_load_config (struct fast_reload_thread *fr, struct timeval *time_read, struct timeval *time_construct, struct timeval *time_reload)
 fast reload thread, load config
static void * fast_reload_thread_main (void *arg)
 fast reload thread.
static int create_socketpair (int *pair, struct ub_randstate *rand)
 create a socketpair for bidirectional communication, false on failure
static int fast_reload_thread_setup (struct worker *worker, int fr_verb, int fr_nopause, int fr_drop_mesh)
 fast reload thread.
static void fr_auth_change_list_delete (struct fast_reload_auth_change *auth_zone_change_list)
 fast reload, delete auth zone change list
static void fast_reload_thread_desetup (struct fast_reload_thread *fast_reload_thread)
 fast reload thread.
static void fr_send_cmd_to (struct fast_reload_thread *fr, enum fast_reload_notification status, int check_cmds, int blocking)
 Fast reload thread, send a command to the thread.
static void fr_main_perform_done (struct fast_reload_thread *fr)
 Fast reload, the main thread handles that the fast reload thread has exited.
static void cfg_strlist_append_listhead (struct config_strlist_head *list, struct config_strlist_head *more)
 Append strlist after strlist.
static void fr_read_ack_from_workers (struct fast_reload_thread *fr)
 fast reload, receive ack from workers that they are waiting, run by the mainthr after sending them reload_stop.
static void fr_poll_for_reload_start (struct fast_reload_thread *fr)
 fast reload, poll for reload_start in mainthr waiting on a notification from the fast reload thread.
static void fr_worker_pickup_mesh (struct worker *worker)
 Pick up the worker mesh changes, after fast reload.
static void tcl_remove_old (struct listen_dnsport *front)
 Remove the old tcl_addr entries from the open connections.
static void auth_zone_zonemd_stop_lookup (struct auth_zone *z, struct mesh_area *mesh)
 Stop zonemd lookup.
static void fr_pickup_auth_locks (struct worker *worker, struct auth_zone *namez, struct auth_zone *old_z, struct auth_zone *new_z, struct auth_xfer **xfr, struct auth_xfer **loadxfr)
 Pick up the auth zone locks.
static void fr_worker_auth_del (struct worker *worker, struct fast_reload_auth_change *item, int for_change)
 Fast reload, worker picks up deleted auth zone.
static void auth_xfr_pickup_config (struct auth_xfer *loadxfr, struct auth_xfer *xfr)
 Fast reload, auth xfer config is picked up.
static void fr_worker_auth_add (struct worker *worker, struct fast_reload_auth_change *item, int for_change)
 Fast reload, worker picks up added auth zone.
static void fr_worker_auth_cha (struct worker *worker, struct fast_reload_auth_change *item)
 Fast reload, worker picks up changed auth zone.
static void fr_worker_pickup_auth_changes (struct worker *worker, struct fast_reload_auth_change *auth_zone_change_list)
 Fast reload, the worker picks up changes in auth zones.
static void fr_worker_pickup_listen_dnsport (struct worker *worker)
 Fast reload, the worker picks up changes in listen_dnsport.
static void fr_worker_pickup_outside_network (struct worker *worker)
 Fast reload, the worker picks up changes in outside_network.
void fast_reload_worker_pickup_changes (struct worker *worker)
 Pick up per worker changes after a fast reload.
static void fr_main_perform_reload_stop (struct fast_reload_thread *fr)
 fast reload thread, handle reload_stop notification, send reload stop to other threads over IPC and collect their ack.
static void fr_main_perform_reload_nopause_poll (struct fast_reload_thread *fr)
 Fast reload, the main thread performs the nopause poll.
static void fr_main_perform_cmd (struct fast_reload_thread *fr, enum fast_reload_notification status)
 Fast reload, perform the command received from the fast reload thread.
static void fr_main_handle_cmd (struct fast_reload_thread *fr)
 Fast reload, handle command from fast reload to the main thread.
void fast_reload_service_cb (int ATTR_UNUSED(fd), short ATTR_UNUSED(bits), void *arg)
static int fr_client_send_item_fd (struct fast_reload_printq *printq)
 fast reload, send client item for fd, returns bytes sent, or 0 for wait later, or -1 on failure.
static int fr_client_send_item (struct fast_reload_printq *printq)
 fast reload, send current client item.
static void fr_client_pickup_next_item (struct fast_reload_printq *printq)
 fast reload, pick up the next item to print
int fast_reload_client_callback (struct comm_point *ATTR_UNUSED(c), void *arg, int err, struct comm_reply *ATTR_UNUSED(rep))
static struct fast_reload_printq * fr_printq_create (struct comm_point *c, struct worker *worker)
 fast reload printq create
void fast_reload_printq_list_delete (struct fast_reload_printq *list)
 fast reload printq delete list
static void fr_printq_list_remove (struct fast_reload_printq *printq)
 fast reload printq remove the item from the printq list
static void fr_send_stop (struct fast_reload_thread *fr)
 fast reload thread, send stop command to the thread, from the main thread.
void fast_reload_thread_start (RES *ssl, struct worker *worker, struct rc_state *s, int fr_verb, int fr_nopause, int fr_drop_mesh)
 Start fast reload thread.
void fast_reload_thread_stop (struct fast_reload_thread *fast_reload_thread)
 Stop fast reload thread.

Detailed Description

This file contains the remote control functionality for the daemon.

The remote control can be performed using either the commandline unbound-control tool, or a TLS capable web browser. The channel is secured using TLSv1, and certificates. Both the server and the client(control tool) have their own keys.

Macro Definition Documentation

◆ SQ

#define SQ   "="

what to put on statistics lines between var and value, ": " or "="

Referenced by print_ext(), print_mem(), print_stats(), and print_uptime().

◆ MAX_CMD_STRLINE

#define MAX_CMD_STRLINE   1024

◆ IPC_LOOP_MAX

#define IPC_LOOP_MAX   200

What number of loop iterations is too much for ipc retries.

Referenced by create_socketpair(), fr_poll_for_ack(), fr_poll_for_quit(), fr_poll_for_reload_start(), fr_send_cmd_to(), fr_send_notification(), and sock_poll_timeout().

◆ IPC_NOTIFICATION_WAIT

#define IPC_NOTIFICATION_WAIT   200

Timeout in msec for ipc socket poll.

Referenced by fr_send_cmd_to(), and fr_send_notification().

◆ FR_CHECK_CHANGED_CFG

#define FR_CHECK_CHANGED_CFG ( desc,
var,
str )
Value:
do { \
if(cfg->var != newcfg->var) { \
fr_add_incompatible_option(desc, str, sizeof(str)); \
} \
} while(0);

fast reload thread, check if config item has changed; thus incompatible

Referenced by fr_check_compat_cfg(), and fr_check_nopause_compat_cfg().

◆ FR_CHECK_CHANGED_CFG_STR

#define FR_CHECK_CHANGED_CFG_STR ( desc,
var,
str )
Value:
do { \
if((!cfg->var && newcfg->var) || \
(cfg->var && !newcfg->var) || \
(cfg->var && newcfg->var \
&& strcmp(cfg->var, newcfg->var) != 0)) { \
fr_add_incompatible_option(desc, str, sizeof(str)); \
} \
} while(0);

fast reload thread, check if config string has changed, checks NULLs.

Referenced by fr_check_compat_cfg(), and fr_check_nopause_compat_cfg().

◆ FR_CHECK_CHANGED_CFG_STRLIST

#define FR_CHECK_CHANGED_CFG_STRLIST ( desc,
var,
str )
Value:
do { \
fr_check_changed_cfg_strlist(cfg->var, newcfg->var, desc, str, \
sizeof(str)); \
} while(0);

fast reload thread, check if config strlist has changed.

Referenced by fr_check_compat_cfg(), and fr_check_nopause_compat_cfg().

◆ FR_CHECK_CHANGED_CFG_STR2LIST

#define FR_CHECK_CHANGED_CFG_STR2LIST ( desc,
var,
buff )
Value:
do { \
fr_check_changed_cfg_str2list(cfg->var, newcfg->var, desc, buff,\
sizeof(buff)); \
} while(0);

fast reload thread, check if config str2list has changed.

Referenced by fr_check_nopause_compat_cfg().

◆ FR_CHECK_CHANGED_CFG_STR3LIST

#define FR_CHECK_CHANGED_CFG_STR3LIST ( desc,
var,
buff )
Value:
do { \
fr_check_changed_cfg_str3list(cfg->var, newcfg->var, desc, buff,\
sizeof(buff)); \
} while(0);

fast reload thread, check if config str3list has changed.

Referenced by fr_check_tag_datas().

Function Documentation

◆ fr_printq_delete()

◆ fr_main_perform_printout()

◆ fr_printq_empty()

int fr_printq_empty ( struct fast_reload_printq * printq)
static

fast reload printq, returns true if the list is empty and no item

References fast_reload_printq::client_item, config_strlist_head::first, fr_printq_empty(), and fast_reload_printq::to_print.

Referenced by fast_reload_thread_desetup(), and fr_printq_empty().

◆ fr_printq_list_insert()

void fr_printq_list_insert ( struct fast_reload_printq * printq,
struct daemon * daemon )
static

◆ fr_printq_remove()

void fr_printq_remove ( struct fast_reload_printq * printq)
static

◆ fr_check_cmd_from_thread()

◆ daemon_remote_create()

struct daemon_remote * daemon_remote_create ( struct config_file * cfg)

◆ daemon_remote_clear()

void daemon_remote_clear ( struct daemon_remote * rc)

remote control state to clear up.

Busy and accept points are closed. Does not delete the rc itself, or the ssl context (with its keys).

Parameters
rcstate to clear.

References daemon_remote::accept_list, daemon_remote::active, daemon_remote::busy_list, rc_state::c, comm_point_delete(), daemon_remote_clear(), listen_list_delete(), rc_state::next, rc_state::rc, and daemon_remote::worker.

Referenced by daemon_cleanup(), daemon_remote_clear(), and daemon_remote_delete().

◆ daemon_remote_delete()

void daemon_remote_delete ( struct daemon_remote * rc)

remote control state to delete.

Parameters
rcstate to delete.

References daemon_remote_clear(), daemon_remote_delete(), and rc_state::rc.

Referenced by daemon_delete(), daemon_remote_create(), and daemon_remote_delete().

◆ add_open()

int add_open ( const char * ip,
int nr,
struct listen_port ** list,
int noproto_is_err,
struct config_file * cfg )
static

Add and open a new control port.

Parameters
ipip str
nrport nr
listlist head
noproto_is_errif lack of protocol support is an error.
cfgconfig with username for chown of unix-sockets.
Returns
false on failure.

References add_open(), cfg_gid, cfg_uid, create_local_accept_sock(), create_tcp_accept_sock(), listen_port::fd, config_file::ip_dscp, config_file::ip_freebind, config_file::ip_transparent, log_assert, log_err(), listen_port::next, sock_close(), config_file::use_systemd, config_file::username, VERB_QUERY, and verbose().

Referenced by add_open(), and daemon_remote_open_ports().

◆ daemon_remote_open_ports()

struct listen_port * daemon_remote_open_ports ( struct config_file * cfg)

◆ accept_open()

◆ daemon_remote_open_accept()

int daemon_remote_open_accept ( struct daemon_remote * rc,
struct listen_port * ports,
struct worker * worker )

Setup comm points for accepting remote control connections.

Parameters
rcstate
portsalready opened ports.
workerworker with communication base. and links to command channels.
Returns
false on error.

References accept_open(), daemon_remote_open_accept(), listen_port::fd, log_err(), listen_port::next, and daemon_remote::worker.

Referenced by daemon_remote_open_accept(), and worker_init().

◆ daemon_remote_stop_accept()

void daemon_remote_stop_accept ( struct daemon_remote * rc)

Stop accept handlers for TCP (until enabled again).

Parameters
rcstate

References daemon_remote::accept_list, listen_list::com, daemon_remote_stop_accept(), and listen_list::next.

Referenced by daemon_remote_stop_accept(), and worker_stop_accept().

◆ daemon_remote_start_accept()

void daemon_remote_start_accept ( struct daemon_remote * rc)

Stop accept handlers for TCP (until enabled again).

Parameters
rcstate

References daemon_remote::accept_list, listen_list::com, daemon_remote_start_accept(), and listen_list::next.

Referenced by daemon_remote_start_accept(), and worker_start_accept().

◆ state_list_remove_elem()

void state_list_remove_elem ( struct rc_state ** list,
struct comm_point * c )
static

◆ clean_point()

void clean_point ( struct daemon_remote * rc,
struct rc_state * s )
static

decrease active count and remove commpoint from busy list

References daemon_remote::active, daemon_remote::busy_list, rc_state::c, clean_point(), comm_point_delete(), rc_state::rc, and state_list_remove_elem().

Referenced by clean_point(), and remote_handshake_later().

◆ ssl_print_vmsg()

int ssl_print_vmsg ( RES * ssl,
const char * format,
va_list args )
static

print text over the ssl connection

References ssl_print_vmsg().

Referenced by ssl_print_vmsg(), and ssl_printf().

◆ ssl_printf()

int ssl_printf ( RES * ssl,
const char * format,
... )

◆ skipwhite()

char * skipwhite ( char * str)
static

◆ send_ok()

◆ distribute_cmd()

◆ do_stop()

void do_stop ( RES * ssl,
struct worker * worker )
static

do the stop command

References worker::base, comm_base_exit(), do_stop(), worker::need_to_exit, and send_ok().

Referenced by do_stop(), execute_cmd(), and ub_ctx_delete().

◆ do_reload()

void do_reload ( RES * ssl,
struct worker * worker,
int reuse_cache )
static

◆ fr_parse_options()

int fr_parse_options ( RES * ssl,
char * arg,
int * fr_verb,
int * fr_nopause,
int * fr_drop_mesh )
static

parse fast reload command options.

References fr_parse_options(), skipwhite(), and ssl_printf().

Referenced by do_fast_reload(), and fr_parse_options().

◆ do_fast_reload()

void do_fast_reload ( RES * ssl,
struct worker * worker,
struct rc_state * s,
char * arg )
static

do the fast_reload command

References do_fast_reload(), fast_reload_thread_start(), fr_parse_options(), and ssl_printf().

Referenced by do_fast_reload(), and execute_cmd().

◆ do_verbosity()

void do_verbosity ( RES * ssl,
char * str )
static

do the verbosity command

References do_verbosity(), send_ok(), ssl_printf(), and verbosity.

Referenced by do_verbosity(), and execute_cmd().

◆ print_stats()

◆ print_thread_stats()

int print_thread_stats ( RES * ssl,
int i,
struct ub_stats_info * s )
static

print stats for one thread

References print_stats(), and print_thread_stats().

Referenced by do_stats(), and print_thread_stats().

◆ print_longnum()

int print_longnum ( RES * ssl,
const char * desc,
size_t x )
static

print long number

References print_longnum(), and ssl_printf().

Referenced by print_longnum(), and print_mem().

◆ print_mem()

◆ print_uptime()

int print_uptime ( RES * ssl,
struct worker * worker,
int reset )
static

◆ print_hist()

◆ print_ext()

int print_ext ( RES * ssl,
struct ub_stats_info * s,
int inhibit_zero )
static

print extended stats

References sldns_struct_rr_descriptor::_name, ub_server_stats::ans_bogus, ub_server_stats::ans_rcode, ub_server_stats::ans_rcode_nodata, ub_server_stats::ans_secure, ub_server_stats::infra_cache_count, ub_server_stats::key_cache_count, LDNS_RR_TYPE_ANY, LDNS_RR_TYPE_MAILA, LDNS_RR_TYPE_MAILB, ub_server_stats::msg_cache_count, ub_server_stats::msg_cache_max_collisions, ub_server_stats::nonce_cache_count, ub_server_stats::num_dnstap_congestion_drop, ub_server_stats::num_neg_cache_noerror, ub_server_stats::num_neg_cache_nxdomain, ub_server_stats::num_query_authzone_down, ub_server_stats::num_query_authzone_up, ub_server_stats::num_query_cachedb, ub_server_stats::num_query_dnscrypt_replay, ub_server_stats::num_query_dnscrypt_secret_missed_cache, ub_server_stats::num_query_subnet, ub_server_stats::num_query_subnet_cache, print_ext(), ub_server_stats::qbit_AA, ub_server_stats::qbit_AD, ub_server_stats::qbit_CD, ub_server_stats::qbit_QR, ub_server_stats::qbit_RA, ub_server_stats::qbit_RD, ub_server_stats::qbit_TC, ub_server_stats::qbit_Z, ub_server_stats::qclass, ub_server_stats::qclass_big, ub_server_stats::qEDNS, ub_server_stats::qEDNS_DO, ub_server_stats::qhttps, ub_server_stats::qipv6, ub_server_stats::qopcode, ub_server_stats::qquic, ub_server_stats::qtcp, ub_server_stats::qtcp_outgoing, ub_server_stats::qtls, ub_server_stats::qtls_resume, ub_server_stats::qtype, ub_server_stats::qtype_big, ub_server_stats::qudp_outgoing, ub_server_stats::queries_ratelimited, ub_server_stats::rpz_action, rpz_action_to_string(), ub_server_stats::rrset_bogus, ub_server_stats::rrset_cache_count, ub_server_stats::rrset_cache_max_collisions, ub_server_stats::shared_secret_cache_count, sldns_opcodes, sldns_rcodes, sldns_rr_classes, sldns_rr_descript(), SQ, ssl_printf(), ub_stats_info::svr, UB_STATS_OPCODE_NUM, UB_STATS_QCLASS_NUM, UB_STATS_QTYPE_NUM, UB_STATS_RCODE_NUM, UB_STATS_RPZ_ACTION_NUM, ub_server_stats::unwanted_queries, ub_server_stats::unwanted_replies, and ub_server_stats::val_ops.

Referenced by do_stats(), and print_ext().

◆ do_stats()

◆ parse_arg_name()

◆ find_arg2()

int find_arg2 ( RES * ssl,
char * arg,
char ** arg2 )
static

◆ perform_zone_add()

◆ do_zone_add()

void do_zone_add ( RES * ssl,
struct local_zones * zones,
char * arg )
static

Do the local_zone command.

References do_zone_add(), perform_zone_add(), and send_ok().

Referenced by do_view_zone_add(), do_zone_add(), and execute_cmd().

◆ do_zones_add()

void do_zones_add ( struct daemon_remote * rc,
RES * ssl,
struct worker * worker )
static

◆ perform_zone_remove()

int perform_zone_remove ( RES * ssl,
struct local_zones * zones,
char * arg )
static

◆ do_zone_remove()

void do_zone_remove ( RES * ssl,
struct local_zones * zones,
char * arg )
static

Do the local_zone_remove command.

References do_zone_remove(), perform_zone_remove(), and send_ok().

Referenced by do_view_zone_remove(), do_zone_remove(), and execute_cmd().

◆ do_zones_remove()

void do_zones_remove ( struct daemon_remote * rc,
RES * ssl,
struct worker * worker )
static

◆ check_RR_syntax()

int check_RR_syntax ( RES * ssl,
char * str,
int line )
static

◆ perform_data_add()

int perform_data_add ( RES * ssl,
struct local_zones * zones,
char * arg,
int line )
static

◆ do_data_add()

void do_data_add ( RES * ssl,
struct local_zones * zones,
char * arg )
static

Do the local_data command.

References do_data_add(), perform_data_add(), and send_ok().

Referenced by do_data_add(), do_view_data_add(), and execute_cmd().

◆ do_datas_add()

void do_datas_add ( struct daemon_remote * rc,
RES * ssl,
struct worker * worker )
static

◆ perform_data_remove()

◆ do_data_remove()

void do_data_remove ( RES * ssl,
struct local_zones * zones,
char * arg )
static

Do the local_data_remove command.

References do_data_remove(), perform_data_remove(), and send_ok().

Referenced by do_data_remove(), do_view_data_remove(), and execute_cmd().

◆ do_datas_remove()

void do_datas_remove ( struct daemon_remote * rc,
RES * ssl,
struct worker * worker )
static

◆ do_view_zone_add()

void do_view_zone_add ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_view_zone_remove()

void do_view_zone_remove ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_view_data_add()

void do_view_data_add ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_view_datas_add()

void do_view_datas_add ( struct daemon_remote * rc,
RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_view_data_remove()

void do_view_data_remove ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_view_datas_remove()

void do_view_datas_remove ( struct daemon_remote * rc,
RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_cache_lookup_domain()

◆ do_cache_lookup()

void do_cache_lookup ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_lookup()

void do_lookup ( RES * ssl,
struct worker * worker,
char * arg )
static

cache lookup of nameservers

References do_lookup(), and parse_arg_name().

Referenced by do_lookup(), do_lookup(), do_update(), and execute_cmd().

◆ do_cache_remove()

◆ parse_remcachedb()

int parse_remcachedb ( RES * ssl,
char ** arg,
int * pc )
static

parse '+c' option, modifies string to return remainder.

References find_arg2(), parse_remcachedb(), and skipwhite().

Referenced by do_flush_bogus(), do_flush_name(), do_flush_negative(), do_flush_type(), do_flush_zone(), and parse_remcachedb().

◆ do_flush_type()

void do_flush_type ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_flush_stats()

void do_flush_stats ( RES * ssl,
struct worker * worker )
static

flush statistics

References do_flush_stats(), send_ok(), and worker_stats_clear().

Referenced by do_flush_stats(), and execute_cmd().

◆ infra_del_host()

◆ do_flush_infra()

◆ do_flush_requestlist()

void do_flush_requestlist ( RES * ssl,
struct worker * worker )
static

◆ zone_del_rrset()

◆ zone_del_msg()

◆ zone_del_kcache()

void zone_del_kcache ( struct lruhash_entry * e,
void * arg )
static

◆ do_flush_zone()

◆ bogus_del_rrset()

void bogus_del_rrset ( struct lruhash_entry * e,
void * arg )
static

◆ bogus_del_msg()

◆ bogus_del_kcache()

void bogus_del_kcache ( struct lruhash_entry * e,
void * arg )
static

◆ do_flush_bogus()

◆ negative_del_rrset()

◆ negative_del_msg()

◆ negative_del_kcache()

void negative_del_kcache ( struct lruhash_entry * e,
void * arg )
static

◆ do_flush_negative()

◆ do_flush_name()

◆ ssl_print_name_dp()

◆ print_root_fwds()

int print_root_fwds ( RES * ssl,
struct iter_forwards * fwds,
uint8_t * root )
static

◆ parse_delegpt()

struct delegpt * parse_delegpt ( RES * ssl,
char * args,
uint8_t * nm )
static

◆ do_forward()

void do_forward ( RES * ssl,
struct worker * worker,
char * args )
static

◆ do_forward_add()

void do_forward_add ( RES * ssl,
struct worker * worker,
char * args )
static

◆ do_forward_remove()

void do_forward_remove ( RES * ssl,
struct worker * worker,
char * args )
static

◆ do_stub_add()

◆ do_stub_remove()

◆ do_insecure_add()

void do_insecure_add ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_insecure_remove()

void do_insecure_remove ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_status()

◆ get_mesh_age()

void get_mesh_age ( struct mesh_state * m,
char * buf,
size_t len,
struct module_env * env )
static

◆ get_mesh_status()

◆ do_dump_requestlist()

◆ dump_infra_host()

◆ do_dump_infra()

void do_dump_infra ( RES * ssl,
struct worker * worker )
static

◆ do_log_reopen()

void do_log_reopen ( RES * ssl,
struct worker * worker )
static

◆ do_auth_zone_reload()

◆ do_auth_zone_transfer()

void do_auth_zone_transfer ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_set_option()

◆ remote_get_opt_ssl()

void remote_get_opt_ssl ( char * line,
void * arg )

routine to printout option values over SSL

References remote_get_opt_ssl(), and ssl_printf().

Referenced by do_get_option(), fptr_whitelist_print_func(), remote_control_callback(), and remote_get_opt_ssl().

◆ do_get_option()

void do_get_option ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_list_forwards()

◆ do_list_stubs()

◆ do_list_auth_zones()

◆ do_list_local_zones()

◆ do_list_local_data()

◆ do_view_list_local_zones()

void do_view_list_local_zones ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_view_list_local_data()

void do_view_list_local_data ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ rate_list()

◆ ip_rate_list()

void ip_rate_list ( struct lruhash_entry * e,
void * arg )
static

◆ do_ratelimit_list()

◆ do_ip_ratelimit_list()

void do_ip_ratelimit_list ( RES * ssl,
struct worker * worker,
char * arg )
static

◆ do_rpz_enable_disable()

void do_rpz_enable_disable ( RES * ssl,
struct worker * worker,
char * arg,
int enable )
static

◆ do_rpz_enable()

void do_rpz_enable ( RES * ssl,
struct worker * worker,
char * arg )
static

do the rpz_enable command

References do_rpz_enable(), and do_rpz_enable_disable().

Referenced by do_rpz_enable(), and execute_cmd().

◆ do_rpz_disable()

void do_rpz_disable ( RES * ssl,
struct worker * worker,
char * arg )
static

do the rpz_disable command

References do_rpz_disable(), and do_rpz_enable_disable().

Referenced by do_rpz_disable(), and execute_cmd().

◆ cookie_secret_file_dump()

int cookie_secret_file_dump ( RES * ssl,
struct worker * worker )
static

◆ do_activate_cookie_secret()

◆ do_drop_cookie_secret()

◆ do_add_cookie_secret()

◆ do_print_cookie_secrets()

void do_print_cookie_secrets ( RES * ssl,
struct worker * worker )
static

◆ cmd_no_args()

int cmd_no_args ( RES * ssl,
char * cmd,
char * p )
static

check that there is no argument after a command that takes no arguments.

References cmd_no_args(), and ssl_printf().

Referenced by cmd_no_args(), and execute_cmd().

◆ cmdcmp()

int cmdcmp ( char * p,
const char * cmd,
size_t len )
static

check for name with end-of-string, space or tab after it

References cmdcmp().

Referenced by cmdcmp(), and execute_cmd().

◆ execute_cmd()

void execute_cmd ( struct daemon_remote * rc,
struct rc_state * s,
RES * ssl,
char * cmd,
struct worker * worker )
static

◆ daemon_remote_exec()

void daemon_remote_exec ( struct worker * worker)

Handle nonthreaded remote cmd execution.

Parameters
workerthis worker (the remote worker).

References worker::cmd, daemon_remote_exec(), execute_cmd(), log_err(), tube_read_msg(), VERB_ALGO, and verbose().

Referenced by daemon_remote_exec().

◆ handle_req()

void handle_req ( struct daemon_remote * rc,
struct rc_state * s,
RES * res )
static

◆ remote_handshake_later()

int remote_handshake_later ( struct daemon_remote * rc,
struct rc_state * s,
struct comm_point * c,
int r,
int r2 )
static

◆ sock_poll_timeout()

int sock_poll_timeout ( int fd,
int timeout,
int pollin,
int pollout,
int * event )
static

This routine polls a socket for readiness.

Parameters
fdfile descriptor, -1 uses no fd for a timer only.
timeouttime in msec to wait. 0 means nonblocking test, -1 waits blocking for events.
pollincheck for input event.
polloutcheck for output event.
eventoutput variable, set to true if the event happens. It is false if there was an error or timeout.
Returns
false is system call failure, also logged.

References IPC_LOOP_MAX, log_assert, log_err(), sock_poll_timeout(), and sock_strerror().

Referenced by create_socketpair(), fr_check_cmd_from_thread(), fr_poll_for_ack(), fr_poll_for_quit(), fr_poll_for_reload_start(), fr_send_cmd_to(), fr_send_notification(), and sock_poll_timeout().

◆ fr_notification_to_string()

◆ fr_poll_for_quit()

◆ fr_send_notification()

◆ fr_output_text()

int fr_output_text ( struct fast_reload_thread * fr,
const char * msg )
static

fast reload thread queue up text string for output

References cfg_strlist_append(), fast_reload_thread::fr_output, fast_reload_thread::fr_output_lock, fr_output_text(), and log_err().

Referenced by fr_output_text(), and fr_output_vmsg().

◆ fr_output_vmsg()

int fr_output_vmsg ( struct fast_reload_thread * fr,
const char * format,
va_list args )
static

fast reload thread output vmsg function

References fr_output_text(), and fr_output_vmsg().

Referenced by fr_output_printf(), and fr_output_vmsg().

◆ fr_output_printf()

int static int fr_output_printf ( struct fast_reload_thread * fr,
const char * format,
... )
static

fast reload thread printout function, with printf arguments

fast reload thread printout function, prints to list and signals the remote control thread to move that to get written to the socket of the remote control connection.

References fr_output_printf(), and fr_output_vmsg().

Referenced by fast_reload_thread_main(), fr_check_compat_cfg(), fr_check_nopause_compat_cfg(), fr_check_tag_datas(), fr_check_tag_defines(), fr_finish_time(), fr_load_config(), fr_output_printf(), fr_printmem(), and fr_read_config().

◆ fr_init_time()

void fr_init_time ( struct timeval * time_start,
struct timeval * time_read,
struct timeval * time_construct,
struct timeval * time_reload,
struct timeval * time_end )
static

fast reload thread, init time counters

References fr_init_time(), and log_err().

Referenced by fast_reload_thread_main(), and fr_init_time().

◆ fr_read_config()

◆ taglist_equal()

int taglist_equal ( char ** tagname_a,
int num_tags_a,
char ** tagname_b,
int num_tags_b )
static

Check if two taglists are equal.

References taglist_equal().

Referenced by fr_check_tag_defines(), taglist_change_at_end(), and taglist_equal().

◆ taglist_change_at_end()

int taglist_change_at_end ( char ** tagname_a,
int num_tags_a,
char ** tagname_b,
int num_tags_b )
static

Check the change from a to b is only new entries at the end.

References taglist_change_at_end(), and taglist_equal().

Referenced by fr_check_tag_defines(), and taglist_change_at_end().

◆ fr_check_tag_defines()

◆ fr_add_incompatible_option()

void fr_add_incompatible_option ( const char * desc,
char * str,
size_t len )
static

fast reload thread, add incompatible option to the explanatory string

References fr_add_incompatible_option().

Referenced by fr_add_incompatible_option().

◆ fr_check_tag_datas()

◆ fr_check_compat_cfg()

◆ fr_check_nopause_compat_cfg()

◆ fr_construct_clear()

void fr_construct_clear ( struct fast_reload_construct * ct)
static

fast reload thread, clear construct information, deletes items

References fast_reload_construct::acl, fast_reload_construct::acl_interface, acl_list_delete(), fast_reload_construct::allow_proxy_tree, allow_proxy_tree_delete(), fast_reload_construct::anchors, anchors_delete(), fast_reload_construct::auth_zones, auth_zones_delete(), fast_reload_construct::caps_white, caps_white_delete(), config_delete(), fast_reload_construct::connect_dot_sslctx, fast_reload_construct::domain_limits, domain_limits_free(), fast_reload_construct::donotq, donotq_delete(), fast_reload_construct::edns_strings, edns_strings_delete(), forwards_delete(), fr_construct_clear(), fast_reload_construct::fwds, fast_reload_construct::hints, hints_delete(), fast_reload_construct::listen_doh_sslctx, fast_reload_construct::listen_dot_sslctx, fast_reload_construct::listen_quic_sslctx, fast_reload_construct::local_zones, local_zones_delete(), config_file::log_identity, fast_reload_construct::nsec3_keysize, fast_reload_construct::nsec3_maxiter, fast_reload_construct::oldcfg, fast_reload_construct::priv, priv_delete(), fast_reload_construct::respip_set, respip_set_delete(), fast_reload_construct::ssl_service_key, fast_reload_construct::ssl_service_pem, fast_reload_construct::target_fetch_policy, fast_reload_construct::tcl, tcl_list_delete(), fast_reload_construct::views, views_delete(), fast_reload_construct::wait_limits_cookie_netblock, wait_limits_free(), and fast_reload_construct::wait_limits_netblock.

Referenced by fr_construct_clear(), fr_construct_from_config(), and fr_load_config().

◆ getmem_config_strlist()

◆ getmem_config_str2list()

size_t getmem_config_str2list ( struct config_str2list * p)
static

◆ getmem_config_str3list()

size_t getmem_config_str3list ( struct config_str3list * p)
static

◆ getmem_config_strbytelist()

size_t getmem_config_strbytelist ( struct config_strbytelist * p)
static

◆ getmem_ifs()

size_t getmem_ifs ( int numifs,
char ** ifs )
static

get memory used by ifs array

References getmem_ifs(), and getmem_str().

Referenced by config_file_getmem(), and getmem_ifs().

◆ getmem_config_stub()

◆ getmem_config_auth()

◆ getmem_config_view()

◆ config_file_getmem()

size_t config_file_getmem ( struct config_file * cfg)
static

get memory used by config_file item, estimate

References config_file::acl_tag_actions, config_file::acl_tag_datas, config_file::acl_tags, config_file::acl_view, config_file::acls, config_file::allow_proxy, config_file::auths, config_file::auto_trust_anchor_file_list, config_file::caps_whitelist, config_file::chrootdir, config_file_getmem(), config_file::control_cert_file, config_file::control_ifs, config_file::control_key_file, config_file::directory, config_file::dns64_ignore_aaaa, config_file::dnscrypt_provider, config_file::dnscrypt_provider_cert, config_file::dnscrypt_provider_cert_rotated, config_file::dnscrypt_secret_key, config_file::dnstap_identity, config_file::dnstap_ip, config_file::dnstap_socket_path, config_file::dnstap_tls_cert_bundle, config_file::dnstap_tls_client_cert_file, config_file::dnstap_tls_client_key_file, config_file::dnstap_tls_server_name, config_file::dnstap_version, config_file::domain_insecure, config_file::donotqueryaddrs, config_file::dynlib_file, config_file::edns_client_strings, config_strlist_head::first, config_file::forwards, getmem_config_auth(), getmem_config_str2list(), getmem_config_str3list(), getmem_config_strbytelist(), getmem_config_strlist(), getmem_config_stub(), getmem_config_view(), getmem_ifs(), getmem_str(), config_file::http_endpoint, config_file::http_user_agent, config_file::identity, config_file::if_automatic_ports, config_file::ifs, config_file::interface_actions, config_file::interface_tag_actions, config_file::interface_tag_datas, config_file::interface_tags, config_file::interface_view, config_file::local_data, config_file::local_zone_overrides, config_file::local_zone_tags, config_file::local_zones, config_file::local_zones_nodefault, config_file::log_identity, config_file::logfile, config_file::module_conf, config_file::nsid_cfg_str, config_file::num_ifs, config_file::num_out_ifs, config_file::num_tags, config_file::out_ifs, config_file::outgoing_avail_ports, config_file::pidfile, config_file::private_address, config_file::private_domain, config_file::proxy_protocol_port, config_file::python_script, config_file::ratelimit_below_domain, config_file::ratelimit_for_domain, config_file::respip_actions, config_file::respip_data, config_file::respip_tags, config_file::root_hints, config_file::server_cert_file, config_file::server_key_file, config_file::ssl_service_key, config_file::ssl_service_pem, config_file::stubs, config_file::tagname, config_file::target_fetch_policy, config_file::tcp_connection_limits, config_file::tls_additional_port, config_file::tls_cert_bundle, config_file::tls_ciphers, config_file::tls_ciphersuites, config_file::tls_protocols, config_file::tls_session_ticket_keys, config_file::trust_anchor_file_list, config_file::trust_anchor_list, config_file::trusted_keys_file_list, config_file::username, config_file::val_nsec3_key_iterations, config_file::version, and config_file::views.

Referenced by config_file_getmem(), and fr_printmem().

◆ fr_printmem()

◆ ct_acl_interface_setup_ports()

int ct_acl_interface_setup_ports ( struct acl_list * acl_interface,
struct daemon * daemon )
static

fast reload thread, setup the acl_interface for the ports that the server has.

References acl_interface_init(), ct_acl_interface_setup_ports(), daemon::num_ports, daemon::ports, daemon::reuseport, and setup_acl_for_ports().

Referenced by ct_acl_interface_setup_ports(), and fr_construct_from_config().

◆ fr_add_auth_zone_change()

int fr_add_auth_zone_change ( struct fast_reload_thread * fr,
struct auth_zone * old_z,
struct auth_zone * new_z,
int is_deleted,
int is_added,
int is_changed )
static

◆ xfr_auth_master_equal()

int xfr_auth_master_equal ( struct auth_master * m1,
struct auth_master * m2 )
static

◆ xfr_masterlist_equal()

int xfr_masterlist_equal ( struct auth_master * list1,
struct auth_master * list2 )
static

See if list of auth masters is equal.

References auth_master::next, xfr_auth_master_equal(), and xfr_masterlist_equal().

Referenced by xfr_masterlist_equal(), and xfr_masters_equal().

◆ xfr_config_equal()

int xfr_config_equal ( struct auth_xfer * xfr1,
struct auth_xfer * xfr2 )
static

◆ xfr_masters_equal()

int xfr_masters_equal ( struct auth_xfer * xfr1,
struct auth_xfer * xfr2 )
static

◆ auth_zones_check_changes()

◆ fr_check_sslctx_change()

◆ ct_create_sslctxs()

◆ fr_construct_from_config()

int fr_construct_from_config ( struct fast_reload_thread * fr,
struct config_file * newcfg,
struct fast_reload_construct * ct )
static

fast reload thread, construct from config the new items

References fast_reload_construct::acl, fast_reload_construct::acl_interface, acl_interface_apply_cfg(), acl_list_apply_cfg(), acl_list_create(), fast_reload_construct::allow_proxy_tree, allow_proxy_tree_apply_cfg(), allow_proxy_tree_create(), fast_reload_construct::anchors, module_env::anchors, anchors_apply_cfg(), anchors_create(), fast_reload_construct::auth_zones, auth_zones_apply_cfg(), auth_zones_check_changes(), auth_zones_create(), fast_reload_construct::caps_white, caps_white_apply_cfg(), caps_white_create(), config_file::caps_whitelist, rbtree_type::count, ct_acl_interface_setup_ports(), ct_create_sslctxs(), worker::daemon, fast_reload_construct::domain_limits, fast_reload_construct::donotq, donotq_apply_cfg(), donotq_create(), fast_reload_construct::edns_strings, edns_strings_apply_cfg(), edns_strings_create(), daemon::env, worker::env, daemon::fast_reload_tcl_has_changes, forwards_apply_cfg(), forwards_create(), fr_check_sslctx_change(), fr_construct_clear(), fr_construct_from_config(), fr_poll_for_quit(), fr_printmem(), fast_reload_thread::fr_verb, fast_reload_construct::fwds, fast_reload_construct::hints, hints_apply_cfg(), hints_create(), fast_reload_construct::local_zones, local_zones_apply_cfg(), local_zones_create(), log_err(), fast_reload_construct::max_dependency_depth, daemon::mods, fast_reload_construct::nat64, nat64_apply_cfg(), fast_reload_construct::nsec3_keyiter_count, fast_reload_construct::nsec3_keysize, fast_reload_construct::nsec3_maxiter, fast_reload_construct::oldcfg, fast_reload_construct::priv, priv_apply_cfg(), priv_create(), read_fetch_policy(), respip_global_apply_cfg(), fast_reload_construct::respip_set, respip_set_create(), respip_set_is_empty(), respip_views_apply_cfg(), setup_domain_limits(), setup_wait_limits(), fast_reload_thread::sslctxs_changed, config_file::target_fetch_policy, fast_reload_construct::target_fetch_policy, daemon::tcl, fast_reload_construct::tcl, tcl_list_apply_cfg(), tcl_list_create(), tcl_list::tree, fast_reload_construct::use_response_ip, fast_reload_construct::use_rpz, val_env_parse_key_iter(), config_file::val_nsec3_key_iterations, fast_reload_construct::views, views_apply_cfg(), views_create(), fast_reload_construct::wait_limits_cookie_netblock, fast_reload_construct::wait_limits_netblock, and fast_reload_thread::worker.

Referenced by fr_construct_from_config(), and fr_load_config().

◆ fr_finish_time()

int fr_finish_time ( struct fast_reload_thread * fr,
struct timeval * time_start,
struct timeval * time_read,
struct timeval * time_construct,
struct timeval * time_reload,
struct timeval * time_end )
static

◆ auth_zones_swap()

void auth_zones_swap ( struct auth_zones * az,
struct auth_zones * data )
static

◆ void_ptr_swap()

void void_ptr_swap ( void ** a,
void ** b )
static

Swap two void*.

References void_ptr_swap().

Referenced by sslctxs_swap(), and void_ptr_swap().

◆ char_ptr_swap()

void char_ptr_swap ( char ** a,
char ** b )
static

Swap two char*.

References char_ptr_swap().

Referenced by char_ptr_swap(), and sslctxs_swap().

◆ sslctxs_swap()

◆ fr_adjust_cache()

◆ fr_adjust_iter_env()

◆ fr_adjust_val_env()

◆ fr_adjust_infra()

◆ fr_reload_config()

int fr_reload_config ( struct fast_reload_thread * fr,
struct config_file * newcfg,
struct fast_reload_construct * ct )
static

fast reload thread, reload config with putting the new config items in place and swapping out the old items.

References daemon::acl, fast_reload_construct::acl, daemon::acl_interface, fast_reload_construct::acl_interface, acl_list_swap_tree(), daemon::allow_proxy_tree, fast_reload_construct::allow_proxy_tree, allow_proxy_tree_swap_tree(), fast_reload_construct::anchors, module_env::anchors, anchors_swap_tree(), fast_reload_construct::auth_zones, module_env::auth_zones, auth_zones_swap(), cachedb_is_enabled(), module_env::cfg, config_apply(), worker::daemon, config_file::dnstap, fast_reload_construct::edns_strings, module_env::edns_strings, edns_strings_swap_tree(), daemon::env, forwards_swap_tree(), fr_adjust_cache(), fr_adjust_infra(), fr_adjust_iter_env(), fr_adjust_val_env(), fast_reload_thread::fr_nopause, fr_reload_config(), fast_reload_construct::fwds, module_env::fwds, fast_reload_construct::hints, module_env::hints, hints_swap_tree(), daemon::local_zones, fast_reload_construct::local_zones, local_zones_swap_tree(), auth_zones::lock, iter_forwards::lock, iter_hints::lock, local_zones::lock, val_anchors::lock, views::lock, log_assert, log_ident_set_or_default(), config_file::log_identity, log_warn(), daemon::mods, fast_reload_construct::oldcfg, fast_reload_construct::respip_set, module_env::respip_set, respip_set_swap_tree(), auth_zones::rpz_lock, fast_reload_thread::sslctxs_changed, sslctxs_swap(), daemon::tcl, fast_reload_construct::tcl, tcl_list_swap_tree(), daemon::use_response_ip, fast_reload_construct::use_response_ip, daemon::use_rpz, fast_reload_construct::use_rpz, fast_reload_construct::views, module_env::views, views_swap_tree(), and fast_reload_thread::worker.

Referenced by fr_reload_config(), and fr_reload_ipc().

◆ fr_poll_for_ack()

◆ fr_reload_ipc()

int fr_reload_ipc ( struct fast_reload_thread * fr,
struct config_file * newcfg,
struct fast_reload_construct * ct )
static

◆ fr_load_config()

◆ fast_reload_thread_main()

◆ create_socketpair()

int create_socketpair ( int * pair,
struct ub_randstate * rand )
static

create a socketpair for bidirectional communication, false on failure

References create_socketpair(), IPC_LOOP_MAX, log_err(), sock_close(), sock_poll_timeout(), sock_strerror(), socketpair, and ub_random_max().

Referenced by create_socketpair(), and fast_reload_thread_setup().

◆ fast_reload_thread_setup()

◆ fr_auth_change_list_delete()

void fr_auth_change_list_delete ( struct fast_reload_auth_change * auth_zone_change_list)
static

fast reload, delete auth zone change list

References fr_auth_change_list_delete(), and fast_reload_auth_change::next.

Referenced by fast_reload_thread_desetup(), and fr_auth_change_list_delete().

◆ fast_reload_thread_desetup()

◆ fr_send_cmd_to()

void fr_send_cmd_to ( struct fast_reload_thread * fr,
enum fast_reload_notification status,
int check_cmds,
int blocking )
static

Fast reload thread, send a command to the thread.

Blocking on timeout. It handles received input from the thread, if any is received.

References fast_reload_thread::commpair, fr_check_cmd_from_thread(), fr_notification_to_string(), fr_send_cmd_to(), IPC_LOOP_MAX, IPC_NOTIFICATION_WAIT, log_assert, log_err(), sock_poll_timeout(), sock_strerror(), VERB_ALGO, and verbose().

Referenced by fr_main_perform_reload_nopause_poll(), fr_main_perform_reload_stop(), fr_send_cmd_to(), and fr_send_stop().

◆ fr_main_perform_done()

void fr_main_perform_done ( struct fast_reload_thread * fr)
static

◆ cfg_strlist_append_listhead()

void cfg_strlist_append_listhead ( struct config_strlist_head * list,
struct config_strlist_head * more )
static

◆ fr_read_ack_from_workers()

void fr_read_ack_from_workers ( struct fast_reload_thread * fr)
static

fast reload, receive ack from workers that they are waiting, run by the mainthr after sending them reload_stop.

References fast_reload_thread::commreload, worker::daemon, fr_read_ack_from_workers(), log_err(), daemon::num, sock_strerror(), VERB_ALGO, verbose(), and fast_reload_thread::worker.

Referenced by fr_main_perform_reload_nopause_poll(), fr_main_perform_reload_stop(), and fr_read_ack_from_workers().

◆ fr_poll_for_reload_start()

void fr_poll_for_reload_start ( struct fast_reload_thread * fr)
static

fast reload, poll for reload_start in mainthr waiting on a notification from the fast reload thread.

References fast_reload_thread::commpair, fast_reload_notification_reload_start, fr_poll_for_reload_start(), IPC_LOOP_MAX, log_err(), sock_poll_timeout(), sock_strerror(), VERB_ALGO, and verbose().

Referenced by fr_main_perform_reload_stop(), and fr_poll_for_reload_start().

◆ fr_worker_pickup_mesh()

◆ tcl_remove_old()

void tcl_remove_old ( struct listen_dnsport * front)
static

Remove the old tcl_addr entries from the open connections.

They are only incremented when an accept is performed on a tcp comm point.

Parameters
frontlistening comm ports of the worker.

References listen_list::com, listen_dnsport::cps, comm_point::max_tcp_count, listen_list::next, comm_point::tcl_addr, tcl_remove_old(), comm_point::tcp_handlers, and comm_point::type.

Referenced by fast_reload_worker_pickup_changes(), and tcl_remove_old().

◆ auth_zone_zonemd_stop_lookup()

◆ fr_pickup_auth_locks()

◆ fr_worker_auth_del()

◆ auth_xfr_pickup_config()

◆ fr_worker_auth_add()

◆ fr_worker_auth_cha()

◆ fr_worker_pickup_auth_changes()

◆ fr_worker_pickup_listen_dnsport()

◆ fr_worker_pickup_outside_network()

◆ fast_reload_worker_pickup_changes()

◆ fr_main_perform_reload_stop()

void fr_main_perform_reload_stop ( struct fast_reload_thread * fr)
static

◆ fr_main_perform_reload_nopause_poll()

void fr_main_perform_reload_nopause_poll ( struct fast_reload_thread * fr)
static

Fast reload, the main thread performs the nopause poll.

It polls every other worker thread briefly over the command pipe ipc. The command takes no time for the worker, it can return immediately. After that it sends an acknowledgement to the fastreload thread.

References worker::daemon, fast_reload_notification_reload_ack, fast_reload_worker_pickup_changes(), fr_main_perform_reload_nopause_poll(), fr_read_ack_from_workers(), fr_send_cmd_to(), daemon::num, worker::thread_num, fast_reload_thread::worker, worker_cmd_reload_poll, worker_send_cmd(), and daemon::workers.

Referenced by fr_main_perform_cmd(), and fr_main_perform_reload_nopause_poll().

◆ fr_main_perform_cmd()

◆ fr_main_handle_cmd()

◆ fr_client_send_item_fd()

◆ fr_client_send_item()

int fr_client_send_item ( struct fast_reload_printq * printq)
static

◆ fr_client_pickup_next_item()

◆ fr_printq_create()

struct fast_reload_printq * fr_printq_create ( struct comm_point * c,
struct worker * worker )
static

◆ fast_reload_printq_list_delete()

void fast_reload_printq_list_delete ( struct fast_reload_printq * list)

fast reload printq delete list

References fast_reload_printq_list_delete(), and fr_printq_delete().

Referenced by daemon_cleanup(), and fast_reload_printq_list_delete().

◆ fr_printq_list_remove()

void fr_printq_list_remove ( struct fast_reload_printq * printq)
static

◆ fr_send_stop()

void fr_send_stop ( struct fast_reload_thread * fr)
static

fast reload thread, send stop command to the thread, from the main thread.

References fast_reload_notification_exit, fr_send_cmd_to(), and fr_send_stop().

Referenced by fast_reload_thread_stop(), and fr_send_stop().

◆ fast_reload_thread_start()

void fast_reload_thread_start ( RES * ssl,
struct worker * worker,
struct rc_state * s,
int fr_verb,
int fr_nopause,
int fr_drop_mesh )

Start fast reload thread.

Parameters
sslthe RES connection to print to.
workerthe remote servicing worker.
sthe rc_state that is servicing the remote control connection to the remote control client. It needs to be moved away to stay connected while the fast reload is running.
fr_verbverbosity to print output at. 0 is nothing, 1 is some and 2 is more detail.
fr_nopauseoption to not pause threads during reload.
fr_drop_meshoption to drop mesh queries.

References daemon_remote::active, worker::base, daemon_remote::busy_list, rc_state::c, fast_reload_printq::client_cp, fast_reload_thread::commpair, worker::daemon, daemon::fast_reload_thread, fast_reload_thread_desetup(), fast_reload_thread_main(), fast_reload_thread_setup(), fast_reload_thread_start(), comm_point::fd, fd_set_nonblock(), fr_printq_create(), log_assert, log_err(), fast_reload_thread::printq, rc_state::rc, fast_reload_printq::remote, fast_reload_thread::service_event, fast_reload_thread::service_event_is_added, ssl_printf(), fast_reload_thread::started, state_list_remove_elem(), fast_reload_thread::tid, UB_EV_PERSIST, UB_EV_READ, ub_event_add(), and ub_event_new().

Referenced by do_fast_reload(), and fast_reload_thread_start().

◆ fast_reload_thread_stop()

void fast_reload_thread_stop ( struct fast_reload_thread * fast_reload_thread)

Stop fast reload thread.

Parameters
fast_reload_threadthe thread struct.

References worker::daemon, daemon::fast_reload_thread, fast_reload_thread_stop(), fr_main_perform_done(), fr_send_stop(), and fast_reload_thread::worker.

Referenced by daemon_cleanup(), and fast_reload_thread_stop().