diff options
Diffstat (limited to 'contrib/unbound/daemon/daemon.h')
-rw-r--r-- | contrib/unbound/daemon/daemon.h | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/contrib/unbound/daemon/daemon.h b/contrib/unbound/daemon/daemon.h index 3effbafb7918..2295761ab7e3 100644 --- a/contrib/unbound/daemon/daemon.h +++ b/contrib/unbound/daemon/daemon.h @@ -58,6 +58,10 @@ struct ub_randstate; struct daemon_remote; struct respip_set; struct shm_main_info; +struct doq_table; +struct cookie_secrets; +struct fast_reload_thread; +struct fast_reload_printq; #include "dnstap/dnstap_config.h" #ifdef USE_DNSTAP @@ -95,12 +99,22 @@ struct daemon { struct listen_port* rc_ports; /** remote control connections management (for first worker) */ struct daemon_remote* rc; - /** ssl context for listening to dnstcp over ssl, and connecting ssl */ - void* listen_sslctx, *connect_sslctx; + /** ssl context for listening to dnstcp over ssl */ + void* listen_dot_sslctx; + /** ssl context for connecting to dnstcp over ssl */ + void* connect_dot_sslctx; + /** ssl context for listening to DoH */ + void* listen_doh_sslctx; + /** ssl context for listening to quic */ + void* listen_quic_sslctx; /** num threads allocated */ int num; + /** num threads allocated in the previous config or 0 at first */ + int old_num; /** the worker entries */ struct worker** workers; + /** per-worker allocation cache */ + struct alloc_cache **worker_allocs; /** do we need to exit unbound (or is it only a reload?) */ int need_to_exit; /** master random table ; used for port div between threads on reload*/ @@ -111,8 +125,12 @@ struct daemon { struct module_env* env; /** stack of module callbacks */ struct module_stack mods; + /** The module stack has been inited */ + int mods_inited; /** access control, which client IPs are allowed to connect */ struct acl_list* acl; + /** access control, which interfaces are allowed to connect */ + struct acl_list* acl_interface; /** TCP connection limit, limit connections from client IPs */ struct tcl_list* tcl; /** local authority zones */ @@ -121,15 +139,11 @@ struct daemon { struct timeval time_last_stat; /** time when daemon started */ struct timeval time_boot; - /** views structure containing view tree */ - struct views* views; #ifdef USE_DNSTAP /** the dnstap environment master value, copied and changed by threads*/ struct dt_env* dtenv; #endif struct shm_main_info* shm_info; - /** response-ip set with associated actions and tags. */ - struct respip_set* respip_set; /** some response-ip tags or actions are configured if true */ int use_response_ip; /** some RPZ policies are configured */ @@ -138,6 +152,23 @@ struct daemon { /** the dnscrypt environment */ struct dnsc_env* dnscenv; #endif + /** the doq connection table */ + struct doq_table* doq_table; + /** reuse existing cache on reload if other conditions allow it. */ + int reuse_cache; + /** the EDNS cookie secrets from the cookie-secret-file */ + struct cookie_secrets* cookie_secrets; + /** the fast reload thread, or NULL */ + struct fast_reload_thread* fast_reload_thread; + /** the fast reload printq list */ + struct fast_reload_printq* fast_reload_printq_list; + /** the fast reload option to drop mesh queries, true if so. */ + int fast_reload_drop_mesh; + /** for fast reload, if the tcl, tcp connection limits, has + * changes for workers */ + int fast_reload_tcl_has_changes; + /** config file name */ + char* cfgfile; }; /** @@ -155,6 +186,15 @@ struct daemon* daemon_init(void); int daemon_open_shared_ports(struct daemon* daemon); /** + * Do daemon setup that needs privileges + * like opening privileged ports or opening device files. + * The cfg member pointer must have been set for the daemon. + * @param daemon: the daemon. + * @return: false on error. + */ +int daemon_privileged(struct daemon* daemon); + +/** * Fork workers and start service. * When the routine exits, it is no longer forked. * @param daemon: the daemon. @@ -181,4 +221,12 @@ void daemon_delete(struct daemon* daemon); */ void daemon_apply_cfg(struct daemon* daemon, struct config_file* cfg); +/** + * Setup acl list to have entries for the port list. + * @param list: the acl interface + * @param port_list: list of open ports, or none. + * @return false on failure + */ +int setup_acl_for_ports(struct acl_list* list, struct listen_port* port_list); + #endif /* DAEMON_H */ |