OpenVPN
|
This main event loop module drives the packet processing of OpenVPN. More...
Functions | |
static void | tunnel_server_loop (struct multi_context *multi) |
Main event loop for OpenVPN in point-to-multipoint server mode. | |
void | tunnel_server (struct context *top) |
Main event loop for OpenVPN in server mode. | |
static void | tunnel_point_to_point (struct context *c) |
Main event loop for OpenVPN in client mode, where only one VPN tunnel is active. | |
static int | openvpn_main (int argc, char *argv[]) |
OpenVPN's main init-run-cleanup loop. | |
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 162 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, 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 58 of file openvpn.c.
References context::c2, CC_HARD_USR1_TO_HUP, close_instance(), CM_P2P, options::config, context_clear_2(), context::es, ES_TIMEOUT, context_2::event_set_status, init_instance_handle_signals(), io_wait(), IS_SIG, context_2::link_sockets, context::mode, context::options, 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.
top | - Top-level context structure. |
Definition at line 4219 of file multi.c.
References ASSERT, 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, options::mode, MODE_SERVER, msg, multi_ifconfig_pool_persist(), multi_init(), multi_top_free(), multi_top_init(), multi_uninit(), context::options, multi_context::top, tunnel_server_loop(), and uninit_management_callback().
Referenced by openvpn_main().
|
static |
Main event loop for OpenVPN in point-to-multipoint server mode.
top | - Top-level context structure. |
Definition at line 4183 of file multi.c.
References context::c2, MULTI_CHECK_SIG, multi_get_timeout(), multi_io_action(), multi_io_process_io(), multi_io_wait(), multi_process_per_second_timers(), PERF_EVENT_LOOP, perf_pop(), perf_push(), status, TA_TIMEOUT, context_2::timeval, and multi_context::top.
Referenced by tunnel_server().