OpenVPN
manage.h File Reference
#include "misc.h"
#include "event.h"
#include "socket_util.h"
#include "mroute.h"
Include dependency graph for manage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  man_def_auth_context
struct  command_line
union  log_entry_union
struct  log_entry
struct  log_history
struct  management_callback
struct  man_persist
struct  man_settings
struct  man_connection
struct  management

Macros

#define MF_SERVER   (1u << 0)
#define MF_QUERY_PASSWORDS   (1u << 1)
#define MF_HOLD   (1u << 2)
#define MF_SIGNAL   (1u << 3)
#define MF_FORGET_DISCONNECT   (1u << 4)
#define MF_CONNECT_AS_CLIENT   (1u << 5)
#define MF_CLIENT_AUTH   (1u << 6)
#define MF_UNIX_SOCK   (1u << 8)
#define MF_EXTERNAL_KEY   (1u << 9)
#define MF_EXTERNAL_KEY_NOPADDING   (1u << 10)
#define MF_EXTERNAL_KEY_PKCS1PAD   (1u << 11)
#define MF_UP_DOWN   (1u << 12)
#define MF_QUERY_REMOTE   (1u << 13)
#define MF_QUERY_PROXY   (1u << 14)
#define MF_EXTERNAL_CERT   (1u << 15)
#define MF_EXTERNAL_KEY_PSSPAD   (1u << 16)
#define MF_EXTERNAL_KEY_DIGEST   (1u << 17)
#define MANAGEMENT_VERSION   6
#define MANAGEMENT_N_PASSWORD_RETRIES   3
#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE   100
#define MANAGEMENT_ECHO_BUFFER_SIZE   100
#define MANAGEMENT_STATE_BUFFER_SIZE   100
#define DAF_CONNECTION_ESTABLISHED   (1u << 0)
#define DAF_CONNECTION_CLOSED   (1u << 1)
#define DAF_INITIAL_AUTH   (1u << 2)
#define LOG_PRINT_LOG_PREFIX   (1u << 0)
#define LOG_PRINT_ECHO_PREFIX   (1u << 1)
#define LOG_PRINT_STATE_PREFIX   (1u << 2)
#define LOG_PRINT_INT_DATE   (1u << 3)
#define LOG_PRINT_MSG_FLAGS   (1u << 4)
#define LOG_PRINT_STATE   (1u << 5)
#define LOG_PRINT_LOCAL_IP   (1u << 6)
#define LOG_PRINT_CRLF   (1u << 7)
#define LOG_FATAL_NOTIFY   (1u << 8)
#define LOG_PRINT_INTVAL   (1u << 9)
#define LOG_PRINT_REMOTE_IP   (1u << 10)
#define LOG_ECHO_TO_LOG   (1u << 11)
#define MCF_SERVER   (1u << 0) /* is OpenVPN being run as a server? */
#define MANSIG_IGNORE_USR1_HUP   (1u << 0)
#define MANSIG_MAP_USR1_TO_HUP   (1u << 1)
#define MANSIG_MAP_USR1_TO_TERM   (1u << 2)
#define UP_QUERY_DISABLED   0
#define UP_QUERY_USER_PASS   1
#define UP_QUERY_PASS   2
#define UP_QUERY_NEED_OK   3
#define UP_QUERY_NEED_STR   4
#define UP_QUERY_USERNAME   5
#define MS_INITIAL   0 /* all sockets are closed */
#define MS_LISTEN   1 /* no client is connected */
#define MS_CC_WAIT_READ   2 /* client is connected, waiting for read on socket */
#define MS_CC_WAIT_WRITE   3 /* client is connected, waiting for ability to write to socket */
#define IEC_UNDEF   0
#define IEC_CLIENT_AUTH   1
#define IEC_RSA_SIGN   3
#define IEC_CERTIFICATE   4
#define IEC_PK_SIGN   5
#define IEC_PASSWORD   6
#define EKS_UNDEF   0
#define EKS_SOLICIT   1
#define EKS_INPUT   2
#define EKS_READY   3
#define OPENVPN_STATE_INITIAL   0 /* Initial, undefined state */
#define OPENVPN_STATE_CONNECTING   1 /* Management interface has been initialized */
#define OPENVPN_STATE_ASSIGN_IP   2 /* Assigning IP address to virtual network interface */
#define OPENVPN_STATE_ADD_ROUTES   3 /* Adding routes to system */
#define OPENVPN_STATE_CONNECTED   4 /* Initialization sequence completed */
#define OPENVPN_STATE_RECONNECTING   5 /* Restart */
#define OPENVPN_STATE_EXITING   6 /* Exit */
#define OPENVPN_STATE_WAIT   7 /* Waiting for initial response from server */
#define OPENVPN_STATE_AUTH   8 /* Authenticating with server */
#define OPENVPN_STATE_GET_CONFIG   9 /* Downloading configuration from server */
#define OPENVPN_STATE_RESOLVE   10 /* DNS lookup */
#define OPENVPN_STATE_TCP_CONNECT   11 /* Connecting to TCP server */
#define OPENVPN_STATE_AUTH_PENDING
#define OPENVPN_STATE_CLIENT_BASE   7 /* Base index of client-only states */

