Electroneum
Loading...
Searching...
No Matches
daemon.h
Go to the documentation of this file.
1/*
2 * daemon/daemon.h - collection of workers that handles requests.
3 *
4 * Copyright (c) 2007, NLnet Labs. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * Neither the name of the NLNET LABS nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
41
42#ifndef DAEMON_H
43#define DAEMON_H
44
45#include "util/locks.h"
46#include "util/alloc.h"
47#include "services/modstack.h"
48struct config_file;
49struct worker;
50struct listen_port;
51struct slabhash;
52struct module_env;
53struct rrset_cache;
54struct acl_list;
55struct local_zones;
56struct views;
57struct ub_randstate;
58struct daemon_remote;
59struct respip_set;
60struct shm_main_info;
61
62#include "dnstap/dnstap_config.h"
63#ifdef USE_DNSTAP
64struct dt_env;
65#endif
66
67#include "dnscrypt/dnscrypt_config.h"
68#ifdef USE_DNSCRYPT
69struct dnsc_env;
70#endif
71
76struct daemon {
80 char* chroot;
82 char* pidfile;
89 size_t num_ports;
101 int num;
103 struct worker** workers;
107 struct ub_randstate* rand;
115 struct acl_list* acl;
119 struct timeval time_last_stat;
121 struct timeval time_boot;
123 struct views* views;
124#ifdef USE_DNSTAP
126 struct dt_env* dtenv;
127#endif
133#ifdef USE_DNSCRYPT
135 struct dnsc_env* dnscenv;
136#endif
137};
138
143struct daemon* daemon_init(void);
144
152
159
166
172
179
180#endif /* DAEMON_H */
struct daemon * daemon_init(void)
void daemon_cleanup(struct daemon *daemon)
void daemon_delete(struct daemon *daemon)
void daemon_fork(struct daemon *daemon)
int daemon_open_shared_ports(struct daemon *daemon)
void daemon_apply_cfg(struct daemon *daemon, struct config_file *cfg)
int use_response_ip
Definition daemon.h:132
struct timeval time_last_stat
Definition daemon.h:119
int reuseport
Definition daemon.h:91
int need_to_exit
Definition daemon.h:105
struct config_file * cfg
Definition daemon.h:78
struct listen_port ** ports
Definition daemon.h:87
char * pidfile
Definition daemon.h:82
char * chroot
Definition daemon.h:80
struct module_env * env
Definition daemon.h:111
struct ub_randstate * rand
Definition daemon.h:107
size_t num_ports
Definition daemon.h:89
struct timeval time_boot
Definition daemon.h:121
struct worker ** workers
Definition daemon.h:103
struct listen_port * rc_ports
Definition daemon.h:95
int rc_port
Definition daemon.h:93
struct alloc_cache superalloc
Definition daemon.h:109
void * connect_sslctx
Definition daemon.h:99
struct module_stack mods
Definition daemon.h:113
void * listen_sslctx
Definition daemon.h:99
struct shm_main_info * shm_info
Definition daemon.h:128
struct local_zones * local_zones
Definition daemon.h:117
struct daemon_remote * rc
Definition daemon.h:97
int num
Definition daemon.h:101
int listening_port
Definition daemon.h:84
struct views * views
Definition daemon.h:123
struct acl_list * acl
Definition daemon.h:115
struct respip_set * respip_set
Definition daemon.h:130
Definition view.h:56