Electroneum
Toggle main menu visibility
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
"
48
struct
config_file
;
49
struct
worker
;
50
struct
listen_port
;
51
struct
slabhash
;
52
struct
module_env
;
53
struct
rrset_cache
;
54
struct
acl_list
;
55
struct
local_zones
;
56
struct
views
;
57
struct
ub_randstate;
58
struct
daemon_remote
;
59
struct
respip_set;
60
struct
shm_main_info
;
61
62
#include "dnstap/dnstap_config.h"
63
#ifdef USE_DNSTAP
64
struct
dt_env;
65
#endif
66
67
#include "dnscrypt/dnscrypt_config.h"
68
#ifdef USE_DNSCRYPT
69
struct
dnsc_env;
70
#endif
71
76
struct
daemon
{
78
struct
config_file
*
cfg
;
80
char
*
chroot
;
82
char
*
pidfile
;
84
int
listening_port
;
87
struct
listen_port
**
ports
;
89
size_t
num_ports
;
91
int
reuseport
;
93
int
rc_port
;
95
struct
listen_port
*
rc_ports
;
97
struct
daemon_remote
*
rc
;
99
void
*
listen_sslctx
, *
connect_sslctx
;
101
int
num
;
103
struct
worker
**
workers
;
105
int
need_to_exit
;
107
struct
ub_randstate*
rand
;
109
struct
alloc_cache
superalloc
;
111
struct
module_env
*
env
;
113
struct
module_stack
mods
;
115
struct
acl_list
*
acl
;
117
struct
local_zones
*
local_zones
;
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
128
struct
shm_main_info
*
shm_info
;
130
struct
respip_set
*
respip_set
;
132
int
use_response_ip
;
133
#ifdef USE_DNSCRYPT
135
struct
dnsc_env* dnscenv;
136
#endif
137
};
138
143
struct
daemon
*
daemon_init
(
void
);
144
151
int
daemon_open_shared_ports
(
struct
daemon
*
daemon
);
152
158
void
daemon_fork
(
struct
daemon
*
daemon
);
159
165
void
daemon_cleanup
(
struct
daemon
*
daemon
);
166
171
void
daemon_delete
(
struct
daemon
*
daemon
);
172
178
void
daemon_apply_cfg
(
struct
daemon
*
daemon
,
struct
config_file
*
cfg
);
179
180
#endif
/* DAEMON_H */
alloc.h
daemon_init
struct daemon * daemon_init(void)
daemon_cleanup
void daemon_cleanup(struct daemon *daemon)
daemon_delete
void daemon_delete(struct daemon *daemon)
daemon_fork
void daemon_fork(struct daemon *daemon)
daemon_open_shared_ports
int daemon_open_shared_ports(struct daemon *daemon)
daemon_apply_cfg
void daemon_apply_cfg(struct daemon *daemon, struct config_file *cfg)
locks.h
modstack.h
acl_list
Definition
acl_list.h:74
alloc_cache
Definition
alloc.h:72
config_file
Definition
config_file.h:68
daemon_remote
Definition
remote.h:89
daemon
Definition
daemon.h:76
daemon::use_response_ip
int use_response_ip
Definition
daemon.h:132
daemon::time_last_stat
struct timeval time_last_stat
Definition
daemon.h:119
daemon::reuseport
int reuseport
Definition
daemon.h:91
daemon::need_to_exit
int need_to_exit
Definition
daemon.h:105
daemon::cfg
struct config_file * cfg
Definition
daemon.h:78
daemon::ports
struct listen_port ** ports
Definition
daemon.h:87
daemon::pidfile
char * pidfile
Definition
daemon.h:82
daemon::chroot
char * chroot
Definition
daemon.h:80
daemon::env
struct module_env * env
Definition
daemon.h:111
daemon::rand
struct ub_randstate * rand
Definition
daemon.h:107
daemon::num_ports
size_t num_ports
Definition
daemon.h:89
daemon::time_boot
struct timeval time_boot
Definition
daemon.h:121
daemon::workers
struct worker ** workers
Definition
daemon.h:103
daemon::rc_ports
struct listen_port * rc_ports
Definition
daemon.h:95
daemon::rc_port
int rc_port
Definition
daemon.h:93
daemon::superalloc
struct alloc_cache superalloc
Definition
daemon.h:109
daemon::connect_sslctx
void * connect_sslctx
Definition
daemon.h:99
daemon::mods
struct module_stack mods
Definition
daemon.h:113
daemon::listen_sslctx
void * listen_sslctx
Definition
daemon.h:99
daemon::shm_info
struct shm_main_info * shm_info
Definition
daemon.h:128
daemon::local_zones
struct local_zones * local_zones
Definition
daemon.h:117
daemon::rc
struct daemon_remote * rc
Definition
daemon.h:97
daemon::num
int num
Definition
daemon.h:101
daemon::listening_port
int listening_port
Definition
daemon.h:84
daemon::views
struct views * views
Definition
daemon.h:123
daemon::acl
struct acl_list * acl
Definition
daemon.h:115
daemon::respip_set
struct respip_set * respip_set
Definition
daemon.h:130
listen_port
Definition
listen_dnsport.h:104
local_zones
Definition
localzone.h:99
module_env
Definition
module.h:307
module_stack
Definition
modstack.h:50
rrset_cache
Definition
rrset.h:56
shm_main_info
Definition
shm_main.h:53
slabhash
Definition
slabhash.h:57
views
Definition
view.h:56
worker
Definition
worker.h:82
external
unbound
daemon
daemon.h
Generated on
for Electroneum by
1.17.0