Functions

struct command_line * command_line_new (const size_t buf_len)
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_reset (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)
struct log_history * log_history_init (const int capacity)
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)
static int log_history_size (const struct log_history *h)
static int log_history_capacity (const struct log_history *h)
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_post_tunnel_open (struct management *man, const in_addr_t tun_local_ip)
void management_pre_tunnel_close (struct management *man)
void management_socket_set (struct management *man, struct event_set *es, void *arg, unsigned int *persistent)
void management_io (struct management *man)
void management_set_callback (struct management *man, const struct management_callback *cb)
void management_clear_callback (struct management *man)
bool management_query_user_pass (struct management *man, struct user_pass *up, const char *type, const unsigned int flags, const char *static_challenge)
bool management_would_hold (struct management *man)
bool management_hold (struct management *man, int holdtime)
void management_event_loop_n_seconds (struct management *man, int sec)
void management_up_down (const 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)
void management_notify_client_needing_auth (struct management *man, const unsigned int auth_id, struct man_def_auth_context *mdac, const struct env_set *es)
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_notify_client_cr_response (unsigned mda_key_id, const struct man_def_auth_context *mdac, const struct env_set *es, const char *response)
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)
static bool management_connected (const struct management *man)
static bool management_query_user_pass_enabled (const struct management *man)
static bool management_query_remote_enabled (const struct management *man)
static bool management_query_proxy_enabled (const struct management *man)
static bool management_enable_def_auth (const 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_addr, const struct openvpn_sockaddr *remote_addr)
void management_echo (struct management *man, const char *string, const bool pull)
void management_auth_failure (const struct management *man, const char *type, const char *reason)
void management_auth_token (const char *token)
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)
void management_sleep (const int n)
 A sleep function that services the management layer for n seconds rather than doing nothing.

Variables

struct management * management

Macro Definition Documentation

◆ DAF_CONNECTION_CLOSED

#define DAF_CONNECTION_CLOSED   (1u << 1)

◆ DAF_CONNECTION_ESTABLISHED

#define DAF_CONNECTION_ESTABLISHED   (1u << 0)

◆ DAF_INITIAL_AUTH

#define DAF_INITIAL_AUTH   (1u << 2)

◆ EKS_INPUT

#define EKS_INPUT   2

Definition at line 307 of file manage.h.

Referenced by man_certificate(), man_pk_sig(), and management_query_multiline().

◆ EKS_READY

#define EKS_READY   3

Definition at line 308 of file manage.h.

Referenced by in_extra_dispatch(), and management_query_multiline().

