OpenVPN
|
This main event loop module drives the packet processing of OpenVPN. More...
Functions | |
void | tunnel_server_tcp (struct context *top) |
Main event loop for OpenVPN in TCP server mode. More... | |
void | tunnel_server_udp (struct context *top) |
Main event loop for OpenVPN in UDP server mode. More... | |
void | tunnel_server (struct context *top) |
Main event loop for OpenVPN in server mode. More... | |
static void | tunnel_point_to_point (struct context *c) |
Main event loop for OpenVPN in client mode, where only one VPN tunnel is active. More... | |
static int | openvpn_main (int argc, char *argv[]) |
OpenVPN's main init-run-cleanup loop. More... | |
This main event loop module drives the packet processing of OpenVPN.
OpenVPN is an event driven system. Its activities are driven by a main event loop, which repeatedly waits for one of several predefined events to occur, and then calls the appropriate module to handle the event. The major types of network events that OpenVPN processes are:
Beside these external events, OpenVPN also processes other types of internal events. These include scheduled events, such as resending of non-acknowledged control channel messages.
Depending on the mode in which OpenVPN is running, a different main event loop function is called to drive the event processing. The following implementations are available:
tunnel_point_to_point()
tunnel_server_udp()
tunnel_server_tcp()
|
static |
OpenVPN's main init-run-cleanup loop.
This function contains the two outer OpenVPN loops. Its structure is as follows:
SIGHUP:
SIGUSR1:
argc | - Commandline argument count. |
argv | - Commandline argument values. |
Definition at line 160 of file openvpn.c.
References ASSERT, options::chroot_dir, CLEAR, close_management(), context_clear_all_except_first_time(), context_gc_free(), context_init_1(), context::did_we_daemonize, do_genkey(), do_persist_tuntap(), do_test_crypto(), env_set_create(), env_set_destroy(), context::es, context::first_time, context::gc, gc_init(), gc_reset(), init_early(), init_management(), init_options(), init_options_dev(), init_plugins(), init_query_passwords(), init_static(), init_verb_mute(), IS_SIG, IVM_LEVEL_1, M_INFO, M_USAGE, options::management_flags, MF_QUERY_PASSWORDS, options::mode, MODE_POINT_TO_POINT, MODE_SERVER, msg, context::net_ctx, open_management(), open_plugins(), openvpn_exit(), OPENVPN_EXIT_STATUS_GOOD, OPENVPN_PLUGIN_INIT_PRE_CONFIG_PARSE, OPT_P_DEFAULT, context::options, options_postprocess(), parse_argv(), possibly_become_daemon(), pre_init_signal_catch(), pre_setup(), print_openssl_info(), print_signal(), set_win_sys_path_via_env(), setenv_settings(), show_dco_version(), show_library_versions(), show_settings(), show_windows_version(), context::sig, siginfo_static, signal_reset(), signal_restart_status(), title_string, tunnel_point_to_point(), tunnel_server(), uninit_early(), uninit_options(), uninit_static(), write_pid_file(), and options::writepid.
Referenced by wmain().
|
static |
Main event loop for OpenVPN in client mode, where only one VPN tunnel is active.
c | - The context structure of the single active VPN tunnel. |
Definition at line 57 of file openvpn.c.
References context::c2, CC_HARD_USR1_TO_HUP, close_instance(), CM_P2P, context_clear_2(), context::es, ES_TIMEOUT, context_2::event_set_status, init_instance_handle_signals(), io_wait(), IS_SIG, context::mode, P2P_CHECK_SIG, p2p_iow_flags(), PERF_EVENT_LOOP, perf_pop(), perf_push(), persist_client_stats(), pre_select(), process_io(), and uninit_management_callback().
Referenced by openvpn_main().
void tunnel_server | ( | struct context * | top | ) |
Main event loop for OpenVPN in server mode.
This function calls the appropriate main event loop function depending on the transport protocol used:
top | - Top-level context structure. |
Definition at line 4169 of file multi.c.
References ASSERT, options::ce, options::mode, MODE_SERVER, context::options, connection_entry::proto, proto_is_dgram(), tunnel_server_tcp(), and tunnel_server_udp().
Referenced by openvpn_main().
void tunnel_server_tcp | ( | struct context * | top | ) |
Main event loop for OpenVPN in TCP server mode.
top | - Top-level context structure. |
Definition at line 789 of file mtcp.c.
References context::c2, CC_HARD_USR1_TO_HUP, close_instance(), CM_TOP, context_clear_2(), D_MULTI_ERRORS, context::es, init_instance_handle_signals(), init_management_callback_multi(), initialization_sequence_completed(), IS_SIG, ISC_SERVER, M_ERRNO, context::mode, msg, multi_context::mtcp, MULTI_CHECK_SIG, multi_get_timeout(), multi_ifconfig_pool_persist(), multi_init(), multi_process_per_second_timers(), multi_tcp_action(), multi_tcp_process_io(), multi_tcp_wait(), multi_top_free(), multi_top_init(), multi_uninit(), PERF_EVENT_LOOP, perf_pop(), perf_push(), status, TA_TIMEOUT, context_2::timeval, multi_context::top, and uninit_management_callback().
Referenced by tunnel_server().
void tunnel_server_udp | ( | struct context * | top | ) |
Main event loop for OpenVPN in UDP server mode.
This function implements OpenVPN's main event loop for UDP server mode.
top | - Top-level context structure. |
Definition at line 462 of file mudp.c.
References context::c2, CC_HARD_USR1_TO_HUP, close_instance(), CM_TOP, context_clear_2(), D_MULTI_ERRORS, context::es, ES_TIMEOUT, context_2::event_set_status, init_instance_handle_signals(), init_management_callback_multi(), initialization_sequence_completed(), io_wait(), IS_SIG, ISC_SERVER, M_ERRNO, context::mode, MPP_CLOSE_ON_SIGNAL, MPP_PRE_SELECT, msg, MULTI_CHECK_SIG, multi_get_timeout(), multi_ifconfig_pool_persist(), multi_init(), multi_process_io_udp(), multi_process_per_second_timers(), multi_process_timeout(), multi_top_free(), multi_top_init(), multi_uninit(), p2mp_iow_flags(), PERF_EVENT_LOOP, perf_pop(), perf_push(), context_2::timeval, multi_context::top, and uninit_management_callback().
Referenced by tunnel_server().