Go to the documentation of this file.
25 #ifndef OPENVPN_WIN32_H
26 #define OPENVPN_WIN32_H
38 #define SYS_PATH_ENV_VAR_NAME "SystemRoot"
39 #define NETSH_PATH_SUFFIX "\\system32\\netsh.exe"
40 #define WIN_ROUTE_PATH_SUFFIX "\\system32\\route.exe"
41 #define WIN_IPCONFIG_PATH_SUFFIX "\\system32\\ipconfig.exe"
42 #define WIN_NET_PATH_SUFFIX "\\system32\\net.exe"
43 #define WMIC_PATH_SUFFIX "\\system32\\wbem\\wmic.exe"
51 #ifndef IN6_ARE_ADDR_EQUAL
52 #define IN6_ARE_ADDR_EQUAL(a, b) \
53 (memcmp((const void *)(a), (const void *)(b), sizeof(struct in6_addr)) == 0)
64 SECURITY_ATTRIBUTES
sa;
65 SECURITY_DESCRIPTOR
sd;
68 #define HANDLE_DEFINED(h) ((h) != NULL && (h) != INVALID_HANDLE_VALUE)
88 #define NE32_PERSIST_EVENT (1<<0)
89 #define NE32_WRITE_EVENT (1<<1)
94 return event->read != NULL;
154 #define WSO_MODE_UNDEF 0
155 #define WSO_MODE_SERVICE 1
156 #define WSO_MODE_CONSOLE 2
169 #define WSO_NOFORCE 0
170 #define WSO_FORCE_SERVICE 1
171 #define WSO_FORCE_CONSOLE 2
175 const char *exit_event_name,
176 bool exit_event_initial_state);
203 #define IOSTATE_INITIAL 0
204 #define IOSTATE_QUEUED 1
205 #define IOSTATE_IMMEDIATE_RETURN 2
291 bool win_wfp_block(
const NET_IFINDEX index,
const HANDLE msg_channel, BOOL dns_only);
293 bool win_wfp_uninit(
const NET_IFINDEX index,
const HANDLE msg_channel);
static bool overlapped_io_active(struct overlapped_io *o)
char * get_win_sys_path(void)
void netcmd_semaphore_release(void)
void net_event_win32_reset(struct net_event_win32 *ne)
void netcmd_semaphore_init(void)
void net_event_win32_close(struct net_event_win32 *ne)
long reset_net_event_win32(struct rw_handle *event, socket_descriptor_t sd)
void win32_signal_clear(struct win32_signal *ws)
void window_title_save(struct window_title *wt)
void semaphore_release(struct semaphore *s)
void netcmd_semaphore_close(void)
void overlapped_io_close(struct overlapped_io *o)
Contains all state information for one tunnel.
void win32_signal_close(struct win32_signal *ws)
void fork_to_self(const char *cmdline)
void net_event_win32_stop(struct net_event_win32 *ne)
void close_net_event_win32(struct rw_handle *event, socket_descriptor_t sd, unsigned int flags)
void netcmd_semaphore_lock(void)
Packet geometry parameters.
#define IOSTATE_IMMEDIATE_RETURN
static bool net_event_win32_defined(const struct net_event_win32 *ne)
void set_win_sys_path_via_env(struct env_set *es)
bool win32_service_interrupt(struct win32_signal *ws)
Container for unidirectional cipher and HMAC key material.
void set_pause_exit_win32(void)
void semaphore_clear(struct semaphore *s)
char old_window_title[256]
bool get_openvpn_reg_value(const WCHAR *key, WCHAR *value, DWORD size)
Fetches a registry value for OpenVPN registry key.
static bool defined_net_event_win32(const struct rw_handle *event)
void win32_pause(struct win32_signal *ws)
static long net_event_win32_get_event_mask(const struct net_event_win32 *ne)
struct sockaddr_in6 addr6
void window_title_clear(struct window_title *wt)
bool win_wfp_block(const NET_IFINDEX index, const HANDLE msg_channel, BOOL dns_only)
int openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
Wrapper structure for dynamically allocated memory.
bool plugin_in_trusted_dir(const WCHAR *plugin_path)
Checks if a plugin is located in a trusted directory.
void win32_sleep(const int n)
bool win_wfp_uninit(const NET_IFINDEX index, const HANDLE msg_channel)
void net_event_win32_start(struct net_event_win32 *ne, long network_events, socket_descriptor_t sd)
void init_net_event_win32(struct rw_handle *event, long network_events, socket_descriptor_t sd, unsigned int flags)
Garbage collection arena used to keep track of dynamically allocated memory.
void win32_signal_open(struct win32_signal *ws, int force, const char *exit_event_name, bool exit_event_initial_state)
void window_title_restore(const struct window_title *wt)
void semaphore_open(struct semaphore *s, const char *name)
static void net_event_win32_clear_selected_events(struct net_event_win32 *ne, long selected_events)
SOCKET socket_descriptor_t
bool init_security_attributes_allow_all(struct security_attributes *obj)
void net_event_win32_reset_write(struct net_event_win32 *ne)
static struct rw_handle * net_event_win32_get_event(struct net_event_win32 *ne)
char * overlapped_io_state_ascii(const struct overlapped_io *o)
void window_title_generate(const char *title)
bool semaphore_lock(struct semaphore *s, int timeout_milliseconds)
void net_event_win32_init(struct net_event_win32 *ne)
bool send_msg_iservice(HANDLE pipe, const void *data, size_t size, ack_message_t *ack, const char *context)
struct semaphore netcmd_semaphore
int win32_version_info(void)
const char * win32_version_string(struct gc_arena *gc, bool add_name)
int win32_signal_get(struct win32_signal *ws)
void semaphore_close(struct semaphore *s)
void set_win_sys_path(const char *newpath, struct env_set *es)
bool console_mode_save_defined
void overlapped_io_init(struct overlapped_io *o, const struct frame *frame, BOOL event_state)