◆ EKS_SOLICIT

#define EKS_SOLICIT   1

Definition at line 306 of file manage.h.

Referenced by man_certificate(), man_pk_sig(), and management_query_multiline().

◆ EKS_UNDEF

#define EKS_UNDEF   0

Definition at line 305 of file manage.h.

Referenced by management_query_multiline().

◆ IEC_CERTIFICATE

#define IEC_CERTIFICATE   4

Definition at line 298 of file manage.h.

Referenced by in_extra_dispatch(), and man_certificate().

◆ IEC_CLIENT_AUTH

#define IEC_CLIENT_AUTH   1

Definition at line 295 of file manage.h.

Referenced by in_extra_dispatch(), and man_client_auth().

◆ IEC_PASSWORD

#define IEC_PASSWORD   6

Definition at line 300 of file manage.h.

Referenced by in_extra_dispatch(), and man_query_password_base64().

◆ IEC_PK_SIGN

#define IEC_PK_SIGN   5

Definition at line 299 of file manage.h.

Referenced by in_extra_dispatch(), and man_pk_sig().

◆ IEC_RSA_SIGN

#define IEC_RSA_SIGN   3

Definition at line 297 of file manage.h.

◆ IEC_UNDEF

#define IEC_UNDEF   0

Definition at line 294 of file manage.h.

Referenced by in_extra_reset().

◆ LOG_ECHO_TO_LOG

#define LOG_ECHO_TO_LOG   (1u << 11)

Definition at line 133 of file manage.h.

Referenced by log_entry_print(), and management_set_state().

◆ LOG_FATAL_NOTIFY

#define LOG_FATAL_NOTIFY   (1u << 8)

Definition at line 127 of file manage.h.

Referenced by log_entry_print(), and virtual_output_callback_func().

◆ LOG_PRINT_CRLF

#define LOG_PRINT_CRLF   (1u << 7)

◆ LOG_PRINT_ECHO_PREFIX

#define LOG_PRINT_ECHO_PREFIX   (1u << 1)

Definition at line 118 of file manage.h.

Referenced by log_entry_print(), and management_echo().

◆ LOG_PRINT_INT_DATE

#define LOG_PRINT_INT_DATE   (1u << 3)

◆ LOG_PRINT_INTVAL

#define LOG_PRINT_INTVAL   (1u << 9)

Definition at line 129 of file manage.h.

Referenced by log_entry_print().

◆ LOG_PRINT_LOCAL_IP

#define LOG_PRINT_LOCAL_IP   (1u << 6)

Definition at line 124 of file manage.h.

Referenced by log_entry_print(), man_state(), and management_set_state().

◆ LOG_PRINT_LOG_PREFIX

#define LOG_PRINT_LOG_PREFIX   (1u << 0)

Definition at line 117 of file manage.h.

Referenced by log_entry_print(), and virtual_output_callback_func().

◆ LOG_PRINT_MSG_FLAGS

#define LOG_PRINT_MSG_FLAGS   (1u << 4)

Definition at line 122 of file manage.h.

Referenced by log_entry_print(), man_log(), and virtual_output_callback_func().

◆ LOG_PRINT_REMOTE_IP

#define LOG_PRINT_REMOTE_IP   (1u << 10)

Definition at line 131 of file manage.h.

Referenced by log_entry_print(), man_state(), and management_set_state().

◆ LOG_PRINT_STATE

#define LOG_PRINT_STATE   (1u << 5)

Definition at line 123 of file manage.h.

Referenced by log_entry_print(), man_state(), and management_set_state().

◆ LOG_PRINT_STATE_PREFIX

#define LOG_PRINT_STATE_PREFIX   (1u << 2)

Definition at line 119 of file manage.h.

Referenced by log_entry_print(), and management_set_state().

◆ MANAGEMENT_ECHO_BUFFER_SIZE

#define MANAGEMENT_ECHO_BUFFER_SIZE   100

