OpenVPN
|
#include "syshead.h"
#include "error.h"
#include "fdmisc.h"
#include "options.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 "memdbg.h"
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) |
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. More... | |
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 (struct management *man, const int update_seconds) |
static void | man_bytecount_output_client (struct management *man, counter_type dco_read_bytes, counter_type dco_write_bytes) |
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 (struct management *man) |
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 | 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) More... | |
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 (struct management *man, 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. More... | |
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_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 int | man_read (struct management *man) |
static int | 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 (struct management *man, const char *severity, const char *type, const char *text) |
void | management_notify_generic (struct management *man, 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 *management, 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 *management, struct man_def_auth_context *mdac, const struct env_set *es) |
void | management_notify_client_close (struct management *management, struct man_def_auth_context *mdac, const struct env_set *es) |
void | management_learn_addr (struct management *management, 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 (struct management *man, 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_should_daemonize (struct management *man) |
bool | management_hold (struct management *man, int holdtime) |
struct command_line * | command_line_new (const int buf_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 int 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. More... | |
void | management_check_bytecount (struct context *c, struct management *man, struct timeval *timeval) |
void | man_persist_client_stats (struct management *man, struct context *c) |
Variables | |
static const char | blank_up [] = "[[BLANK]]" |
struct management * | management |
#define AF_DID_PUSH (1<<0) |
#define AF_DID_RESET (1<<1) |
void command_line_add | ( | struct command_line * | cl, |
const unsigned char * | buf, | ||
const int | len | ||
) |
Definition at line 3895 of file manage.c.
References command_line::buf, buf_clear(), buf_write_u8(), CC_NEWLINE, CC_PRINT, and char_class().
Referenced by man_read().
void command_line_free | ( | struct command_line * | cl | ) |
Definition at line 3882 of file manage.c.
References command_line::buf, command_line_reset(), free_buf(), and command_line::residual.
Referenced by man_connection_close().
const char* command_line_get | ( | struct command_line * | cl | ) |
Definition at line 3911 of file manage.c.
References BSTR, command_line::buf, buf_chomp(), buf_copy_excess(), buf_substring_len(), and command_line::residual.
Referenced by man_read().
struct command_line* command_line_new | ( | const int | buf_len | ) |
Definition at line 3865 of file manage.c.
References alloc_buf(), ALLOC_OBJ_CLEAR, command_line::buf, buf_len(), and command_line::residual.
Referenced by man_connection_init().
void command_line_next | ( | struct command_line * | cl | ) |
Definition at line 3927 of file manage.c.
References command_line::buf, buf_clear(), buf_copy(), and command_line::residual.
Referenced by man_read().
void command_line_reset | ( | struct command_line * | cl | ) |
Definition at line 3875 of file manage.c.
References command_line::buf, buf_clear(), and command_line::residual.
Referenced by command_line_free(), and man_reset_client_socket().
|
static |
|
static |
Definition at line 979 of file manage.c.
References management_callback::arg, buffer_list_free(), man_persist::callback, management_callback::client_auth, management::connection, EKS_READY, man_connection::ext_cert_input, man_connection::ext_cert_state, man_connection::ext_key_input, man_connection::ext_key_state, IEC_CERTIFICATE, IEC_CLIENT_AUTH, IEC_PK_SIGN, IER_RESET, man_connection::in_extra, man_connection::in_extra_cid, man_connection::in_extra_cmd, man_connection::in_extra_kid, in_extra_reset(), man_command_unsupported(), management::persist, report_command_status(), and status.
Referenced by man_client_auth(), and man_read().
|
static |
Definition at line 956 of file manage.c.
References buffer_list_free(), buffer_list_new(), IEC_UNDEF, IER_NEW, man_connection::in_extra, man_connection::in_extra_cid, man_connection::in_extra_cmd, and man_connection::in_extra_kid.
Referenced by in_extra_dispatch(), man_certificate(), man_client_auth(), man_connection_close(), man_pk_sig(), man_process_command(), man_reset_client_socket(), and management_query_multiline().
|
static |
Definition at line 4005 of file manage.c.
References CLEAR, and log_entry::string.
Referenced by log_history_add(), and log_history_free_contents().
const char* log_entry_print | ( | const struct log_entry * | e, |
unsigned int | flags, | ||
struct gc_arena * | gc | ||
) |
Definition at line 3939 of file manage.c.
References openvpn_sockaddr::addr, addr_defined(), alloc_buf_gc(), BSTR, buf_printf(), D_MANAGEMENT, ERR_BUF_SIZE, IA_EMPTY_IF_UNDEF, log_entry_union::intval, log_entry::local_ip, log_entry::local_ip6, log_entry::local_sock, LOG_ECHO_TO_LOG, LOG_FATAL_NOTIFY, LOG_PRINT_CRLF, LOG_PRINT_ECHO_PREFIX, LOG_PRINT_INT_DATE, LOG_PRINT_INTVAL, LOG_PRINT_LOCAL_IP, LOG_PRINT_LOG_PREFIX, LOG_PRINT_MSG_FLAGS, LOG_PRINT_REMOTE_IP, LOG_PRINT_STATE, LOG_PRINT_STATE_PREFIX, man_state_name(), msg, log_entry_union::msg_flags, msg_flags_string(), print_in6_addr(), print_in_addr_t(), print_sockaddr_ex(), PS_DONT_SHOW_FAMILY, PS_SHOW_PORT, log_entry::remote_sock, openvpn_sockaddr::sa, log_entry_union::state, log_entry::string, log_entry::timestamp, and log_entry::u.
Referenced by man_history(), management_echo(), management_set_state(), and virtual_output_callback_func().
void log_history_add | ( | struct log_history * | h, |
const struct log_entry * | le | ||
) |
Definition at line 4059 of file manage.c.
References log_history::array, ASSERT, log_history::base, log_history::capacity, log_entry_free_contents(), log_index(), log_history::size, log_entry::string, and string_alloc().
Referenced by log_history_resize(), management_echo(), management_set_state(), and virtual_output_callback_func().
void log_history_close | ( | struct log_history * | h | ) |
Definition at line 4052 of file manage.c.
References log_history_free_contents().
Referenced by man_persist_close().
|
static |
Definition at line 4041 of file manage.c.
References log_history::array, log_entry_free_contents(), log_index(), and log_history::size.
Referenced by log_history_close(), and log_history_resize().
struct log_history* log_history_init | ( | const int | capacity | ) |
Definition at line 4031 of file manage.c.
References ALLOC_OBJ, ASSERT, log_history::capacity, and log_history_obj_init().
Referenced by man_persist_init().
|
static |
Definition at line 4023 of file manage.c.
References ALLOC_ARRAY_CLEAR, log_history::array, buffer::capacity, log_history::capacity, and CLEAR.
Referenced by log_history_init(), and log_history_resize().
const struct log_entry* log_history_ref | ( | const struct log_history * | h, |
const int | index | ||
) |
Definition at line 4101 of file manage.c.
References log_history::array, log_index(), and log_history::size.
Referenced by man_history().
void log_history_resize | ( | struct log_history * | h, |
const int | capacity | ||
) |
Definition at line 4080 of file manage.c.
References log_history::array, ASSERT, log_history::capacity, log_history_add(), log_history_free_contents(), log_history_obj_init(), log_index(), and log_history::size.
Referenced by management_open().
|
inlinestatic |
Definition at line 4017 of file manage.c.
References log_history::base, log_history::capacity, and modulo_add().
Referenced by log_history_add(), log_history_free_contents(), log_history_ref(), and log_history_resize().
|
static |
Definition at line 1805 of file manage.c.
References CLEAR, management::connection, link_socket_actual::dest, man_settings::flags, man_new_connection_post(), man_stop_ne32(), MF_UNIX_SOCK, man_connection::remote, man_connection::sd_cli, sd_close(), man_connection::sd_top, management::settings, socket_defined(), and socket_do_accept().
Referenced by management_io().
|
static |
Definition at line 3291 of file manage.c.
References management::connection, man_connection::es, event_reset(), event_wait(), man_check_for_signals(), man_standalone_ok(), management_socket_set(), now, status, and update_time().
Referenced by man_output_standalone(), and man_standalone_event_loop().
|
static |
Definition at line 492 of file manage.c.
References man_connection::bytecount_update_interval, man_connection::bytecount_update_seconds, management::connection, event_timeout_clear(), event_timeout_init(), M_CLIENT, msg, and now.
Referenced by man_dispatch_command().
|
static |
Definition at line 510 of file manage.c.
References man_persist::bytes_in, man_persist::bytes_out, counter_format, M_CLIENT, msg, and management::persist.
Referenced by management_check_bytecount().
void man_bytecount_output_server | ( | const counter_type * | bytes_in_total, |
const counter_type * | bytes_out_total, | ||
struct man_def_auth_context * | mdac | ||
) |
Definition at line 524 of file manage.c.
References man_def_auth_context::bytecount_last_update, man_def_auth_context::cid, counter_format, M_CLIENT, msg, and now.
Referenced by management_bytes_server().
|
static |
Definition at line 1206 of file manage.c.
References management::connection, EKS_INPUT, EKS_SOLICIT, man_connection::ext_cert_state, IEC_CERTIFICATE, IER_NEW, man_connection::in_extra_cmd, in_extra_reset(), M_CLIENT, and msg.
Referenced by man_dispatch_command().
|
static |
Definition at line 3274 of file manage.c.
References get_signal().
Referenced by man_block(), management_event_loop_n_seconds(), management_hold(), management_query_multiline(), and management_query_user_pass().
|
static |
Definition at line 197 of file manage.c.
References management::connection, man_connection::halt, M_CLIENT, M_WARN, man_password_needed(), man_welcome(), MANAGEMENT_N_PASSWORD_RETRIES, memcmp_constant_time(), min_uint(), msg, user_pass::password, man_connection::password_tries, man_connection::password_verified, management::settings, and man_settings::up.
Referenced by man_process_command().
|
static |
Definition at line 1092 of file manage.c.
References management::connection, IEC_CLIENT_AUTH, IER_NEW, man_connection::in_extra_cid, man_connection::in_extra_cmd, in_extra_dispatch(), man_connection::in_extra_kid, in_extra_reset(), parse_cid(), and parse_uint().
Referenced by man_dispatch_command().
|
static |
Definition at line 1110 of file manage.c.
References management_callback::arg, man_persist::callback, management_callback::client_auth, M_CLIENT, man_command_unsupported(), msg, parse_cid(), parse_uint(), management::persist, and status.
Referenced by man_dispatch_command().
|
static |
Definition at line 1143 of file manage.c.
References management_callback::arg, man_persist::callback, management_callback::kill_by_cid, M_CLIENT, man_command_unsupported(), msg, parse_cid(), management::persist, and status.
Referenced by man_dispatch_command().
|
static |
Definition at line 1168 of file manage.c.
References management_callback::arg, man_persist::callback, M_CLIENT, man_command_unsupported(), msg, management_callback::n_clients, and management::persist.
Referenced by man_dispatch_command().
|
static |
Will send a notification to the client that succesful authentication will require an additional step (web based SSO/2-factor auth/etc)
man | The management interface struct |
cid_str | The CID in string form |
kid_str | The key ID in string form |
extra | The string to be send to the client containing the information of the additional steps |
Definition at line 1059 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().
|
static |
Definition at line 317 of file manage.c.
References management_callback::arg, man_persist::callback, management_callback::delete_event, openvpn_close_socket, and management::persist.
Referenced by man_connection_close(), and man_reset_client_socket().
|
static |
Definition at line 473 of file manage.c.
Referenced by in_extra_dispatch(), man_client_deny(), man_client_kill(), man_client_n_clients(), man_client_pending_auth(), man_kill(), man_net(), man_proxy(), man_remote(), man_remote_entry_count(), man_remote_entry_get(), man_send_cc_message(), and man_status().
|
static |
Definition at line 1920 of file manage.c.
References management::connection, create_socket_tcp(), D_LINK_ERRORS, man_settings::flags, gc_free(), gc_new(), man_settings::local, M_ERRNO, man_new_connection_post(), MF_UNIX_SOCK, MS_INITIAL, msg, openvpn_connect(), print_sockaddr(), man_connection::sd_cli, sd_close(), man_connection::sd_top, management::settings, SOCKET_UNDEFINED, man_connection::state, status, throw_signal(), and throw_signal_soft().
Referenced by man_connection_init().
|
static |
Definition at line 2376 of file manage.c.
References CLEAR, MS_INITIAL, man_connection::sd_cli, man_connection::sd_top, SOCKET_UNDEFINED, and man_connection::state.
Referenced by man_connection_close(), and management_init().
|
static |
Definition at line 2610 of file manage.c.
References buffer_list_free(), man_connection::bytecount_update_interval, command_line_free(), management::connection, man_connection::es, event_free(), event_timeout_clear(), man_connection::ext_key_input, IER_RESET, man_connection::in, in_extra_reset(), man_close_socket(), man_connection_clear(), man_delete_unix_socket(), man_connection::ne32, net_event_win32_close(), man_connection::out, man_connection::sd_cli, man_connection::sd_top, and socket_defined().
Referenced by management_close(), and management_pre_tunnel_close().
|
static |
Definition at line 2565 of file manage.c.
References buffer_list_new(), man_connection::client_version, command_line_new(), management::connection, man_connection::es, EVENT_METHOD_FAST, event_set_init(), man_settings::flags, man_connection::in, man_connect(), man_listen(), MF_CONNECT_AS_CLIENT, MS_INITIAL, man_connection::ne32, net_event_win32_init(), man_connection::out, management::settings, and man_connection::state.
Referenced by management_open(), and management_post_tunnel_open().
|
static |
Definition at line 1703 of file manage.c.
References man_connection::bytecount_update_seconds, management::connection, man_connection::echo_realtime, man_connection::halt, man_connection::log_realtime, MS_CC_WAIT_WRITE, man_connection::password_tries, man_connection::password_verified, man_connection::state, and man_connection::state_realtime.
Referenced by man_new_connection_post().
|
static |
Definition at line 306 of file manage.c.
References man_settings::flags, MF_CONNECT_AS_CLIENT, MF_UNIX_SOCK, and management::settings.
Referenced by man_connection_close(), and man_listen().
|
static |
Definition at line 1329 of file manage.c.
References ASSERT, auth_retry_print(), auth_retry_set(), management::connection, gc_free(), gc_new(), get_debug_level(), get_mute_cutoff(), man_connection::halt, M_CLIENT, man_bytecount(), man_certificate(), man_client_auth(), man_client_deny(), man_client_kill(), man_client_n_clients(), man_client_pending_auth(), man_echo(), man_env_filter(), man_forget_passwords(), man_help(), man_hold(), man_kill(), man_load_stats(), man_log(), man_need(), man_net(), man_pk_sig(), man_proxy(), man_query_need_ok(), man_query_need_str(), man_query_password(), man_query_username(), man_remote(), man_remote_entry_count(), man_remote_entry_get(), man_send_cc_message(), man_signal(), man_state(), man_status(), MANAGEMENT_VERSION, MN_AT_LEAST, msg, platform_getpid(), set_client_version(), set_debug_level(), set_mute_cutoff(), streq, and title_string.
Referenced by man_process_command().
|
static |
Definition at line 676 of file manage.c.
References management::connection, man_persist::echo, man_connection::echo_realtime, LOG_PRINT_INT_DATE, man_history(), MANAGEMENT_ECHO_FLAGS, and management::persist.
Referenced by man_dispatch_command().
|
static |
Definition at line 1182 of file manage.c.
References management::connection, man_connection::env_filter_level, M_CLIENT, and msg.
Referenced by man_dispatch_command().
|
static |
Definition at line 798 of file manage.c.
References M_CLIENT, msg, ssl_clean_auth_token(), and ssl_purge_auth().
Referenced by man_dispatch_command().
|
static |
Definition at line 71 of file manage.c.
References M_CLIENT, msg, and title_string.
Referenced by man_dispatch_command().
|
static |
Definition at line 619 of file manage.c.
References gc_free(), gc_new(), log_entry_print(), log_history_ref(), log_history_size(), M_CLIENT, msg, streq, and virtual_output_callback_func().
Referenced by man_echo(), man_log(), and man_state().
|
static |
Definition at line 922 of file manage.c.
References BOOL_CAST, man_settings::flags, man_persist::hold_release, M_CLIENT, MF_HOLD, msg, management::persist, management::settings, and streq.
Referenced by man_dispatch_command().
|
static |
Definition at line 2084 of file manage.c.
References D_MANAGEMENT, gc_free(), gc_new(), ignore_sys_error(), msg, and openvpn_errno_maybe_crt().
Referenced by man_read(), and man_write().
|
static |
Definition at line 538 of file manage.c.
References management_callback::arg, buf_parse(), buf_set_read(), man_persist::callback, gc_free(), gc_new(), getaddr(), GETADDR_HOST_ORDER, GETADDR_MSG_VIRT_OUT, management_callback::kill_by_addr, management_callback::kill_by_cn, M_CLIENT, man_command_unsupported(), msg, management::persist, print_in_addr_t(), and status.
Referenced by man_dispatch_command().
|
static |
Definition at line 1843 of file manage.c.
References management::connection, create_socket_tcp(), D_MANAGEMENT, man_settings::flags, gc_free(), gc_new(), man_settings::local, M_ERR, M_ERRNO, M_WARN, man_delete_unix_socket(), man_start_ne32(), MF_UNIX_SOCK, MS_LISTEN, msg, print_sockaddr(), man_connection::sd_cli, man_connection::sd_top, set_nonblock(), management::settings, socket_bind(), SOCKET_UNDEFINED, and man_connection::state.
Referenced by man_connection_init(), and man_reset_client_socket().
|
static |
Definition at line 1222 of file manage.c.
References management_callback::arg, man_persist::callback, counter_format, link_read_bytes_global, link_write_bytes_global, M_CLIENT, msg, management_callback::n_clients, and management::persist.
Referenced by man_dispatch_command().
|
static |
Definition at line 665 of file manage.c.
References management::connection, man_persist::log, LOG_PRINT_INT_DATE, LOG_PRINT_MSG_FLAGS, man_connection::log_realtime, man_history(), and management::persist.
Referenced by man_dispatch_command().
|
static |
Definition at line 420 of file manage.c.
References man_settings::mansig, MANSIG_IGNORE_USR1_HUP, MANSIG_MAP_USR1_TO_HUP, MANSIG_MAP_USR1_TO_TERM, and management::settings.
Referenced by man_reset_client_socket(), and man_signal().
|
static |
Checks if the correct number of arguments to a management command are present and otherwise prints an error and returns false.
p | pointer to the parameter array |
n | number of arguments required |
flags | if MN_AT_LEAST require at least n parameters and not exactly n |
Definition at line 1249 of file manage.c.
References ASSERT, M_CLIENT, MN_AT_LEAST, and msg.
Referenced by man_dispatch_command().
|
static |
Definition at line 806 of file manage.c.
References management_callback::arg, man_persist::callback, M_CLIENT, man_command_unsupported(), management::persist, and management_callback::show_net.
Referenced by man_dispatch_command().
|
static |
Definition at line 1716 of file manage.c.
References buffer_list_reset(), management::connection, D_MANAGEMENT, man_settings::flags, gc_free(), gc_new(), man_settings::local, man_connection_settings_reset(), man_password_needed(), man_prompt(), man_start_ne32(), man_update_io_state(), man_welcome(), MF_CONNECT_AS_CLIENT, MF_UNIX_SOCK, msg, man_connection::out, print_sockaddr(), man_connection::sd_cli, set_nonblock(), and management::settings.
Referenced by man_accept(), and man_connect().
|
static |
Definition at line 2844 of file manage.c.
References env_filter_match(), es, env_set::list, M_CLIENT, msg, env_item::next, and env_item::string.
Referenced by man_output_extra_env(), management_connection_established(), management_notify_client_close(), management_notify_client_cr_response(), management_notify_client_needing_auth(), and management_up_down().
|
static |
Definition at line 2864 of file manage.c.
References management_callback::arg, man_persist::callback, management::connection, man_connection::env_filter_level, env_set_create(), es, env_set::gc, gc_free(), gc_new(), man_output_env(), management_callback::n_clients, management::persist, and setenv_int().
Referenced by management_connection_established(), management_notify_client_cr_response(), and management_notify_client_needing_auth().
|
static |
Definition at line 266 of file manage.c.
References man_output_list_push_finalize(), and man_output_list_push_str().
Referenced by man_prompt(), management_echo(), and management_set_state().
|
static |
Definition at line 243 of file manage.c.
References man_output_standalone(), man_update_io_state(), management_connected(), management::persist, and man_persist::standalone_disabled.
Referenced by man_output_list_push(), management_clear_callback(), management_close(), and virtual_output_callback_func().
|
static |
Definition at line 257 of file manage.c.
References buffer_list_push(), management::connection, management_connected(), and man_connection::out.
Referenced by man_output_list_push(), and virtual_output_callback_func().
|
static |
Definition at line 2900 of file manage.c.
References management_callback::arg, buf_parse(), buf_set_read(), man_persist::callback, chomp(), man_def_auth_context::cid, D_MANAGEMENT, management_callback::get_peer_info, M_CLIENT, msg, management::persist, and validate_peer_info_line().
Referenced by management_notify_client_cr_response(), and management_notify_client_needing_auth().
|
static |
Definition at line 3350 of file manage.c.
References management::connection, man_block(), man_standalone_ok(), management_io(), MS_CC_WAIT_WRITE, and man_connection::state.
Referenced by man_output_list_push_finalize().
|
inlinestatic |
Definition at line 191 of file manage.c.
References management::connection, user_pass::defined, man_connection::password_verified, management::settings, and man_settings::up.
Referenced by man_check_password(), man_new_connection_post(), man_process_command(), man_prompt(), man_wait_for_client_connection(), and virtual_output_callback_func().
void man_persist_client_stats | ( | struct management * | man, |
struct context * | c | ||
) |
Definition at line 4164 of file manage.c.
References context::c2, dco_enabled(), dco_get_peer_stats(), context_2::dco_read_bytes, context_2::dco_write_bytes, management_bytes_client(), and context::options.
Referenced by persist_client_stats().
|
static |
Definition at line 2427 of file manage.c.
References CLEAR, man_persist::echo, man_persist::log, log_history_close(), msg_set_virtual_output(), and man_persist::state.
Referenced by management_close().
|
static |
Definition at line 2389 of file manage.c.
References virtual_output::arg, CLEAR, man_persist::defined, man_persist::echo, virtual_output::flags_default, virtual_output::func, man_persist::log, log_history_init(), M_CLIENT, msg_set_virtual_output(), management::persist, man_persist::state, virtual_output_callback_func(), and man_persist::vout.
Referenced by management_init().
|
inlinestatic |
Definition at line 3099 of file manage.c.
Referenced by management_socket_set().
|
static |
Definition at line 1190 of file manage.c.
References management::connection, EKS_INPUT, EKS_SOLICIT, man_connection::ext_key_state, IEC_PK_SIGN, IER_NEW, man_connection::in_extra_cmd, in_extra_reset(), M_CLIENT, and msg.
Referenced by man_dispatch_command().
|
static |
Definition at line 2034 of file manage.c.
References CLEAR, management::connection, D_MANAGEMENT_DEBUG, gc_free(), gc_new(), IER_RESET, in_extra_reset(), M_CLIENT, M_INFO, man_check_password(), man_dispatch_command(), man_password_needed(), MAX_PARMS, msg, parse_line(), management::persist, status_close(), status_open(), streq, and man_persist::vout.
Referenced by man_read().
|
static |
Definition at line 273 of file manage.c.
References man_output_list_push(), and man_password_needed().
Referenced by man_new_connection_post(), and man_read().
|
static |
Definition at line 1269 of file manage.c.
References management_callback::arg, man_persist::callback, man_command_unsupported(), management::persist, management_callback::proxy_cmd, report_command_status(), and status.
Referenced by man_dispatch_command().
|
static |
Definition at line 784 of file manage.c.
References management::connection, man_query_user_pass(), user_pass::password, man_connection::up_query, man_connection::up_query_mode, UP_QUERY_NEED_OK, man_connection::up_query_type, and USER_PASS_LEN.
Referenced by man_dispatch_command().
|
static |
Definition at line 791 of file manage.c.
References management::connection, man_query_user_pass(), user_pass::password, man_connection::up_query, man_connection::up_query_mode, UP_QUERY_NEED_STR, man_connection::up_query_type, and USER_PASS_LEN.
Referenced by man_dispatch_command().
|
static |
Definition at line 771 of file manage.c.
References blank_up, management::connection, man_query_user_pass(), user_pass::password, man_connection::up_query, man_connection::up_query_mode, UP_QUERY_PASS, man_connection::up_query_type, UP_QUERY_USER_PASS, and USER_PASS_LEN.
Referenced by man_dispatch_command().
|
static |
Definition at line 729 of file manage.c.
References ASSERT, management::connection, M_CLIENT, man_up_finalize(), msg, streq, strncpynt(), and man_connection::up_query_type.
Referenced by man_query_need_ok(), man_query_need_str(), man_query_password(), and man_query_username().
|
static |
Definition at line 763 of file manage.c.
References management::connection, man_query_user_pass(), man_connection::up_query, man_connection::up_query_mode, man_connection::up_query_type, UP_QUERY_USER_PASS, USER_PASS_LEN, and user_pass::username.
Referenced by man_dispatch_command().
|
static |
Definition at line 2240 of file manage.c.
References ASSERT, buffer_list_push(), buffer_list_reset(), command_line_add(), command_line_get(), command_line_next(), management::connection, man_connection::halt, man_connection::in, man_connection::in_extra, in_extra_dispatch(), man_io_error(), man_process_command(), man_prompt(), man_reset_client_socket(), man_update_io_state(), MSG_NOSIGNAL, man_connection::out, and man_connection::sd_cli.
Referenced by management_io().
|
static |
Definition at line 1283 of file manage.c.
References management_callback::arg, man_persist::callback, man_command_unsupported(), management::persist, management_callback::remote_cmd, report_command_status(), and status.
Referenced by man_dispatch_command().
|
static |
Definition at line 869 of file manage.c.
References management_callback::arg, man_persist::callback, M_CLIENT, man_command_unsupported(), msg, management::persist, and management_callback::remote_entry_count.
Referenced by man_dispatch_command().
|
static |
Definition at line 885 of file manage.c.
References management_callback::arg, ASSERT, man_persist::callback, M_CLIENT, man_command_unsupported(), min_uint(), msg, management::persist, management_callback::remote_entry_count, and management_callback::remote_entry_get.
Referenced by man_dispatch_command().
|
static |
Definition at line 1988 of file manage.c.
References buffer_list_reset(), command_line_reset(), management::connection, D_MANAGEMENT, man_settings::flags, IER_RESET, man_connection::in, in_extra_reset(), man_close_socket(), man_listen(), man_mod_signal(), man_stop_ne32(), MF_CONNECT_AS_CLIENT, MF_FORGET_DISCONNECT, MF_SIGNAL, MS_INITIAL, msg, man_connection::out, man_connection::sd_cli, management::settings, socket_defined(), SOCKET_UNDEFINED, ssl_clean_auth_token(), ssl_purge_auth(), man_connection::state, and throw_signal_soft().
Referenced by man_read(), man_write(), management_io(), and virtual_output_callback_func().
|
static |
Definition at line 819 of file manage.c.
References management_callback::arg, man_persist::callback, M_CLIENT, man_command_unsupported(), msg, management::persist, management_callback::send_cc_message, and status.
Referenced by man_dispatch_command().
|
static |
Definition at line 2554 of file manage.c.
References CLEAR, and man_settings::local.
Referenced by management_close().
|
static |
Definition at line 2449 of file manage.c.
References ASSERT, CLEAR, man_settings::client_gid, man_settings::client_uid, D_MANAGEMENT, man_settings::defined, man_settings::echo_buffer_size, man_settings::flags, get_user_pass(), GET_USER_PASS_PASSWORD_ONLY, GETADDR_FATAL, GETADDR_PASSIVE, GETADDR_RESOLVE, GETADDR_WARN_ON_SIGNAL, man_settings::local, man_settings::log_history_cache, man_settings::management_over_tunnel, man_settings::mansig, MANSIG_MAP_USR1_TO_HUP, MANSIG_MAP_USR1_TO_TERM, MF_CONNECT_AS_CLIENT, MF_UNIX_SOCK, msg, openvpn_getaddrinfo(), platform_group_get(), platform_state_group_gid(), platform_state_user_uid(), platform_user_get(), man_settings::state_buffer_size, status, streq, and man_settings::up.
Referenced by management_open().
|
static |
Definition at line 446 of file manage.c.
References M_CLIENT, man_mod_signal(), msg, parse_signal(), management::persist, signal_name(), man_persist::special_state_msg, and throw_signal().
Referenced by man_dispatch_command().
|
static |
Definition at line 3373 of file manage.c.
References man_block(), man_standalone_ok(), management_io(), and status.
Referenced by man_wait_for_client_connection(), management_event_loop_n_seconds(), management_hold(), management_query_multiline(), and management_query_user_pass().
|
inlinestatic |
Definition at line 3268 of file manage.c.
References management::connection, man_settings::management_over_tunnel, MS_INITIAL, management::settings, and man_connection::state.
Referenced by man_block(), man_output_standalone(), man_standalone_event_loop(), man_wait_for_client_connection(), management_event_loop_n_seconds(), management_query_multiline(), management_query_user_pass(), and management_would_hold().
|
static |
Definition at line 1676 of file manage.c.
References ASSERT, management::connection, MS_CC_WAIT_READ, MS_CC_WAIT_WRITE, MS_LISTEN, man_connection::ne32, net_event_win32_start(), man_connection::sd_cli, man_connection::sd_top, and man_connection::state.
Referenced by man_listen(), and man_new_connection_post().
|
static |
Definition at line 687 of file manage.c.
References management::connection, LOG_PRINT_INT_DATE, LOG_PRINT_LOCAL_IP, LOG_PRINT_REMOTE_IP, LOG_PRINT_STATE, man_history(), management::persist, man_persist::state, and man_connection::state_realtime.
Referenced by man_dispatch_command().
|
static |
Definition at line 131 of file manage.c.
References OPENVPN_STATE_ADD_ROUTES, OPENVPN_STATE_ASSIGN_IP, OPENVPN_STATE_AUTH, OPENVPN_STATE_AUTH_PENDING, OPENVPN_STATE_CONNECTED, OPENVPN_STATE_CONNECTING, OPENVPN_STATE_EXITING, OPENVPN_STATE_GET_CONFIG, OPENVPN_STATE_INITIAL, OPENVPN_STATE_RECONNECTING, OPENVPN_STATE_RESOLVE, OPENVPN_STATE_TCP_CONNECT, and OPENVPN_STATE_WAIT.
Referenced by log_entry_print().
|
static |
Definition at line 479 of file manage.c.
References management_callback::arg, man_persist::callback, man_command_unsupported(), management::persist, and management_callback::status.
Referenced by man_dispatch_command().
|
static |
Definition at line 1695 of file manage.c.
References management::connection, man_connection::ne32, and net_event_win32_stop().
Referenced by man_accept(), and man_reset_client_socket().
|
static |
Definition at line 699 of file manage.c.
References ASSERT, management::connection, user_pass::defined, user_pass::password, man_connection::up_query, UP_QUERY_DISABLED, man_connection::up_query_mode, UP_QUERY_NEED_OK, UP_QUERY_NEED_STR, UP_QUERY_PASS, UP_QUERY_USER_PASS, and user_pass::username.
Referenced by man_query_user_pass().
|
static |
Definition at line 227 of file manage.c.
References buffer_list_defined(), management::connection, MS_CC_WAIT_READ, MS_CC_WAIT_WRITE, man_connection::out, man_connection::sd_cli, socket_defined(), and man_connection::state.
Referenced by man_new_connection_post(), man_output_list_push_finalize(), man_read(), and man_write().
|
static |
Definition at line 3395 of file manage.c.
References ASSERT, management::connection, D_MANAGEMENT, man_password_needed(), man_standalone_event_loop(), man_standalone_ok(), MS_LISTEN, msg, MWCC_HOLD_WAIT, MWCC_OTHER_WAIT, MWCC_PASSWORD_WAIT, and man_connection::state.
Referenced by management_event_loop_n_seconds(), management_hold(), management_query_multiline(), and management_query_user_pass().
|
static |
Definition at line 180 of file manage.c.
References M_CLIENT, MANAGEMENT_VERSION, msg, management::persist, and man_persist::special_state_msg.
Referenced by man_check_password(), and man_new_connection_post().
|
static |
Definition at line 2334 of file manage.c.
References BLEN, BPTR, buffer_list_advance(), buffer_list_aggregate(), buffer_list_peek(), management::connection, buffer::len, man_io_error(), man_reset_client_socket(), man_update_io_state(), min_int(), MSG_NOSIGNAL, man_connection::out, and man_connection::sd_cli.
Referenced by management_io().
void management_auth_failure | ( | struct management * | man, |
const char * | type, | ||
const char * | reason | ||
) |
Definition at line 3080 of file manage.c.
Referenced by auth_user_pass_mgmt(), receive_auth_failed(), tls_ctx_load_pkcs12(), and tls_ctx_load_priv_file().
void management_auth_token | ( | struct management * | man, |
const char * | token | ||
) |
void management_check_bytecount | ( | struct context * | c, |
struct management * | man, | ||
struct timeval * | timeval | ||
) |
Definition at line 4138 of file manage.c.
References man_connection::bytecount_update_interval, context::c2, man_persist::callback, management::connection, dco_enabled(), dco_get_peer_stats(), context_2::dco_read_bytes, context_2::dco_write_bytes, ETT_DEFAULT, event_timeout_trigger(), management_callback::flags, man_bytecount_output_client(), MCF_SERVER, context::options, and management::persist.
Referenced by process_coarse_timers().
void management_clear_callback | ( | struct management * | man | ) |
Definition at line 2728 of file manage.c.
References man_persist::callback, CLEAR, man_persist::hold_release, man_output_list_push_finalize(), management::persist, and man_persist::standalone_disabled.
Referenced by uninit_management_callback().
void management_close | ( | struct management * | man | ) |
Definition at line 2710 of file manage.c.
References man_connection_close(), man_output_list_push_finalize(), man_persist_close(), man_settings_close(), management::persist, and management::settings.
Referenced by close_management().
void management_connection_established | ( | struct management * | management, |
struct man_def_auth_context * | mdac, | ||
const struct env_set * | es | ||
) |
Definition at line 2974 of file manage.c.
References man_def_auth_context::cid, management::connection, DAF_CONNECTION_ESTABLISHED, man_connection::env_filter_level, es, man_def_auth_context::flags, M_CLIENT, man_output_env(), man_output_extra_env(), and msg.
Referenced by multi_connection_established().
void management_echo | ( | struct management * | man, |
const char * | string, | ||
const bool | pull | ||
) |
Definition at line 3015 of file manage.c.
References BOOL_CAST, CLEAR, management::connection, man_persist::echo, man_connection::echo_realtime, gc_free(), gc_new(), log_entry_union::intval, log_entry_print(), log_history_add(), LOG_PRINT_CRLF, LOG_PRINT_ECHO_PREFIX, LOG_PRINT_INT_DATE, man_output_list_push(), MANAGEMENT_ECHO_FLAGS, now, management::persist, log_entry::string, log_entry::timestamp, log_entry::u, and update_time().
Referenced by add_option().
void management_event_loop_n_seconds | ( | struct management * | man, |
int | sec | ||
) |
Definition at line 3430 of file manage.c.
References man_check_for_signals(), man_standalone_event_loop(), man_standalone_ok(), man_wait_for_client_connection(), now, management::persist, sleep, man_persist::standalone_disabled, and update_time().
Referenced by ce_management_query_proxy(), ce_management_query_remote(), and management_sleep().
bool management_hold | ( | struct management * | man, |
int | holdtime | ||
) |
Definition at line 3813 of file manage.c.
References alloc_buf_gc(), BSTR, buf_printf(), gc_free(), gc_new(), man_persist::hold_release, M_CLIENT, man_check_for_signals(), man_standalone_event_loop(), man_wait_for_client_connection(), management_would_hold(), man_settings::mansig, MANSIG_IGNORE_USR1_HUP, msg, MWCC_HOLD_WAIT, management::persist, management::settings, man_persist::special_state_msg, and man_persist::standalone_disabled.
Referenced by do_hold().
struct management* management_init | ( | void | ) |
Definition at line 2639 of file manage.c.
References ALLOC_OBJ_CLEAR, management::connection, man_connection_clear(), man_persist_init(), MANAGEMENT_ECHO_BUFFER_SIZE, MANAGEMENT_LOG_HISTORY_INITIAL_SIZE, and MANAGEMENT_STATE_BUFFER_SIZE.
Referenced by init_management().
void management_io | ( | struct management * | man | ) |
Definition at line 3155 of file manage.c.
References management::connection, man_accept(), man_read(), man_reset_client_socket(), man_write(), MS_CC_WAIT_READ, MS_CC_WAIT_WRITE, MS_INITIAL, MS_LISTEN, man_connection::ne32, net_event_win32_clear_selected_events(), net_event_win32_get_event_mask(), net_event_win32_reset(), man_connection::state, and status.
Referenced by man_output_standalone(), man_standalone_event_loop(), multi_process_io_udp(), multi_tcp_process_io(), and process_io().
void management_learn_addr | ( | struct management * | management, |
struct man_def_auth_context * | mdac, | ||
const struct mroute_addr * | addr, | ||
const bool | primary | ||
) |
Definition at line 2998 of file manage.c.
References BOOL_CAST, man_def_auth_context::cid, DAF_CONNECTION_CLOSED, DAF_INITIAL_AUTH, man_def_auth_context::flags, gc_free(), gc_new(), M_CLIENT, MAPF_SUBNET, mroute_addr_print_ex(), and msg.
Referenced by multi_learn_in6_addr(), and multi_learn_in_addr_t().
void management_notify | ( | struct management * | man, |
const char * | severity, | ||
const char * | type, | ||
const char * | text | ||
) |
Definition at line 2888 of file manage.c.
Referenced by receive_exit_message(), and server_pushed_signal().
void management_notify_client_close | ( | struct management * | management, |
struct man_def_auth_context * | mdac, | ||
const struct env_set * | es | ||
) |
Definition at line 2985 of file manage.c.
References man_def_auth_context::cid, management::connection, DAF_CONNECTION_CLOSED, DAF_INITIAL_AUTH, man_connection::env_filter_level, es, man_def_auth_context::flags, M_CLIENT, man_output_env(), and msg.
Referenced by close_instance(), and multi_client_disconnect_script().
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 | ||
) |
Definition at line 2951 of file manage.c.
References man_def_auth_context::cid, management::connection, man_connection::env_filter_level, es, gc_free(), gc_new(), M_CLIENT, man_output_env(), man_output_extra_env(), man_output_peer_info_env(), and msg.
Referenced by receive_cr_response().
void management_notify_client_needing_auth | ( | struct management * | management, |
const unsigned int | mda_key_id, | ||
struct man_def_auth_context * | mdac, | ||
const struct env_set * | es | ||
) |
Definition at line 2927 of file manage.c.
References man_def_auth_context::cid, management::connection, DAF_CONNECTION_CLOSED, DAF_CONNECTION_ESTABLISHED, DAF_INITIAL_AUTH, man_connection::env_filter_level, es, man_def_auth_context::flags, M_CLIENT, man_output_env(), man_output_extra_env(), man_output_peer_info_env(), and msg.
Referenced by verify_user_pass_management().
void management_notify_generic | ( | struct management * | man, |
const char * | str | ||
) |
Definition at line 2894 of file manage.c.
Referenced by ce_management_query_proxy(), ce_management_query_remote(), and server_pushed_info().
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 | ||
) |
Definition at line 2655 of file manage.c.
References management::connection, man_persist::echo, man_settings::echo_buffer_size, man_persist::log, man_settings::log_history_cache, log_history_resize(), man_connection_init(), man_settings_init(), man_settings::management_over_tunnel, MS_INITIAL, management::persist, management::settings, man_persist::state, man_connection::state, and man_settings::state_buffer_size.
Referenced by open_management().
void management_post_tunnel_open | ( | struct management * | man, |
const in_addr_t | tun_local_ip | ||
) |
Definition at line 3046 of file manage.c.
References ASSERT, management::connection, GETADDR_PASSIVE, man_settings::local, man_connection_init(), man_settings::management_over_tunnel, MS_INITIAL, openvpn_getaddrinfo(), management::settings, and man_connection::state.
Referenced by initialization_sequence_completed().
void management_pre_tunnel_close | ( | struct management * | man | ) |
Definition at line 3071 of file manage.c.
References man_connection_close(), man_settings::management_over_tunnel, and management::settings.
Referenced by do_close_tun().
char* management_query_cert | ( | struct management * | man, |
const char * | cert_name | ||
) |
Definition at line 3774 of file manage.c.
References alloc_buf(), buf_bptr(), buf_write(), management::connection, man_connection::ext_cert_input, man_connection::ext_cert_state, free_buf(), and management_query_multiline_flatten_newline().
Referenced by init_ssl().
|
static |
Definition at line 3612 of file manage.c.
References alloc_buf_gc(), BSTR, buf_printf(), clear_buf(), management::connection, EKS_INPUT, EKS_READY, EKS_SOLICIT, EKS_UNDEF, gc_free(), gc_new(), IER_RESET, in_extra_reset(), M_CLIENT, man_check_for_signals(), man_standalone_event_loop(), man_standalone_ok(), man_wait_for_client_connection(), msg, MWCC_OTHER_WAIT, management::persist, man_persist::special_state_msg, man_persist::standalone_disabled, and man_connection::state.
Referenced by management_query_multiline_flatten(), and management_query_multiline_flatten_newline().
|
static |
Definition at line 3718 of file manage.c.
References BLEN, buffer_list_aggregate(), buffer_list_defined(), buffer_list_free(), buffer_list_peek(), check_malloc_return(), buffer::data, and management_query_multiline().
Referenced by management_query_pk_sig().
|
static |
Definition at line 3689 of file manage.c.
References BLEN, buffer_list_aggregate_separator(), buffer_list_defined(), buffer_list_free(), buffer_list_peek(), check_malloc_return(), buffer::data, and management_query_multiline().
Referenced by management_query_cert().
char* management_query_pk_sig | ( | struct management * | man, |
const char * | b64_data, | ||
const char * | algorithm | ||
) |
Definition at line 3747 of file manage.c.
Referenced by get_sig_from_man().
bool management_query_user_pass | ( | struct management * | man, |
struct user_pass * | up, | ||
const char * | type, | ||
const unsigned int | flags, | ||
const char * | static_challenge | ||
) |
Definition at line 3482 of file manage.c.
Referenced by auth_user_pass_mgmt().
void management_set_callback | ( | struct management * | man, |
const struct management_callback * | cb | ||
) |
Definition at line 2720 of file manage.c.
References man_persist::callback, management::persist, and man_persist::standalone_disabled.
Referenced by init_management_callback_multi(), and init_management_callback_p2p().
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 | ||
) |
Definition at line 2737 of file manage.c.
References CLEAR, management::connection, man_settings::flags, gc_free(), gc_new(), log_entry::local_ip, log_entry::local_ip6, log_entry::local_sock, LOG_ECHO_TO_LOG, log_entry_print(), log_history_add(), LOG_PRINT_CRLF, LOG_PRINT_INT_DATE, LOG_PRINT_LOCAL_IP, LOG_PRINT_REMOTE_IP, LOG_PRINT_STATE, LOG_PRINT_STATE_PREFIX, man_output_list_push(), MF_SERVER, now, OPENVPN_STATE_CLIENT_BASE, management::persist, log_entry::remote_sock, management::settings, log_entry_union::state, man_persist::state, man_connection::state_realtime, log_entry::string, log_entry::timestamp, log_entry::u, and update_time().
Referenced by add_routes(), check_connection_established(), do_ifconfig(), initialization_sequence_completed(), open_management(), openvpn_getaddrinfo(), parse_auth_pending_keywords(), session_move_pre_start(), signal_restart_status(), socket_connect(), and tls_pre_decrypt().
bool management_should_daemonize | ( | struct management * | man | ) |
Definition at line 3803 of file manage.c.
References man_settings::flags, management_would_hold(), MF_QUERY_PASSWORDS, and management::settings.
void management_sleep | ( | const int | n | ) |
A sleep function that services the management layer for n seconds rather than doing nothing.
Definition at line 4114 of file manage.c.
References management_event_loop_n_seconds(), sleep, and win32_sleep().
Referenced by dco_connect_wait(), do_up(), exec_command(), openvpn_connect(), openvpn_getaddrinfo(), read_incoming_link(), socket_listen_accept(), socket_restart_pause(), and tuntap_set_connected().
void management_socket_set | ( | struct management * | man, |
struct event_set * | es, | ||
void * | arg, | ||
unsigned int * | persistent | ||
) |
Definition at line 3115 of file manage.c.
References ASSERT, management::connection, es, event_ctl(), EVENT_READ, EVENT_WRITE, man_persist_state(), MS_CC_WAIT_READ, MS_CC_WAIT_WRITE, MS_INITIAL, MS_LISTEN, man_connection::ne32, net_event_win32_get_event(), net_event_win32_reset_write(), and man_connection::state.
Referenced by io_wait_dowork(), man_block(), and multi_tcp_wait().
void management_up_down | ( | struct management * | man, |
const char * | updown, | ||
const struct env_set * | es | ||
) |
Definition at line 2878 of file manage.c.
References es, man_settings::flags, M_CLIENT, man_output_env(), MF_UP_DOWN, msg, and management::settings.
Referenced by do_close_tun(), and do_route().
bool management_would_hold | ( | struct management * | man | ) |
Definition at line 3793 of file manage.c.
References man_settings::flags, man_persist::hold_release, man_standalone_ok(), MF_HOLD, management::persist, and management::settings.
Referenced by management_hold(), and management_should_daemonize().
|
static |
Definition at line 1021 of file manage.c.
Referenced by man_client_auth(), man_client_deny(), man_client_kill(), and man_client_pending_auth().
|
static |
Definition at line 1035 of file manage.c.
Referenced by man_client_auth(), man_client_deny(), and man_client_pending_auth().
|
static |
Small function to report the success or failure of a command to the management interface.
Definition at line 293 of file manage.c.
References M_CLIENT, msg, and status.
Referenced by in_extra_dispatch(), man_proxy(), and man_remote().
|
static |
Definition at line 1320 of file manage.c.
References man_connection::client_version, and management::connection.
Referenced by man_dispatch_command().
|
static |
Definition at line 333 of file manage.c.
References AF_DID_PUSH, AF_DID_RESET, CLEAR, management::connection, gc_free(), gc_new(), man_persist::log, log_entry_print(), LOG_FATAL_NOTIFY, log_history_add(), LOG_PRINT_CRLF, LOG_PRINT_INT_DATE, LOG_PRINT_LOG_PREFIX, LOG_PRINT_MSG_FLAGS, man_connection::log_realtime, M_CLIENT, M_FATAL, man_output_list_push_finalize(), man_output_list_push_str(), man_password_needed(), man_reset_client_socket(), log_entry_union::msg_flags, now, management::persist, man_persist::standalone_disabled, log_entry::string, log_entry::timestamp, log_entry::u, and update_time().
Referenced by man_history(), and man_persist_init().
|
static |
Definition at line 61 of file manage.c.
Referenced by man_query_password(), and management_query_user_pass().
struct management* management |