26 #elif defined(_MSC_VER) 40 #define P2P_CHECK_SIG() EVENT_LOOP_CHECK_SIGNAL(c, process_signal_p2p, c); 106 #undef PROCESS_SIGNAL_P2P 136 fprintf(stderr,
"Sorry, I was built with --enable-pedantic and I am incapable of doing any real work!\n");
141 SetConsoleOutputCP(CP_UTF8);
178 #ifdef ENABLE_MANAGEMENT 246 #ifdef ENABLE_MANAGEMENT 258 #ifdef ENABLE_MANAGEMENT 318 #ifdef ENABLE_MANAGEMENT 338 if ((argv = calloc(argc+1,
sizeof(
char *))) == NULL)
343 for (i = 0; i < argc; i++)
345 int n = WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, NULL, 0, NULL, NULL);
347 WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, argv[i], n, NULL, NULL);
352 for (i = 0; i < argc; i++)
struct signal_info siginfo_static
static int openvpn_main(int argc, char *argv[])
OpenVPN's main init-run-cleanup loop.
void print_signal(const struct signal_info *si, const char *title, int msglevel)
struct env_set * env_set_create(struct gc_arena *gc)
unsigned int management_flags
struct options options
Options loaded from command line or configuration file.
void init_verb_mute(struct context *c, unsigned int flags)
Contains all state information for one tunnel.
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 env_set * es
Set of environment variables.
void remap_signal(struct context *c)
void openvpn_exit(const int status)
void close_instance(struct context *c)
static void perf_pop(void)
static void perf_push(int type)
struct signal_info * sig
Internal error signaling object.
void open_plugins(struct context *c, const bool import_options, int init_point)
void pre_select(struct context *c)
int wmain(int argc, wchar_t *wargv[])
void init_query_passwords(const struct context *c)
Query for private key and auth-user-pass username/passwords.
void close_management(void)
bool print_openssl_info(const struct options *options)
void init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
void pre_init_signal_catch(void)
void init_options_dev(struct options *options)
void write_pid_file(const char *filename, const char *chroot_dir)
openvpn_net_ctx_t net_ctx
Networking API opaque context.
bool open_management(struct context *c)
void context_gc_free(struct context *c)
bool do_genkey(const struct options *options)
void set_win_sys_path_via_env(struct env_set *es)
static void gc_init(struct gc_arena *a)
static int net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
static bool process_signal_p2p(struct context *c)
bool possibly_become_daemon(const struct options *options)
#define OPENVPN_PLUGIN_INIT_PRE_CONFIG_PARSE
static void io_wait(struct context *c, const unsigned int flags)
void init_plugins(struct context *c)
void process_io(struct context *c)
Interface functions to the internal and external multiplexers.
bool do_persist_tuntap(const struct options *options, openvpn_net_ctx_t *ctx)
struct context_2 c2
Level 2 context.
void env_set_destroy(struct env_set *es)
void show_library_versions(const unsigned int flags)
void context_clear_all_except_first_time(struct context *c)
void show_windows_version(const unsigned int flags)
void context_init_1(struct context *c)
bool process_signal(struct context *c)
void signal_restart_status(const struct signal_info *si)
void tunnel_server(struct context *top)
Main event loop for OpenVPN in server mode.
#define MODE_POINT_TO_POINT
#define MF_QUERY_PASSWORDS
void pre_setup(const struct options *options)
volatile int signal_received
void init_options(struct options *o, const bool init_gc)
void show_settings(const struct options *o)
void uninit_options(struct options *o)
int mode
Role of this context within the OpenVPN process.
bool do_test_crypto(const struct options *o)
static void net_ctx_free(openvpn_net_ctx_t *ctx)
void context_clear_2(struct context *c)
bool first_time
True on the first iteration of OpenVPN's main loop.
void init_management(void)
static unsigned int p2p_iow_flags(const struct context *c)
struct gc_arena gc
Garbage collection arena for allocations done in the scope of this context structure.
void setenv_settings(struct env_set *es, const struct options *o)
static void gc_reset(struct gc_arena *a)
bool did_we_daemonize
Whether demonization has already taken place.
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)
unsigned int event_set_status
#define OPENVPN_EXIT_STATUS_GOOD
const char title_string[]
#define CC_HARD_USR1_TO_HUP
void uninit_management_callback(void)
void options_postprocess(struct options *options)