Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
remote.h
Go to the documentation of this file.
1
/*
2
* daemon/remote.h - remote control for the unbound daemon.
3
*
4
* Copyright (c) 2008, 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
45
46
#ifndef DAEMON_REMOTE_H
47
#define DAEMON_REMOTE_H
48
#ifdef HAVE_OPENSSL_SSL_H
49
#include "openssl/ssl.h"
50
#endif
51
struct
config_file
;
52
struct
listen_list
;
53
struct
listen_port
;
54
struct
worker
;
55
struct
comm_reply
;
56
struct
comm_point
;
57
struct
daemon_remote
;
58
60
#define REMOTE_CONTROL_TCP_TIMEOUT 120000
61
65
struct
rc_state
{
67
struct
rc_state
*
next
;
69
struct
comm_point
*
c
;
71
enum
{
rc_none
,
rc_hs_read
,
rc_hs_write
}
shake_state
;
72
#ifdef HAVE_SSL
74
SSL* ssl;
75
#endif
77
int
fd
;
79
struct
daemon_remote
*
rc
;
80
};
81
89
struct
daemon_remote
{
91
struct
worker
*
worker
;
93
struct
listen_list
*
accept_list
;
94
/* if certificates are used */
95
int
use_cert
;
97
int
active
;
99
int
max_active
;
101
struct
rc_state
*
busy_list
;
102
#ifdef HAVE_SSL
104
SSL_CTX* ctx;
105
#endif
106
};
107
111
struct
remote_stream
{
112
#ifdef HAVE_SSL
114
SSL* ssl;
115
#endif
117
int
fd
;
118
};
119
typedef
struct
remote_stream
RES
;
120
126
struct
daemon_remote
*
daemon_remote_create
(
struct
config_file
* cfg);
127
132
void
daemon_remote_delete
(
struct
daemon_remote
* rc);
133
139
void
daemon_remote_clear
(
struct
daemon_remote
* rc);
140
147
struct
listen_port
*
daemon_remote_open_ports
(
struct
config_file
* cfg);
148
156
int
daemon_remote_open_accept
(
struct
daemon_remote
* rc,
157
struct
listen_port
* ports,
struct
worker
*
worker
);
158
163
void
daemon_remote_stop_accept
(
struct
daemon_remote
* rc);
164
169
void
daemon_remote_start_accept
(
struct
daemon_remote
* rc);
170
175
void
daemon_remote_exec
(
struct
worker
*
worker
);
176
177
#ifdef HAVE_SSL
184
int
ssl_print_text(
RES
* ssl,
const
char
* text);
185
192
int
ssl_printf(
RES
* ssl,
const
char
* format, ...)
193
ATTR_FORMAT(printf, 2, 3);
194
203
int
ssl_read_line(
RES
* ssl,
char
*
buf
,
size_t
max);
204
#endif
/* HAVE_SSL */
205
206
#endif
/* DAEMON_REMOTE_H */
daemon_remote_create
struct daemon_remote * daemon_remote_create(struct config_file *cfg)
daemon_remote_open_ports
struct listen_port * daemon_remote_open_ports(struct config_file *cfg)
daemon_remote_start_accept
void daemon_remote_start_accept(struct daemon_remote *rc)
daemon_remote_delete
void daemon_remote_delete(struct daemon_remote *rc)
RES
struct remote_stream RES
Definition
remote.h:119
daemon_remote_clear
void daemon_remote_clear(struct daemon_remote *rc)
daemon_remote_stop_accept
void daemon_remote_stop_accept(struct daemon_remote *rc)
daemon_remote_open_accept
int daemon_remote_open_accept(struct daemon_remote *rc, struct listen_port *ports, struct worker *worker)
daemon_remote_exec
void daemon_remote_exec(struct worker *worker)
buf
const char * buf
Definition
slow_memmem.cpp:74
comm_point
Definition
netevent.h:154
comm_reply
Definition
netevent.h:112
config_file
Definition
config_file.h:68
daemon_remote
Definition
remote.h:89
daemon_remote::worker
struct worker * worker
Definition
remote.h:91
daemon_remote::accept_list
struct listen_list * accept_list
Definition
remote.h:93
daemon_remote::active
int active
Definition
remote.h:97
daemon_remote::busy_list
struct rc_state * busy_list
Definition
remote.h:101
daemon_remote::use_cert
int use_cert
Definition
remote.h:95
daemon_remote::max_active
int max_active
Definition
remote.h:99
listen_list
Definition
listen_dnsport.h:72
listen_port
Definition
listen_dnsport.h:104
rc_state
Definition
remote.h:65
rc_state::fd
int fd
Definition
remote.h:77
rc_state::c
struct comm_point * c
Definition
remote.h:69
rc_state::rc
struct daemon_remote * rc
Definition
remote.h:79
rc_state::shake_state
enum rc_state::@200345346374355104104017117224325211175204124104 shake_state
rc_state::rc_hs_write
@ rc_hs_write
Definition
remote.h:71
rc_state::rc_hs_read
@ rc_hs_read
Definition
remote.h:71
rc_state::rc_none
@ rc_none
Definition
remote.h:71
rc_state::next
struct rc_state * next
Definition
remote.h:67
remote_stream
Definition
remote.h:111
remote_stream::fd
int fd
Definition
remote.h:117
worker
Definition
worker.h:82
external
unbound
daemon
remote.h
Generated on
for Electroneum by
1.17.0