OpenVPN
Data Structures | Macros | Enumerations | Functions | Variables
service.h File Reference
#include <windows.h>
#include <stdlib.h>
#include <tchar.h>
Include dependency graph for service.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  openvpn_service_t
 
struct  settings_t
 

Macros

#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 { automatic, interactive, _service_max }
 

Functions

VOID WINAPI ServiceStartAutomatic (DWORD argc, LPTSTR *argv)
 
VOID WINAPI ServiceStartInteractive (DWORD argc, LPTSTR *argv)
 
int openvpn_vsntprintf (LPTSTR str, size_t size, LPCTSTR format, va_list arglist)
 
int openvpn_sntprintf (LPTSTR str, size_t size, LPCTSTR format,...)
 
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)
 

Variables

openvpn_service_t automatic_service
 
openvpn_service_t interactive_service
 

Macro Definition Documentation

◆ APPNAME

#define APPNAME   TEXT(PACKAGE "serv")

Definition at line 37 of file service.h.

Referenced by _tmain(), and MsgToEventLog().

◆ M_ERR

#define M_ERR   (MSG_FLAGS_ERROR) /* error */

Definition at line 47 of file service.h.

◆ M_INFO

#define M_INFO   (0) /* informational */

Definition at line 45 of file service.h.

◆ M_SYSERR

#define M_SYSERR   (MSG_FLAGS_ERROR|MSG_FLAGS_SYS_CODE) /* error + system code */

◆ MAX_NAME

#define MAX_NAME   256

Definition at line 63 of file service.h.

Referenced by GetBuiltinAdminGroupName(), IsAuthorizedUser(), and LookupSID().

◆ MSG_FLAGS_ERROR

#define MSG_FLAGS_ERROR   (1<<0)

Definition at line 43 of file service.h.

Referenced by _tmain(), HandleMessage(), MsgToEventLog(), ReportStatusToSCMgr(), and ReturnError().

◆ MSG_FLAGS_SYS_CODE

#define MSG_FLAGS_SYS_CODE   (1<<1)

Definition at line 44 of file service.h.

Referenced by MsgToEventLog().

◆ SERVICE_DEPENDENCIES

#define SERVICE_DEPENDENCIES   TAP_WIN_COMPONENT_ID "\0Dhcp\0\0"

Definition at line 38 of file service.h.

Enumeration Type Documentation

◆ openvpn_service_type

Enumerator
automatic 
interactive 
_service_max 

Definition at line 49 of file service.h.

Function Documentation

◆ GetLastErrorText()

LPCTSTR GetLastErrorText ( )

Definition at line 188 of file common.c.

References openvpn_sntprintf().

Referenced by CmdInstallServices(), CmdRemoveServices(), CmdStartService(), and MsgToEventLog().

◆ GetOpenvpnSettings()

DWORD GetOpenvpnSettings ( settings_t s)

◆ MsgToEventLog()

DWORD MsgToEventLog ( DWORD  flags,
LPCTSTR  lpszMsg,
  ... 
)

◆ openvpn_sntprintf()

int openvpn_sntprintf ( LPTSTR  str,
size_t  size,
LPCTSTR  format,
  ... 
)

◆ openvpn_vsntprintf()

int openvpn_vsntprintf ( LPTSTR  str,
size_t  size,
LPCTSTR  format,
va_list  arglist 
)

Definition at line 32 of file common.c.

Referenced by MsgToEventLog(), and openvpn_sntprintf().

◆ ReportStatusToSCMgr()

BOOL ReportStatusToSCMgr ( SERVICE_STATUS_HANDLE  service,
SERVICE_STATUS *  status 
)

◆ ServiceStartAutomatic()

VOID WINAPI ServiceStartAutomatic ( DWORD  argc,
LPTSTR *  argv 
)

◆ ServiceStartInteractive()

VOID WINAPI ServiceStartInteractive ( DWORD  argc,
LPTSTR *  argv 
)

◆ utf8to16()

wchar_t* utf8to16 ( const char *  utf8)

Definition at line 254 of file common.c.

Referenced by HandleDNSConfigMessage(), and InterfaceLuid().

Variable Documentation

◆ automatic_service

openvpn_service_t automatic_service

Definition at line 49 of file automatic.c.

Referenced by _tmain().

◆ interactive_service

openvpn_service_t interactive_service

Definition at line 63 of file interactive.c.

Referenced by _tmain().