OpenVPN
Data Structures | Macros | Enumerations | Functions | Variables
service.h File Reference
#include <winsock2.h>
#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 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
 

Macro Definition Documentation

◆ APPNAME

#define APPNAME   TEXT(PACKAGE "serv")

Definition at line 41 of file service.h.

◆ M_ERR

#define M_ERR   (MSG_FLAGS_ERROR) /* error */

Definition at line 51 of file service.h.

◆ M_INFO

#define M_INFO   (0) /* informational */

Definition at line 49 of file service.h.

◆ M_SYSERR

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

Definition at line 50 of file service.h.

◆ MAX_NAME

#define MAX_NAME   256

Definition at line 66 of file service.h.

◆ MSG_FLAGS_ERROR

#define MSG_FLAGS_ERROR   (1<<0)

Definition at line 47 of file service.h.

◆ MSG_FLAGS_SYS_CODE

#define MSG_FLAGS_SYS_CODE   (1<<1)

Definition at line 48 of file service.h.

◆ SERVICE_DEPENDENCIES

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

Definition at line 42 of file service.h.

◆ UNICODE

#define UNICODE

Definition at line 29 of file service.h.

Enumeration Type Documentation

◆ openvpn_service_type

Enumerator
interactive 
_service_max 

Definition at line 53 of file service.h.

Function Documentation

◆ get_win_sys_path()

const wchar_t* get_win_sys_path ( void  )

◆ GetLastErrorText()

LPCTSTR GetLastErrorText ( )

Definition at line 184 of file common.c.

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

◆ GetOpenvpnSettings()

DWORD GetOpenvpnSettings ( settings_t s)

◆ MsgToEventLog()

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

◆ ReportStatusToSCMgr()

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().

◆ ServiceStartInteractive()

VOID WINAPI ServiceStartInteractive ( DWORD  argc,
LPTSTR *  argv 
)

◆ ServiceStartInteractiveOwn()

VOID WINAPI ServiceStartInteractiveOwn ( DWORD  argc,
LPTSTR *  argv 
)

Definition at line 2257 of file interactive.c.

References ServiceStartInteractive(), and status.

Referenced by _tmain().

◆ utf8to16()

wchar_t* utf8to16 ( const char *  utf8)

Variable Documentation

◆ interactive_service

openvpn_service_t interactive_service

Definition at line 61 of file interactive.c.

Referenced by _tmain(), and ServiceStartInteractive().

◆ service_instance

LPCTSTR service_instance