OpenVPN
manage.c File Reference
#include "syshead.h"
#include "error.h"
#include "fdmisc.h"
#include "options.h"
#include "base64.h"
#include "sig.h"
#include "event.h"
#include "otime.h"
#include "integer.h"
#include "misc.h"
#include "ssl.h"
#include "common.h"
#include "manage.h"
#include "openvpn.h"
#include "dco.h"
#include "push.h"
#include "multi.h"
#include "memdbg.h"
Include dependency graph for manage.c:

Go to the source code of this file.

Macros

#define MANAGEMENT_ECHO_PULL_INFO   0
#define MANAGEMENT_ECHO_FLAGS   0
#define AF_DID_PUSH   (1 << 0)
#define AF_DID_RESET   (1 << 1)
#define IER_RESET   0
#define IER_NEW   1
#define MN_AT_LEAST   (1 << 0)
#define MWCC_PASSWORD_WAIT   (1 << 0)
#define MWCC_HOLD_WAIT   (1 << 1)
#define MWCC_OTHER_WAIT   (1 << 2)

Enumerations

enum  mcv {
  MCV_DEFAULT = 1 , MCV_PKSIGN = 2 , MCV_PKSIGN_ALG = 3 , MCV_USERNAME_ONLY = 4 ,
  MCV_MULTILINE_PASSWORD = 5
}

Functions

static void man_output_standalone (struct management *man, volatile int *signal_received)
static void man_reset_client_socket (struct management *man, const bool exiting)
static void man_help (void)
static const char * man_state_name (const int state)
static void man_welcome (struct management *man)
static bool man_password_needed (struct management *man)
static void man_check_password (struct management *man, const char *line)
static void man_update_io_state (struct management *man)
static void man_output_list_push_finalize (struct management *man)
static void man_output_list_push_str (struct management *man, const char *str)
static void man_output_list_push (struct management *man, const char *str)
static void man_prompt (struct management *man)
static void report_command_status (const bool status, const char *command)
 Small function to report the success or failure of a command to the management interface.
static void man_delete_unix_socket (struct management *man)
static void man_close_socket (struct management *man, const socket_descriptor_t sd)
static void virtual_output_callback_func (void *arg, const unsigned int flags, const char *str)
static int man_mod_signal (const struct management *man, const int signum)
static void man_signal (struct management *man, const char *name)
static void man_command_unsupported (const char *command_name)
static void man_status (struct management *man, const int version, struct status_output *so)
static void man_bytecount_stop (struct management *man)
static void man_bytecount (struct management *man, const int update_seconds)
static void man_bytecount_output_client (counter_type bytes_in_total, counter_type bytes_out_total)
static void man_bytecount_output_server (const counter_type bytes_in_total, const counter_type bytes_out_total, struct man_def_auth_context *mdac)
static void man_kill (struct management *man, const char *victim)
static void man_history (struct management *man, const char *parm, const char *type, struct log_history *log, bool *realtime, const unsigned int lep_flags)
static void man_log (struct management *man, const char *parm)
static void man_echo (struct management *man, const char *parm)
static void man_state (struct management *man, const char *parm)
static void man_up_finalize (struct management *man)
static void man_query_user_pass (struct management *man, const char *type, const char *string, const bool needed, const char *prompt, char *dest, int len)
static void man_query_username (struct management *man, const char *type, const char *string)
static void man_query_password (struct management *man, const char *type, const char *string)
static void man_query_need_ok (struct management *man, const char *type, const char *action)
static void man_query_need_str (struct management *man, const char *type, const char *action)
static void man_forget_passwords (void)
static void man_net (struct management *man)
static void man_send_cc_message (struct management *man, const char *message, const char *parameters)
static void man_remote_entry_count (struct management *man)
static void man_remote_entry_get (struct management *man, const char *p1, const char *p2)
static void man_hold (struct management *man, const char *cmd)
static void in_extra_reset (struct man_connection *mc, const int mode)
static void man_query_password_base64 (struct management *man, const char *type)
 Enter multi-line base64 mode for receiving a password that exceeds the single-line parameter size limit.
static void in_extra_dispatch (struct management *man)
static bool parse_cid (const char *str, unsigned long *cid)
static bool parse_uint (const char *str, const char *what, unsigned int *uint)
static void man_client_pending_auth (struct management *man, const char *cid_str, const char *kid_str, const char *extra, const char *timeout_str)
 Will send a notification to the client that succesful authentication will require an additional step (web based SSO/2-factor auth/etc).
