2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
8 * Copyright (C) 2002-2005 OpenVPN Solutions LLC <info@openvpn.net>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program (see the file COPYING included with this
21 * distribution); if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * Baseline maximum number of events
34 #define BASE_N_EVENTS 4
36 void context_clear (struct context
*c
);
37 void context_clear_1 (struct context
*c
);
38 void context_clear_2 (struct context
*c
);
39 void context_init_1 (struct context
*c
);
40 void context_clear_all_except_first_time (struct context
*c
);
42 bool init_static (void);
44 void uninit_static (void);
46 #define IVM_LEVEL_1 (1<<0)
47 #define IVM_LEVEL_2 (1<<1)
48 void init_verb_mute (struct context
*c
, unsigned int flags
);
50 void init_options_dev (struct options
*options
);
52 bool print_openssl_info (const struct options
*options
);
54 bool do_genkey (const struct options
*options
);
56 bool do_persist_tuntap (const struct options
*options
);
58 void pre_setup (const struct options
*options
);
60 void init_instance_handle_signals (struct context
*c
, const struct env_set
*env
, const unsigned int flags
);
62 void init_instance (struct context
*c
, const struct env_set
*env
, const unsigned int flags
);
64 void do_route (const struct options
*options
,
65 struct route_list
*route_list
,
66 const struct tuntap
*tt
,
67 const struct plugin_list
*plugins
,
70 void close_instance (struct context
*c
);
72 bool do_test_crypto (const struct options
*o
);
74 void context_gc_free (struct context
*c
);
76 void do_up (struct context
*c
,
78 unsigned int option_types_found
);
80 unsigned int pull_permission_mask (void);
82 const char *format_common_name (struct context
*c
, struct gc_arena
*gc
);
84 void reset_coarse_timers (struct context
*c
);
86 void do_deferred_options (struct context
*c
, const unsigned int found
);
88 void inherit_context_child (struct context
*dest
,
89 const struct context
*src
);
91 void inherit_context_top (struct context
*dest
,
92 const struct context
*src
);
94 #define CC_GC_FREE (1<<0)
95 #define CC_USR1_TO_HUP (1<<1)
96 #define CC_HARD_USR1_TO_HUP (1<<2)
97 #define CC_NO_CLOSE (1<<3)
99 void close_context (struct context
*c
, int sig
, unsigned int flags
);
101 struct context_buffers
*init_context_buffers (const struct frame
*frame
);
103 void free_context_buffers (struct context_buffers
*b
);
105 #define ISC_ERRORS (1<<0)
106 #define ISC_SERVER (1<<1)
107 void initialization_sequence_completed (struct context
*c
, const unsigned int flags
);
109 #ifdef ENABLE_MANAGEMENT
111 void init_management (struct context
*c
);
112 bool open_management (struct context
*c
);
113 void close_management (void);
115 void management_show_net_callback (void *arg
, const int msglevel
);
119 void init_management_callback_p2p (struct context
*c
);
120 void uninit_management_callback (void);