OpenVPN
|
#include <winsock2.h>
#include <windows.h>
#include <stdlib.h>
#include <tchar.h>
Go to the source code of this file.
Data Structures | |
struct | openvpn_service_t |
struct | settings_t |
Macros | |
#define | UNICODE |
#define | APPNAME TEXT(PACKAGE "serv") |
#define | SERVICE_DEPENDENCIES TAP_WIN_COMPONENT_ID "\0Dhcp\0\0" |
#define | MSG_FLAGS_ERROR (1<<0) |
#define | MSG_FLAGS_SYS_CODE (1<<1) |
#define | M_INFO (0) /* informational */ |
#define | M_SYSERR (MSG_FLAGS_ERROR|MSG_FLAGS_SYS_CODE) /* error + system code */ |
#define | M_ERR (MSG_FLAGS_ERROR) /* error */ |
#define | MAX_NAME 256 |
Enumerations | |
enum | openvpn_service_type { interactive, _service_max } |
Functions | |
VOID WINAPI | ServiceStartInteractiveOwn (DWORD argc, LPTSTR *argv) |
VOID WINAPI | ServiceStartInteractive (DWORD argc, LPTSTR *argv) |
DWORD | GetOpenvpnSettings (settings_t *s) |
BOOL | ReportStatusToSCMgr (SERVICE_STATUS_HANDLE service, SERVICE_STATUS *status) |
LPCTSTR | GetLastErrorText () |
DWORD | MsgToEventLog (DWORD flags, LPCTSTR lpszMsg,...) |
wchar_t * | utf8to16 (const char *utf8) |
const wchar_t * | get_win_sys_path (void) |
Variables | |
openvpn_service_t | interactive_service |
LPCTSTR | service_instance |
#define M_ERR (MSG_FLAGS_ERROR) /* error */ |
#define M_SYSERR (MSG_FLAGS_ERROR|MSG_FLAGS_SYS_CODE) /* error + system code */ |
#define SERVICE_DEPENDENCIES TAP_WIN_COMPONENT_ID "\0Dhcp\0\0" |
enum openvpn_service_type |
const wchar_t* get_win_sys_path | ( | void | ) |
Definition at line 1113 of file win32.c.
References ASSERT, and win_sys_path.
Referenced by add_route(), delete_route(), do_dns_domain_wmic(), do_ifconfig_ipv6(), env_block(), HandleEnableDHCPMessage(), ipconfig_register_dns(), netsh_delete_address_dns(), netsh_dns_cmd(), netsh_enable_dhcp(), netsh_ifconfig(), netsh_ifconfig_options(), netsh_set_dns6_servers(), netsh_wins_cmd(), RegisterDNS(), and wmic_nicconfig_cmd().
LPCTSTR GetLastErrorText | ( | ) |
Definition at line 184 of file common.c.
Referenced by CmdInstallServices(), CmdRemoveServices(), CmdStartService(), and MsgToEventLog().
DWORD GetOpenvpnSettings | ( | settings_t * | s | ) |
Definition at line 56 of file common.c.
References settings_t::append, settings_t::config_dir, settings_t::exe_path, settings_t::ext_string, GetRegString(), settings_t::log_dir, M_ERR, M_SYSERR, MsgToEventLog(), OVPN_ADMIN_GROUP, settings_t::ovpn_admin_group, PACKAGE_NAME, settings_t::priority, service_instance, and status.
Referenced by ServiceStartInteractive().
DWORD MsgToEventLog | ( | DWORD | flags, |
LPCTSTR | lpszMsg, | ||
... | |||
) |
Definition at line 215 of file common.c.
References APPNAME, GetLastErrorText(), msg, MSG_FLAGS_ERROR, MSG_FLAGS_SYS_CODE, and service_instance.
Referenced by _tmain(), BlockDNSErrHandler(), ConvertInterfaceNameToIndex(), CreateClientPipeInstance(), DeleteWfpBlock(), DuplicateAndMapRing(), ExecCommand(), GetOpenvpnSettings(), GetRegString(), GetStartupData(), GetTokenGroups(), HandleMessage(), HandleRegisterRingBuffers(), IsAuthorizedUser(), IsUserInGroup(), OvpnDuplicateHandle(), RegisterDNS(), ReportStatusToSCMgr(), ReturnError(), RunOpenvpn(), and ServiceStartInteractive().
BOOL ReportStatusToSCMgr | ( | SERVICE_STATUS_HANDLE | service, |
SERVICE_STATUS * | status | ||
) |
Definition at line 22 of file service.c.
References MSG_FLAGS_ERROR, MsgToEventLog(), service, and status.
Referenced by ServiceCtrlInteractive(), and ServiceStartInteractive().
VOID WINAPI ServiceStartInteractive | ( | DWORD | argc, |
LPTSTR * | argv | ||
) |
Definition at line 2265 of file interactive.c.
References AddListItem(), CloseHandleEx(), CmpHandle(), CreateClientPipeInstance(), exit_event, FreeWaitHandles(), GetOpenvpnSettings(), InitOverlapped(), interactive_service, M_SYSERR, MsgToEventLog(), openvpn_service_t::name, rdns_semaphore, RemoveListItem(), ReportStatusToSCMgr(), ResetOverlapped(), ReturnError(), RunOpenvpn(), service, ServiceCtrlInteractive(), settings, status, and UpdateWaitHandles().
Referenced by _tmain(), and ServiceStartInteractiveOwn().
VOID WINAPI ServiceStartInteractiveOwn | ( | DWORD | argc, |
LPTSTR * | argv | ||
) |
Definition at line 2257 of file interactive.c.
References ServiceStartInteractive(), and status.
Referenced by _tmain().
wchar_t* utf8to16 | ( | const char * | utf8 | ) |
Definition at line 252 of file common.c.
Referenced by HandleDNSConfigMessage(), HandleWINSConfigMessage(), InterfaceLuid(), and SetDNSDomain().
openvpn_service_t interactive_service |
Definition at line 61 of file interactive.c.
Referenced by _tmain(), and ServiceStartInteractive().
LPCTSTR service_instance |
Definition at line 27 of file common.c.
Referenced by _tmain(), CreateClientPipeInstance(), GetOpenvpnSettings(), GetRegString(), MsgToEventLog(), and RunOpenvpn().