Definition at line 56 of file manage.h.

Referenced by management_init().

◆ MANAGEMENT_LOG_HISTORY_INITIAL_SIZE

#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE   100

Definition at line 55 of file manage.h.

Referenced by management_init().

◆ MANAGEMENT_N_PASSWORD_RETRIES

#define MANAGEMENT_N_PASSWORD_RETRIES   3

Definition at line 54 of file manage.h.

Referenced by man_check_password().

◆ MANAGEMENT_STATE_BUFFER_SIZE

#define MANAGEMENT_STATE_BUFFER_SIZE   100

Definition at line 57 of file manage.h.

Referenced by management_init().

◆ MANAGEMENT_VERSION

#define MANAGEMENT_VERSION   6

Definition at line 53 of file manage.h.

Referenced by man_dispatch_command(), and man_welcome().

◆ MANSIG_IGNORE_USR1_HUP

#define MANSIG_IGNORE_USR1_HUP   (1u << 0)

Definition at line 255 of file manage.h.

Referenced by man_mod_signal(), and management_hold().

◆ MANSIG_MAP_USR1_TO_HUP

#define MANSIG_MAP_USR1_TO_HUP   (1u << 1)

Definition at line 256 of file manage.h.

Referenced by man_mod_signal(), and man_settings_init().

◆ MANSIG_MAP_USR1_TO_TERM

#define MANSIG_MAP_USR1_TO_TERM   (1u << 2)

Definition at line 257 of file manage.h.

Referenced by man_mod_signal(), and man_settings_init().

◆ MCF_SERVER

#define MCF_SERVER   (1u << 0) /* is OpenVPN being run as a server? */

◆ MF_CLIENT_AUTH

#define MF_CLIENT_AUTH   (1u << 6)

Definition at line 33 of file manage.h.

Referenced by add_option(), and management_enable_def_auth().

◆ MF_CONNECT_AS_CLIENT

#define MF_CONNECT_AS_CLIENT   (1u << 5)

◆ MF_EXTERNAL_CERT

#define MF_EXTERNAL_CERT   (1u << 15)

Definition at line 42 of file manage.h.

Referenced by add_option(), init_ssl(), options_postprocess_verify_ce(), and show_settings().

◆ MF_EXTERNAL_KEY

#define MF_EXTERNAL_KEY   (1u << 9)

◆ MF_EXTERNAL_KEY_DIGEST

#define MF_EXTERNAL_KEY_DIGEST   (1u << 17)

Definition at line 44 of file manage.h.

Referenced by add_option().

◆ MF_EXTERNAL_KEY_NOPADDING

#define MF_EXTERNAL_KEY_NOPADDING   (1u << 10)

Definition at line 37 of file manage.h.

Referenced by add_option(), and options_postprocess_verify_ce().

◆ MF_EXTERNAL_KEY_PKCS1PAD

#define MF_EXTERNAL_KEY_PKCS1PAD   (1u << 11)

Definition at line 38 of file manage.h.

Referenced by add_option().

◆ MF_EXTERNAL_KEY_PSSPAD

#define MF_EXTERNAL_KEY_PSSPAD   (1u << 16)

Definition at line 43 of file manage.h.

Referenced by add_option().

◆ MF_FORGET_DISCONNECT

#define MF_FORGET_DISCONNECT   (1u << 4)

Definition at line 31 of file manage.h.

Referenced by add_option(), and man_reset_client_socket().

◆ MF_HOLD

#define MF_HOLD   (1u << 2)

Definition at line 29 of file manage.h.

Referenced by add_option(), man_hold(), and management_would_hold().

◆ MF_QUERY_PASSWORDS

#define MF_QUERY_PASSWORDS   (1u << 1)

Definition at line 28 of file manage.h.

Referenced by add_option(), management_query_user_pass_enabled(), and openvpn_main().

◆ MF_QUERY_PROXY

