Go to the documentation of this file.
38 #define P2P_CHECK_SIG() EVENT_LOOP_CHECK_SIGNAL(c, process_signal_p2p, c);
106 #undef PROCESS_SIGNAL_P2P
165 fprintf(stderr,
"Sorry, I was built with --enable-pedantic and I am incapable of doing any real work!\n");
170 SetConsoleOutputCP(CP_UTF8);
206 #ifdef ENABLE_MANAGEMENT
275 #ifdef ENABLE_MANAGEMENT
287 #ifdef ENABLE_MANAGEMENT
347 #ifdef ENABLE_MANAGEMENT
367 if ((
argv = calloc(argc+1,
sizeof(
char *))) == NULL)
372 for (i = 0; i < argc; i++)
374 int n = WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, NULL, 0, NULL, NULL);
376 WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1,
argv[i], n, NULL, NULL);
381 for (i = 0; i < argc; i++)
void signal_restart_status(const struct signal_info *si)
static void uninit_early(struct context *c)
bool do_test_crypto(const struct options *o)
unsigned int event_set_status
#define OPENVPN_PLUGIN_INIT_PRE_CONFIG_PARSE
static int openvpn_main(int argc, char *argv[])
OpenVPN's main init-run-cleanup loop.
void init_early(struct context *c)
void print_signal(const struct signal_info *si, const char *title, int msglevel)
bool open_management(struct context *c)
void init_query_passwords(const struct context *c)
Query for private key and auth-user-pass username/passwords.
void env_set_destroy(struct env_set *es)
Contains all state information for one tunnel.
#define OPENVPN_EXIT_STATUS_GOOD
bool print_openssl_info(const struct options *options)
void pre_select(struct context *c)
provider_t * providers[MAX_PARMS]
void context_gc_free(struct context *c)
static void gc_reset(struct gc_arena *a)
int mode
Role of this context within the OpenVPN process.
const char * names[MAX_PARMS]
static int net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
int wmain(int argc, wchar_t *wargv[])
struct context_2 c2
Level 2 context.
static bool process_signal_p2p(struct context *c)
static void tunnel_point_to_point(struct context *c)
Main event loop for OpenVPN in client mode, where only one VPN tunnel is active.
struct gc_arena gc
Garbage collection arena for allocations done in the scope of this context structure.
void open_plugins(struct context *c, const bool import_options, int init_point)
static void io_wait(struct context *c, const unsigned int flags)
void tunnel_server(struct context *top)
Main event loop for OpenVPN in server mode.
#define MF_QUERY_PASSWORDS
bool first_time
True on the first iteration of OpenVPN's main loop.
void close_instance(struct context *c)
static void perf_pop(void)
void init_verb_mute(struct context *c, unsigned int flags)
struct options options
Options loaded from command line or configuration file.
struct provider_list providers
void set_win_sys_path_via_env(struct env_set *es)
void write_pid_file(const char *filename, const char *chroot_dir)
void options_postprocess(struct options *options, struct env_set *es)
bool did_we_daemonize
Whether demonization has already taken place.
void crypto_unload_provider(const char *provname, provider_t *provider)
Unloads the given (OpenSSL) provider.
void pre_setup(const struct options *options)
void openvpn_exit(const int status)
void show_windows_version(const unsigned int flags)
void init_management(void)
void pre_init_signal_catch(void)
bool process_signal(struct context *c)
struct env_set * env_set_create(struct gc_arena *gc)
int signal_reset(struct signal_info *si, int signum)
Clear the signal if its current value equals signum.
static void net_ctx_free(openvpn_net_ctx_t *ctx)
unsigned int management_flags
void process_io(struct context *c)
struct signal_info * sig
Internal error signaling object.
void context_clear_2(struct context *c)
#define MODE_POINT_TO_POINT
bool do_genkey(const struct options *options)
bool possibly_become_daemon(const struct options *options)
void show_library_versions(const unsigned int flags)
void uninit_management_callback(void)
void uninit_options(struct options *o)
struct env_set * es
Set of environment variables.
void show_dco_version(const unsigned int flags)
#define CC_HARD_USR1_TO_HUP
void init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
void init_options(struct options *o, const bool init_gc)
void init_options_dev(struct options *options)
void show_settings(const struct options *o)
provider_t * crypto_load_provider(const char *provider)
Load the given (OpenSSL) providers.
bool do_persist_tuntap(struct options *options, openvpn_net_ctx_t *ctx)
void setenv_settings(struct env_set *es, const struct options *o)
void init_plugins(struct context *c)
static unsigned int p2p_iow_flags(const struct context *c)
static void gc_init(struct gc_arena *a)
void parse_argv(struct options *options, const int argc, char *argv[], const int msglevel, const unsigned int permission_mask, unsigned int *option_types_found, struct env_set *es)
void remap_signal(struct context *c)
void context_clear_all_except_first_time(struct context *c)
const char title_string[]
void context_init_1(struct context *c)
struct signal_info siginfo_static
void persist_client_stats(struct context *c)
static void perf_push(int type)
void close_management(void)
openvpn_net_ctx_t net_ctx
Networking API opaque context.