OpenVPN
|
#include "syshead.h"
#include "win32.h"
#include "init.h"
#include "sig.h"
#include "occ.h"
#include "list.h"
#include "otime.h"
#include "pool.h"
#include "gremlin.h"
#include "pkcs11.h"
#include "ps.h"
#include "lladdr.h"
#include "ping.h"
#include "mstats.h"
#include "ssl_verify.h"
#include "tls_crypt.h"
#include "forward-inline.h"
#include "memdbg.h"
#include "occ-inline.h"
Go to the source code of this file.
Macros | |
#define | CF_LOAD_PERSISTED_PACKET_ID (1<<0) |
#define | CF_INIT_TLS_MULTI (1<<1) |
#define | CF_INIT_TLS_AUTH_STANDALONE (1<<2) |
Functions | |
static void | do_init_first_time (struct context *c) |
void | context_clear (struct context *c) |
void | context_clear_1 (struct context *c) |
void | context_clear_2 (struct context *c) |
void | context_clear_all_except_first_time (struct context *c) |
static void | run_up_down (const char *command, const struct plugin_list *plugins, int plugin_type, const char *arg, DWORD adapter_index, const char *dev_type, int tun_mtu, int link_mtu, const char *ifconfig_local, const char *ifconfig_remote, const char *context, const char *signal_text, const char *script_type, struct env_set *es) |
static void | update_options_ce_post (struct options *options) |
static bool | management_callback_proxy_cmd (void *arg, const char **p) |
static bool | ce_management_query_proxy (struct context *c) |
static bool | management_callback_remote_cmd (void *arg, const char **p) |
static bool | ce_management_query_remote (struct context *c) |
static void | init_connection_list (struct context *c) |
static void | clear_remote_addrlist (struct link_socket_addr *lsa, bool free) |
static void | next_connection_entry (struct context *c) |
void | init_query_passwords (const struct context *c) |
Query for private key and auth-user-pass username/passwords. More... | |
static void | uninit_proxy_dowork (struct context *c) |
static void | init_proxy_dowork (struct context *c) |
static void | init_proxy (struct context *c) |
static void | uninit_proxy (struct context *c) |
void | context_init_1 (struct context *c) |
void | context_gc_free (struct context *c) |
bool | init_static (void) |
void | uninit_static (void) |
void | init_verb_mute (struct context *c, unsigned int flags) |
void | init_options_dev (struct options *options) |
bool | print_openssl_info (const struct options *options) |
bool | do_genkey (const struct options *options) |
bool | do_persist_tuntap (const struct options *options) |
bool | possibly_become_daemon (const struct options *options) |
static void | do_uid_gid_chroot (struct context *c, bool no_delay) |
const char * | format_common_name (struct context *c, struct gc_arena *gc) |
void | pre_setup (const struct options *options) |
void | reset_coarse_timers (struct context *c) |
static void | do_init_server_poll_timeout (struct context *c) |
static void | do_init_timers (struct context *c, bool deferred) |
static void | do_init_traffic_shaper (struct context *c) |
static void | do_alloc_route_list (struct context *c) |
static void | do_init_route_list (const struct options *options, struct route_list *route_list, const struct link_socket_info *link_socket_info, struct env_set *es) |
static void | do_init_route_ipv6_list (const struct options *options, struct route_ipv6_list *route_ipv6_list, const struct link_socket_info *link_socket_info, struct env_set *es) |
void | initialization_sequence_completed (struct context *c, const unsigned int flags) |
void | do_route (const struct options *options, struct route_list *route_list, struct route_ipv6_list *route_ipv6_list, const struct tuntap *tt, const struct plugin_list *plugins, struct env_set *es) |
static void | do_init_tun (struct context *c) |
static bool | do_open_tun (struct context *c) |
static void | do_close_tun_simple (struct context *c) |
static void | do_close_tun (struct context *c, bool force) |
void | tun_abort (void) |
static bool | options_hash_changed_or_zero (const struct sha256_digest *a, const struct sha256_digest *b) |
Helper for do_up(). More... | |
bool | do_up (struct context *c, bool pulled_options, unsigned int option_types_found) |
unsigned int | pull_permission_mask (const struct context *c) |
bool | do_deferred_options (struct context *c, const unsigned int found) |
static bool | do_hold (int holdtime) |
static void | socket_restart_pause (struct context *c) |
static void | do_startup_pause (struct context *c) |
static void | frame_finalize_options (struct context *c, const struct options *o) |
static void | key_schedule_free (struct key_schedule *ks, bool free_ssl_ctx) |
static void | init_crypto_pre (struct context *c, const unsigned int flags) |
static void | do_init_crypto_static (struct context *c, const unsigned int flags) |
static void | do_init_crypto_tls_c1 (struct context *c) |
static void | do_init_crypto_tls (struct context *c, const unsigned int flags) |
static void | do_init_finalize_tls_frame (struct context *c) |
static void | do_init_crypto_none (const struct context *c) |
static void | do_init_crypto (struct context *c, const unsigned int flags) |
static void | do_init_frame (struct context *c) |
static void | do_option_warnings (struct context *c) |
static void | do_init_frame_tls (struct context *c) |
struct context_buffers * | init_context_buffers (const struct frame *frame) |
void | free_context_buffers (struct context_buffers *b) |
static void | do_init_buffers (struct context *c) |
static void | do_init_fragment (struct context *c) |
static void | do_link_socket_new (struct context *c) |
static void | do_init_socket_1 (struct context *c, const int mode) |
static void | do_init_socket_2 (struct context *c) |
static void | do_print_data_channel_mtu_parms (struct context *c) |
static void | do_compute_occ_strings (struct context *c) |
static void | do_close_check_if_restart_permitted (struct context *c) |
static void | do_close_free_buf (struct context *c) |
static void | do_close_tls (struct context *c) |
static void | do_close_free_key_schedule (struct context *c, bool free_ssl_ctx) |
static void | do_close_link_socket (struct context *c) |
static void | do_close_packet_id (struct context *c) |
static void | do_close_fragment (struct context *c) |
static void | do_event_set_init (struct context *c, bool need_us_timeout) |
static void | do_close_event_set (struct context *c) |
static void | do_open_status_output (struct context *c) |
static void | do_close_status_output (struct context *c) |
static void | do_open_ifconfig_pool_persist (struct context *c) |
static void | do_close_ifconfig_pool_persist (struct context *c) |
static void | do_inherit_env (struct context *c, const struct env_set *src) |
static void | do_env_set_destroy (struct context *c) |
static void | do_setup_fast_io (struct context *c) |
static void | do_signal_on_tls_errors (struct context *c) |
void | init_plugins (struct context *c) |
void | open_plugins (struct context *c, const bool import_options, int init_point) |
static void | do_close_plugins (struct context *c) |
static void | do_inherit_plugins (struct context *c, const struct context *src) |
static void | management_callback_status_p2p (void *arg, const int version, struct status_output *so) |
void | management_show_net_callback (void *arg, const int msglevel) |
void | init_management_callback_p2p (struct context *c) |
void | init_management (struct context *c) |
bool | open_management (struct context *c) |
void | close_management (void) |
void | uninit_management_callback (void) |
void | init_instance_handle_signals (struct context *c, const struct env_set *env, const unsigned int flags) |
void | init_instance (struct context *c, const struct env_set *env, const unsigned int flags) |
void | close_instance (struct context *c) |
void | inherit_context_child (struct context *dest, const struct context *src) |
void | inherit_context_top (struct context *dest, const struct context *src) |
void | close_context (struct context *c, int sig, unsigned int flags) |
static void * | test_crypto_thread (void *arg) |
bool | do_test_crypto (const struct options *o) |
Variables | |
static struct context * | static_context |
#define CF_INIT_TLS_AUTH_STANDALONE (1<<2) |
Definition at line 64 of file init.c.
Referenced by do_init_crypto_tls(), and init_instance().
#define CF_INIT_TLS_MULTI (1<<1) |
Definition at line 63 of file init.c.
Referenced by do_init_crypto_tls(), and init_instance().
#define CF_LOAD_PERSISTED_PACKET_ID (1<<0) |
Definition at line 62 of file init.c.
Referenced by init_crypto_pre(), and init_instance().
Definition at line 256 of file init.c.
References alloc_buf_gc(), BSTR, buf_printf(), options::ce, CE_MAN_QUERY_PROXY, options::connection_list, connection_list::current, connection_entry::flags, gc_free(), gc_new(), IS_SIG, management_event_loop_n_seconds(), management_notify_generic(), np(), context::options, connection_entry::proto, proto_is_udp(), connection_entry::remote, and update_time().
Referenced by next_connection_entry().
Definition at line 338 of file init.c.
References connection_entry::af, alloc_buf_gc(), BSTR, buf_printf(), options::ce, CE_MAN_QUERY_REMOTE_MASK, CE_MAN_QUERY_REMOTE_QUERY, CE_MAN_QUERY_REMOTE_SHIFT, CE_MAN_QUERY_REMOTE_SKIP, connection_entry::flags, gc_free(), gc_new(), IS_SIG, management_event_loop_n_seconds(), management_notify_generic(), np(), context::options, connection_entry::proto, proto2ascii(), connection_entry::remote, connection_entry::remote_port, and update_time().
Referenced by next_connection_entry().
|
static |
Definition at line 411 of file init.c.
References link_socket_addr::current_remote, and link_socket_addr::remote_list.
Referenced by do_close_link_socket().
void close_context | ( | struct context * | c, |
int | sig, | ||
unsigned int | flags | ||
) |
Definition at line 4471 of file init.c.
References ASSERT, CC_GC_FREE, CC_HARD_USR1_TO_HUP, CC_NO_CLOSE, CC_USR1_TO_HUP, close_instance(), context_gc_free(), context::sig, SIG_SOURCE_HARD, SIGHUP, signal_info::signal_received, signal_info::signal_text, SIGUSR1, and signal_info::source.
Referenced by init_instance(), multi_close_instance(), and multi_top_free().
void close_instance | ( | struct context * | c | ) |
Definition at line 4265 of file init.c.
References context::c2, CM_CHILD_TCP, CM_CHILD_UDP, CM_P2P, CM_TOP, do_close_check_if_restart_permitted(), do_close_event_set(), do_close_fragment(), do_close_free_buf(), do_close_free_key_schedule(), do_close_ifconfig_pool_persist(), do_close_link_socket(), do_close_packet_id(), do_close_plugins(), do_close_status_output(), do_close_tls(), do_close_tun(), do_env_set_destroy(), context_2::gc, gc_free(), context::mode, and uninit_proxy().
Referenced by close_context(), tunnel_point_to_point(), tunnel_server_tcp(), and tunnel_server_udp_single_threaded().
void close_management | ( | void | ) |
Definition at line 3899 of file init.c.
References management_close().
Referenced by open_management(), and openvpn_main().
void context_clear | ( | struct context * | c | ) |
Definition at line 69 of file init.c.
References CLEAR.
Referenced by context_clear_all_except_first_time(), and do_test_crypto().
void context_clear_1 | ( | struct context * | c | ) |
Definition at line 75 of file init.c.
References context::c1, and CLEAR.
Referenced by context_init_1().
void context_clear_2 | ( | struct context * | c | ) |
Definition at line 81 of file init.c.
References context::c2, and CLEAR.
Referenced by tunnel_point_to_point(), tunnel_server_tcp(), and tunnel_server_udp_single_threaded().
void context_clear_all_except_first_time | ( | struct context * | c | ) |
Definition at line 87 of file init.c.
References context_clear(), context::first_time, and context::persist.
Referenced by openvpn_main().
void context_gc_free | ( | struct context * | c | ) |
Definition at line 664 of file init.c.
References context::c2, context_2::frame, options::gc, context_2::gc, context::gc, gc_free(), M_FATAL, MAX_RW_SIZE_LINK, msg, and context::options.
Referenced by close_context(), openvpn_main(), and test_crypto_thread().
void context_init_1 | ( | struct context * | c | ) |
Definition at line 617 of file init.c.
References context::c1, CLEAR, context_clear_1(), context::first_time, get_user_pass(), GET_USER_PASS_MANAGEMENT, GET_USER_PASS_NEED_OK, init_connection_list(), M_INFO, MAX_PARMS, msg, context::options, packet_id_persist_init(), user_pass::password, context_1::pid_persist, and user_pass::username.
Referenced by openvpn_main(), and test_crypto_thread().
|
static |
Definition at line 1370 of file init.c.
References ALLOC_OBJ_CLEAR_GC, context::c1, context::gc, context::options, context_1::route_ipv6_list, context_1::route_list, and options::routes_ipv6.
Referenced by do_open_tun().
|
static |
Definition at line 3366 of file init.c.
References options::inetd, M_INFO, msg, context::options, context::sig, SIGHUP, signal_info::signal_received, SIGTERM, and SIGUSR1.
Referenced by close_instance().
|
static |
Definition at line 3532 of file init.c.
References context::c2, event_free(), context_2::event_set, and context_2::event_set_owned.
Referenced by close_instance().
|
static |
Definition at line 3498 of file init.c.
References context::c2, context_2::fragment, and fragment_free().
Referenced by close_instance().
|
static |
Definition at line 3383 of file init.c.
References context_2::buffers, context_2::buffers_owned, context::c2, and free_context_buffers().
Referenced by close_instance().
Definition at line 3425 of file init.c.
References context::c1, key_schedule_free(), context_1::ks, context::options, options::persist_key, context::sig, signal_info::signal_received, and SIGUSR1.
Referenced by close_instance().
|
static |
Definition at line 3591 of file init.c.
References context::c1, context_1::ifconfig_pool_persist, ifconfig_pool_persist_close(), context_1::ifconfig_pool_persist_owned, context::sig, signal_info::signal_received, and SIGUSR1.
Referenced by close_instance().
|
static |
Definition at line 3437 of file init.c.
References link_socket_addr::actual, link_socket_addr::bind_local, context::c1, context::c2, CLEAR, clear_remote_addrlist(), link_socket_addr::current_remote, context_2::link_socket, context_1::link_socket_addr, link_socket_close(), context_2::link_socket_owned, options::no_advance, context::options, options::persist_local_ip, options::persist_remote_ip, options::resolve_in_advance, context::sig, SIG_SOURCE_HARD, signal_info::signal_received, SIGUSR1, and signal_info::source.
Referenced by close_instance().
|
static |
Definition at line 3481 of file init.c.
References context::c1, context::c2, context_2::crypto_options, crypto_options::packet_id, packet_id_free(), packet_id_persist_close(), packet_id_persist_save(), context_1::pid_persist, context::sig, signal_info::signal_received, and SIGUSR1.
Referenced by close_instance().
|
static |
Definition at line 3731 of file init.c.
References plugin_list_close(), context::plugins, context::plugins_owned, context::sig, signal_info::signal_received, and SIGUSR1.
Referenced by close_instance().
|
static |
Definition at line 3561 of file init.c.
References context::c1, context::sig, signal_info::signal_received, SIGUSR1, status_close(), context_1::status_output, and context_1::status_output_owned.
Referenced by close_instance().
|
static |
Definition at line 3397 of file init.c.
References context::c2, context_2::options_string_local, context_2::options_string_remote, context_2::tls_multi, and tls_multi_free().
Referenced by close_instance().
Definition at line 1876 of file init.c.
References tuntap::actual_name, tuntap::adapter_index, options::block_outside_dns, context::c1, context::c2, delete_routes(), do_close_tun_simple(), options::down_pre, options::down_script, context_2::es, EXPANDED_SIZE, context_2::frame, gc_free(), gc_new(), IA_EMPTY_IF_UNDEF, in_addr_t, tuntap::local, M_FATAL, management_pre_tunnel_close(), management_up_down(), msg, options::msg_channel, context::options, options::persist_tun, context::plugins, print_in_addr_t(), tuntap::remote_netmask, context_1::route_ipv6_list, context_1::route_list, ROUTE_OPTION_FLAGS, options::route_predown_script, run_up_down(), context::sig, signal_description(), signal_info::signal_received, signal_info::signal_text, SIGUSR1, string_alloc(), TUN_MTU_SIZE, context_1::tuntap, context_1::tuntap_owned, options::up_restart, and win_wfp_uninit().
Referenced by close_instance(), do_up(), and tun_abort().
|
static |
Definition at line 1864 of file init.c.
References context::c1, CLEAR, close_tun(), D_CLOSE, msg, context_1::pulled_options_digest_save, context_1::tuntap, and context_1::tuntap_owned.
Referenced by do_close_tun().
|
static |
Definition at line 3302 of file init.c.
References context::c1, context::c2, D_SHOW_OCC, context_2::frame, gc_free(), gc_new(), msg, context::options, options_string(), context_2::options_string_local, context_2::options_string_remote, options_string_version(), context_2::tls_multi, tls_multi_init_set_options(), and context_1::tuntap.
Referenced by init_instance().
Definition at line 2152 of file init.c.
References context::c2, options::ce, key_state::crypto_options, D_PUSH, D_TLS_ERRORS, do_init_timers(), do_init_traffic_shaper(), EXPANDED_SIZE, connection_entry::explicit_exit_notification, context_2::frame, frame_add_to_extra_frame(), frame_add_to_link_mtu(), init_verb_mute(), key_ctx_bi::initialized, IVM_LEVEL_1, IVM_LEVEL_2, tls_session::key, crypto_options::key_ctx_bi, KS_PRIMARY, connection_entry::link_mtu_defined, context_2::link_socket, link_socket_update_buffer_sizes(), link_socket_update_flags(), M_WARN, msg, options::ncp_enabled, OPT_P_COMP, OPT_P_EXPLICIT_NOTIFY, OPT_P_IPWIN32, OPT_P_MESSAGES, OPT_P_NCP, OPT_P_PEER_ID, OPT_P_PERSIST, OPT_P_ROUTE, OPT_P_ROUTE_EXTRAS, OPT_P_SETENV, OPT_P_SHAPER, OPT_P_SOCKBUF, OPT_P_SOCKFLAGS, OPT_P_TIMER, OPT_P_UP, context::options, tls_multi::peer_id, options::peer_id, connection_entry::proto, proto_is_udp(), options::pull, options::rcvbuf, tls_multi::remote_ciphername, tls_multi::session, options::sndbuf, options::sockflags, context_2::tls_multi, tls_poor_mans_ncp(), tls_session_update_crypto_params(), TM_ACTIVE, TUN_MTU_SIZE, and tls_multi::use_peer_id.
Referenced by do_up(), and multi_connection_established().
|
static |
Definition at line 3619 of file init.c.
References context::c2, env_set_destroy(), context_2::es, and context_2::es_owned.
Referenced by close_instance().
Definition at line 3513 of file init.c.
References BASE_N_EVENTS, context::c2, EVENT_METHOD_FAST, EVENT_METHOD_US_TIMEOUT, context_2::event_set, event_set_init(), context_2::event_set_max, and context_2::event_set_owned.
Referenced by inherit_context_top(), and init_instance().
Definition at line 1035 of file init.c.
References D_GENKEY, options::genkey, M_NOPREFIX, options::mlock, msg, notnull(), platform_mlockall(), options::shared_secret_file, and write_key_file().
Referenced by openvpn_main().
|
static |
Definition at line 2282 of file init.c.
References management_hold().
Referenced by do_startup_pause(), open_management(), and socket_restart_pause().
Definition at line 3611 of file init.c.
References context::c2, env_set_create(), env_set_inherit(), context_2::es, and context_2::es_owned.
Referenced by init_instance().
Definition at line 3742 of file init.c.
References plugin_list_inherit(), context::plugins, and context::plugins_owned.
Referenced by inherit_context_child().
|
static |
Definition at line 3193 of file init.c.
References context_2::buffers, context_2::buffers_owned, context::c2, context_2::frame, and init_context_buffers().
Referenced by init_instance().
|
static |
Definition at line 2872 of file init.c.
References do_init_crypto_none(), do_init_crypto_static(), do_init_crypto_tls(), M_WARN, msg, context::options, options::shared_secret_file, options::tls_client, and options::tls_server.
Referenced by init_instance().
|
static |
Definition at line 2860 of file init.c.
References ASSERT, M_WARN, msg, context::options, and options::test_crypto.
Referenced by do_init_crypto().
|
static |
Definition at line 2468 of file init.c.
References ASSERT, options::authname, context::c1, context::c2, check_replay_consistency(), options::ciphername, CO_MUTE_REPLAY_WARNINGS, CO_PACKET_ID_LONG_FORM, crypto_adjust_frame_parameters(), context_2::crypto_options, crypto_read_openvpn_key(), crypto_options::flags, context_2::frame, init_crypto_pre(), init_key_type(), crypto_options::key_ctx_bi, key_ctx_bi_defined(), options::key_direction, key_schedule::key_type, options::keysize, context_1::ks, M_INFO, msg, options::mute_replay_warnings, context::options, crypto_options::packet_id, packet_id_init(), packet_id_persist_load_obj(), context_1::pid_persist, crypto_options::pid_persist, options::replay, options::replay_time, options::replay_window, options::shared_secret_file, options::shared_secret_file_inline, key_schedule::static_key, and options::test_crypto.
Referenced by do_init_crypto(), and test_crypto_thread().
|
static |
Definition at line 2626 of file init.c.
References ASSERT, tls_options::auth_token_generate, options::auth_token_generate, tls_options::auth_token_lifetime, options::auth_token_lifetime, tls_options::auth_user_pass_file, options::auth_user_pass_file, tls_options::auth_user_pass_verify_script, options::auth_user_pass_verify_script, tls_options::auth_user_pass_verify_script_via_file, options::auth_user_pass_verify_script_via_file, context_1::authname, context::c1, context::c2, options::ccd_exclusive, options::ce, CF_INIT_TLS_AUTH_STANDALONE, CF_INIT_TLS_MULTI, check_replay_consistency(), key_type::cipher, cipher_kt_mode_ofb_cfb(), context_1::ciphername, CLEAR, options::client_config_dir, tls_options::client_config_dir_exclusive, CO_MUTE_REPLAY_WARNINGS, CO_PACKET_ID_LONG_FORM, tls_options::config_authname, tls_options::config_ciphername, tls_options::crl_file, options::crl_file, tls_options::crl_file_inline, options::crl_file_inline, crypto_adjust_frame_parameters(), tls_options::crypto_flags, crypto_max_overhead(), tls_options::disable_occ, do_init_crypto_tls_c1(), tls_options::ekm_label, tls_options::ekm_label_size, tls_options::ekm_size, ENABLE_DEBUG, tls_options::es, context_2::es, crypto_options::flags, context_2::frame, tls_options::frame, frame_add_to_extra_frame(), context_2::gc, tls_options::gremlin, tls_options::handshake_window, options::handshake_window, init_crypto_pre(), IS_SIG, crypto_options::key_ctx_bi, tls_options::key_method, options::key_method, key_schedule::key_type, tls_options::key_type, context_1::ks, link_socket_proto_connection_oriented(), options::mode, tls_wrap_ctx::mode, tls_options::mode, MODE_SERVER, options::mute_replay_warnings, tls_options::ncp_enabled, options::ncp_enabled, tls_options::ns_cert_type, options::ns_cert_type, options::occ, tls_wrap_ctx::opt, context::options, P2MP_SERVER, tls_options::packet_timeout, context_1::pid_persist, crypto_options::pid_persist, tls_options::plugins, context::plugins, connection_entry::proto, PROTO_TCP_SERVER, tls_options::pull, options::pull, tls_options::remote_cert_eku, options::remote_cert_eku, tls_options::remote_cert_ku, options::remote_cert_ku, tls_options::renegotiate_bytes, options::renegotiate_bytes, tls_options::renegotiate_packets, options::renegotiate_packets, tls_options::renegotiate_seconds, options::renegotiate_seconds, tls_options::replay, options::replay, tls_options::replay_time, options::replay_time, tls_options::replay_window, options::replay_window, tls_options::server, tls_options::single_session, options::single_session, socket_adjust_frame_parameters(), key_schedule::ssl_ctx, tls_options::ssl_ctx, tls_options::ssl_flags, options::ssl_flags, tls_options::tcp_mode, options::test_crypto, tls_adjust_frame_parameters(), options::tls_auth_file, key_schedule::tls_auth_key_type, context_2::tls_auth_standalone, tls_auth_standalone_init(), options::tls_client, tls_crypt_adjust_frame_parameters(), options::tls_crypt_file, options::tls_export_cert, context_2::tls_multi, tls_multi_init(), options::tls_server, options::tls_timeout, options::tls_verify, tls_options::tls_wrap, key_schedule::tls_wrap_key, tls_options::tmp_dir, options::tmp_dir, tls_options::transition_window, options::transition_window, tls_options::verify_command, tls_options::verify_export_cert, tls_options::verify_hash, options::verify_hash, tls_options::verify_hash_algo, options::verify_hash_algo, tls_options::verify_x509_name, options::verify_x509_name, tls_options::verify_x509_type, options::verify_x509_type, tls_options::x509_track, options::x509_track, tls_options::x509_username_field, X509_USERNAME_FIELD_DEFAULT, and tls_options::xmit_hold.
Referenced by do_init_crypto().
|
static |
Definition at line 2528 of file init.c.
References AR_INTERACT, AR_NOINTERACT, AR_NONE, ASSERT, auth_retry_get(), context_1::authname, options::authname, context::c1, context_1::ciphername, options::ciphername, CLEAR, crypto_read_openvpn_key(), D_INIT_MEDIUM, key_type::digest, key_type::hmac_length, init_key_type(), init_ssl(), options::key_direction, key_schedule::key_type, context_1::keysize, options::keysize, context_1::ks, M_FATAL, md_kt_get(), md_kt_size(), msg, context::options, options::priv_key_file_inline, options::prng_hash, prng_init(), options::prng_nonce_secret_len, context::sig, signal_info::signal_received, signal_info::signal_text, SIGUSR1, key_schedule::ssl_ctx, ssl_purge_auth(), streq, string_clear(), options::tls_auth_file, options::tls_auth_file_inline, key_schedule::tls_auth_key_type, options::tls_crypt_file, tls_crypt_init_key(), options::tls_crypt_inline, tls_ctx_initialised(), options::tls_server, and key_schedule::tls_wrap_key.
Referenced by do_init_crypto_tls().
|
static |
Definition at line 2838 of file init.c.
References ASSERT, context::c2, D_MTU_INFO, EXPANDED_SIZE, context_2::frame, tls_options::frame, tls_auth_standalone::frame, frame_print(), tls_multi::opt, context_2::tls_auth_standalone, tls_auth_standalone_finalize(), context_2::tls_multi, and tls_multi_init_finalize().
Referenced by do_init_frame_tls().
|
static |
Definition at line 3337 of file init.c.
References ALLOC_OBJ_CLEAR_GC, context::c0, options::cd_dir, context::did_we_daemonize, context::first_time, context::gc, options::groupname, options::nice, context::options, platform_chdir(), platform_group_get(), platform_nice(), context_0::platform_state_group, context_0::platform_state_user, platform_user_get(), context_0::uid_gid_specified, and options::username.
Referenced by init_instance().
|
static |
Definition at line 3205 of file init.c.
References ASSERT, context::c2, options::ce, connection_entry::fragment, context_2::fragment, fragment_frame_init(), context_2::frame_fragment, frame_set_mtu_dynamic(), context::options, and SET_MTU_UPPER_BOUND.
Referenced by init_instance().
|
static |
Definition at line 2895 of file init.c.
References context::c2, options::ce, CIPHER_ENABLED, ETHERNET_MTU, connection_entry::fragment, context_2::frame, frame_add_to_align_adjust(), frame_add_to_extra_link(), frame_finalize_options(), context_2::frame_fragment, context_2::frame_fragment_omit, FRAME_HEADROOM_MARKER_DECRYPT, FRAME_HEADROOM_MARKER_FRAGMENT, frame_or_align_flags(), frame_subtract_extra(), M_WARN, msg, connection_entry::mssfix, options::mtu_test, context::options, connection_entry::proto, socket_adjust_frame_parameters(), socks_adjust_frame_parameters(), connection_entry::socks_proxy_server, tun_adjust_frame_parameters(), connection_entry::tun_mtu_extra, connection_entry::tun_mtu_extra_defined, and TUN_MTU_SIZE.
Referenced by init_instance().
|
static |
Definition at line 3133 of file init.c.
References do_init_finalize_tls_frame().
Referenced by init_instance().
|
static |
Definition at line 1423 of file init.c.
References add_route_ipv6_to_option_list(), route_ipv6_option_list::flags, route_ipv6_option_list::gc, options::ifconfig_ipv6_remote, init_route_ipv6_list(), link_socket_current_remote_ipv6(), RG_REROUTE_GW, options::route_default_metric, options::routes_ipv6, setenv_routes_ipv6(), and string_alloc().
Referenced by do_open_tun().
|
static |
Definition at line 1388 of file init.c.
References options::dev, options::dev_type, dev_type_enum(), DEV_TYPE_TUN, options::ifconfig_remote_netmask, init_route_list(), link_socket_current_remote(), options::route_default_gateway, options::route_default_metric, options::routes, setenv_routes(), TOP_NET30, TOP_P2P, and options::topology.
Referenced by do_open_tun().
|
static |
Definition at line 1277 of file init.c.
References context::c2, options::ce, connection_entry::connect_timeout, event_timeout_init(), now, context::options, context_2::server_poll_interval, and update_time().
Referenced by init_instance().
|
static |
Definition at line 3229 of file init.c.
References context_2::accept_from, connection_entry::af, connection_entry::bind_ipv6_only, connection_entry::bind_local, context::c1, context::c2, options::ce, context_1::dns_cache, ENABLE_DEBUG, context_1::http_proxy, options::inetd, options::ipchange, context_2::link_socket, context_1::link_socket_addr, link_socket_init_phase1(), connection_entry::local, connection_entry::local_port, options::mark, connection_entry::mtu_discover_type, context::options, context::plugins, connection_entry::proto, options::rcvbuf, connection_entry::remote, connection_entry::remote_float, connection_entry::remote_port, options::resolve_retry_seconds, context_2::server_poll_interval, SF_PORT_SHARE, options::sndbuf, options::sockflags, and context_1::socks_proxy.
Referenced by init_instance().
|
static |
Definition at line 3275 of file init.c.
References context::c2, context_2::frame, context_2::link_socket, link_socket_init_phase2(), and context::sig.
Referenced by init_instance().
Definition at line 1290 of file init.c.
References context::c2, event_timeout_init(), context_2::inactivity_interval, options::inactivity_timeout, interval_init(), options::mtu_test, now, options::occ, context_2::occ_interval, OCC_INTERVAL_SECONDS, OCC_MTU_LOAD_INTERVAL_SECONDS, context_2::occ_mtu_load_test_interval, context::options, context_2::options_string_local, context_2::options_string_remote, options::packet_id_file, context_2::packet_id_persist_interval, context_2::ping_rec_interval, options::ping_rec_timeout, context_2::ping_send_interval, options::ping_send_timeout, reset_coarse_timers(), TLS_MODE, TLS_MULTI_HORIZON, TLS_MULTI_REFRESH, context_2::tmp_int, update_time(), and context_2::wait_for_connect.
Referenced by do_deferred_options(), and init_instance().
|
static |
Definition at line 1352 of file init.c.
References context::c2, context::options, and shaper_msg().
Referenced by do_deferred_options(), and init_instance().
|
static |
Definition at line 1651 of file init.c.
References link_socket_addr::bind_local, context::c1, context::c2, options::dev, options::dev_type, context_2::es, context_2::frame, options::ifconfig_ipv6_local, options::ifconfig_ipv6_netbits, options::ifconfig_ipv6_remote, options::ifconfig_local, options::ifconfig_nowarn, options::ifconfig_remote_netmask, init_tun(), init_tun_post(), context_1::link_socket_addr, context::options, link_socket_addr::remote_list, options::topology, context_1::tuntap, options::tuntap_options, and context_1::tuntap_owned.
Referenced by do_open_tun().
|
static |
Definition at line 3218 of file init.c.
References ASSERT, context::c2, context_2::link_socket, link_socket_new(), and context_2::link_socket_owned.
Referenced by init_instance().
|
static |
Definition at line 3578 of file init.c.
References context::c1, context_1::ifconfig_pool_persist, options::ifconfig_pool_persist_filename, ifconfig_pool_persist_init(), context_1::ifconfig_pool_persist_owned, options::ifconfig_pool_persist_refresh_freq, and context::options.
Referenced by init_instance().
|
static |
Definition at line 3547 of file init.c.
References context::c1, context::options, options::status_file, options::status_file_update_freq, status_open(), context_1::status_output, context_1::status_output_owned, and STATUS_OUTPUT_WRITE.
Referenced by init_instance().
Definition at line 1678 of file init.c.
References tuntap::actual_name, tuntap::adapter_index, ASSERT, options::block_outside_dns, context::c1, context::c2, D_LOW, D_ROUTE, options::dev, options::dev_node, options::dev_type, dev_type_string(), dmsg, do_alloc_route_list(), do_ifconfig(), do_ifconfig_setenv(), do_init_route_ipv6_list(), do_init_route_list(), do_init_tun(), do_route(), context_2::es, EXPANDED_SIZE, context_2::frame, frame_set_mtu_dynamic(), gc_free(), gc_new(), guess_tuntap_dev(), IA_EMPTY_IF_UNDEF, IFCONFIG_AFTER_TUN_OPEN, IFCONFIG_BEFORE_TUN_OPEN, options::ifconfig_noexec, ifconfig_order(), link_socket::info, context_2::link_socket, options::lladdr, tuntap::local, M_FATAL, M_INFO, msg, tuntap_options::msg_channel, options::msg_channel, open_tun(), tuntap::options, context::options, context::plugins, tuntap::post_open_mtu, print_in_addr_t(), tuntap::remote_netmask, ROUTE_AFTER_TUN, ROUTE_BEFORE_TUN, options::route_delay_defined, context_1::route_ipv6_list, context_1::route_list, route_order(), options::routes, options::routes_ipv6, run_up_down(), set_lladdr(), SET_MTU_TUN, SET_MTU_UPPER_BOUND, TUN_MTU_SIZE, context_1::tuntap, options::up_restart, options::up_script, and win_wfp_block_dns().
Referenced by do_up(), and init_instance().
|
static |
Definition at line 3026 of file init.c.
References options::chroot_dir, options::client_config_dir, options::duplicate_cn, ENABLE_PKCS11, context::first_time, options::groupname, options::ifconfig_local, options::ifconfig_pool_persist_filename, options::keepalive_ping, options::keepalive_timeout, M_WARN, options::mode, MODE_SERVER, msg, NS_CERT_CHECK_SERVER, options::ns_cert_type, context::options, options::persist_key, options::persist_tun, options::ping_rec_timeout, options::ping_send_timeout, options::pull, options::remote_cert_eku, options::replay, script_security, options::server_bridge_defined, options::server_bridge_proxy_dhcp, SSEC_PW_ENV, SSEC_SCRIPTS, options::tls_client, options::tls_server, options::tls_verify, options::user_script_used, options::username, VERIFY_X509_NONE, options::verify_x509_type, and warn_on_use_of_common_subnets().
Referenced by init_instance().
Definition at line 1065 of file init.c.
References options::ce, options::dev, options::dev_node, options::dev_type, ENABLE_CRYPTO, options::groupname, options::ifconfig_local, options::ifconfig_remote_netmask, options::lladdr, M_FATAL, M_OPTERR, msg, notnull(), options::persist_config, options::persist_mode, connection_entry::remote, set_lladdr(), options::shared_secret_file, options::tls_client, options::tls_server, tuncfg(), options::tuntap_options, and options::username.
Referenced by openvpn_main().
|
static |
Definition at line 3285 of file init.c.
References context::c2, D_MTU_INFO, context_2::fragment, context_2::frame, context_2::frame_fragment, and frame_print().
Referenced by init_instance().
void do_route | ( | const struct options * | options, |
struct route_list * | route_list, | ||
struct route_ipv6_list * | route_ipv6_list, | ||
const struct tuntap * | tt, | ||
const struct plugin_list * | plugins, | ||
struct env_set * | es | ||
) |
Definition at line 1597 of file init.c.
References add_routes(), argv_new(), argv_parse_cmd(), argv_reset(), check_debug_level(), D_SHOW_NET, M_INFO, M_NOPREFIX, M_WARN, management_up_down(), msg, openvpn_run_script(), plugin_call(), plugin_defined(), route_did_redirect_default_gateway(), options::route_noexec, ROUTE_OPTION_FLAGS, options::route_script, setenv_int(), setenv_str(), show_adapters(), options::show_net_up, and show_routes().
Referenced by check_add_routes_action(), and do_open_tun().
|
static |
Definition at line 3638 of file init.c.
References context::c2, options::ce, options::fast_io, context_2::fast_io, M_INFO, msg, context::options, connection_entry::proto, and proto_is_udp().
Referenced by init_instance().
|
static |
Definition at line 3667 of file init.c.
References context::c2, context::options, SIGTERM, SIGUSR1, options::tls_exit, and context_2::tls_exit_signal.
Referenced by init_instance().
|
static |
Definition at line 2375 of file init.c.
References do_hold(), context::first_time, and socket_restart_pause().
Referenced by init_instance().
Definition at line 4534 of file init.c.
References context_clear(), context::first_time, M_INFO, msg, context::options, options_detach(), options::test_crypto, test_crypto_thread(), and title_string.
Referenced by openvpn_main().
Definition at line 1142 of file init.c.
References context::c0, options::chroot_dir, context::first_time, M_ERR, M_INFO, msg, context::options, platform_chroot(), platform_group_set(), context_0::platform_state_group, context_0::platform_state_user, platform_user_set(), context_0::uid_gid_chroot_set, and context_0::uid_gid_specified.
Referenced by init_instance(), and initialization_sequence_completed().
Definition at line 2038 of file init.c.
References context::c1, context::c2, D_PUSH_ERRORS, context_2::did_open_tun, do_close_tun(), do_deferred_options(), do_open_tun(), context_2::do_up_ran, event_timeout_init(), initialization_sequence_completed(), M_INFO, management_sleep(), options::mode, MODE_POINT_TO_POINT, msg, now, context::options, options_hash_changed_or_zero(), PULL_DEFINED, context_2::pulled_options_digest, context_1::pulled_options_digest_save, reset_coarse_timers(), ROUTE_AFTER_TUN, options::route_delay, options::route_delay_defined, options::route_delay_window, route_order(), context_2::route_wakeup, context_2::route_wakeup_expire, tun_standby_init(), context_1::tuntap, options::up_delay, and update_time().
Referenced by check_connection_established_dowork(), and incoming_push_message().
Definition at line 1225 of file init.c.
References alloc_buf_gc(), BSTR, buf_printf(), context::c2, tls_common_name(), and context_2::tls_multi.
Referenced by check_ping_restart_dowork().
Definition at line 2391 of file init.c.
References context::c2, options::ce, CIPHER_ENABLED, context_2::frame, frame_add_to_extra_buffer(), frame_align_to_extra_frame(), frame_finalize(), FRAME_HEADROOM_MARKER_FRAGMENT, FRAME_HEADROOM_MARKER_READ_LINK, FRAME_HEADROOM_MARKER_READ_STREAM, frame_or_align_flags(), connection_entry::link_mtu, connection_entry::link_mtu_defined, context::options, PAYLOAD_ALIGN, connection_entry::tun_mtu, and connection_entry::tun_mtu_defined.
Referenced by do_init_frame(), and test_crypto_thread().
void free_context_buffers | ( | struct context_buffers * | b | ) |
Definition at line 3166 of file init.c.
References context_buffers::aux_buf, context_buffers::decrypt_buf, context_buffers::encrypt_buf, free_buf(), context_buffers::read_link_buf, and context_buffers::read_tun_buf.
Referenced by do_close_free_buf(), and multi_top_free().
Definition at line 4343 of file init.c.
References context_2::accept_from, ALLOC_OBJ_CLEAR_GC, ALLOC_OBJ_GC, context_1::authname, context_2::buffers, context::c1, context::c2, CC_NO_CLOSE, CC_USR1_TO_HUP, options::ce, context_1::ciphername, CLEAR, CM_CHILD_TCP, CM_CHILD_UDP, link_socket_info::connection_established, do_inherit_plugins(), context_2::es, context::gc, gc_new(), link_socket::info, init_instance(), IS_SIG, key_schedule::key_type, context_1::keysize, context_1::ks, context_2::link_socket, context_1::link_socket_addr, context_2::link_socket_info, link_socket_info::lsa, context::mode, context::options, options_detach(), packet_id_persist_init(), context_1::pid_persist, connection_entry::proto, proto_is_dgram(), context::sig, key_schedule::ssl_ctx, key_schedule::tls_auth_key_type, key_schedule::tls_wrap_key, and context_1::tuntap.
Referenced by multi_create_instance().
Definition at line 4417 of file init.c.
References context_2::buffers_owned, context::c0, context::c1, context::c2, options::ce, CM_TOP_CLONE, do_event_set_init(), context_2::es_owned, context_2::event_set, context_2::event_set_owned, context::first_time, context_2::gc, context::gc, gc_detach(), context_1::ifconfig_pool_persist_owned, context_2::link_socket_owned, context::mode, context::options, options_detach(), context::plugins_owned, connection_entry::proto, proto_is_dgram(), context_1::status_output_owned, context_2::tls_multi, and context_1::tuntap_owned.
Referenced by multi_top_init().
|
static |
Definition at line 385 of file init.c.
References connection_list::array, options::connection_list, connection_list::current, get_random(), connection_list::len, context::options, and options::remote_random.
Referenced by context_init_1().
struct context_buffers* init_context_buffers | ( | const struct frame * | frame | ) |
Definition at line 3141 of file init.c.
References alloc_buf(), ALLOC_OBJ_CLEAR, context_buffers::aux_buf, BUF_SIZE, context_buffers::decrypt_buf, context_buffers::encrypt_buf, context_buffers::read_link_buf, and context_buffers::read_tun_buf.
Referenced by do_init_buffers(), and multi_top_init().
|
static |
Definition at line 2439 of file init.c.
References context::c1, CF_LOAD_PERSISTED_PACKET_ID, crypto_init_lib_engine(), options::engine, context::options, options::packet_id_file, packet_id_persist_load(), and context_1::pid_persist.
Referenced by do_init_crypto_static(), and do_init_crypto_tls().
Definition at line 3949 of file init.c.
References AR_INTERACT, auth_retry_get(), context::c2, options::ce, CF_INIT_TLS_AUTH_STANDALONE, CF_INIT_TLS_MULTI, CF_LOAD_PERSISTED_PACKET_ID, close_context(), CM_CHILD_TCP, CM_CHILD_UDP, CM_P2P, CM_TOP, context_2::did_open_tun, do_compute_occ_strings(), do_event_set_init(), do_inherit_env(), do_init_buffers(), do_init_crypto(), do_init_first_time(), do_init_fragment(), do_init_frame(), do_init_frame_tls(), do_init_server_poll_timeout(), do_init_socket_1(), do_init_socket_2(), do_init_timers(), do_init_traffic_shaper(), do_link_socket_new(), do_open_ifconfig_pool_persist(), do_open_status_output(), do_open_tun(), do_option_warnings(), do_preresolve(), do_print_data_channel_mtu_parms(), do_setup_fast_io(), do_signal_on_tls_errors(), do_startup_pause(), do_uid_gid_chroot(), context::first_time, connection_entry::fragment, context_2::fragment, fragment_init(), context_2::frame, frame_init_mssfix(), context_2::frame_initial, context_2::gc, gc_init(), init_management_callback_p2p(), init_proxy(), init_query_passwords(), init_verb_mute(), IS_SIG, IVM_LEVEL_2, LS_MODE_DEFAULT, LS_MODE_TCP_ACCEPT_FROM, LS_MODE_TCP_LISTEN, options::mlock, context::mode, next_connection_entry(), context_2::occ_op, occ_reset_op(), open_plugins(), context::options, P2P_ERROR_DELAY_MS, platform_mlockall(), connection_entry::proto, PROTO_TCP_SERVER, PULL_DEFINED, options::resolve_in_advance, set_check_status_error_delay(), SHAPER_DEFINED, context::sig, SIG_SOURCE_SOFT, signal_info::signal_received, signal_info::signal_text, signal_info::source, and options::up_delay.
Referenced by inherit_context_child(), and init_instance_handle_signals().
void init_instance_handle_signals | ( | struct context * | c, |
const struct env_set * | env, | ||
const unsigned int | flags | ||
) |
Definition at line 3927 of file init.c.
References init_instance(), IS_SIG, post_init_signal_catch(), pre_init_signal_catch(), remap_signal(), and uninit_management_callback().
Referenced by tunnel_point_to_point(), tunnel_server_tcp(), and tunnel_server_udp_single_threaded().
void init_management | ( | struct context * | c | ) |
void init_management_callback_p2p | ( | struct context * | c | ) |
Definition at line 3816 of file init.c.
References management_callback::arg, CLEAR, management_callback_proxy_cmd(), management_callback_remote_cmd(), management_callback_status_p2p(), management_set_callback(), management_show_net_callback(), management_callback::proxy_cmd, management_callback::remote_cmd, management_callback::show_net, and management_callback::status.
Referenced by init_instance().
void init_options_dev | ( | struct options * | options | ) |
Definition at line 986 of file init.c.
References basename(), options::dev, options::dev_node, and string_alloc().
Referenced by openvpn_main().
void init_plugins | ( | struct context * | c | ) |
Definition at line 3684 of file init.c.
References context::options, options::plugin_list, plugin_list_init(), context::plugins, and context::plugins_owned.
Referenced by openvpn_main().
|
static |
Definition at line 605 of file init.c.
References init_proxy_dowork().
Referenced by init_instance().
|
static |
Definition at line 575 of file init.c.
References context::c1, options::ce, context_1::http_proxy, http_proxy_new(), connection_entry::http_proxy_options, context_1::http_proxy_owned, context::options, context_1::socks_proxy, connection_entry::socks_proxy_authfile, socks_proxy_new(), context_1::socks_proxy_owned, connection_entry::socks_proxy_port, connection_entry::socks_proxy_server, and uninit_proxy_dowork().
Referenced by init_proxy().
void init_query_passwords | ( | const struct context * | c | ) |
Query for private key and auth-user-pass username/passwords.
Definition at line 530 of file init.c.
References options::auth_user_pass_file, auth_user_pass_setup(), options::key_pass_file, context::options, and pem_password_setup().
Referenced by init_instance(), and openvpn_main().
bool init_static | ( | void | ) |
Definition at line 703 of file init.c.
References ASSERT, buf_read_u8(), buffer_list_advance(), buffer_list_aggregate(), buffer_list_free(), buffer_list_new(), buffer_list_peek(), buffer_list_push(), create_temp_file(), error_reset(), extract_x509_field_test(), format_hex(), gc_free(), gc_new(), gen_path(), get_default_gateway(), get_default_gateway_ipv6(), init_ssl_lib(), init_win32(), M_INFO, M_WARN, msg, print_default_gateway(), prng_bytes(), prng_init(), prng_uninit(), rand_bytes(), reset_check_status(), SIZE, sleep, srandom, status_close(), status_open(), STATUS_OUTPUT_WRITE, status_printf(), time_test(), and update_time().
Referenced by openvpn_main().
void init_verb_mute | ( | struct context * | c, |
unsigned int | flags | ||
) |
Definition at line 963 of file init.c.
References context::c2, check_debug_level(), D_LINK_ERRORS, D_LOG_RW, D_READ_WRITE, IVM_LEVEL_1, IVM_LEVEL_2, context_2::log_rw, options::mute, context::options, SDL_CONSTRAIN, set_check_status(), set_debug_level(), set_mute_cutoff(), and options::verbosity.
Referenced by do_deferred_options(), init_instance(), openvpn_main(), and test_crypto_thread().
void initialization_sequence_completed | ( | struct context * | c, |
const unsigned int | flags | ||
) |
Definition at line 1476 of file init.c.
References link_socket_addr::actual, openvpn_sockaddr::addr, addr_defined(), context::c1, context::c2, CLEAR, delayed_auth_pass_purge(), link_socket_actual::dest, do_uid_gid_chroot(), fork_register_dns_action(), get_link_socket_info(), openvpn_sockaddr::in4, openvpn_sockaddr::in6, in_addr_t, ISC_ERRORS, ISC_SERVER, context_2::link_socket, tuntap::local, tuntap::local_ipv6, link_socket_info::lsa, M_INFO, M_NOPREFIX, management_post_tunnel_open(), management_set_state(), options::mode, MODE_POINT_TO_POINT, msg, options::no_advance, OPENVPN_STATE_CONNECTED, context::options, openvpn_sockaddr::sa, link_socket::sd, show_adapters(), show_routes(), context_1::tuntap, and options::unsuccessful_attempts.
Referenced by check_add_routes_action(), do_up(), tunnel_server_tcp(), and tunnel_server_udp_single_threaded().
|
static |
Definition at line 2423 of file init.c.
References CLEAR, free_key_ctx_bi(), key_schedule::ssl_ctx, key_schedule::static_key, tls_ctx_free(), tls_ctx_initialised(), and key_schedule::tls_wrap_key.
Referenced by do_close_free_key_schedule(), and test_crypto_thread().
|
static |
Definition at line 210 of file init.c.
References http_proxy_options::auth_retry, context::c2, options::ce, CE_MAN_QUERY_PROXY, connection_entry::flags, context_2::gc, connection_entry::http_proxy_options, init_http_proxy_options_once(), M_WARN, msg, context::options, PAR_ALL, PAR_NCT, http_proxy_options::port, connection_entry::proto, PROTO_TCP, PROTO_TCP_CLIENT, http_proxy_options::server, connection_entry::socks_proxy_port, connection_entry::socks_proxy_server, streq, string_alloc(), and update_time().
Referenced by init_management_callback_p2p().
|
static |
Definition at line 291 of file init.c.
References ALLOC_OBJ_CLEAR_GC, options::ce, CE_MAN_QUERY_REMOTE_ACCEPT, CE_MAN_QUERY_REMOTE_MASK, CE_MAN_QUERY_REMOTE_MOD, CE_MAN_QUERY_REMOTE_QUERY, CE_MAN_QUERY_REMOTE_SHIFT, CE_MAN_QUERY_REMOTE_SKIP, connection_entry::flags, options::gc, remote_host_store::host, context::options, remote_host_store::port, connection_entry::remote, connection_entry::remote_port, RH_HOST_LEN, RH_PORT_LEN, options::rh_store, and strncpynt().
Referenced by init_management_callback_p2p().
|
static |
Definition at line 3756 of file init.c.
References print_status().
Referenced by init_management_callback_p2p().
void management_show_net_callback | ( | void * | arg, |
const int | msglevel | ||
) |
Definition at line 3763 of file init.c.
References context::c2, context_2::link_socket, msg, context::options, options::pull, link_socket::sd, show_adapters(), show_routes(), SOCKET_UNDEFINED, context_2::tls_multi, and tls_multi::use_peer_id.
Referenced by init_management_callback_multi(), and init_management_callback_p2p().
|
static |
Definition at line 425 of file init.c.
References connection_list::array, ASSERT, context::c1, options::ce, CE_DISABLED, ce_management_query_proxy(), ce_management_query_remote(), options::connect_retry_max, options::connection_list, connection_list::current, link_socket_addr::current_remote, connection_entry::flags, IS_SIG, connection_list::len, context_1::link_socket_addr, M_FATAL, management_query_proxy_enabled(), management_query_remote_enabled(), msg, options::no_advance, context::options, options::persist_remote_ip, link_socket_addr::remote_list, options::unsuccessful_attempts, and update_options_ce_post().
Referenced by init_instance(), and test_crypto_thread().
Definition at line 3848 of file init.c.
References close_management(), do_hold(), management_callback::flags, IS_SIG, M_WARN, options::management_addr, options::management_client_group, options::management_client_user, options::management_echo_buffer_size, options::management_flags, options::management_log_history_cache, management_open(), options::management_port, management_set_state(), options::management_state_buffer_size, options::management_user_pass, options::management_write_peer_info_file, MF_SERVER, options::mode, MODE_SERVER, msg, OPENVPN_STATE_CONNECTING, context::options, and options::remap_sigusr1.
Referenced by openvpn_main().
Definition at line 3694 of file init.c.
References context::c2, D_IMPORT_ERRORS, context_2::es, context::es, plugin_return::list, M_OPTERR, plugin_return::n, OPT_P_DEFAULT, OPT_P_PLUGIN, context::options, options_string_import(), options::plugin_list, plugin_list_open(), plugin_return_defined(), plugin_return_free(), plugin_return_get_column(), plugin_return_init(), context::plugins, and context::plugins_owned.
Referenced by init_instance(), and openvpn_main().
|
static |
Definition at line 1107 of file init.c.
References ASSERT, daemon(), options::daemon, options::inetd, options::log, M_ERR, msg, restore_signal_state(), and set_std_files_to_null().
Referenced by openvpn_main().
void pre_setup | ( | const struct options * | options | ) |
Definition at line 1238 of file init.c.
References options::config, options::exit_event_initial_state, options::exit_event_name, win32_signal::mode, win32_signal_open(), window_title_generate(), window_title_save(), WSO_FORCE_CONSOLE, WSO_FORCE_SERVICE, and WSO_MODE_CONSOLE.
Referenced by openvpn_main().
Definition at line 996 of file init.c.
References options::cipher_list, show_available_ciphers(), show_available_curves(), show_available_digests(), show_available_engines(), show_available_tls_ciphers(), options::show_ciphers, options::show_curves, options::show_digests, options::show_engines, and options::show_tls_ciphers.
Referenced by openvpn_main().
unsigned int pull_permission_mask | ( | const struct context * | c | ) |
Definition at line 2115 of file init.c.
References options::ncp_enabled, OPT_P_COMP, OPT_P_ECHO, OPT_P_EXPLICIT_NOTIFY, OPT_P_IPWIN32, OPT_P_MESSAGES, OPT_P_NCP, OPT_P_PEER_ID, OPT_P_PERSIST, OPT_P_PULL_MODE, OPT_P_ROUTE, OPT_P_ROUTE_EXTRAS, OPT_P_SETENV, OPT_P_SHAPER, OPT_P_SOCKBUF, OPT_P_SOCKFLAGS, OPT_P_TIMER, OPT_P_UP, context::options, and options::route_nopull.
Referenced by incoming_push_message().
void reset_coarse_timers | ( | struct context * | c | ) |
Definition at line 1266 of file init.c.
References context::c2, and context_2::coarse_timer_wakeup.
Referenced by check_connection_established_dowork(), do_init_timers(), do_up(), process_explicit_exit_notification_init(), and schedule_exit().
|
static |
Definition at line 101 of file init.c.
References argv_msg(), argv_new(), argv_parse_cmd(), argv_printf(), argv_printf_cat(), argv_reset(), ASSERT, gc_free(), gc_new(), M_FATAL, M_INFO, msg, openvpn_run_script(), plugin_call(), plugin_defined(), S_FATAL, setenv_int(), and setenv_str().
Referenced by do_close_tun(), and do_open_tun().
|
static |
Definition at line 2301 of file init.c.
References AR_NOINTERACT, auth_retry_get(), options::ce, connection_entry::connect_retry_seconds, connection_entry::connect_retry_seconds_max, options::connection_list, D_RESTART, do_hold(), connection_list::len, management_sleep(), max_int(), min_int(), msg, context::options, context::persist, connection_entry::proto, PROTO_TCP_CLIENT, PROTO_TCP_SERVER, PROTO_UDP, context_persist::restart_sleep_seconds, and options::unsuccessful_attempts.
Referenced by do_startup_pause().
|
static |
Definition at line 4509 of file init.c.
References ASSERT, context::c1, context::c2, context_gc_free(), context_init_1(), context_2::crypto_options, do_init_crypto_static(), context_2::frame, frame_finalize_options(), init_verb_mute(), IVM_LEVEL_1, key_schedule_free(), context_1::ks, next_connection_entry(), context::options, crypto_options::packet_id, packet_id_free(), options::test_crypto, and test_crypto().
Referenced by do_test_crypto().
void tun_abort | ( | void | ) |
Definition at line 2008 of file init.c.
References do_close_tun(), and static_context.
Referenced by openvpn_exit().
void uninit_management_callback | ( | void | ) |
Definition at line 3912 of file init.c.
References management_clear_callback().
Referenced by init_instance_handle_signals(), tunnel_point_to_point(), and uninit_management_callback_multi().
|
static |
Definition at line 611 of file init.c.
References uninit_proxy_dowork().
Referenced by close_instance().
|
static |
Definition at line 558 of file init.c.
References context::c1, context_1::http_proxy, http_proxy_close(), context_1::http_proxy_owned, context_1::socks_proxy, socks_proxy_close(), and context_1::socks_proxy_owned.
Referenced by init_proxy_dowork(), and uninit_proxy().
void uninit_static | ( | void | ) |
|
static |
Definition at line 189 of file init.c.
References options::ce, options::ping_rec_timeout, options::ping_rec_timeout_action, PING_RESTART, PING_UNDEF, PRE_PULL_INITIAL_PING_RESTART, connection_entry::proto, proto_is_dgram(), and options::pull.
Referenced by next_connection_entry().
|
static |
Definition at line 57 of file init.c.
Referenced by tun_abort().