#define MF_QUERY_PROXY   (1u << 14)

Definition at line 41 of file manage.h.

Referenced by add_option(), and management_query_proxy_enabled().

◆ MF_QUERY_REMOTE

#define MF_QUERY_REMOTE   (1u << 13)

Definition at line 40 of file manage.h.

Referenced by add_option(), and management_query_remote_enabled().

◆ MF_SERVER

#define MF_SERVER   (1u << 0)

Definition at line 27 of file manage.h.

Referenced by man_bytecount(), management_set_state(), and open_management().

◆ MF_SIGNAL

#define MF_SIGNAL   (1u << 3)

Definition at line 30 of file manage.h.

Referenced by add_option(), and man_reset_client_socket().

◆ MF_UNIX_SOCK

◆ MF_UP_DOWN

#define MF_UP_DOWN   (1u << 12)

Definition at line 39 of file manage.h.

Referenced by add_option(), and management_up_down().

◆ MS_CC_WAIT_READ

#define MS_CC_WAIT_READ   2 /* client is connected, waiting for read on socket */

◆ MS_CC_WAIT_WRITE

#define MS_CC_WAIT_WRITE   3 /* client is connected, waiting for ability to write to socket */

◆ MS_INITIAL

◆ MS_LISTEN

#define MS_LISTEN   1 /* no client is connected */

◆ OPENVPN_STATE_ADD_ROUTES

#define OPENVPN_STATE_ADD_ROUTES   3 /* Adding routes to system */

Definition at line 453 of file manage.h.

Referenced by add_routes(), and man_state_name().

◆ OPENVPN_STATE_ASSIGN_IP

#define OPENVPN_STATE_ASSIGN_IP   2 /* Assigning IP address to virtual network interface */

Definition at line 452 of file manage.h.

Referenced by do_ifconfig(), and man_state_name().

◆ OPENVPN_STATE_AUTH

#define OPENVPN_STATE_AUTH   8 /* Authenticating with server */

Definition at line 460 of file manage.h.

Referenced by man_state_name(), and tls_pre_decrypt().

◆ OPENVPN_STATE_AUTH_PENDING

#define OPENVPN_STATE_AUTH_PENDING
Value:
12 /* Waiting in auth-pending mode \
* technically variant of GET_CONFIG */

Definition at line 464 of file manage.h.

Referenced by man_state_name(), and parse_auth_pending_keywords().

◆ OPENVPN_STATE_CLIENT_BASE

#define OPENVPN_STATE_CLIENT_BASE   7 /* Base index of client-only states */

Definition at line 467 of file manage.h.

Referenced by management_set_state().

◆ OPENVPN_STATE_CONNECTED

#define OPENVPN_STATE_CONNECTED   4 /* Initialization sequence completed */

Definition at line 454 of file manage.h.

Referenced by initialization_sequence_completed(), and man_state_name().

◆ OPENVPN_STATE_CONNECTING

#define OPENVPN_STATE_CONNECTING   1 /* Management interface has been initialized */

Definition at line 451 of file manage.h.

Referenced by man_state_name(), and open_management().

◆ OPENVPN_STATE_EXITING

#define OPENVPN_STATE_EXITING   6 /* Exit */

Definition at line 456 of file manage.h.

Referenced by man_state_name(), and signal_restart_status().

◆ OPENVPN_STATE_GET_CONFIG

#define OPENVPN_STATE_GET_CONFIG   9 /* Downloading configuration from server */

Definition at line 461 of file manage.h.

Referenced by check_connection_established(), and man_state_name().

◆ OPENVPN_STATE_INITIAL

#define OPENVPN_STATE_INITIAL   0 /* Initial, undefined state */

Definition at line 450 of file manage.h.

Referenced by man_state_name().

◆ OPENVPN_STATE_RECONNECTING

#define OPENVPN_STATE_RECONNECTING   5 /* Restart */

