|
unbound 0.1
|
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. | |
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.
| #define SQ "=" |
what to put on statistics lines between var and value, ": " or "="
Referenced by print_ext(), print_mem(), print_stats(), and print_uptime().
| #define MAX_CMD_STRLINE 1024 |
Acceptable lengths of str lines.
Referenced by do_datas_add(), do_datas_remove(), do_view_datas_add(), do_view_datas_remove(), do_zones_add(), do_zones_remove(), and handle_req().
| #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().
| #define IPC_NOTIFICATION_WAIT 200 |
Timeout in msec for ipc socket poll.
Referenced by fr_send_cmd_to(), and fr_send_notification().
| #define FR_CHECK_CHANGED_CFG | ( | desc, | |
| var, | |||
| str ) |
fast reload thread, check if config item has changed; thus incompatible
Referenced by fr_check_compat_cfg(), and fr_check_nopause_compat_cfg().
| #define FR_CHECK_CHANGED_CFG_STR | ( | desc, | |
| var, | |||
| str ) |
fast reload thread, check if config string has changed, checks NULLs.
Referenced by fr_check_compat_cfg(), and fr_check_nopause_compat_cfg().
| #define FR_CHECK_CHANGED_CFG_STRLIST | ( | desc, | |
| var, | |||
| str ) |
fast reload thread, check if config strlist has changed.
Referenced by fr_check_compat_cfg(), and fr_check_nopause_compat_cfg().
| #define FR_CHECK_CHANGED_CFG_STR2LIST | ( | desc, | |
| var, | |||
| buff ) |
fast reload thread, check if config str2list has changed.
Referenced by fr_check_nopause_compat_cfg().
| #define FR_CHECK_CHANGED_CFG_STR3LIST | ( | desc, | |
| var, | |||
| buff ) |
fast reload thread, check if config str3list has changed.
Referenced by fr_check_tag_datas().
|
static |
fast reload printq delete
References fast_reload_printq::client_cp, comm_point_delete(), config_delstrlist(), config_strlist_head::first, fr_printq_delete(), fast_reload_printq::remote, and fast_reload_printq::to_print.
Referenced by fast_reload_printq_list_delete(), fast_reload_thread_desetup(), fr_printq_delete(), and fr_printq_remove().
|
static |
Fast reload, the remote control thread handles that the fast reload thread has output to be printed, on the linked list that is locked.
References cfg_strlist_append_listhead(), fast_reload_printq::client_cp, comm_point_listen_for_rw(), config_delstrlist(), comm_point::event_added, config_strlist_head::first, fr_main_perform_printout(), fast_reload_thread::fr_output, fast_reload_thread::fr_output_lock, config_strlist_head::last, fast_reload_thread::printq, and fast_reload_printq::to_print.
Referenced by fast_reload_thread_desetup(), fr_main_perform_cmd(), and fr_main_perform_printout().
|
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().
|
static |
fast reload printq, insert onto list
References daemon::fast_reload_printq_list, fr_printq_list_insert(), fast_reload_printq::in_list, and fast_reload_printq::prev.
Referenced by fast_reload_thread_desetup(), and fr_printq_list_insert().
|
static |
fast reload printq, remove the printq when no longer needed, like the stream is closed.
References worker::daemon, daemon::fast_reload_thread, fr_printq_delete(), fr_printq_list_remove(), fr_printq_remove(), fast_reload_printq::in_list, fast_reload_thread::printq, and fast_reload_printq::worker.
Referenced by fr_client_send_item(), and fr_printq_remove().
|
static |
Fast reload, poll for and handle cmd from fast reload thread.
References fast_reload_thread::commpair, worker::daemon, daemon::fast_reload_thread, fr_check_cmd_from_thread(), fr_main_handle_cmd(), log_err(), fast_reload_thread::service_event, sock_poll_timeout(), UB_EV_READ, ub_winsock_tcp_wouldblock(), and fast_reload_thread::worker.
Referenced by fr_check_cmd_from_thread(), and fr_send_cmd_to().
| struct daemon_remote * daemon_remote_create | ( | struct config_file * | cfg | ) |
Create new remote control state for the daemon.
| cfg | config file with key file settings. |
References config_file::control_ifs, config_file::control_use_cert, daemon_remote_create(), daemon_remote_delete(), config_strlist_head::first, log_err(), log_warn(), daemon_remote::max_active, config_strlist::next, options_remote_is_address(), config_file::remote_control_enable, and config_strlist::str.
Referenced by daemon_remote_create(), service_init(), and setup_sslctx_remote().
| 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).
| rc | state 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().
| void daemon_remote_delete | ( | struct daemon_remote * | rc | ) |
remote control state to delete.
| rc | state to delete. |
References daemon_remote_clear(), daemon_remote_delete(), and rc_state::rc.
Referenced by daemon_delete(), daemon_remote_create(), and daemon_remote_delete().
|
static |
Add and open a new control port.
| ip | ip str |
| nr | port nr |
| list | list head |
| noproto_is_err | if lack of protocol support is an error. |
| cfg | config with username for chown of unix-sockets. |
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().
| struct listen_port * daemon_remote_open_ports | ( | struct config_file * | cfg | ) |
Open and create listening ports for remote control.
| cfg | config options. |
References add_open(), config_del_strarray(), config_file::control_ifs, config_file::control_port, daemon_remote_open_ports(), config_file::do_ip4, config_file::do_ip6, config_strlist_head::first, listening_ports_free(), log_assert, config_file::remote_control_enable, and resolve_interface_names().
Referenced by daemon_open_shared_ports(), and daemon_remote_open_ports().
|
static |
open accept commpoint
References daemon_remote::accept_list, accept_open(), worker::base, listen_list::com, comm_point::do_not_close, log_err(), listen_list::next, and daemon_remote::worker.
Referenced by accept_open(), and 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.
| rc | state |
| ports | already opened ports. |
| worker | worker with communication base. and links to command channels. |
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().
| void daemon_remote_stop_accept | ( | struct daemon_remote * | rc | ) |
Stop accept handlers for TCP (until enabled again).
| rc | state |
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().
| void daemon_remote_start_accept | ( | struct daemon_remote * | rc | ) |
Stop accept handlers for TCP (until enabled again).
| rc | state |
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().
|
static |
delete from list
References rc_state::c, rc_state::next, and state_list_remove_elem().
Referenced by clean_point(), fast_reload_thread_start(), and state_list_remove_elem().
|
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().
|
static |
print text over the ssl connection
References ssl_print_vmsg().
Referenced by ssl_print_vmsg(), and ssl_printf().
| int ssl_printf | ( | RES * | ssl, |
| const char * | format, | ||
| ... ) |
printf style printing to the ssl connection
References ssl_print_vmsg(), and ssl_printf().
Referenced by check_RR_syntax(), cmd_no_args(), cookie_secret_file_dump(), distribute_cmd(), do_activate_cookie_secret(), do_add_cookie_secret(), do_auth_zone_reload(), do_auth_zone_transfer(), do_cache_lookup(), do_datas_add(), do_datas_remove(), do_drop_cookie_secret(), do_dump_requestlist(), do_fast_reload(), do_flush_bogus(), do_flush_infra(), do_flush_negative(), do_flush_type(), do_flush_zone(), do_forward(), do_forward_add(), do_get_option(), do_insecure_add(), do_list_auth_zones(), do_list_local_data(), do_list_local_zones(), do_print_cookie_secrets(), do_rpz_enable_disable(), do_set_option(), do_status(), do_stub_add(), do_verbosity(), do_view_data_add(), do_view_data_remove(), do_view_datas_add(), do_view_datas_remove(), do_view_list_local_data(), do_view_list_local_zones(), do_view_zone_add(), do_view_zone_remove(), do_zones_add(), do_zones_remove(), dump_cache(), dump_infra_host(), dump_msg_cache(), dump_rrset_cache(), execute_cmd(), fast_reload_thread_start(), find_arg2(), fr_parse_options(), handle_req(), ip_rate_list(), parse_arg_name(), parse_delegpt(), perform_data_add(), perform_data_remove(), perform_zone_add(), print_dp_details(), print_dp_main(), print_ext(), print_hist(), print_longnum(), print_root_fwds(), print_stats(), print_uptime(), rate_list(), remote_get_opt_ssl(), send_ok(), spool_strlist(), ssl_print_name_dp(), and ssl_printf().
|
static |
skip whitespace, return new pointer into string
References skipwhite().
Referenced by do_cache_lookup(), do_ip_ratelimit_list(), do_ratelimit_list(), execute_cmd(), find_arg2(), fr_parse_options(), parse_delegpt(), parse_remcachedb(), and skipwhite().
|
static |
send the OK to the control client
References send_ok(), and ssl_printf().
Referenced by do_activate_cookie_secret(), do_add_cookie_secret(), do_auth_zone_reload(), do_auth_zone_transfer(), do_data_add(), do_data_remove(), do_drop_cookie_secret(), do_flush_infra(), do_flush_name(), do_flush_requestlist(), do_flush_stats(), do_flush_type(), do_forward(), do_forward_add(), do_forward_remove(), do_insecure_add(), do_insecure_remove(), do_log_reopen(), do_reload(), do_rpz_enable_disable(), do_set_option(), do_stop(), do_stub_add(), do_stub_remove(), do_verbosity(), do_view_data_remove(), do_view_zone_remove(), do_zone_add(), do_zone_remove(), execute_cmd(), and send_ok().
|
static |
tell other processes to execute the command
References worker::cmd, worker::daemon, distribute_cmd(), daemon::num, rc_state::rc, ssl_printf(), tube_write_msg(), daemon_remote::worker, worker_cmd_remote, worker_send_cmd(), and daemon::workers.
Referenced by distribute_cmd(), do_datas_add(), do_datas_remove(), do_view_datas_add(), do_view_datas_remove(), do_zones_add(), do_zones_remove(), and execute_cmd().
|
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().
|
static |
do the reload command
References worker::base, comm_base_exit(), do_reload(), worker::need_to_exit, worker::reuse_cache, and send_ok().
Referenced by do_reload(), and execute_cmd().
|
static |
parse fast reload command options.
References fr_parse_options(), skipwhite(), and ssl_printf().
Referenced by do_fast_reload(), and fr_parse_options().
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().
|
static |
do the verbosity command
References do_verbosity(), send_ok(), ssl_printf(), and verbosity.
Referenced by do_verbosity(), and execute_cmd().
|
static |
print stats from statinfo
References ub_server_stats::ans_expired, ub_server_stats::max_query_list_size, ub_server_stats::max_query_time_us, ub_stats_info::mesh_dropped, ub_stats_info::mesh_jostled, ub_stats_info::mesh_num_reply_addrs, ub_stats_info::mesh_num_reply_states, ub_stats_info::mesh_num_states, ub_stats_info::mesh_replies_sent, ub_stats_info::mesh_replies_sum_wait_sec, ub_stats_info::mesh_time_median, ub_server_stats::num_dns_error_reports, ub_server_stats::num_queries, ub_server_stats::num_queries_cookie_client, ub_server_stats::num_queries_cookie_invalid, ub_server_stats::num_queries_cookie_valid, ub_server_stats::num_queries_discard_timeout, ub_server_stats::num_queries_ip_ratelimited, ub_server_stats::num_queries_missed_cache, ub_server_stats::num_queries_prefetch, ub_server_stats::num_queries_replyaddr_limit, ub_server_stats::num_queries_timed_out, ub_server_stats::num_queries_wait_limit, ub_server_stats::num_query_dnscrypt_cert, ub_server_stats::num_query_dnscrypt_cleartext, ub_server_stats::num_query_dnscrypt_crypted, ub_server_stats::num_query_dnscrypt_crypted_malformed, print_stats(), SQ, ssl_printf(), ub_server_stats::sum_query_list_size, ub_stats_info::svr, ub_server_stats::tcp_accept_usage, and timeval_divide().
Referenced by do_stats(), print_stats(), and print_thread_stats().
|
static |
print stats for one thread
References print_stats(), and print_thread_stats().
Referenced by do_stats(), and print_thread_stats().
|
static |
print long number
References print_longnum(), and ssl_printf().
Referenced by print_longnum(), and print_mem().
|
static |
print mem stats
References daemon::env, worker::env, ub_server_stats::mem_http2_query_buffer, ub_server_stats::mem_http2_response_buffer, ub_server_stats::mem_quic, ub_server_stats::mem_stream_wait, mod_get_mem(), module_env::msg_cache, print_longnum(), print_mem(), module_env::rrset_cache, slabhash_get_mem(), SQ, ub_stats_info::svr, and rrset_cache::table.
Referenced by do_stats(), and print_mem().
|
static |
print uptime stats
References worker::daemon, worker::env, module_env::now_tv, print_uptime(), SQ, ssl_printf(), daemon::time_boot, daemon::time_last_stat, and timeval_subtract().
Referenced by do_stats(), and print_uptime().
|
static |
print extended histogram
References timehist::buckets, th_buck::count, ub_server_stats::hist, log_err(), th_buck::lower, timehist::num, NUM_BUCKETS_HIST, print_hist(), ssl_printf(), ub_stats_info::svr, timehist_delete(), timehist_import(), timehist_setup(), and th_buck::upper.
Referenced by do_stats(), and print_hist().
|
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().
|
static |
do the stats command
References daemon::cfg, worker::daemon, do_stats(), log_assert, ub_stats_info::mesh_time_median, daemon::num, print_ext(), print_hist(), print_mem(), print_stats(), print_thread_stats(), print_uptime(), server_stats_add(), server_stats_obtain(), config_file::stat_extended, config_file::stat_inhibit_zero, and daemon::workers.
Referenced by do_stats(), and execute_cmd().
|
static |
parse commandline argument domain name
References dname_count_size_labels(), LDNS_MAX_DOMAINLEN, memdup(), parse_arg_name(), sldns_get_errorstr_parse(), sldns_str2wire_dname_buf(), and ssl_printf().
Referenced by do_auth_zone_reload(), do_auth_zone_transfer(), do_flush_name(), do_flush_type(), do_flush_zone(), do_insecure_add(), do_insecure_remove(), do_lookup(), do_rpz_enable_disable(), parse_arg_name(), perform_data_remove(), perform_zone_add(), and perform_zone_remove().
|
static |
find second argument, modifies string
References find_arg2(), skipwhite(), and ssl_printf().
Referenced by do_flush_type(), do_set_option(), do_view_data_add(), do_view_data_remove(), do_view_zone_add(), do_view_zone_remove(), find_arg2(), parse_remcachedb(), and perform_zone_add().
|
static |
Add a new zone.
References find_arg2(), LDNS_RR_CLASS_IN, local_zone_str2type(), local_zones_add_zone(), local_zones_find(), local_zone::lock, local_zones::lock, parse_arg_name(), perform_zone_add(), ssl_printf(), and local_zone::type.
Referenced by do_zone_add(), do_zones_add(), and perform_zone_add().
|
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().
|
static |
Do the local_zones command.
References worker::daemon, distribute_cmd(), do_zones_add(), daemon::local_zones, MAX_CMD_STRLINE, perform_zone_add(), and ssl_printf().
Referenced by do_zones_add(), and execute_cmd().
|
static |
Remove a zone.
References LDNS_RR_CLASS_IN, local_zones_del_zone(), local_zones_find(), local_zones::lock, parse_arg_name(), and perform_zone_remove().
Referenced by do_zone_remove(), do_zones_remove(), and perform_zone_remove().
|
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().
|
static |
Do the local_zones_remove command.
References worker::daemon, distribute_cmd(), do_zones_remove(), daemon::local_zones, MAX_CMD_STRLINE, perform_zone_remove(), and ssl_printf().
Referenced by do_zones_remove(), and execute_cmd().
|
static |
check syntax of newly added RR
References check_RR_syntax(), LDNS_RR_BUF_SIZE, sldns_get_errorstr_parse(), sldns_str2wire_rr_buf(), and ssl_printf().
Referenced by check_RR_syntax(), and perform_data_add().
|
static |
Add new RR data.
References check_RR_syntax(), local_zones_add_RR(), perform_data_add(), and ssl_printf().
Referenced by do_data_add(), do_datas_add(), do_view_datas_add(), and perform_data_add().
|
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().
|
static |
Do the local_datas command.
References worker::daemon, distribute_cmd(), do_datas_add(), daemon::local_zones, MAX_CMD_STRLINE, perform_data_add(), and ssl_printf().
Referenced by do_datas_add(), and execute_cmd().
|
static |
Remove RR data.
References LDNS_RR_BUF_SIZE, LDNS_RR_CLASS_IN, local_zones_del_data(), parse_arg_name(), perform_data_remove(), sldns_get_errorstr_parse(), sldns_str2wire_rr_buf(), and ssl_printf().
Referenced by do_data_remove(), do_datas_remove(), do_view_datas_remove(), and perform_data_remove().
|
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().
|
static |
Do the local_datas_remove command.
References worker::daemon, distribute_cmd(), do_datas_remove(), daemon::local_zones, MAX_CMD_STRLINE, perform_data_remove(), and ssl_printf().
Referenced by do_datas_remove(), and execute_cmd().
|
static |
Add a new zone to view.
References do_view_zone_add(), do_zone_add(), worker::env, find_arg2(), view::isfirst, local_zone_enter_defaults(), view::local_zones, local_zones_create(), view::lock, ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_zone_add(), and execute_cmd().
|
static |
Remove a zone from view.
References do_view_zone_remove(), do_zone_remove(), worker::env, find_arg2(), view::local_zones, view::lock, send_ok(), ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_zone_remove(), and execute_cmd().
|
static |
Add new RR data to view.
References do_data_add(), do_view_data_add(), worker::env, find_arg2(), view::isfirst, local_zone_enter_defaults(), view::local_zones, local_zones_create(), view::lock, ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_data_add(), and execute_cmd().
|
static |
Add new RR data from stdin to view.
References distribute_cmd(), do_view_datas_add(), worker::env, view::isfirst, local_zone_enter_defaults(), view::local_zones, local_zones_create(), view::lock, MAX_CMD_STRLINE, perform_data_add(), ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_datas_add(), and execute_cmd().
|
static |
Remove RR data from view.
References do_data_remove(), do_view_data_remove(), worker::env, find_arg2(), view::local_zones, view::lock, send_ok(), ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_data_remove(), and execute_cmd().
|
static |
Remove RR data from stdin from view.
References distribute_cmd(), do_view_datas_remove(), worker::env, view::local_zones, view::lock, MAX_CMD_STRLINE, perform_data_remove(), ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_datas_remove(), and execute_cmd().
|
static |
perform cache search for domain
References do_cache_lookup_domain(), worker::env, module_env::modinfo, module_env::modstack, modstack_find(), module_env::msg_cache, cache_lookup_info::nm, cache_lookup_info::nmlen, module_env::rrset_cache, slabhash_traverse(), cache_lookup_info::ssl, subnet_env::subnet_msg_cache, rrset_cache::table, and cache_lookup_info::worker.
Referenced by do_cache_lookup(), and do_cache_lookup_domain().
|
static |
cache lookup of domain
References dname_count_labels(), do_cache_lookup(), do_cache_lookup_domain(), LDNS_MAX_DOMAINLEN, skipwhite(), sldns_get_errorstr_parse(), sldns_str2wire_dname_buf(), and ssl_printf().
Referenced by do_cache_lookup(), and execute_cmd().
|
static |
cache lookup of nameservers
References do_lookup(), and parse_arg_name().
Referenced by do_lookup(), do_lookup(), do_update(), and execute_cmd().
|
static |
flush something from rrset and msg caches
References BIT_CD, cachedb_msg_remove_qinfo(), do_cache_remove(), worker::env, LDNS_RR_TYPE_AAAA, LDNS_RR_TYPE_SOA, query_info::local_alias, module_env::msg_cache, PACKED_RRSET_SOA_NEG, query_info::qclass, query_info::qname, query_info::qname_len, query_info::qtype, query_info_hash(), module_env::rrset_cache, rrset_cache_remove(), and slabhash_remove().
Referenced by do_cache_remove(), do_flush_name(), and do_flush_type().
|
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().
|
static |
flush a type
References do_cache_remove(), do_flush_type(), find_arg2(), LDNS_RR_CLASS_IN, parse_arg_name(), parse_remcachedb(), send_ok(), sldns_get_rr_type_by_name(), and ssl_printf().
Referenced by do_flush_type(), and execute_cmd().
|
static |
flush statistics
References do_flush_stats(), send_ok(), and worker_stats_clear().
Referenced by do_flush_stats(), and execute_cmd().
|
static |
callback to delete hosts in infra cache
References del_info::addr, infra_key::addr, del_info::addrlen, infra_key::addrlen, lruhash_entry::data, del_info::expired, infra_del_host(), lruhash_entry::key, del_info::num_keys, infra_data::probedelay, infra_data::rtt, rtt_init(), sockaddr_cmp(), infra_data::timeout_A, infra_data::timeout_AAAA, infra_data::timeout_other, and infra_data::ttl.
Referenced by do_flush_infra(), and infra_del_host().
|
static |
flush infra cache
References del_info::addr, del_info::addrlen, do_flush_infra(), worker::env, del_info::expired, infra_cache::hosts, module_env::infra_cache, infra_del_host(), ipstrtoaddr(), del_info::labs, del_info::len, del_info::name, module_env::now, del_info::num_keys, del_info::num_msgs, del_info::num_rrsets, del_info::remcachedb, send_ok(), slabhash_clear(), slabhash_traverse(), ssl_printf(), and del_info::worker.
Referenced by do_flush_infra(), and execute_cmd().
|
static |
flush requestlist
References do_flush_requestlist(), worker::env, module_env::mesh, mesh_delete_all(), and send_ok().
Referenced by do_flush_requestlist(), and execute_cmd().
|
static |
callback to delete rrsets in a zone
References lruhash_entry::data, packed_rrset_key::dname, dname_subdomain_c(), del_info::expired, lruhash_entry::key, del_info::name, del_info::num_rrsets, ub_packed_rrset_key::rk, packed_rrset_data::ttl, packed_rrset_data::ttl_add, and zone_del_rrset().
Referenced by do_flush_zone(), and zone_del_rrset().
|
static |
callback to delete messages in a zone
References cachedb_msg_remove_qinfo(), lruhash_entry::data, dname_subdomain_c(), worker::env, del_info::expired, lruhash_entry::key, msgreply_entry::key, del_info::name, del_info::num_msgs, reply_info::prefetch_ttl, query_info::qname, del_info::remcachedb, reply_info::serve_expired_ttl, reply_info::ttl, del_info::worker, and zone_del_msg().
Referenced by do_flush_zone(), and zone_del_msg().
|
static |
callback to delete keys in zone
References lruhash_entry::data, dname_subdomain_c(), del_info::expired, lruhash_entry::key, del_info::name, key_entry_key::name, del_info::num_keys, key_entry_data::ttl, and zone_del_kcache().
Referenced by do_flush_zone(), and zone_del_kcache().
|
static |
remove all rrsets and keys from zone from cache
References do_flush_zone(), worker::env, del_info::expired, module_env::key_cache, del_info::labs, del_info::len, module_env::msg_cache, del_info::name, module_env::now, del_info::num_keys, del_info::num_msgs, del_info::num_rrsets, parse_arg_name(), parse_remcachedb(), del_info::remcachedb, module_env::rrset_cache, key_cache::slab, slabhash_traverse(), ssl_printf(), rrset_cache::table, del_info::worker, zone_del_kcache(), zone_del_msg(), and zone_del_rrset().
Referenced by do_flush_zone(), and execute_cmd().
|
static |
callback to delete bogus rrsets
References bogus_del_rrset(), lruhash_entry::data, del_info::expired, del_info::num_rrsets, sec_status_bogus, packed_rrset_data::security, and packed_rrset_data::ttl.
Referenced by bogus_del_rrset(), and do_flush_bogus().
|
static |
callback to delete bogus messages
References bogus_del_msg(), cachedb_msg_remove_qinfo(), lruhash_entry::data, worker::env, del_info::expired, lruhash_entry::key, del_info::num_msgs, reply_info::prefetch_ttl, del_info::remcachedb, sec_status_bogus, reply_info::security, reply_info::serve_expired_ttl, reply_info::ttl, and del_info::worker.
Referenced by bogus_del_msg(), and do_flush_bogus().
|
static |
callback to delete bogus keys
References bogus_del_kcache(), lruhash_entry::data, del_info::expired, key_entry_data::isbad, del_info::num_keys, and key_entry_data::ttl.
Referenced by bogus_del_kcache(), and do_flush_bogus().
|
static |
remove all bogus rrsets, msgs and keys from cache
References bogus_del_kcache(), bogus_del_msg(), bogus_del_rrset(), do_flush_bogus(), worker::env, del_info::expired, module_env::key_cache, module_env::msg_cache, module_env::now, del_info::num_keys, del_info::num_msgs, del_info::num_rrsets, parse_remcachedb(), del_info::remcachedb, module_env::rrset_cache, key_cache::slab, slabhash_traverse(), ssl_printf(), rrset_cache::table, and del_info::worker.
Referenced by do_flush_bogus(), and execute_cmd().
|
static |
callback to delete negative and servfail rrsets
References packed_rrset_data::count, lruhash_entry::data, del_info::expired, packed_rrset_key::flags, lruhash_entry::key, negative_del_rrset(), del_info::num_rrsets, PACKED_RRSET_PARENT_SIDE, ub_packed_rrset_key::rk, packed_rrset_data::rr_len, packed_rrset_data::rrsig_count, and packed_rrset_data::ttl.
Referenced by do_flush_negative(), and negative_del_rrset().
|
static |
callback to delete negative and servfail messages
References reply_info::an_numrrsets, cachedb_msg_remove_qinfo(), lruhash_entry::data, worker::env, del_info::expired, reply_info::flags, FLAGS_GET_RCODE, lruhash_entry::key, negative_del_msg(), del_info::num_msgs, reply_info::prefetch_ttl, del_info::remcachedb, reply_info::serve_expired_ttl, reply_info::ttl, and del_info::worker.
Referenced by do_flush_negative(), and negative_del_msg().
|
static |
callback to delete negative key entries
References lruhash_entry::data, del_info::expired, key_entry_data::isbad, negative_del_kcache(), del_info::num_keys, and key_entry_data::ttl.
Referenced by do_flush_negative(), and negative_del_kcache().
|
static |
remove all negative(NODATA,NXDOMAIN), and servfail messages from cache
References do_flush_negative(), worker::env, del_info::expired, module_env::key_cache, module_env::msg_cache, negative_del_kcache(), negative_del_msg(), negative_del_rrset(), module_env::now, del_info::num_keys, del_info::num_msgs, del_info::num_rrsets, parse_remcachedb(), del_info::remcachedb, module_env::rrset_cache, key_cache::slab, slabhash_traverse(), ssl_printf(), rrset_cache::table, and del_info::worker.
Referenced by do_flush_negative(), and execute_cmd().
|
static |
remove name rrset from cache
References do_cache_remove(), do_flush_name(), LDNS_RR_CLASS_IN, LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, LDNS_RR_TYPE_CNAME, LDNS_RR_TYPE_DNAME, LDNS_RR_TYPE_MX, LDNS_RR_TYPE_NAPTR, LDNS_RR_TYPE_NS, LDNS_RR_TYPE_PTR, LDNS_RR_TYPE_SOA, LDNS_RR_TYPE_SRV, parse_arg_name(), parse_remcachedb(), and send_ok().
Referenced by do_flush_name(), and execute_cmd().
|
static |
printout a delegation point info
References delegpt_addr::addr, addr_to_str(), delegpt_addr::addrlen, dname_str(), LDNS_MAX_DOMAINLEN, delegpt_ns::name, delegpt_ns::next, delegpt_addr::next_target, delegpt::nslist, delegpt_ns::port, sldns_wire2str_class(), ssl_print_name_dp(), ssl_printf(), delegpt::target_list, delegpt_addr::tls_auth_name, and delegpt_ns::tls_auth_name.
Referenced by do_list_forwards(), do_list_stubs(), print_root_fwds(), and ssl_print_name_dp().
|
static |
print root forwards
References forwards_lookup(), LDNS_RR_CLASS_IN, iter_forwards::lock, log_assert, delegpt::name, print_root_fwds(), query_dname_compare(), ssl_print_name_dp(), and ssl_printf().
Referenced by do_forward(), and print_root_fwds().
|
static |
parse args into delegpt
References authextstrtoaddr(), authextstrtodname(), delegpt_add_addr_mlc(), delegpt_add_ns_mlc(), delegpt_create_mlc(), delegpt_free_mlc(), delegpt::has_parent_side_NS, log_err(), parse_delegpt(), skipwhite(), and ssl_printf().
Referenced by do_forward(), and parse_delegpt().
|
static |
do the forward command
References do_forward(), worker::env, forwards_add_zone(), forwards_delete_zone(), module_env::fwds, LDNS_RR_CLASS_IN, module_env::mesh, mesh_delete_all(), parse_delegpt(), print_root_fwds(), send_ok(), and ssl_printf().
Referenced by do_forward(), and execute_cmd().
|
static |
do the forward_add command
References module_env::anchors, anchors_add_insecure(), delegpt_free_mlc(), do_forward_add(), worker::env, forwards_add_zone(), module_env::fwds, LDNS_RR_CLASS_IN, iter_forwards::lock, send_ok(), ssl_printf(), and delegpt::ssl_upstream.
Referenced by do_forward_add(), and execute_cmd().
|
static |
do the forward_remove command
References module_env::anchors, anchors_delete_insecure(), do_forward_remove(), worker::env, forwards_delete_zone(), module_env::fwds, LDNS_RR_CLASS_IN, iter_forwards::lock, and send_ok().
Referenced by do_forward_remove(), and execute_cmd().
|
static |
do the stub_add command
References module_env::anchors, anchors_add_insecure(), anchors_delete_insecure(), delegpt_free_mlc(), do_stub_add(), worker::env, forwards_add_stub_hole(), forwards_delete_stub_hole(), module_env::fwds, module_env::hints, hints_add_stub(), LDNS_RR_CLASS_IN, iter_forwards::lock, iter_hints::lock, send_ok(), ssl_printf(), and delegpt::ssl_upstream.
Referenced by do_stub_add(), and execute_cmd().
|
static |
do the stub_remove command
References module_env::anchors, anchors_delete_insecure(), do_stub_remove(), worker::env, forwards_delete_stub_hole(), module_env::fwds, module_env::hints, hints_delete_stub(), LDNS_RR_CLASS_IN, iter_forwards::lock, iter_hints::lock, and send_ok().
Referenced by do_stub_remove(), and execute_cmd().
|
static |
do the insecure_add command
References module_env::anchors, anchors_add_insecure(), do_insecure_add(), worker::env, LDNS_RR_CLASS_IN, parse_arg_name(), send_ok(), and ssl_printf().
Referenced by do_insecure_add(), and execute_cmd().
|
static |
do the insecure_remove command
References module_env::anchors, anchors_delete_insecure(), do_insecure_remove(), worker::env, LDNS_RR_CLASS_IN, parse_arg_name(), and send_ok().
Referenced by do_insecure_remove(), and execute_cmd().
|
static |
do the status command
References daemon_remote::accept_list, daemon::cfg, config_file::control_ifs, worker::daemon, do_status(), config_strlist_head::first, module_stack::mod, daemon::mods, module_func_block::name, daemon::num, module_stack::num, daemon::rc, daemon::reuseport, ssl_printf(), config_strlist::str, daemon::time_boot, and verbosity.
Referenced by do_status(), and execute_cmd().
|
static |
get age for the mesh state
References get_mesh_age(), mesh_reply::next, module_env::now_tv, mesh_state::reply_list, mesh_reply::start_time, and timeval_subtract().
Referenced by do_dump_requestlist(), and get_mesh_age().
|
static |
get status of a mesh state
References serviced_query::addr, addr_to_str(), serviced_query::addrlen, rbtree_type::count, module_qstate::curmod, dname_str(), module_qstate::ext_state, outbound_list::first, get_mesh_status(), LDNS_MAX_DOMAINLEN, module_qstate::minfo, module_stack::mod, mesh_area::mods, module_wait_reply, module_wait_subquery, module_func_block::name, outbound_entry::next, iter_qstate::outlist, query_info::qclass, module_qstate::qinfo, query_info::qname, outbound_entry::qsent, query_info::qtype, RBTREE_FOR, mesh_state::s, mesh_state_ref::s, sldns_wire2str_class(), sldns_wire2str_type(), strextstate(), and mesh_state::sub_set.
Referenced by do_dump_requestlist(), and get_mesh_status().
|
static |
do the dump_requestlist command
References mesh_area::all, dname_str(), do_dump_requestlist(), worker::env, get_mesh_age(), get_mesh_status(), LDNS_MAX_DOMAINLEN, module_env::mesh, query_info::qclass, module_qstate::qinfo, query_info::qname, query_info::qtype, RBTREE_FOR, mesh_state::s, sldns_wire2str_class(), sldns_wire2str_type(), ssl_printf(), and worker::thread_num.
Referenced by do_dump_requestlist(), and execute_cmd().
|
static |
callback for every host element in the infra cache
References infra_key::addr, addr_to_str(), infra_key::addrlen, lruhash_entry::data, dname_str(), dump_infra_host(), infra_data::edns_lame_known, infra_data::edns_version, infra_data::isdnsseclame, lruhash_entry::key, infra_data::lame_other, infra_data::lame_type_A, LDNS_MAX_DOMAINLEN, infra_arg::now, infra_data::probedelay, infra_data::rec_lame, rtt_info::rto, infra_data::rtt, rtt_notimeout(), rtt_info::rttvar, rtt_info::srtt, infra_arg::ssl, infra_arg::ssl_failed, ssl_printf(), infra_data::timeout_A, infra_data::timeout_AAAA, infra_data::timeout_other, infra_data::ttl, USEFUL_SERVER_TOP_TIMEOUT, and infra_key::zonename.
Referenced by do_dump_infra(), and dump_infra_host().
|
static |
do the dump_infra command
References do_dump_infra(), dump_infra_host(), worker::env, infra_cache::hosts, infra_arg::infra, module_env::infra_cache, infra_arg::now, module_env::now, slabhash_traverse(), infra_arg::ssl, and infra_arg::ssl_failed.
Referenced by do_dump_infra(), and execute_cmd().
|
static |
do the log_reopen command
References module_env::cfg, config_file::chrootdir, do_log_reopen(), worker::env, log_init(), config_file::logfile, send_ok(), and config_file::use_syslog.
Referenced by do_log_reopen(), and execute_cmd().
|
static |
do the auth_zone_reload command
References auth_xfer_find(), auth_zone_clear_data(), auth_zone_find(), auth_zone_read_zonefile(), auth_zone_verify_zonemd(), module_env::auth_zones, module_env::cfg, rbtree_type::count, auth_zone::data, do_auth_zone_reload(), worker::env, auth_xfer::have_zone, LDNS_RR_CLASS_IN, auth_xfer::lease_time, auth_xfer::lock, auth_zone::lock, auth_zones::lock, module_env::mesh, mesh_area::mods, module_env::now, auth_xfer::num_ixfrs, parse_arg_name(), send_ok(), auth_xfer::soa_zone_acquired, auth_zone::soa_zone_acquired, ssl_printf(), xfr_find_soa(), auth_xfer::zone_expired, and auth_zone::zone_expired.
Referenced by do_auth_zone_reload(), and execute_cmd().
|
static |
do the auth_zone_transfer command
References module_env::auth_zones, auth_zones_startprobesequence(), do_auth_zone_transfer(), worker::env, LDNS_RR_CLASS_IN, parse_arg_name(), send_ok(), and ssl_printf().
Referenced by do_auth_zone_transfer(), and execute_cmd().
|
static |
do the set_option command
References module_env::cfg, config_set_option(), val_env::date_override, do_set_option(), worker::env, find_arg2(), module_env::mesh, module_env::modinfo, mesh_area::mods, modstack_find(), send_ok(), ssl_printf(), and config_file::val_date_override.
Referenced by do_set_option(), and execute_cmd().
| 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().
|
static |
do the get_option command
References module_env::cfg, config_get_option(), do_get_option(), worker::env, remote_get_opt_ssl(), and ssl_printf().
Referenced by do_get_option(), and execute_cmd().
|
static |
do the list_forwards command
References anchor_find(), module_env::anchors, iter_forward_zone::dclass, do_list_forwards(), iter_forward_zone::dp, worker::env, module_env::fwds, trust_anchor::keylist, iter_forwards::lock, trust_anchor::lock, iter_forward_zone::name, iter_forward_zone::namelabs, iter_forward_zone::namelen, trust_anchor::numDNSKEY, trust_anchor::numDS, RBTREE_FOR, ssl_print_name_dp(), and iter_forwards::tree.
Referenced by do_list_forwards(), and execute_cmd().
|
static |
do the list_stubs command
References anchor_find(), module_env::anchors, name_tree_node::dclass, do_list_stubs(), iter_hints_stub::dp, worker::env, module_env::hints, trust_anchor::keylist, name_tree_node::labs, name_tree_node::len, iter_hints::lock, trust_anchor::lock, name_tree_node::name, iter_hints_stub::node, iter_hints_stub::noprime, trust_anchor::numDNSKEY, trust_anchor::numDS, RBTREE_FOR, ssl_print_name_dp(), and iter_hints::tree.
Referenced by do_list_stubs(), and execute_cmd().
|
static |
do the list_auth_zones command
References auth_zone_get_serial(), dname_str(), do_list_auth_zones(), LDNS_MAX_DOMAINLEN, auth_zone::lock, auth_zones::lock, auth_zone::name, RBTREE_FOR, auth_zone::soa_zone_acquired, ssl_printf(), auth_zone::zone_expired, and auth_zones::ztree.
Referenced by do_list_auth_zones(), and execute_cmd().
|
static |
do the list_local_zones command
References dname_str(), do_list_local_zones(), LDNS_MAX_DOMAINLEN, local_zone_type2str(), local_zone::lock, local_zones::lock, local_zone::name, RBTREE_FOR, ssl_printf(), local_zone::type, and local_zones::ztree.
Referenced by do_list_local_zones(), do_view_list_local_zones(), and execute_cmd().
|
static |
do the list_local_data command
References packed_rrset_data::count, local_zone::data, lruhash_entry::data, do_list_local_data(), ub_packed_rrset_key::entry, worker::env, local_zone::lock, local_zones::lock, local_rrset::next, packed_rr_to_string(), RBTREE_FOR, local_rrset::rrset, local_data::rrsets, packed_rrset_data::rrsig_count, module_env::scratch_buffer, sldns_buffer_begin(), sldns_buffer_capacity(), ssl_printf(), and local_zones::ztree.
Referenced by do_list_local_data(), do_view_list_local_data(), and execute_cmd().
|
static |
do the view_list_local_zones command
References do_list_local_zones(), do_view_list_local_zones(), worker::env, view::local_zones, view::lock, ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_list_local_zones(), and execute_cmd().
|
static |
do the view_list_local_data command
References do_list_local_data(), do_view_list_local_data(), worker::env, view::local_zones, view::lock, ssl_printf(), module_env::views, and views_find_view().
Referenced by do_view_list_local_data(), and execute_cmd().
|
static |
list items in the ratelimit table
References ratelimit_list_arg::all, ratelimit_list_arg::backoff, lruhash_entry::data, dname_str(), ratelimit_list_arg::infra, infra_find_ratelimit(), infra_rate_max(), lruhash_entry::key, LDNS_MAX_DOMAINLEN, rate_key::name, rate_key::namelen, ratelimit_list_arg::now, rate_list(), ratelimit_list_arg::ssl, and ssl_printf().
Referenced by do_ratelimit_list(), and rate_list().
|
static |
list items in the ip_ratelimit table
References ip_rate_key::addr, addr_to_str(), ip_rate_key::addrlen, lruhash_entry::data, infra_ip_ratelimit, infra_rate_max(), ip_rate_list(), lruhash_entry::key, and ssl_printf().
Referenced by do_ip_ratelimit_list(), and ip_rate_list().
|
static |
do the ratelimit_list command
References ratelimit_list_arg::all, ratelimit_list_arg::backoff, module_env::cfg, do_ratelimit_list(), infra_cache::domain_rates, worker::env, ratelimit_list_arg::infra, module_env::infra_cache, infra_dp_ratelimit, module_env::now, ratelimit_list_arg::now, rate_list(), config_file::ratelimit_backoff, skipwhite(), slabhash_traverse(), and ratelimit_list_arg::ssl.
Referenced by do_ratelimit_list(), and execute_cmd().
|
static |
do the ip_ratelimit_list command
References module_env::cfg, do_ip_ratelimit_list(), worker::env, module_env::infra_cache, infra_ip_ratelimit, ip_rate_list(), config_file::ip_ratelimit_backoff, module_env::now, skipwhite(), and slabhash_traverse().
Referenced by do_ip_ratelimit_list(), and execute_cmd().
|
static |
do the rpz_enable/disable command
References auth_zone_find(), module_env::auth_zones, do_rpz_enable_disable(), worker::env, LDNS_RR_CLASS_IN, auth_zone::lock, auth_zones::lock, parse_arg_name(), auth_zone::rpz, rpz_disable(), rpz_enable(), send_ok(), and ssl_printf().
Referenced by do_rpz_disable(), do_rpz_enable(), and do_rpz_enable_disable().
|
static |
do the rpz_enable command
References do_rpz_enable(), and do_rpz_enable_disable().
Referenced by do_rpz_enable(), and execute_cmd().
|
static |
do the rpz_disable command
References do_rpz_disable(), and do_rpz_enable_disable().
Referenced by do_rpz_disable(), and execute_cmd().
|
static |
Write the cookie secrets to file, returns 0 on failure.
Caller has to hold the lock.
References module_env::cfg, cookie_secrets::cookie_count, cookie_secret::cookie_secret, config_file::cookie_secret_file, cookie_secret_file_dump(), daemon::cookie_secrets, worker::daemon, worker::env, hex_ntop(), log_assert, and ssl_printf().
Referenced by cookie_secret_file_dump(), do_activate_cookie_secret(), do_add_cookie_secret(), and do_drop_cookie_secret().
|
static |
Activate cookie secret.
References activate_cookie_secret(), module_env::cfg, cookie_secrets::cookie_count, config_file::cookie_secret_file, cookie_secret_file_dump(), daemon::cookie_secrets, worker::daemon, do_activate_cookie_secret(), worker::env, cookie_secrets::lock, send_ok(), ssl_printf(), and worker::thread_num.
Referenced by do_activate_cookie_secret(), and execute_cmd().
|
static |
Drop cookie secret.
References module_env::cfg, cookie_secrets::cookie_count, config_file::cookie_secret_file, cookie_secret_file_dump(), daemon::cookie_secrets, worker::daemon, do_drop_cookie_secret(), drop_cookie_secret(), worker::env, cookie_secrets::lock, send_ok(), ssl_printf(), and worker::thread_num.
Referenced by do_drop_cookie_secret(), and execute_cmd().
|
static |
Add cookie secret.
References add_cookie_secret(), module_env::cfg, config_file::cookie_secret_file, cookie_secret_file_dump(), daemon::cookie_secrets, cookie_secrets_create(), worker::daemon, do_add_cookie_secret(), worker::env, hex_pton(), cookie_secrets::lock, send_ok(), ssl_printf(), and worker::thread_num.
Referenced by do_add_cookie_secret(), and execute_cmd().
|
static |
Print cookie secrets.
References cookie_secrets::cookie_count, cookie_secret::cookie_secret, daemon::cookie_secrets, worker::daemon, do_print_cookie_secrets(), hex_ntop(), cookie_secrets::lock, log_assert, and ssl_printf().
Referenced by do_print_cookie_secrets(), and execute_cmd().
|
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().
|
static |
check for name with end-of-string, space or tab after it
References cmdcmp().
Referenced by cmdcmp(), and execute_cmd().
|
static |
execute a remote control command
References module_env::auth_zones, cmd_no_args(), cmdcmp(), worker::daemon, distribute_cmd(), do_activate_cookie_secret(), do_add_cookie_secret(), do_auth_zone_reload(), do_auth_zone_transfer(), do_cache_lookup(), do_data_add(), do_data_remove(), do_datas_add(), do_datas_remove(), do_drop_cookie_secret(), do_dump_infra(), do_dump_requestlist(), do_fast_reload(), do_flush_bogus(), do_flush_infra(), do_flush_name(), do_flush_negative(), do_flush_requestlist(), do_flush_stats(), do_flush_type(), do_flush_zone(), do_forward(), do_forward_add(), do_forward_remove(), do_get_option(), do_insecure_add(), do_insecure_remove(), do_ip_ratelimit_list(), do_list_auth_zones(), do_list_forwards(), do_list_local_data(), do_list_local_zones(), do_list_stubs(), do_log_reopen(), do_lookup(), do_print_cookie_secrets(), do_ratelimit_list(), do_reload(), do_rpz_disable(), do_rpz_enable(), do_set_option(), do_stats(), do_status(), do_stop(), do_stub_add(), do_stub_remove(), do_verbosity(), do_view_data_add(), do_view_data_remove(), do_view_datas_add(), do_view_datas_remove(), do_view_list_local_data(), do_view_list_local_zones(), do_view_zone_add(), do_view_zone_remove(), do_zone_add(), do_zone_remove(), do_zones_add(), do_zones_remove(), dump_cache(), worker::env, execute_cmd(), load_cache(), daemon::local_zones, daemon::num, send_ok(), skipwhite(), and ssl_printf().
Referenced by daemon_remote_exec(), execute_cmd(), and handle_req().
| void daemon_remote_exec | ( | struct worker * | worker | ) |
Handle nonthreaded remote cmd execution.
| worker | this 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().
|
static |
handle remote control request
References rc_state::c, execute_cmd(), comm_point::fd, remote_stream::fd, fd_set_block(), handle_req(), log_crypto_err_io(), log_err(), MAX_CMD_STRLINE, sock_strerror(), ssl_printf(), VERB_DETAIL, VERB_QUERY, verbose(), and daemon_remote::worker.
Referenced by handle_req().
|
static |
handle SSL_do_handshake changes to the file descriptor to wait for later
References rc_state::c, clean_point(), comm_point_listen_for_rw(), log_addr(), log_crypto_err_io(), log_err(), comm_reply::remote_addr, comm_reply::remote_addrlen, remote_handshake_later(), comm_point::repinfo, and VERB_OPS.
Referenced by remote_handshake_later().
|
static |
This routine polls a socket for readiness.
| fd | file descriptor, -1 uses no fd for a timer only. |
| timeout | time in msec to wait. 0 means nonblocking test, -1 waits blocking for events. |
| pollin | check for input event. |
| pollout | check for output event. |
| event | output variable, set to true if the event happens. It is false if there was an error or timeout. |
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().
|
static |
fast reload convert fast reload notification status to string
References fast_reload_notification_done, fast_reload_notification_done_error, fast_reload_notification_exit, fast_reload_notification_exited, fast_reload_notification_none, fast_reload_notification_printout, fast_reload_notification_reload_ack, fast_reload_notification_reload_nopause_poll, fast_reload_notification_reload_start, fast_reload_notification_reload_stop, and fr_notification_to_string().
Referenced by fr_main_perform_cmd(), fr_notification_to_string(), fr_poll_for_quit(), fr_send_cmd_to(), and fr_send_notification().
|
static |
fast reload, poll for notification incoming.
True if quit
References fast_reload_thread::commpair, fast_reload_notification_exit, fr_notification_to_string(), fr_poll_for_quit(), IPC_LOOP_MAX, log_err(), fast_reload_thread::need_to_quit, sock_poll_timeout(), sock_strerror(), VERB_ALGO, and verbose().
Referenced by fast_reload_thread_main(), fr_construct_from_config(), fr_load_config(), fr_poll_for_quit(), fr_printmem(), fr_read_config(), and fr_send_notification().
|
static |
fast reload thread.
Send notification from the fast reload thread
References fast_reload_thread::commpair, fr_notification_to_string(), fr_poll_for_quit(), fr_send_notification(), IPC_LOOP_MAX, IPC_NOTIFICATION_WAIT, log_err(), sock_poll_timeout(), sock_strerror(), VERB_ALGO, and verbose().
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_printmem(), fr_read_config(), fr_reload_ipc(), and fr_send_notification().
|
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().
|
static |
fast reload thread output vmsg function
References fr_output_text(), and fr_output_vmsg().
Referenced by fr_output_printf(), and fr_output_vmsg().
|
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().
|
static |
fast reload thread, init time counters
References fr_init_time(), and log_err().
Referenced by fast_reload_thread_main(), and fr_init_time().
|
static |
fast reload thread, read config
References daemon::cfgfile, daemon::chroot, config_create(), config_delete(), config_read(), worker::daemon, fast_reload_notification_printout, fr_output_printf(), fr_poll_for_quit(), fr_read_config(), fr_send_notification(), fast_reload_thread::fr_verb, and fast_reload_thread::worker.
Referenced by fr_load_config(), and fr_read_config().
|
static |
Check if two taglists are equal.
References taglist_equal().
Referenced by fr_check_tag_defines(), taglist_change_at_end(), and taglist_equal().
|
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().
|
static |
fast reload thread, check tag defines.
References daemon::cfg, worker::daemon, daemon::fast_reload_drop_mesh, fast_reload_notification_printout, fr_check_tag_defines(), fast_reload_thread::fr_drop_mesh, fr_output_printf(), fr_send_notification(), config_file::num_tags, taglist_change_at_end(), taglist_equal(), config_file::tagname, and fast_reload_thread::worker.
Referenced by fr_check_tag_defines(), and fr_load_config().
|
static |
fast reload thread, add incompatible option to the explanatory string
References fr_add_incompatible_option().
Referenced by fr_add_incompatible_option().
|
static |
fast reload thread, check tag datas.
References config_file::acl_tag_datas, module_env::cfg, worker::daemon, worker::env, daemon::fast_reload_drop_mesh, fast_reload_notification_printout, FR_CHECK_CHANGED_CFG_STR3LIST, fr_check_tag_datas(), fast_reload_thread::fr_drop_mesh, fr_output_printf(), fr_send_notification(), config_file::interface_tag_datas, and fast_reload_thread::worker.
Referenced by fr_check_tag_datas(), and fr_load_config().
|
static |
fast reload thread, check compatible config items
References module_env::cfg, config_file::do_ip4, config_file::do_ip6, config_file::do_tcp, config_file::do_tcp_keepalive, config_file::do_udp, worker::env, fast_reload_notification_printout, FR_CHECK_CHANGED_CFG, FR_CHECK_CHANGED_CFG_STR, FR_CHECK_CHANGED_CFG_STRLIST, fr_check_compat_cfg(), fr_output_printf(), fr_send_notification(), config_file::harden_large_queries, config_file::http_endpoint, config_file::http_max_streams, config_file::http_notls_downstream, config_file::https_port, config_file::if_automatic, config_file::if_automatic_ports, config_file::ifs, config_file::incoming_num_tcp, config_file::ip_freebind, config_file::ip_transparent, config_file::msg_buffer_size, config_file::num_ifs, config_file::num_out_ifs, config_file::num_threads, config_file::out_ifs, config_file::outgoing_num_tcp, config_file::port, config_file::proxy_protocol_port, config_file::so_rcvbuf, config_file::so_reuseport, config_file::so_sndbuf, config_file::ssl_port, config_file::tcp_idle_timeout, config_file::tcp_keepalive_timeout, config_file::tls_additional_port, config_file::tls_protocols, config_file::udp_connect, config_file::udp_upstream_without_downstream, and fast_reload_thread::worker.
Referenced by fr_check_compat_cfg(), and fr_load_config().
|
static |
fast reload thread, check nopause config items
References config_file::allow_proxy, config_file::bogus_ttl, config_file::caps_whitelist, module_env::cfg, config_file::dnstap_identity, config_file::dnstap_send_identity, config_file::dnstap_send_version, config_file::dnstap_version, config_file::do_nat64, config_file::donotquery_localhost, config_file::donotqueryaddrs, worker::env, fast_reload_notification_printout, FR_CHECK_CHANGED_CFG, FR_CHECK_CHANGED_CFG_STR, FR_CHECK_CHANGED_CFG_STR2LIST, FR_CHECK_CHANGED_CFG_STRLIST, fr_check_nopause_compat_cfg(), fast_reload_thread::fr_nopause, fr_output_printf(), fr_send_notification(), config_file::host_ttl, config_file::infra_keep_probing, config_file::ip_ratelimit, config_file::ip_ratelimit_cookie, config_file::max_query_restarts, config_file::max_sent_count, config_file::outbound_msg_retry, config_file::private_address, config_file::private_domain, config_file::ratelimit, config_file::ratelimit_below_domain, config_file::ratelimit_for_domain, config_file::target_fetch_policy, config_file::val_date_override, config_file::val_max_restart, config_file::val_nsec3_key_iterations, config_file::val_sig_skew_max, config_file::val_sig_skew_min, config_file::wait_limit_cookie_netblock, config_file::wait_limit_netblock, and fast_reload_thread::worker.
Referenced by fr_check_nopause_compat_cfg(), and fr_load_config().
|
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().
|
static |
get memory for strlist
References getmem_config_strlist(), getmem_str(), config_strlist::next, and config_strlist::str.
Referenced by config_file_getmem(), getmem_config_auth(), getmem_config_strlist(), getmem_config_stub(), and getmem_config_view().
|
static |
get memory for str2list
References getmem_config_str2list(), getmem_str(), config_str2list::next, config_str2list::str, and config_str2list::str2.
Referenced by config_file_getmem(), getmem_config_str2list(), and getmem_config_view().
|
static |
get memory for str3list
References getmem_config_str3list(), getmem_str(), config_str3list::next, config_str3list::str, config_str3list::str2, and config_str3list::str3.
Referenced by config_file_getmem(), and getmem_config_str3list().
|
static |
get memory for strbytelist
References getmem_config_strbytelist(), getmem_str(), config_strbytelist::next, config_strbytelist::str, and config_strbytelist::str2.
Referenced by config_file_getmem(), and getmem_config_strbytelist().
|
static |
get memory used by ifs array
References getmem_ifs(), and getmem_str().
Referenced by config_file_getmem(), and getmem_ifs().
|
static |
get memory for config_stub
References config_stub::addrs, getmem_config_strlist(), getmem_config_stub(), getmem_str(), config_stub::hosts, config_stub::name, and config_stub::next.
Referenced by config_file_getmem(), and getmem_config_stub().
|
static |
get memory for config_auth
References config_auth::allow_notify, getmem_config_auth(), getmem_config_strlist(), getmem_str(), config_auth::masters, config_auth::name, config_auth::next, config_auth::rpz_action_override, config_auth::rpz_cname, config_auth::rpz_log_name, config_auth::rpz_taglistlen, config_auth::urls, and config_auth::zonefile.
Referenced by config_file_getmem(), and getmem_config_auth().
|
static |
get memory for config_view
References getmem_config_str2list(), getmem_config_strlist(), getmem_config_view(), getmem_str(), config_view::local_data, config_view::local_zones, config_view::local_zones_nodefault, config_view::name, config_view::next, config_view::respip_actions, and config_view::respip_data.
Referenced by config_file_getmem(), and getmem_config_view().
|
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().
|
static |
fast reload thread, print memory used by construct of items.
References fast_reload_construct::acl, fast_reload_construct::acl_interface, acl_list_get_mem(), fast_reload_construct::allow_proxy_tree, allow_proxy_tree_get_mem(), fast_reload_construct::anchors, anchors_get_mem(), fast_reload_construct::auth_zones, auth_zones_get_mem(), config_file_getmem(), fast_reload_construct::edns_strings, edns_strings_get_mem(), fast_reload_notification_printout, forwards_get_mem(), fr_output_printf(), fr_poll_for_quit(), fr_printmem(), fr_send_notification(), fast_reload_construct::fwds, getmem_str(), fast_reload_construct::hints, hints_get_mem(), fast_reload_construct::local_zones, local_zones_get_mem(), fast_reload_construct::oldcfg, fast_reload_construct::respip_set, respip_set_get_mem(), fast_reload_construct::ssl_service_key, fast_reload_construct::ssl_service_pem, fast_reload_construct::tcl, tcl_list_get_mem(), fast_reload_construct::views, and views_get_mem().
Referenced by fr_construct_from_config(), and fr_printmem().
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().
|
static |
fast reload, add new change to list of auth zones
References fast_reload_thread::auth_zone_change_list, fr_add_auth_zone_change(), fast_reload_auth_change::is_added, fast_reload_auth_change::is_changed, fast_reload_auth_change::is_deleted, log_err(), fast_reload_auth_change::new_z, fast_reload_auth_change::next, and fast_reload_auth_change::old_z.
Referenced by auth_zones_check_changes(), and fr_add_auth_zone_change().
|
static |
See if auth master is equal.
References auth_master::allow_notify, auth_master::file, auth_master::host, auth_master::http, auth_master::ixfr, auth_master::port, auth_master::ssl, and xfr_auth_master_equal().
Referenced by xfr_auth_master_equal(), and xfr_masterlist_equal().
|
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().
See if configuration has changed.
References auth_xfer::max_transfer_size, auth_xfer::max_transfer_time, and xfr_config_equal().
Referenced by auth_zones_check_changes(), and xfr_config_equal().
See if the list of masters has changed.
References auth_probe::masters, auth_transfer::masters, auth_xfer::task_probe, auth_xfer::task_transfer, xfr_masterlist_equal(), and xfr_masters_equal().
Referenced by auth_zones_check_changes(), and xfr_masters_equal().
|
static |
Check what has changed in auth zones, like added and deleted zones.
References auth_xfer_find(), auth_zone_find(), auth_zone_get_serial(), fast_reload_construct::auth_zones, module_env::auth_zones, auth_zones_check_changes(), auth_zone::dclass, worker::env, fr_add_auth_zone_change(), auth_xfer::lock, auth_zone::lock, auth_zones::lock, auth_zone::name, auth_zone::namelen, fast_reload_thread::old_auth_zones, RBTREE_FOR, fast_reload_thread::worker, xfr_config_equal(), xfr_masters_equal(), auth_zone::zonemd_callback_env, and auth_zones::ztree.
Referenced by auth_zones_check_changes(), and fr_construct_from_config().
|
static |
Check if the sslctxs have changed.
References daemon::cfg, worker::daemon, fr_check_sslctx_change(), ssl_cert_changed(), config_file::ssl_service_key, daemon::ssl_service_key, config_file::tls_cert_bundle, and fast_reload_thread::worker.
Referenced by fr_check_sslctx_change(), and fr_construct_from_config().
|
static |
Create the SSL CTXs when they have changed.
References cfg_has_https(), cfg_has_quic(), daemon::chroot, fast_reload_construct::connect_dot_sslctx, ct_create_sslctxs(), daemon_setup_connect_dot_sslctx(), daemon_setup_listen_doh_sslctx(), daemon_setup_listen_dot_sslctx(), daemon_setup_listen_quic_sslctx(), file_get_mtime(), fast_reload_construct::listen_doh_sslctx, fast_reload_construct::listen_dot_sslctx, fast_reload_construct::listen_quic_sslctx, log_err(), fast_reload_construct::mtime_ssl_service_key, fast_reload_construct::mtime_ssl_service_pem, config_file::ssl_service_key, fast_reload_construct::ssl_service_key, config_file::ssl_service_pem, and fast_reload_construct::ssl_service_pem.
Referenced by ct_create_sslctxs(), and fr_construct_from_config().
|
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().
|
static |
fast reload thread, finish timers
References fast_reload_notification_printout, fr_finish_time(), fr_output_printf(), fr_send_notification(), log_err(), and timeval_subtract().
Referenced by fast_reload_thread_main(), and fr_finish_time().
|
static |
Swap auth zone information.
References auth_zones_swap(), auth_zone::data, auth_zones::have_downstream, auth_zones::rpz_first, and auth_zones::ztree.
Referenced by auth_zones_swap(), and fr_reload_config().
|
static |
|
static |
|
static |
Swap and set ssl ctx information.
References char_ptr_swap(), daemon::connect_dot_sslctx, fast_reload_construct::connect_dot_sslctx, daemon::listen_doh_sslctx, fast_reload_construct::listen_doh_sslctx, daemon::listen_dot_sslctx, fast_reload_construct::listen_dot_sslctx, daemon::listen_quic_sslctx, fast_reload_construct::listen_quic_sslctx, daemon::mtime_ssl_service_key, fast_reload_construct::mtime_ssl_service_key, daemon::mtime_ssl_service_pem, fast_reload_construct::mtime_ssl_service_pem, daemon::ssl_service_key, fast_reload_construct::ssl_service_key, daemon::ssl_service_pem, fast_reload_construct::ssl_service_pem, sslctxs_swap(), and void_ptr_swap().
Referenced by fr_reload_config(), and sslctxs_swap().
|
static |
fast reload thread, adjust the cache sizes
References module_env::cfg, infra_cache::client_ip_rates, infra_cache::domain_rates, fr_adjust_cache(), infra_cache::hosts, INFRA_BYTES_NAME, module_env::infra_cache, config_file::infra_cache_numhosts, module_env::key_cache, config_file::key_cache_size, module_env::msg_cache, config_file::msg_cache_size, module_env::neg_cache, config_file::neg_cache_size, config_file::ratelimit_size, module_env::rrset_cache, config_file::rrset_cache_size, key_cache::slab, slabhash_adjust_size(), rrset_cache::table, and val_neg_adjust_size().
Referenced by fr_adjust_cache(), and fr_reload_config().
|
static |
fast reload thread, adjust the iterator env
References fast_reload_construct::caps_white, iter_env::caps_white, module_env::cfg, fast_reload_construct::donotq, iter_env::donotq, fr_adjust_iter_env(), fast_reload_construct::max_dependency_depth, iter_env::max_dependency_depth, config_file::max_query_restarts, iter_env::max_query_restarts, config_file::max_sent_count, iter_env::max_sent_count, module_env::modinfo, module_env::modstack, modstack_find(), fast_reload_construct::nat64, iter_env::nat64, config_file::outbound_msg_retry, iter_env::outbound_msg_retry, fast_reload_construct::priv, iter_env::priv, fast_reload_construct::target_fetch_policy, and iter_env::target_fetch_policy.
Referenced by fr_adjust_iter_env(), and fr_reload_config().
|
static |
fast reload thread, adjust the validator env
References config_file::bogus_ttl, module_env::cfg, fr_adjust_val_env(), val_neg_cache::lock, module_env::modinfo, module_env::modstack, modstack_find(), module_env::neg_cache, fast_reload_construct::nsec3_keyiter_count, val_env::nsec3_keyiter_count, fast_reload_construct::nsec3_keysize, val_env::nsec3_keysize, val_neg_cache::nsec3_max_iter, fast_reload_construct::nsec3_maxiter, val_env::nsec3_maxiter, config_file::val_date_override, val_env_apply_cfg(), config_file::val_max_restart, config_file::val_nsec3_key_iterations, config_file::val_sig_skew_max, and config_file::val_sig_skew_min.
Referenced by fr_adjust_val_env(), and fr_reload_config().
|
static |
fast reload thread, adjust the infra cache parameters
References module_env::cfg, fast_reload_construct::domain_limits, infra_cache::domain_limits, fr_adjust_infra(), config_file::host_ttl, infra_cache::host_ttl, module_env::infra_cache, infra_dp_ratelimit, infra_ip_ratelimit, infra_ip_ratelimit_cookie, config_file::infra_keep_probing, infra_cache::infra_keep_probing, config_file::ip_ratelimit, config_file::ip_ratelimit_cookie, config_file::ratelimit, fast_reload_construct::wait_limits_cookie_netblock, infra_cache::wait_limits_cookie_netblock, fast_reload_construct::wait_limits_netblock, and infra_cache::wait_limits_netblock.
Referenced by fr_adjust_infra(), and fr_reload_config().
|
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().
|
static |
fast reload, poll for ack incoming.
References fast_reload_thread::commpair, fast_reload_notification_exit, fast_reload_notification_reload_ack, fr_poll_for_ack(), IPC_LOOP_MAX, log_err(), fast_reload_thread::need_to_quit, sock_poll_timeout(), sock_strerror(), VERB_ALGO, and verbose().
Referenced by fr_load_config(), fr_poll_for_ack(), and fr_reload_ipc().
|
static |
fast reload thread, reload ipc communication to stop and start threads.
References fast_reload_notification_reload_start, fast_reload_notification_reload_stop, fast_reload_thread::fr_nopause, fr_poll_for_ack(), fr_reload_config(), fr_reload_ipc(), and fr_send_notification().
Referenced by fr_load_config(), and fr_reload_ipc().
|
static |
fast reload thread, load config
References config_delete(), fast_reload_notification_printout, fast_reload_notification_reload_nopause_poll, fr_check_compat_cfg(), fr_check_nopause_compat_cfg(), fr_check_tag_datas(), fr_check_tag_defines(), fr_construct_clear(), fr_construct_from_config(), fr_load_config(), fast_reload_thread::fr_nopause, fr_output_printf(), fr_poll_for_ack(), fr_poll_for_quit(), fr_read_config(), fr_reload_ipc(), fr_send_notification(), and log_err().
Referenced by fast_reload_thread_main(), and fr_load_config().
|
static |
fast reload thread.
the thread main function
References fast_reload_notification_done, fast_reload_notification_done_error, fast_reload_notification_exited, fast_reload_notification_printout, fast_reload_thread_main(), fr_finish_time(), fr_init_time(), fr_load_config(), fr_output_printf(), fr_poll_for_quit(), fr_send_notification(), fast_reload_thread::fr_verb, log_thread_set(), fast_reload_thread::need_to_quit, fast_reload_thread::threadnum, VERB_ALGO, and verbose().
Referenced by fast_reload_thread_main(), and fast_reload_thread_start().
|
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().
|
static |
fast reload thread.
setup the thread info
References module_env::cfg, fast_reload_thread::commpair, fast_reload_thread::commreload, create_socketpair(), worker::daemon, worker::env, daemon::fast_reload_drop_mesh, daemon::fast_reload_thread, fast_reload_thread_setup(), fast_reload_thread::fr_drop_mesh, fast_reload_thread::fr_nopause, fast_reload_thread::fr_output, fast_reload_thread::fr_output_lock, fast_reload_thread::fr_verb, config_file::log_thread_id, daemon::num, daemon::rand, sock_close(), fast_reload_thread::threadnum, and fast_reload_thread::worker.
Referenced by fast_reload_thread_setup(), and fast_reload_thread_start().
|
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().
|
static |
fast reload thread.
desetup and delete the thread info.
References fast_reload_thread::auth_zone_change_list, fast_reload_thread::commpair, fast_reload_thread::commreload, config_delstrlist(), worker::daemon, fast_reload_thread_desetup(), config_strlist_head::first, fr_auth_change_list_delete(), fr_main_perform_printout(), fast_reload_thread::fr_output, fast_reload_thread::fr_output_lock, fr_printq_delete(), fr_printq_empty(), fr_printq_list_insert(), fast_reload_thread::printq, fast_reload_thread::service_event, fast_reload_thread::service_event_is_added, sock_close(), ub_event_del(), ub_event_free(), and fast_reload_thread::worker.
Referenced by fast_reload_thread_desetup(), fast_reload_thread_start(), and fr_main_perform_done().
|
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().
|
static |
Fast reload, the main thread handles that the fast reload thread has exited.
References worker::daemon, daemon::fast_reload_thread, fast_reload_thread_desetup(), fr_main_perform_done(), fast_reload_thread::tid, VERB_ALGO, verbose(), and fast_reload_thread::worker.
Referenced by fast_reload_thread_stop(), fr_main_perform_cmd(), and fr_main_perform_done().
|
static |
Append strlist after strlist.
References cfg_strlist_append_listhead(), config_strlist_head::first, config_strlist_head::last, and config_strlist::next.
Referenced by cfg_strlist_append_listhead(), and fr_main_perform_printout().
|
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().
|
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().
|
static |
Pick up the worker mesh changes, after fast reload.
References module_env::cfg, worker::daemon, worker::env, fr_worker_pickup_mesh(), mesh_area::jostle_max, config_file::jostle_time, mesh_area::max_forever_states, mesh_area::max_reply_states, module_env::mesh, config_file::num_queries_per_thread, daemon::use_response_ip, mesh_area::use_response_ip, daemon::use_rpz, and mesh_area::use_rpz.
Referenced by fast_reload_worker_pickup_changes(), and fr_worker_pickup_mesh().
|
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.
| front | listening 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().
Stop zonemd lookup.
References auth_zone_zonemd_stop_lookup(), auth_zonemd_dnskey_lookup_callback(), BIT_RD, auth_zone::dclass, query_info::local_alias, mesh_remove_callback(), auth_zone::name, auth_zone::namelen, query_info::qclass, query_info::qname, query_info::qname_len, query_info::qtype, auth_zone::zonemd_callback_qtype, and auth_zone::zonemd_callback_unique_info.
Referenced by auth_zone_zonemd_stop_lookup(), and fr_worker_auth_del().
|
static |
Pick up the auth zone locks.
References auth_xfer_find(), module_env::auth_zones, worker::daemon, auth_zone::dclass, worker::env, daemon::fast_reload_thread, fr_pickup_auth_locks(), LDNS_MAX_DOMAINLEN, auth_zone::lock, auth_zones::lock, log_assert, auth_zone::name, auth_zone::namelen, and fast_reload_thread::old_auth_zones.
Referenced by fr_pickup_auth_locks(), fr_worker_auth_add(), fr_worker_auth_cha(), and fr_worker_auth_del().
|
static |
Fast reload, worker picks up deleted auth zone.
References auth_xfer_delete(), auth_zone_zonemd_stop_lookup(), module_env::auth_zones, worker::daemon, worker::env, daemon::fast_reload_thread, fr_pickup_auth_locks(), fr_worker_auth_del(), auth_xfer::lock, auth_zone::lock, auth_zones::lock, module_env::mesh, auth_xfer::node, fast_reload_thread::old_auth_zones, fast_reload_auth_change::old_z, rbtree_delete(), auth_xfer::task_nextprobe, auth_xfer::task_probe, auth_xfer::task_transfer, worker::thread_num, module_env::worker, xfr_disown_tasks(), auth_zones::xtree, and auth_zone::zonemd_callback_env.
Referenced by fr_worker_auth_cha(), fr_worker_auth_del(), and fr_worker_pickup_auth_changes().
Fast reload, auth xfer config is picked up.
References auth_xfr_pickup_config(), auth_xfer::dclass, log_assert, auth_probe::masters, auth_transfer::masters, auth_xfer::max_transfer_size, auth_xfer::max_transfer_time, auth_xfer::namelabs, auth_xfer::namelen, auth_xfer::task_probe, and auth_xfer::task_transfer.
Referenced by auth_xfr_pickup_config(), fr_worker_auth_add(), and fr_worker_auth_cha().
|
static |
Fast reload, worker picks up added auth zone.
References auth_xfer_create(), auth_xfer_pickup_initial_zone(), auth_xfr_pickup_config(), auth_zone_pickup_initial_zone(), auth_zone_verify_zonemd(), module_env::auth_zones, worker::daemon, worker::env, daemon::fast_reload_thread, fr_pickup_auth_locks(), fr_worker_auth_add(), auth_xfer::lock, auth_zone::lock, auth_zones::lock, log_err(), module_env::mesh, mesh_area::mods, fast_reload_auth_change::new_z, fast_reload_thread::old_auth_zones, auth_probe::only_lookup, auth_xfer::serial, auth_xfer::task_probe, xfr_find_soa(), and auth_zone::zone_is_slave.
Referenced by fr_worker_auth_add(), fr_worker_auth_cha(), and fr_worker_pickup_auth_changes().
|
static |
Fast reload, worker picks up changed auth zone.
References auth_xfer_create(), auth_xfer_delete(), auth_xfr_pickup_config(), module_env::auth_zones, worker::daemon, worker::env, daemon::fast_reload_thread, fr_pickup_auth_locks(), fr_worker_auth_add(), fr_worker_auth_cha(), fr_worker_auth_del(), auth_xfer::lock, auth_zone::lock, auth_zones::lock, log_err(), fast_reload_auth_change::new_z, fast_reload_thread::old_auth_zones, fast_reload_auth_change::old_z, rbtree_delete(), worker::thread_num, auth_zones::xtree, and auth_zone::zone_is_slave.
Referenced by fr_worker_auth_cha(), and fr_worker_pickup_auth_changes().
|
static |
Fast reload, the worker picks up changes in auth zones.
References fr_worker_auth_add(), fr_worker_auth_cha(), fr_worker_auth_del(), fr_worker_pickup_auth_changes(), fast_reload_auth_change::is_added, fast_reload_auth_change::is_changed, fast_reload_auth_change::is_deleted, fast_reload_auth_change::next, and worker::thread_num.
Referenced by fast_reload_worker_pickup_changes(), and fr_worker_pickup_auth_changes().
|
static |
Fast reload, the worker picks up changes in listen_dnsport.
References listen_list::com, comm_point::comm_doq, comm_point::comm_http, comm_point::comm_tcp_accept, listen_dnsport::cps, worker::daemon, daemon::fast_reload_thread, fr_worker_pickup_listen_dnsport(), worker::front, daemon::listen_doh_sslctx, daemon::listen_dot_sslctx, daemon::listen_quic_sslctx, comm_point::max_tcp_count, listen_list::next, comm_point::ssl, fast_reload_thread::sslctxs_changed, comm_point::tcp_handlers, and comm_point::type.
Referenced by fast_reload_worker_pickup_changes(), and fr_worker_pickup_listen_dnsport().
|
static |
Fast reload, the worker picks up changes in outside_network.
References worker::back, module_env::cfg, daemon::connect_dot_sslctx, worker::daemon, config_file::delay_close, outside_network::delay_tv, outside_network::delayclose, worker::env, daemon::fast_reload_thread, fr_worker_pickup_outside_network(), config_file::ip_dscp, outside_network::ip_dscp, config_file::max_reuse_tcp_queries, outside_network::max_reuse_tcp_queries, config_file::outgoing_tcp_mss, outside_network::sslctx, fast_reload_thread::sslctxs_changed, config_file::tcp_auth_query_timeout, outside_network::tcp_auth_query_timeout, outside_network::tcp_mss, config_file::tcp_reuse_timeout, outside_network::tcp_reuse_timeout, config_file::tls_use_sni, outside_network::tls_use_sni, config_file::unwanted_threshold, outside_network::unwanted_threshold, config_file::use_caps_bits_for_id, and outside_network::use_caps_for_id.
Referenced by fast_reload_worker_pickup_changes(), and fr_worker_pickup_outside_network().
| void fast_reload_worker_pickup_changes | ( | struct worker * | worker | ) |
Pick up per worker changes after a fast reload.
References fast_reload_thread::auth_zone_change_list, worker::daemon, daemon::env, worker::env, daemon::fast_reload_tcl_has_changes, daemon::fast_reload_thread, fast_reload_worker_pickup_changes(), fr_worker_pickup_auth_changes(), fr_worker_pickup_listen_dnsport(), fr_worker_pickup_mesh(), fr_worker_pickup_outside_network(), worker::front, and tcl_remove_old().
Referenced by fast_reload_worker_pickup_changes(), fr_main_perform_reload_nopause_poll(), fr_main_perform_reload_stop(), and worker_stop_and_wait().
|
static |
fast reload thread, handle reload_stop notification, send reload stop to other threads over IPC and collect their ack.
When that is done, ack to the caller, the fast reload thread, and wait for it to send start.
References worker::daemon, worker::env, daemon::fast_reload_drop_mesh, fast_reload_notification_reload_ack, fast_reload_worker_pickup_changes(), fr_main_perform_reload_stop(), fr_poll_for_reload_start(), fr_read_ack_from_workers(), fr_send_cmd_to(), module_env::mesh, mesh_delete_all(), daemon::num, worker::thread_num, VERB_ALGO, verbose(), fast_reload_thread::worker, worker_cmd_reload_start, worker_cmd_reload_stop, worker_send_cmd(), and daemon::workers.
Referenced by fr_main_perform_cmd(), and fr_main_perform_reload_stop().
|
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().
|
static |
Fast reload, perform the command received from the fast reload thread.
References fast_reload_notification_done, fast_reload_notification_done_error, fast_reload_notification_exited, fast_reload_notification_printout, fast_reload_notification_reload_nopause_poll, fast_reload_notification_reload_stop, fr_main_perform_cmd(), fr_main_perform_done(), fr_main_perform_printout(), fr_main_perform_reload_nopause_poll(), fr_main_perform_reload_stop(), fr_notification_to_string(), log_err(), VERB_ALGO, and verbose().
Referenced by fr_main_handle_cmd(), and fr_main_perform_cmd().
|
static |
Fast reload, handle command from fast reload to the main thread.
References fast_reload_thread::commpair, fast_reload_notification_done_error, fr_main_handle_cmd(), fr_main_perform_cmd(), log_assert, log_err(), fast_reload_thread::service_event, fast_reload_thread::service_read_cmd, fast_reload_thread::service_read_cmd_count, sock_strerror(), UB_EV_READ, ub_winsock_tcp_wouldblock(), VERB_ALGO, and verbose().
Referenced by fr_check_cmd_from_thread(), and fr_main_handle_cmd().
|
static |
fast reload, send client item for fd, returns bytes sent, or 0 for wait later, or -1 on failure.
References fast_reload_printq::client_byte_count, fast_reload_printq::client_cp, fast_reload_printq::client_item, fast_reload_printq::client_len, comm_point_internal(), remote_stream::fd, fr_client_send_item_fd(), log_err(), fast_reload_printq::remote, sock_strerror(), UB_EV_WRITE, and ub_winsock_tcp_wouldblock().
Referenced by fr_client_send_item(), and fr_client_send_item_fd().
|
static |
fast reload, send current client item.
false on failure or wait later.
References fast_reload_printq::client_byte_count, fast_reload_printq::client_len, fr_client_send_item(), fr_client_send_item_fd(), fr_printq_remove(), and fast_reload_printq::remote.
Referenced by fr_client_send_item().
|
static |
fast reload, pick up the next item to print
References fast_reload_printq::client_byte_count, fast_reload_printq::client_item, fast_reload_printq::client_len, config_strlist_head::first, fr_client_pickup_next_item(), config_strlist_head::last, config_strlist::next, config_strlist::str, and fast_reload_printq::to_print.
Referenced by fr_client_pickup_next_item().
|
static |
fast reload printq create
References comm_point::callback, comm_point::cb_arg, fast_reload_printq::client_cp, fr_printq_create(), fast_reload_printq::to_print, and fast_reload_printq::worker.
Referenced by fast_reload_thread_start(), and fr_printq_create().
| 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().
|
static |
fast reload printq remove the item from the printq list
References worker::daemon, daemon::fast_reload_printq_list, fr_printq_list_remove(), fast_reload_printq::in_list, fast_reload_printq::prev, and fast_reload_printq::worker.
Referenced by fr_printq_list_remove(), and fr_printq_remove().
|
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().
| 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.
| ssl | the RES connection to print to. |
| worker | the remote servicing worker. |
| s | the 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_verb | verbosity to print output at. 0 is nothing, 1 is some and 2 is more detail. |
| fr_nopause | option to not pause threads during reload. |
| fr_drop_mesh | option 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().
| void fast_reload_thread_stop | ( | struct fast_reload_thread * | fast_reload_thread | ) |
Stop fast reload thread.
| fast_reload_thread | the 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().