Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
worker.h
Go to the documentation of this file.
1
/*
2
* daemon/worker.h - worker that handles a pending list of 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
42
43
#ifndef DAEMON_WORKER_H
44
#define DAEMON_WORKER_H
45
46
#include "
libunbound/worker.h
"
47
#include "
util/netevent.h
"
48
#include "
util/locks.h
"
49
#include "
util/alloc.h
"
50
#include "
util/data/msgreply.h
"
51
#include "
util/data/msgparse.h
"
52
#include "
daemon/stats.h
"
53
#include "
util/module.h
"
54
#include "
dnstap/dnstap.h
"
55
struct
listen_dnsport
;
56
struct
outside_network
;
57
struct
config_file
;
58
struct
daemon
;
59
struct
listen_port
;
60
struct
ub_randstate;
61
struct
regional
;
62
struct
tube
;
63
struct
daemon_remote
;
64
struct
query_info
;
65
67
enum
worker_commands
{
69
worker_cmd_quit
,
71
worker_cmd_stats
,
73
worker_cmd_stats_noreset
,
75
worker_cmd_remote
76
};
77
82
struct
worker
{
84
int
thread_num
;
86
struct
daemon
*
daemon
;
88
ub_thread_type
thr_id
;
90
struct
tube
*
cmd
;
92
struct
comm_base
*
base
;
94
struct
listen_dnsport
*
front
;
96
struct
outside_network
*
back
;
98
int
*
ports
;
100
int
numports
;
102
struct
comm_signal
*
comsig
;
104
struct
comm_point
*
cmd_com
;
106
struct
comm_timer
*
stat_timer
;
108
time_t
err_limit_time
;
110
unsigned
int
err_limit_count
;
111
113
struct
ub_randstate*
rndstate
;
115
int
need_to_exit
;
117
struct
alloc_cache
alloc
;
119
struct
ub_server_stats
stats
;
121
struct
regional
*
scratchpad
;
122
124
struct
module_env
env
;
125
126
#ifdef USE_DNSTAP
128
struct
dt_env dtenv;
129
#endif
130
};
131
141
struct
worker
*
worker_create
(
struct
daemon
*
daemon
,
int
id
,
int
*
ports
,
int
n);
142
152
int
worker_init
(
struct
worker
*
worker
,
struct
config_file
*cfg,
153
struct
listen_port
*
ports
,
int
do_sigs);
154
158
void
worker_work
(
struct
worker
*
worker
);
159
163
void
worker_delete
(
struct
worker
*
worker
);
164
170
void
worker_send_cmd
(
struct
worker
*
worker
,
enum
worker_commands
cmd
);
171
176
void
worker_stats_clear
(
struct
worker
*
worker
);
177
178
#endif
/* DAEMON_WORKER_H */
alloc.h
worker_send_cmd
void worker_send_cmd(struct worker *worker, enum worker_commands cmd)
worker_commands
worker_commands
Definition
worker.h:67
worker_cmd_quit
@ worker_cmd_quit
Definition
worker.h:69
worker_cmd_remote
@ worker_cmd_remote
Definition
worker.h:75
worker_cmd_stats
@ worker_cmd_stats
Definition
worker.h:71
worker_cmd_stats_noreset
@ worker_cmd_stats_noreset
Definition
worker.h:73
worker_work
void worker_work(struct worker *worker)
worker_stats_clear
void worker_stats_clear(struct worker *worker)
worker_init
int worker_init(struct worker *worker, struct config_file *cfg, struct listen_port *ports, int do_sigs)
worker_delete
void worker_delete(struct worker *worker)
worker_create
struct worker * worker_create(struct daemon *daemon, int id, int *ports, int n)
dnstap.h
stats.h
worker.h
locks.h
ub_thread_type
pid_t ub_thread_type
Definition
locks.h:283
module.h
msgparse.h
msgreply.h
netevent.h
alloc_cache
Definition
alloc.h:72
comm_base
Definition
netevent.h:96
comm_point
Definition
netevent.h:154
comm_signal
Definition
netevent.h:323
comm_timer
Definition
netevent.h:309
config_file
Definition
config_file.h:68
daemon_remote
Definition
remote.h:89
daemon
Definition
daemon.h:76
listen_dnsport
Definition
listen_dnsport.h:55
listen_port
Definition
listen_dnsport.h:104
module_env
Definition
module.h:307
outside_network
Definition
outside_network.h:70
query_info
Definition
msgreply.h:69
regional
Definition
regional.h:60
tube
Definition
tube.h:63
ub_server_stats
Definition
unbound.h:642
worker
Definition
worker.h:82
worker::cmd
struct tube * cmd
Definition
worker.h:90
worker::numports
int numports
Definition
worker.h:100
worker::env
struct module_env env
Definition
worker.h:124
worker::ports
int * ports
Definition
worker.h:98
worker::thr_id
ub_thread_type thr_id
Definition
worker.h:88
worker::comsig
struct comm_signal * comsig
Definition
worker.h:102
worker::scratchpad
struct regional * scratchpad
Definition
worker.h:121
worker::err_limit_count
unsigned int err_limit_count
Definition
worker.h:110
worker::stat_timer
struct comm_timer * stat_timer
Definition
worker.h:106
worker::stats
struct ub_server_stats stats
Definition
worker.h:119
worker::cmd_com
struct comm_point * cmd_com
Definition
worker.h:104
worker::front
struct listen_dnsport * front
Definition
worker.h:94
worker::thread_num
int thread_num
Definition
worker.h:84
worker::err_limit_time
time_t err_limit_time
Definition
worker.h:108
worker::back
struct outside_network * back
Definition
worker.h:96
worker::daemon
struct daemon * daemon
Definition
worker.h:86
worker::need_to_exit
int need_to_exit
Definition
worker.h:115
worker::alloc
struct alloc_cache alloc
Definition
worker.h:117
worker::base
struct comm_base * base
Definition
worker.h:92
worker::rndstate
struct ub_randstate * rndstate
Definition
worker.h:113
external
unbound
daemon
worker.h
Generated on
for Electroneum by
1.17.0