Definition at line 455 of file manage.h.

Referenced by man_state_name(), and signal_restart_status().

◆ OPENVPN_STATE_RESOLVE

#define OPENVPN_STATE_RESOLVE   10 /* DNS lookup */

Definition at line 462 of file manage.h.

Referenced by man_state_name(), and openvpn_getaddrinfo().

◆ OPENVPN_STATE_TCP_CONNECT

#define OPENVPN_STATE_TCP_CONNECT   11 /* Connecting to TCP server */

Definition at line 463 of file manage.h.

Referenced by man_state_name(), and socket_connect().

◆ OPENVPN_STATE_WAIT

#define OPENVPN_STATE_WAIT   7 /* Waiting for initial response from server */

Definition at line 459 of file manage.h.

Referenced by man_state_name(), and session_move_pre_start().

◆ UP_QUERY_DISABLED

#define UP_QUERY_DISABLED   0

Definition at line 262 of file manage.h.

Referenced by man_up_finalize(), and management_query_user_pass().

◆ UP_QUERY_NEED_OK

#define UP_QUERY_NEED_OK   3

Definition at line 265 of file manage.h.

Referenced by man_query_need_ok(), man_up_finalize(), and management_query_user_pass().

◆ UP_QUERY_NEED_STR

#define UP_QUERY_NEED_STR   4

Definition at line 266 of file manage.h.

Referenced by man_query_need_str(), man_up_finalize(), and management_query_user_pass().

◆ UP_QUERY_PASS

#define UP_QUERY_PASS   2

◆ UP_QUERY_USER_PASS

#define UP_QUERY_USER_PASS   1

◆ UP_QUERY_USERNAME

#define UP_QUERY_USERNAME   5

Definition at line 267 of file manage.h.

Referenced by man_query_username(), man_up_finalize(), and management_query_user_pass().

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 buf_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().

◆ log_entry_print()

◆ log_history_add()

◆ log_history_capacity()

int log_history_capacity ( const struct log_history * h)
inlinestatic

Definition at line 162 of file manage.h.

References log_history::capacity.

◆ 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_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_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_history_size()

int log_history_size ( const struct log_history * h)
inlinestatic

Definition at line 156 of file manage.h.

References log_history::size.

Referenced by man_history().

◆ man_persist_client_stats()

◆ management_auth_failure()

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

Definition at line 3212 of file manage.c.

References ASSERT, 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 3225 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_connected()

bool management_connected ( const struct management * man)
inlinestatic

◆ management_connection_established()

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

◆ management_echo()

◆ management_enable_def_auth()

bool management_enable_def_auth ( const struct management * man)
inlinestatic

◆ 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 3027 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()

◆ management_notify_generic()

void management_notify_generic ( const char * str)

Definition at line 3033 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_pk_sig()

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

◆ management_query_proxy_enabled()

bool management_query_proxy_enabled ( const struct management * man)
inlinestatic

Definition at line 433 of file manage.h.

References BOOL_CAST, man_settings::flags, MF_QUERY_PROXY, and management::settings.

Referenced by next_connection_entry().

◆ management_query_remote_enabled()

bool management_query_remote_enabled ( const struct management * man)
inlinestatic

Definition at line 427 of file manage.h.

References BOOL_CAST, man_settings::flags, MF_QUERY_REMOTE, and management::settings.

Referenced by next_connection_entry().

◆ management_query_user_pass()

◆ management_query_user_pass_enabled()

bool management_query_user_pass_enabled ( const struct management * man)
inlinestatic

Definition at line 421 of file manage.h.

References BOOL_CAST, man_settings::flags, MF_QUERY_PASSWORDS, and management::settings.

Referenced by get_user_pass_cr().

◆ 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 ( const struct management * man,
const char * updown,
const struct env_set * es )

Definition at line 3017 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)

Variable Documentation

◆ management

struct management* management
extern

Definition at line 76 of file manage.c.