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