Electroneum
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
51struct config_file;
52struct listen_list;
53struct listen_port;
54struct worker;
55struct comm_reply;
56struct comm_point;
57struct daemon_remote;
58
60#define REMOTE_CONTROL_TCP_TIMEOUT 120000
61
65struct rc_state {
67 struct rc_state* next;
69 struct comm_point* c;
72#ifdef HAVE_SSL
74 SSL* ssl;
75#endif
77 int fd;
80};
81
91 struct worker* worker;
94 /* if certificates are used */
97 int active;
102#ifdef HAVE_SSL
104 SSL_CTX* ctx;
105#endif
106};
107
112#ifdef HAVE_SSL
114 SSL* ssl;
115#endif
117 int fd;
118};
119typedef struct remote_stream RES;
120
127
133
140
148
157 struct listen_port* ports, struct worker* worker);
158
164
170
176
177#ifdef HAVE_SSL
184int ssl_print_text(RES* ssl, const char* text);
185
192int ssl_printf(RES* ssl, const char* format, ...)
193 ATTR_FORMAT(printf, 2, 3);
194
203int ssl_read_line(RES* ssl, char* buf, size_t max);
204#endif /* HAVE_SSL */
205
206#endif /* DAEMON_REMOTE_H */
struct daemon_remote * daemon_remote_create(struct config_file *cfg)
struct listen_port * daemon_remote_open_ports(struct config_file *cfg)
void daemon_remote_start_accept(struct daemon_remote *rc)
void daemon_remote_delete(struct daemon_remote *rc)
struct remote_stream RES
Definition remote.h:119
void daemon_remote_clear(struct daemon_remote *rc)
void daemon_remote_stop_accept(struct daemon_remote *rc)
int daemon_remote_open_accept(struct daemon_remote *rc, struct listen_port *ports, struct worker *worker)
void daemon_remote_exec(struct worker *worker)
const char * buf
struct worker * worker
Definition remote.h:91
struct listen_list * accept_list
Definition remote.h:93
struct rc_state * busy_list
Definition remote.h:101
int use_cert
Definition remote.h:95
int max_active
Definition remote.h:99
int fd
Definition remote.h:77
struct comm_point * c
Definition remote.h:69
struct daemon_remote * rc
Definition remote.h:79
enum rc_state::@200345346374355104104017117224325211175204124104 shake_state
@ rc_hs_write
Definition remote.h:71
@ rc_hs_read
Definition remote.h:71
@ rc_none
Definition remote.h:71
struct rc_state * next
Definition remote.h:67