OpenVPN
Macros | Functions
init.h File Reference
#include "openvpn.h"
Include dependency graph for init.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BASE_N_EVENTS   5
 
#define IVM_LEVEL_1   (1<<0)
 
#define IVM_LEVEL_2   (1<<1)
 
#define CC_GC_FREE   (1<<0)
 
#define CC_USR1_TO_HUP   (1<<1)
 
#define CC_HARD_USR1_TO_HUP   (1<<2)
 
#define CC_NO_CLOSE   (1<<3)
 
#define ISC_ERRORS   (1<<0)
 
#define ISC_SERVER   (1<<1)
 
#define ISC_ROUTE_ERRORS   (1<<2)
 

Functions

void context_clear (struct context *c)
 
void context_clear_1 (struct context *c)
 
void context_clear_2 (struct context *c)
 
void context_init_1 (struct context *c)
 
void context_clear_all_except_first_time (struct context *c)
 
bool init_static (void)
 
void uninit_static (void)
 
void init_verb_mute (struct context *c, unsigned int flags)
 
void init_options_dev (struct options *options)
 
bool print_openssl_info (const struct options *options)
 
bool do_genkey (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 pre_setup (const struct options *options)
 
void init_instance_handle_signals (struct context *c, const struct env_set *env, const unsigned int flags)
 
void init_instance (struct context *c, const struct env_set *env, const unsigned int flags)
 
void init_query_passwords (const struct context *c)
 Query for private key and auth-user-pass username/passwords. More...
 
bool do_route (const struct options *options, struct route_list *route_list, struct route_ipv6_list *route_ipv6_list, const struct tuntap *tt, const struct plugin_list *plugins, struct env_set *es, openvpn_net_ctx_t *ctx)
 
void close_instance (struct context *c)
 
bool do_test_crypto (const struct options *o)
 
void context_gc_free (struct context *c)
 
bool do_up (struct context *c, bool pulled_options, unsigned int option_types_found)
 
unsigned int pull_permission_mask (const struct context *c)
 
const char * format_common_name (struct context *c, struct gc_arena *gc)
 
void reset_coarse_timers (struct context *c)
 
bool do_deferred_options (struct context *c, const unsigned int found)
 
void inherit_context_child (struct context *dest, const struct context *src)
 
void inherit_context_top (struct context *dest, const struct context *src)
 
void close_context (struct context *c, int sig, unsigned int flags)
 
struct context_buffersinit_context_buffers (const struct frame *frame)
 
void free_context_buffers (struct context_buffers *b)
 
void initialization_sequence_completed (struct context *c, const unsigned int flags)
 
void init_management (void)
 
bool open_management (struct context *c)
 
void close_management (void)
 
void management_show_net_callback (void *arg, const int msglevel)
 
void init_management_callback_p2p (struct context *c)
 
void uninit_management_callback (void)
 
void init_plugins (struct context *c)
 
void open_plugins (struct context *c, const bool import_options, int init_point)
 
void tun_abort (void)
 
void write_pid_file (const char *filename, const char *chroot_dir)
 
void remove_pid_file (void)
 
void persist_client_stats (struct context *c)
 

Macro Definition Documentation

◆ BASE_N_EVENTS

#define BASE_N_EVENTS   5

Definition at line 33 of file init.h.

◆ CC_GC_FREE

#define CC_GC_FREE   (1<<0)

Definition at line 103 of file init.h.

◆ CC_HARD_USR1_TO_HUP

#define CC_HARD_USR1_TO_HUP   (1<<2)

Definition at line 105 of file init.h.

◆ CC_NO_CLOSE

#define CC_NO_CLOSE   (1<<3)

Definition at line 106 of file init.h.

◆ CC_USR1_TO_HUP

#define CC_USR1_TO_HUP   (1<<1)

Definition at line 104 of file init.h.

◆ ISC_ERRORS

#define ISC_ERRORS   (1<<0)

Definition at line 114 of file init.h.

◆ ISC_ROUTE_ERRORS

#define ISC_ROUTE_ERRORS   (1<<2)

Definition at line 116 of file init.h.

◆ ISC_SERVER

#define ISC_SERVER   (1<<1)

Definition at line 115 of file init.h.

◆ IVM_LEVEL_1

#define IVM_LEVEL_1   (1<<0)

Definition at line 49 of file init.h.

◆ IVM_LEVEL_2

#define IVM_LEVEL_2   (1<<1)

Definition at line 50 of file init.h.

Function Documentation

◆ close_context()

void close_context ( struct context c,
int  sig,
unsigned int  flags 
)

◆ close_instance()

void close_instance ( struct context c)

◆ close_management()

void close_management ( void  )

Definition at line 4345 of file init.c.

References management_close().

Referenced by open_management(), and openvpn_main().

◆ context_clear()

void context_clear ( struct context c)

Definition at line 76 of file init.c.

References CLEAR.

Referenced by context_clear_all_except_first_time(), and do_test_crypto().

◆ context_clear_1()

void context_clear_1 ( struct context c)

Definition at line 82 of file init.c.

References context::c1, and CLEAR.

Referenced by context_init_1().

◆ context_clear_2()

void context_clear_2 ( struct context c)

Definition at line 88 of file init.c.

References context::c2, and CLEAR.

Referenced by tunnel_point_to_point(), tunnel_server_tcp(), and tunnel_server_udp().

◆ context_clear_all_except_first_time()

void context_clear_all_except_first_time ( struct context c)

Definition at line 94 of file init.c.

References context_clear(), context::first_time, and context::persist.

Referenced by openvpn_main().

◆ context_gc_free()

void context_gc_free ( struct context c)

◆ context_init_1()

void context_init_1 ( struct context c)

◆ do_deferred_options()

bool do_deferred_options ( struct context c,
const unsigned int  found 
)

◆ do_genkey()

bool do_genkey ( const struct options options)

◆ do_persist_tuntap()

bool do_persist_tuntap ( struct options options,
openvpn_net_ctx_t ctx 
)

◆ do_route()

bool do_route ( const struct options options,
struct route_list route_list,
struct route_ipv6_list route_ipv6_list,
const struct tuntap tt,
const struct plugin_list plugins,
struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ do_test_crypto()

bool do_test_crypto ( const struct options o)

◆ do_up()

bool do_up ( struct context c,
bool  pulled_options,
unsigned int  option_types_found 
)

◆ format_common_name()

const char* format_common_name ( struct context c,
struct gc_arena gc 
)

◆ free_context_buffers()

void free_context_buffers ( struct context_buffers b)

◆ inherit_context_child()

void inherit_context_child ( struct context dest,
const struct context src 
)

◆ inherit_context_top()

void inherit_context_top ( struct context dest,
const struct context src 
)

◆ init_context_buffers()

struct context_buffers* init_context_buffers ( const struct frame frame)

◆ init_instance()

void init_instance ( struct context c,
const struct env_set env,
const unsigned int  flags 
)

Definition at line 4406 of file init.c.

References AR_INTERACT, auth_retry_get(), context::c1, context::c2, options::ce, CF_INIT_TLS_AUTH_STANDALONE, CF_INIT_TLS_MULTI, CF_LOAD_PERSISTED_PACKET_ID, close_context(), CM_CHILD_TCP, CM_CHILD_UDP, CM_P2P, CM_TOP, options::comp, context_2::did_open_tun, do_compute_occ_strings(), do_event_set_init(), do_inherit_env(), do_init_buffers(), do_init_crypto(), do_init_first_time(), do_init_fragment(), do_init_frame(), do_init_frame_tls(), do_init_server_poll_timeout(), do_init_timers(), do_init_traffic_shaper(), do_link_socket_new(), do_open_ifconfig_pool_persist(), do_open_status_output(), do_open_tun(), do_option_warnings(), do_preresolve(), do_print_data_channel_mtu_parms(), do_setup_fast_io(), do_signal_on_tls_errors(), do_startup_pause(), do_uid_gid_chroot(), context::first_time, connection_entry::fragment, context_2::fragment, fragment_init(), context_2::frame, frame_calculate_dynamic(), context_2::gc, gc_init(), get_link_socket_info(), init_management_callback_p2p(), init_proxy(), init_query_passwords(), init_verb_mute(), IS_SIG, IVM_LEVEL_2, key_schedule::key_type, context_1::ks, link_socket_init_phase1(), link_socket_init_phase2(), LS_MODE_DEFAULT, LS_MODE_TCP_ACCEPT_FROM, LS_MODE_TCP_LISTEN, options::mlock, context::mode, next_connection_entry(), context_2::occ_op, occ_reset_op(), open_plugins(), OPENVPN_PLUGIN_INIT_POST_DAEMON, OPENVPN_PLUGIN_INIT_POST_UID_CHANGE, OPENVPN_PLUGIN_INIT_PRE_DAEMON, context::options, P2P_ERROR_DELAY_MS, platform_mlockall(), pre_connect_restore(), connection_entry::proto, PROTO_TCP_SERVER, PULL_DEFINED, options::resolve_in_advance, set_check_status_error_delay(), SHAPER_DEFINED, context::sig, signal_info::signal_text, and options::up_delay.

Referenced by inherit_context_child(), and init_instance_handle_signals().

◆ init_instance_handle_signals()

void init_instance_handle_signals ( struct context c,
const struct env_set env,
const unsigned int  flags 
)

◆ init_management()

void init_management ( void  )

Definition at line 4286 of file init.c.

References management_init().

Referenced by openvpn_main().

◆ init_management_callback_p2p()

void init_management_callback_p2p ( struct context c)

◆ init_options_dev()

void init_options_dev ( struct options options)

Definition at line 963 of file init.c.

References basename(), options::dev, options::dev_node, and string_alloc().

Referenced by openvpn_main().

◆ init_plugins()

void init_plugins ( struct context c)

◆ init_query_passwords()

void init_query_passwords ( const struct context c)

◆ init_static()

bool init_static ( void  )

◆ init_verb_mute()

void init_verb_mute ( struct context c,
unsigned int  flags 
)

◆ initialization_sequence_completed()

void initialization_sequence_completed ( struct context c,
const unsigned int  flags 
)

◆ management_show_net_callback()

void management_show_net_callback ( void *  arg,
const int  msglevel 
)

Definition at line 4207 of file init.c.

References msg, show_adapters(), and show_routes().

Referenced by init_management_callback_multi(), and init_management_callback_p2p().

◆ open_management()

bool open_management ( struct context c)

◆ open_plugins()

void open_plugins ( struct context c,
const bool  import_options,
int  init_point 
)

◆ persist_client_stats()

void persist_client_stats ( struct context c)

Definition at line 4369 of file init.c.

References man_persist_client_stats().

Referenced by tunnel_point_to_point().

◆ possibly_become_daemon()

bool possibly_become_daemon ( const struct options options)

Definition at line 1158 of file init.c.

References daemon(), options::daemon, options::log, M_ERR, msg, restore_signal_state(), and set_std_files_to_null().

Referenced by openvpn_main().

◆ pre_setup()

void pre_setup ( const struct options options)

◆ print_openssl_info()

bool print_openssl_info ( const struct options options)

◆ pull_permission_mask()

unsigned int pull_permission_mask ( const struct context c)

◆ remove_pid_file()

void remove_pid_file ( void  )

Definition at line 4976 of file init.c.

References platform_unlink(), and saved_pid_file_name.

Referenced by openvpn_exit().

◆ reset_coarse_timers()

void reset_coarse_timers ( struct context c)

◆ tun_abort()

void tun_abort ( void  )

Definition at line 2154 of file init.c.

References do_close_tun(), and static_context.

Referenced by openvpn_exit().

◆ uninit_management_callback()

void uninit_management_callback ( void  )

◆ uninit_static()

void uninit_static ( void  )

Definition at line 922 of file init.c.

References free_ssl_lib().

Referenced by openvpn_main().

◆ write_pid_file()

void write_pid_file ( const char *  filename,
const char *  chroot_dir 
)

Definition at line 4946 of file init.c.

References options::chroot_dir, M_ERR, msg, platform_fopen(), platform_getpid(), and saved_pid_file_name.

Referenced by openvpn_main().