OpenVPN
|
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 (1<<0) |
#define | MF_QUERY_PASSWORDS (1<<1) |
#define | MF_HOLD (1<<2) |
#define | MF_SIGNAL (1<<3) |
#define | MF_FORGET_DISCONNECT (1<<4) |
#define | MF_CONNECT_AS_CLIENT (1<<5) |
#define | MF_CLIENT_AUTH (1<<6) |
#define | MF_UNIX_SOCK (1<<8) |
#define | MF_EXTERNAL_KEY (1<<9) |
#define | MF_EXTERNAL_KEY_NOPADDING (1<<10) |
#define | MF_EXTERNAL_KEY_PKCS1PAD (1<<11) |
#define | MF_UP_DOWN (1<<12) |
#define | MF_QUERY_REMOTE (1<<13) |
#define | MF_QUERY_PROXY (1<<14) |
#define | MF_EXTERNAL_CERT (1<<15) |
#define | MF_EXTERNAL_KEY_PSSPAD (1<<16) |
#define | MF_EXTERNAL_KEY_DIGEST (1<<17) |
#define | MANAGEMENT_VERSION 5 |
#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 (1<<0) |
#define | DAF_CONNECTION_CLOSED (1<<1) |
#define | DAF_INITIAL_AUTH (1<<2) |
#define | LOG_PRINT_LOG_PREFIX (1<<0) |
#define | LOG_PRINT_ECHO_PREFIX (1<<1) |
#define | LOG_PRINT_STATE_PREFIX (1<<2) |
#define | LOG_PRINT_INT_DATE (1<<3) |
#define | LOG_PRINT_MSG_FLAGS (1<<4) |
#define | LOG_PRINT_STATE (1<<5) |
#define | LOG_PRINT_LOCAL_IP (1<<6) |
#define | LOG_PRINT_CRLF (1<<7) |
#define | LOG_FATAL_NOTIFY (1<<8) |
#define | LOG_PRINT_INTVAL (1<<9) |
#define | LOG_PRINT_REMOTE_IP (1<<10) |
#define | LOG_ECHO_TO_LOG (1<<11) |
#define | MCF_SERVER (1<<0) /* is OpenVPN being run as a server? */ |
#define | MANSIG_IGNORE_USR1_HUP (1<<0) |
#define | MANSIG_MAP_USR1_TO_HUP (1<<1) |
#define | MANSIG_MAP_USR1_TO_TERM (1<<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 | 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 | 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 int buf_len) |
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_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_should_daemonize (struct management *man) |
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 (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) |
void | management_notify_client_needing_auth (struct management *management, const unsigned int auth_id, struct man_def_auth_context *mdac, const struct env_set *es) |
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_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 (struct management *man, const char *type, const char *reason) |
void | management_auth_token (struct management *man, const char *token) |
void | management_check_bytecount (struct context *c, struct management *man, struct timeval *timeval) |
static void | management_bytes_client (struct management *man, const int size_in, const int size_out) |
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 | management_bytes_server (struct management *man, const counter_type *bytes_in_total, const counter_type *bytes_out_total, struct man_def_auth_context *mdac) |
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. More... | |
Variables | |
struct management * | management |
#define MCF_SERVER (1<<0) /* is OpenVPN being run as a server? */ |
#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 OPENVPN_STATE_ADD_ROUTES 3 /* Adding routes to system */ |
#define OPENVPN_STATE_ASSIGN_IP 2 /* Assigning IP address to virtual network interface */ |
#define OPENVPN_STATE_AUTH 8 /* Authenticating with server */ |
#define OPENVPN_STATE_AUTH_PENDING |
#define OPENVPN_STATE_CLIENT_BASE 7 /* Base index of client-only states */ |
#define OPENVPN_STATE_CONNECTED 4 /* Initialization sequence completed */ |
#define OPENVPN_STATE_CONNECTING 1 /* Management interface has been initialized */ |
#define OPENVPN_STATE_GET_CONFIG 9 /* Downloading configuration from server */ |
#define OPENVPN_STATE_INITIAL 0 /* Initial, undefined state */ |
#define OPENVPN_STATE_TCP_CONNECT 11 /* Connecting to TCP server */ |
#define OPENVPN_STATE_WAIT 7 /* Waiting for initial response from server */ |
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().
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().
|
inlinestatic |
Definition at line 164 of file manage.h.
References log_history::capacity.
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().
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().
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 |
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().
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().
void management_auth_failure | ( | struct management * | man, |
const char * | type, | ||
const char * | reason | ||
) |
Definition at line 3080 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().
void management_auth_token | ( | struct management * | man, |
const char * | token | ||
) |
|
inlinestatic |
Definition at line 524 of file manage.h.
References man_persist::bytes_in, man_persist::bytes_out, man_persist::callback, management_callback::flags, MCF_SERVER, and management::persist.
Referenced by man_persist_client_stats(), process_incoming_link_part1(), and process_outgoing_link().
|
inlinestatic |
Definition at line 541 of file manage.h.
References man_def_auth_context::bytecount_last_update, man_connection::bytecount_update_seconds, management::connection, DAF_CONNECTION_CLOSED, DAF_CONNECTION_ESTABLISHED, man_def_auth_context::flags, man_bytecount_output_server(), and now.
Referenced by process_incoming_link_part1(), and process_outgoing_link().
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().
|
inlinestatic |
Definition at line 436 of file manage.h.
References management::connection, MS_CC_WAIT_READ, MS_CC_WAIT_WRITE, and man_connection::state.
Referenced by man_output_list_push_finalize(), and man_output_list_push_str().
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().
|
inlinestatic |
Definition at line 461 of file manage.h.
References BOOL_CAST, man_settings::flags, MF_CLIENT_AUTH, and management::settings.
Referenced by man_def_auth_test(), tls_session_user_pass_enabled(), and verify_user_pass().
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 | auth_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().
char* management_query_pk_sig | ( | struct management * | man, |
const char * | b64_data, | ||
const char * | algorithm | ||
) |
Definition at line 3747 of file manage.c.
References alloc_buf(), buf_bptr(), buf_write(), man_connection::client_version, management::connection, man_connection::ext_key_input, man_connection::ext_key_state, free_buf(), and management_query_multiline_flatten().
Referenced by get_sig_from_man().
|
inlinestatic |
Definition at line 454 of file manage.h.
References BOOL_CAST, man_settings::flags, MF_QUERY_PROXY, and management::settings.
Referenced by next_connection_entry().
|
inlinestatic |
Definition at line 448 of file manage.h.
References BOOL_CAST, man_settings::flags, MF_QUERY_REMOTE, and management::settings.
Referenced by next_connection_entry().
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.
References alloc_buf_gc(), blank_up, BOOL_CAST, BSTR, buf_printf(), CLEAR, management::connection, user_pass::defined, gc_free(), gc_new(), GET_USER_PASS_NEED_OK, GET_USER_PASS_NEED_STR, GET_USER_PASS_PASSWORD_ONLY, GET_USER_PASS_STATIC_CHALLENGE_ECHO, M_CLIENT, man_check_for_signals(), man_standalone_event_loop(), man_standalone_ok(), man_wait_for_client_connection(), msg, MWCC_PASSWORD_WAIT, user_pass::nocache, user_pass::password, management::persist, secure_memzero(), man_persist::special_state_msg, man_persist::standalone_disabled, man_connection::up_query, UP_QUERY_DISABLED, man_connection::up_query_mode, UP_QUERY_NEED_OK, UP_QUERY_NEED_STR, UP_QUERY_PASS, man_connection::up_query_type, UP_QUERY_USER_PASS, and user_pass::username.
Referenced by auth_user_pass_mgmt().
|
inlinestatic |
Definition at line 442 of file manage.h.
References BOOL_CAST, man_settings::flags, MF_QUERY_PASSWORDS, and management::settings.
Referenced by get_user_pass_cr().
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_addr, | ||
const struct openvpn_sockaddr * | remote_addr | ||
) |
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().
struct management* management |