static void man_client_auth (struct management *man, const char *cid_str, const char *kid_str, const bool extra)
static void man_client_deny (struct management *man, const char *cid_str, const char *kid_str, const char *reason, const char *client_reason)
static void man_client_kill (struct management *man, const char *cid_str, const char *kill_msg)
static void man_client_n_clients (struct management *man)
static void man_env_filter (struct management *man, const int level)
static void man_pk_sig (struct management *man, const char *cmd_name)
static void man_certificate (struct management *man)
static void man_load_stats (struct management *man)
static bool man_need (const char **p, const int n, unsigned int flags)
 Checks if the correct number of arguments to a management command are present and otherwise prints an error and returns false.
static void man_proxy (struct management *man, const char **p)
static void man_remote (struct management *man, const char **p)
static void set_client_version (struct management *man, const char *version)
static void man_push_update (struct management *man, const char **p, const push_update_type type)
static void man_dispatch_command (struct management *man, struct status_output *so, const char **p, const int nparms)
static void man_start_ne32 (struct management *man)
static void man_stop_ne32 (struct management *man)
static void man_connection_settings_reset (struct management *man)
static void man_new_connection_post (struct management *man, const char *description)
static void man_accept (struct management *man)
static void man_listen (struct management *man)
static void man_connect (struct management *man)
static void man_process_command (struct management *man, const char *line)
static bool man_io_error (struct management *man, const char *prefix)
static ssize_t man_read (struct management *man)
static ssize_t man_write (struct management *man)
static void man_connection_clear (struct man_connection *mc)
static void man_persist_init (struct management *man, const int log_history_cache, const int echo_buffer_size, const int state_buffer_size)
static void man_persist_close (struct man_persist *mp)
static void man_settings_init (struct man_settings *ms, const char *addr, const char *port, const char *pass_file, const char *client_user, const char *client_group, const int log_history_cache, const int echo_buffer_size, const int state_buffer_size, const int remap_sigusr1, const unsigned int flags)
static void man_settings_close (struct man_settings *ms)
static void man_connection_init (struct management *man)
static void man_connection_close (struct management *man)
struct management * management_init (void)
bool management_open (struct management *man, const char *addr, const char *port, const char *pass_file, const char *client_user, const char *client_group, const int log_history_cache, const int echo_buffer_size, const int state_buffer_size, const int remap_sigusr1, const unsigned int flags)
void management_close (struct management *man)
void management_set_callback (struct management *man, const struct management_callback *cb)
void management_clear_callback (struct management *man)
void management_set_state (struct management *man, const int state, const char *detail, const in_addr_t *tun_local_ip, const struct in6_addr *tun_local_ip6, const struct openvpn_sockaddr *local, const struct openvpn_sockaddr *remote)
static bool env_filter_match (const char *env_str, const int env_filter_level)
static void man_output_env (const struct env_set *es, const bool tail, const int env_filter_level, const char *prefix)
static void man_output_extra_env (struct management *man, const char *prefix)
void management_up_down (struct management *man, const char *updown, const struct env_set *es)
void management_notify (const char *severity, const char *type, const char *text)
void management_notify_generic (const char *str)
static void man_output_peer_info_env (struct management *man, const struct man_def_auth_context *mdac)
void management_notify_client_needing_auth (struct management *man, const unsigned int mda_key_id, struct man_def_auth_context *mdac, const struct env_set *es)
void management_notify_client_cr_response (unsigned mda_key_id, const struct man_def_auth_context *mdac, const struct env_set *es, const char *response)
void management_connection_established (struct management *man, struct man_def_auth_context *mdac, const struct env_set *es)
void management_notify_client_close (const struct management *man, struct man_def_auth_context *mdac, const struct env_set *es)
void management_learn_addr (struct man_def_auth_context *mdac, const struct mroute_addr *addr, const bool primary)
void management_echo (struct management *man, const char *string, const bool pull)
void management_post_tunnel_open (struct management *man, const in_addr_t tun_local_ip)
void management_pre_tunnel_close (struct management *man)
void management_auth_failure (struct management *man, const char *type, const char *reason)
void management_auth_token (const char *token)
static bool man_persist_state (unsigned int *persistent, const int n)
void management_socket_set (struct management *man, struct event_set *es, void *arg, unsigned int *persistent)
void management_io (struct management *man)
static bool man_standalone_ok (const struct management *man)
static bool man_check_for_signals (volatile int *signal_received)
static int man_block (struct management *man, volatile int *signal_received, const time_t expire)
static int man_standalone_event_loop (struct management *man, volatile int *signal_received, const time_t expire)
static void man_wait_for_client_connection (struct management *man, volatile int *signal_received, const time_t expire, unsigned int flags)
void management_event_loop_n_seconds (struct management *man, int sec)
bool management_query_user_pass (struct management *man, struct user_pass *up, const char *type, const unsigned int flags, const char *static_challenge)
static int management_query_multiline (struct management *man, const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
static char * management_query_multiline_flatten_newline (struct management *man, const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
static char * management_query_multiline_flatten (struct management *man, const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
char * management_query_pk_sig (struct management *man, const char *b64_data, const char *algorithm)
char * management_query_cert (struct management *man, const char *cert_name)
bool management_would_hold (struct management *man)
bool management_hold (struct management *man, int holdtime)
struct command_line * command_line_new (const size_t len)
void command_line_reset (struct command_line *cl)
void command_line_free (struct command_line *cl)
void command_line_add (struct command_line *cl, const unsigned char *buf, const size_t len)
const char * command_line_get (struct command_line *cl)
void command_line_next (struct command_line *cl)
const char * log_entry_print (const struct log_entry *e, unsigned int flags, struct gc_arena *gc)
static void log_entry_free_contents (struct log_entry *e)
static int log_index (const struct log_history *h, int i)
static void log_history_obj_init (struct log_history *h, int capacity)
struct log_history * log_history_init (const int capacity)
static void log_history_free_contents (struct log_history *h)
void log_history_close (struct log_history *h)
void log_history_add (struct log_history *h, const struct log_entry *le)
void log_history_resize (struct log_history *h, const int capacity)
const struct log_entry * log_history_ref (const struct log_history *h, const int index)
void management_sleep (const int n)
 A sleep function that services the management layer for n seconds rather than doing nothing.
void management_check_bytecount_client (struct context *c, struct management *man, struct timeval *timeval)
void management_check_bytecount_server (struct multi_context *multi, struct timeval *timeval)
void man_persist_client_stats (struct management *man, struct context *c)

Variables

struct management * management

Macro Definition Documentation

◆ AF_DID_PUSH

#define AF_DID_PUSH   (1 << 0)

◆ AF_DID_RESET

#define AF_DID_RESET   (1 << 1)

◆ IER_NEW

#define IER_NEW   1

◆ IER_RESET

#define IER_RESET   0

◆ MANAGEMENT_ECHO_FLAGS

#define MANAGEMENT_ECHO_FLAGS   0

Definition at line 59 of file manage.c.

Referenced by man_echo(), and management_echo().

◆ MANAGEMENT_ECHO_PULL_INFO

#define MANAGEMENT_ECHO_PULL_INFO   0

Definition at line 54 of file manage.c.

◆ MN_AT_LEAST

#define MN_AT_LEAST   (1 << 0)

Definition at line 1341 of file manage.c.

Referenced by man_dispatch_command(), and man_need().

◆ MWCC_HOLD_WAIT

#define MWCC_HOLD_WAIT   (1 << 1)

Definition at line 3514 of file manage.c.

Referenced by man_wait_for_client_connection(), and management_hold().

◆ MWCC_OTHER_WAIT

#define MWCC_OTHER_WAIT   (1 << 2)

Definition at line 3515 of file manage.c.

Referenced by man_wait_for_client_connection(), and management_query_multiline().

◆ MWCC_PASSWORD_WAIT

#define MWCC_PASSWORD_WAIT   (1 << 0)

Definition at line 3513 of file manage.c.

Referenced by man_wait_for_client_connection(), and management_query_user_pass().

Enumeration Type Documentation

◆ mcv

enum mcv
Enumerator
MCV_DEFAULT 
MCV_PKSIGN 
MCV_PKSIGN_ALG 
MCV_USERNAME_ONLY 
MCV_MULTILINE_PASSWORD 

Definition at line 66 of file manage.c.

Function Documentation

◆ command_line_add()

void command_line_add ( struct command_line * cl,
const unsigned char * buf,
const size_t len )

Definition at line 4014 of file manage.c.

References command_line::buf, buf_clear(), buf_write_u8(), CC_NEWLINE, CC_PRINT, and char_class().

Referenced by man_read().

◆ command_line_free()

void command_line_free ( struct command_line * cl)

Definition at line 4001 of file manage.c.

References command_line::buf, command_line_reset(), free_buf(), and command_line::residual.

Referenced by man_connection_close().

◆ command_line_get()

const char * command_line_get ( struct command_line * cl)

◆ command_line_new()

struct command_line * command_line_new ( const size_t len)

Definition at line 3984 of file manage.c.

References alloc_buf(), ALLOC_OBJ_CLEAR, command_line::buf, and command_line::residual.

Referenced by man_connection_init().

◆ command_line_next()

void command_line_next ( struct command_line * cl)

Definition at line 4044 of file manage.c.

References command_line::buf, buf_clear(), buf_copy(), and command_line::residual.

Referenced by man_read().

◆ command_line_reset()

void command_line_reset ( struct command_line * cl)

Definition at line 3994 of file manage.c.

References command_line::buf, buf_clear(), and command_line::residual.

Referenced by command_line_free(), and man_reset_client_socket().

◆ env_filter_match()

bool env_filter_match ( const char * env_str,
const int env_filter_level )
static

Definition at line 2934 of file manage.c.

References SIZE.

Referenced by man_output_env().

◆ in_extra_dispatch()

◆ in_extra_reset()

◆ log_entry_free_contents()

void log_entry_free_contents ( struct log_entry * e)
static

Definition at line 4128 of file manage.c.

References CLEAR, and log_entry::string.

Referenced by log_history_add(), and log_history_free_contents().

◆ log_entry_print()

◆ log_history_add()

◆ log_history_close()

void log_history_close ( struct log_history * h)

Definition at line 4175 of file manage.c.

References log_history_free_contents().

Referenced by man_persist_close().

◆ log_history_free_contents()

void log_history_free_contents ( struct log_history * h)
static

◆ log_history_init()

struct log_history * log_history_init ( const int capacity)

Definition at line 4154 of file manage.c.

References ALLOC_OBJ, ASSERT, log_history::capacity, and log_history_obj_init().

Referenced by man_persist_init().

◆ log_history_obj_init()

void log_history_obj_init ( struct log_history * h,
int capacity )
static

◆ log_history_ref()

const struct log_entry * log_history_ref ( const struct log_history * h,
const int index )

Definition at line 4224 of file manage.c.

References log_history::array, log_index(), and log_history::size.

Referenced by man_history().

◆ log_history_resize()

void log_history_resize ( struct log_history * h,
const int capacity )

◆ log_index()

int log_index ( const struct log_history * h,
int i )
inlinestatic

◆ man_accept()

◆ man_block()

int man_block ( struct management * man,
volatile int * signal_received,
const time_t expire )
static

◆ man_bytecount()

◆ man_bytecount_output_client()

void man_bytecount_output_client ( counter_type bytes_in_total,
counter_type bytes_out_total )
static

Definition at line 566 of file manage.c.

References counter_format, M_CLIENT, and msg.

Referenced by management_check_bytecount_client().

◆ man_bytecount_output_server()

void man_bytecount_output_server ( const counter_type bytes_in_total,
const counter_type bytes_out_total,
struct man_def_auth_context * mdac )
static

Definition at line 578 of file manage.c.

References man_def_auth_context::cid, counter_format, M_CLIENT, and msg.

Referenced by management_check_bytecount_server().

◆ man_bytecount_stop()

void man_bytecount_stop ( struct management * man)
static

◆ man_certificate()

◆ man_check_for_signals()

bool man_check_for_signals ( volatile int * signal_received)
static

◆ man_check_password()

◆ man_client_auth()

void man_client_auth ( struct management * man,
const char * cid_str,
const char * kid_str,
const bool extra )
static

◆ man_client_deny()

void man_client_deny ( struct management * man,
const char * cid_str,
const char * kid_str,
const char * reason,
const char * client_reason )
static

◆ man_client_kill()

void man_client_kill ( struct management * man,
const char * cid_str,
const char * kill_msg )
static

◆ man_client_n_clients()

void man_client_n_clients ( struct management * man)
static

◆ man_client_pending_auth()

void man_client_pending_auth ( struct management * man,
const char * cid_str,
const char * kid_str,
const char * extra,
const char * timeout_str )
static

Will send a notification to the client that succesful authentication will require an additional step (web based SSO/2-factor auth/etc).

Parameters
manThe management interface struct
cid_strThe CID in string form
kid_strThe key ID in string form
extraThe string to be sent to the client containing the information of the additional steps
timeout_strThe timeout value in string form

Definition at line 1172 of file manage.c.

References management_callback::arg, man_persist::callback, management_callback::client_pending_auth, M_CLIENT, man_command_unsupported(), msg, parse_cid(), parse_uint(), and management::persist.

Referenced by man_dispatch_command().

◆ man_close_socket()

void man_close_socket ( struct management * man,
const socket_descriptor_t sd )
static

◆ man_command_unsupported()

◆ man_connect()

◆ man_connection_clear()

void man_connection_clear ( struct man_connection * mc)
static

◆ man_connection_close()

◆ man_connection_init()

◆ man_connection_settings_reset()

◆ man_delete_unix_socket()

void man_delete_unix_socket ( struct management * man)
static

◆ man_dispatch_command()

◆ man_echo()

void man_echo ( struct management * man,
const char * parm )
static

◆ man_env_filter()

void man_env_filter ( struct management * man,
const int level )
static

Definition at line 1289 of file manage.c.

References management::connection, man_connection::env_filter_level, M_CLIENT, and msg.

Referenced by man_dispatch_command().

◆ man_forget_passwords()

void man_forget_passwords ( void )
static

Definition at line 846 of file manage.c.

References M_CLIENT, msg, ssl_clean_auth_token(), and ssl_purge_auth().

Referenced by man_dispatch_command().

◆ man_help()

void man_help ( void )
static

Definition at line 83 of file manage.c.

References M_CLIENT, msg, and title_string.

Referenced by man_dispatch_command().

◆ man_history()

void man_history ( struct management * man,
const char * parm,
const char * type,
struct log_history * log,
bool * realtime,
const unsigned int lep_flags )
static

◆ man_hold()

void man_hold ( struct management * man,
const char * cmd )
static

◆ man_io_error()

bool man_io_error ( struct management * man,
const char * prefix )
static

Definition at line 2260 of file manage.c.

References D_MANAGEMENT, gc, gc_free(), gc_new(), ignore_sys_error(), msg, and openvpn_errno_maybe_crt().

Referenced by man_read(), and man_write().

◆ man_kill()

◆ man_listen()

◆ man_load_stats()

◆ man_log()

void man_log ( struct management * man,
const char * parm )
static

◆ man_mod_signal()

int man_mod_signal ( const struct management * man,
const int signum )
static

◆ man_need()

bool man_need ( const char ** p,
const int n,
unsigned int flags )
static

Checks if the correct number of arguments to a management command are present and otherwise prints an error and returns false.

Parameters
ppointer to the parameter array
nnumber of arguments required
flagsif MN_AT_LEAST require at least n parameters and not exactly n
Returns
Return whether p has n (or at least n) parameters

Definition at line 1352 of file manage.c.

References ASSERT, M_CLIENT, MN_AT_LEAST, and msg.

Referenced by man_dispatch_command().

◆ man_net()

◆ man_new_connection_post()

◆ man_output_env()

void man_output_env ( const struct env_set * es,
const bool tail,
const int env_filter_level,
const char * prefix )
static

◆ man_output_extra_env()

◆ man_output_list_push()

void man_output_list_push ( struct management * man,
const char * str )
static

◆ man_output_list_push_finalize()

◆ man_output_list_push_str()

void man_output_list_push_str ( struct management * man,
const char * str )
static

◆ man_output_peer_info_env()

◆ man_output_standalone()

void man_output_standalone ( struct management * man,
volatile int * signal_received )
static

◆ man_password_needed()

◆ man_persist_client_stats()

◆ man_persist_close()

void man_persist_close ( struct man_persist * mp)
static

◆ man_persist_init()

void man_persist_init ( struct management * man,
const int log_history_cache,
const int echo_buffer_size,
const int state_buffer_size )
static

◆ man_persist_state()

bool man_persist_state ( unsigned int * persistent,
const int n )
inlinestatic

Definition at line 3228 of file manage.c.

Referenced by management_socket_set().

◆ man_pk_sig()

void man_pk_sig ( struct management * man,
const char * cmd_name )
static

◆ man_process_command()

◆ man_prompt()

void man_prompt ( struct management * man)
static

Definition at line 300 of file manage.c.

References man_output_list_push(), and man_password_needed().

Referenced by man_new_connection_post(), and man_read().

◆ man_proxy()

void man_proxy ( struct management * man,
const char ** p )
static

◆ man_push_update()

◆ man_query_need_ok()

void man_query_need_ok ( struct management * man,
const char * type,
const char * action )
static

◆ man_query_need_str()

void man_query_need_str ( struct management * man,
const char * type,
const char * action )
static

◆ man_query_password()

void man_query_password ( struct management * man,
const char * type,
const char * string )
static

◆ man_query_password_base64()

void man_query_password_base64 ( struct management * man,
const char * type )
static

Enter multi-line base64 mode for receiving a password that exceeds the single-line parameter size limit.

The management client sends:

password TYPE <base64-encoded password line 1> <base64-encoded password line 2> ... END

Parameters
manThe management interface struct
typeThe type of password being entered (e.g. "Auth", "Private Key", etc)

Definition at line 1039 of file manage.c.

References management::connection, IEC_PASSWORD, IER_NEW, man_connection::in_extra_cmd, in_extra_reset(), M_CLIENT, msg, streq, man_connection::up_query_mode, UP_QUERY_PASS, man_connection::up_query_type, and UP_QUERY_USER_PASS.

Referenced by man_dispatch_command().

◆ man_query_user_pass()

void man_query_user_pass ( struct management * man,
const char * type,
const char * string,
const bool needed,
const char * prompt,
char * dest,
int len )
static

◆ man_query_username()

void man_query_username ( struct management * man,
const char * type,
const char * string )
static

◆ man_read()

◆ man_remote()

void man_remote ( struct management * man,
const char ** p )
static

◆ man_remote_entry_count()

void man_remote_entry_count ( struct management * man)
static

◆ man_remote_entry_get()

void man_remote_entry_get ( struct management * man,
const char * p1,
const char * p2 )
static

◆ man_reset_client_socket()

◆ man_send_cc_message()

void man_send_cc_message ( struct management * man,
const char * message,
const char * parameters )
static

◆ man_settings_close()

void man_settings_close ( struct man_settings * ms)
static

Definition at line 2716 of file manage.c.

References CLEAR, and man_settings::local.

Referenced by management_close().

◆ man_settings_init()

void man_settings_init ( struct man_settings * ms,
const char * addr,
const char * port,
const char * pass_file,
const char * client_user,
const char * client_group,
const int log_history_cache,
const int echo_buffer_size,
const int state_buffer_size,
const int remap_sigusr1,
const unsigned int flags )
static

◆ man_signal()

void man_signal ( struct management * man,
const char * name )
static

◆ man_standalone_event_loop()

int man_standalone_event_loop ( struct management * man,
volatile int * signal_received,
const time_t expire )
static

◆ man_standalone_ok()

◆ man_start_ne32()

◆ man_state()

◆ man_state_name()

◆ man_status()

void man_status ( struct management * man,
const int version,
struct status_output * so )
static

◆ man_stop_ne32()

void man_stop_ne32 ( struct management * man)
static

◆ man_up_finalize()

◆ man_update_io_state()

◆ man_wait_for_client_connection()

void man_wait_for_client_connection ( struct management * man,
volatile int * signal_received,
const time_t expire,
unsigned int flags )
static

◆ man_welcome()

void man_welcome ( struct management * man)
static

◆ man_write()

◆ management_auth_failure()

void management_auth_failure ( struct management * man,
const char * type,
const char * reason )

Definition at line 3209 of file manage.c.

References M_CLIENT, and msg.

Referenced by auth_user_pass_mgmt(), receive_auth_failed(), tls_ctx_load_pkcs12(), and tls_ctx_load_priv_file().

◆ management_auth_token()

void management_auth_token ( const char * token)

Definition at line 3222 of file manage.c.

References M_CLIENT, and msg.

Referenced by add_option().

◆ management_check_bytecount_client()

◆ management_check_bytecount_server()

◆ management_clear_callback()

void management_clear_callback ( struct management * man)

◆ management_close()

◆ management_connection_established()

void management_connection_established ( struct management * man,
struct man_def_auth_context * mdac,
const struct env_set * es )

◆ management_echo()

◆ management_event_loop_n_seconds()

◆ management_hold()

◆ management_init()

◆ management_io()

◆ management_learn_addr()

void management_learn_addr ( struct man_def_auth_context * mdac,
const struct mroute_addr * addr,
const bool primary )

◆ management_notify()

void management_notify ( const char * severity,
const char * type,
const char * text )

Definition at line 3025 of file manage.c.

References M_CLIENT, and msg.

Referenced by receive_exit_message(), and server_pushed_signal().

◆ management_notify_client_close()

void management_notify_client_close ( const struct management * man,
struct man_def_auth_context * mdac,
const struct env_set * es )

◆ management_notify_client_cr_response()

void management_notify_client_cr_response ( unsigned mda_key_id,
const struct man_def_auth_context * mdac,
const struct env_set * es,
const char * response )

◆ management_notify_client_needing_auth()

void management_notify_client_needing_auth ( struct management * man,
const unsigned int mda_key_id,
struct man_def_auth_context * mdac,
const struct env_set * es )

◆ management_notify_generic()

void management_notify_generic ( const char * str)

Definition at line 3031 of file manage.c.

References M_CLIENT, and msg.

Referenced by ce_management_query_proxy(), ce_management_query_remote(), and server_pushed_info().

◆ management_open()

bool management_open ( struct management * man,
const char * addr,
const char * port,
const char * pass_file,
const char * client_user,
const char * client_group,
const int log_history_cache,
const int echo_buffer_size,
const int state_buffer_size,
const int remap_sigusr1,
const unsigned int flags )

◆ management_post_tunnel_open()

◆ management_pre_tunnel_close()

void management_pre_tunnel_close ( struct management * man)

◆ management_query_cert()

char * management_query_cert ( struct management * man,
const char * cert_name )

◆ management_query_multiline()

◆ management_query_multiline_flatten()

char * management_query_multiline_flatten ( struct management * man,
const char * b64_data,
const char * prompt,
const char * cmd,
int * state,
struct buffer_list ** input )
static

◆ management_query_multiline_flatten_newline()

char * management_query_multiline_flatten_newline ( struct management * man,
const char * b64_data,
const char * prompt,
const char * cmd,
int * state,
struct buffer_list ** input )
static

◆ management_query_pk_sig()

char * management_query_pk_sig ( struct management * man,
const char * b64_data,
const char * algorithm )

◆ management_query_user_pass()

◆ management_set_callback()

void management_set_callback ( struct management * man,
const struct management_callback * cb )

◆ management_set_state()

◆ management_sleep()

void management_sleep ( const int n)

A sleep function that services the management layer for n seconds rather than doing nothing.

Definition at line 4237 of file manage.c.

References management_event_loop_n_seconds(), sleep, and win32_sleep().

Referenced by dco_connect_wait(), do_up(), do_update(), exec_command(), openvpn_connect(), openvpn_getaddrinfo(), read_incoming_link(), socket_listen_accept(), socket_restart_pause(), and tuntap_set_connected().

◆ management_socket_set()

void management_socket_set ( struct management * man,
struct event_set * es,
void * arg,
unsigned int * persistent )

◆ management_up_down()

void management_up_down ( struct management * man,
const char * updown,
const struct env_set * es )

Definition at line 3015 of file manage.c.

References man_settings::flags, M_CLIENT, man_output_env(), MF_UP_DOWN, msg, and management::settings.

Referenced by do_close_tun(), and do_route().

◆ management_would_hold()

bool management_would_hold ( struct management * man)

◆ parse_cid()

bool parse_cid ( const char * str,
unsigned long * cid )
static

Definition at line 1133 of file manage.c.

References M_CLIENT, and msg.

Referenced by man_client_auth(), man_client_deny(), man_client_kill(), man_client_pending_auth(), and man_push_update().

◆ parse_uint()

bool parse_uint ( const char * str,
const char * what,
unsigned int * uint )
static

Definition at line 1147 of file manage.c.

References M_CLIENT, and msg.

Referenced by man_client_auth(), man_client_deny(), and man_client_pending_auth().

◆ report_command_status()

void report_command_status ( const bool status,
const char * command )
static

Small function to report the success or failure of a command to the management interface.

Definition at line 320 of file manage.c.

References M_CLIENT, msg, and status.

Referenced by in_extra_dispatch(), man_proxy(), and man_remote().

◆ set_client_version()

void set_client_version ( struct management * man,
const char * version )
static

◆ virtual_output_callback_func()

Variable Documentation

◆ management

struct management* management

Definition at line 75 of file manage.c.