remote.h File Reference

This file contains the remote control functionality for the daemon. More...


Data Structures

struct  rc_state
 a busy control command connection, SSL state More...
struct  daemon_remote
 The remote control tool state. More...

Defines

#define REMOTE_CONTROL_TCP_TIMEOUT   120
 number of seconds timeout on incoming remote control handshake

Functions

struct daemon_remotedaemon_remote_create (struct worker *worker)
 Create new remote control state for the daemon.
void daemon_remote_delete (struct daemon_remote *rc)
 remote control state to delete.
struct listen_portdaemon_remote_open_ports (struct config_file *cfg)
 Open and create listening ports for remote control.
int daemon_remote_open_accept (struct daemon_remote *rc, struct listen_port *ports)
 Setup comm points for accepting remote control connections.
void daemon_remote_exec (struct worker *worker)
 Handle nonthreaded remote cmd execution.
int remote_accept_callback (struct comm_point *, void *, int, struct comm_reply *)
 handle remote control accept callbacks
int remote_control_callback (struct comm_point *, void *, int, struct comm_reply *)
 handle remote control data callbacks
int ssl_print_text (SSL *ssl, const char *text)
 Print fixed line of text over ssl connection in blocking mode.
int ssl_printf (SSL *ssl, const char *format,...) ATTR_FORMAT(printf
 printf style printing to the ssl connection
int int ssl_read_line (SSL *ssl, char *buf, size_t max)
 Read until
is encountered If SSL signals EOF, the string up to then is returned (without
).


Detailed Description

This file contains the remote control functionality for the daemon.

The remote control can be performed using either the commandline unbound-control tool, or a SSLv3/TLS capable web browser. The channel is secured using SSLv3 or TLSv1, and certificates. Both the server and the client(control tool) have their own keys.


Function Documentation

struct daemon_remote* daemon_remote_create ( struct worker worker  )  [read]

Create new remote control state for the daemon.

Parameters:
worker,: worker with communication base. and links to command channels.
Returns:
new state, or NULL on failure.

References daemon::cfg, config_file::chrootdir, daemon_remote::ctx, worker::daemon, daemon_remote_delete(), log_crypto_err(), log_err(), daemon_remote::max_active, config_file::remote_control_enable, config_file::server_cert_file, config_file::server_key_file, VERB_ALGO, verbose(), and daemon_remote::worker.

Referenced by worker_init().

void daemon_remote_delete ( struct daemon_remote rc  ) 

struct listen_port* daemon_remote_open_ports ( struct config_file cfg  )  [read]

Open and create listening ports for remote control.

Parameters:
cfg,: config options.
Returns:
list of ports or NULL on failure. can be freed with listening_ports_free().

References add_open(), config_file::control_ifs, config_file::control_port, config_file::do_ip4, config_file::do_ip6, listening_ports_free(), log_assert, config_strlist::next, config_file::remote_control_enable, and config_strlist::str.

Referenced by daemon_open_shared_ports().

int daemon_remote_open_accept ( struct daemon_remote rc,
struct listen_port ports 
)

Setup comm points for accepting remote control connections.

Parameters:
rc,: state
ports,: already opened ports.
Returns:
false on error.

References accept_open(), listen_port::fd, log_err(), and listen_port::next.

Referenced by worker_init().

void daemon_remote_exec ( struct worker worker  ) 

Handle nonthreaded remote cmd execution.

Parameters:
worker,: this worker (the remote worker).

References worker::cmd, execute_cmd(), log_err(), tube_read_msg(), VERB_ALGO, and verbose().

Referenced by worker_handle_control_cmd().

int ssl_print_text ( SSL *  ssl,
const char *  text 
)

Print fixed line of text over ssl connection in blocking mode.

Parameters:
ssl,: print to
text,: the text.
Returns:
false on connection failure.

References log_crypto_err(), VERB_QUERY, and verbose().

Referenced by ssl_print_vmsg().

int ssl_printf ( SSL *  ssl,
const char *  format,
  ... 
)

printf style printing to the ssl connection

Parameters:
ssl,: the SSL connection to print to. Blocking.
format,: printf style format string.
Returns:
success or false on a network failure.

int int ssl_read_line ( SSL *  ssl,
char *  buf,
size_t  max 
)

Read until
is encountered If SSL signals EOF, the string up to then is returned (without
).

Parameters:
ssl,: the SSL connection to read from. blocking.
buf,: buffer to read to.
max,: size of buffer.
Returns:
false on connection failure.

References log_crypto_err(), and log_err().

Referenced by handle_req(), and ssl_read_buf().


Generated on Thu Mar 26 10:03:52 2009 for unbound by  doxygen 1.5.8