OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::Win::Service Class Referenceabstract

#include <winsvc.hpp>

Inheritance diagram for openvpn::Win::Service:
[legend]
Collaboration diagram for openvpn::Win::Service:
[legend]

Classes

struct  Config
 
class  ScopedSCHandle
 

Public Member Functions

 OPENVPN_EXCEPTION (winsvc_error)
 
 Service (const Config &config_arg)
 
virtual ~Service ()=default
 
bool is_service () const
 
void install ()
 
void remove ()
 
void start ()
 
void report_service_running ()
 
virtual void service_work (DWORD argc, LPWSTR *argv)=0
 
virtual void service_stop ()=0
 

Private Member Functions

void svc_main (DWORD argc, LPWSTR *argv)
 
void svc_ctrl_handler (DWORD dwCtrl)
 
void report_service_status (DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint)
 

Static Private Member Functions

static VOID WINAPI svc_main_static (DWORD argc, LPWSTR *argv)
 
static VOID WINAPI svc_ctrl_handler_static (DWORD dwCtrl)
 

Private Attributes

const Config config
 
SERVICE_STATUS status
 
SERVICE_STATUS_HANDLE status_handle
 
DWORD checkpoint
 
std::mutex mutex
 

Static Private Attributes

static Serviceservice = nullptr
 

Detailed Description

Definition at line 30 of file winsvc.hpp.

Constructor & Destructor Documentation

◆ Service()

openvpn::Win::Service::Service ( const Config config_arg)
inline

Definition at line 44 of file winsvc.hpp.

◆ ~Service()

virtual openvpn::Win::Service::~Service ( )
virtualdefault

Member Function Documentation

◆ install()

void openvpn::Win::Service::install ( )
inline

Definition at line 59 of file winsvc.hpp.

Here is the caller graph for this function:

◆ is_service()

bool openvpn::Win::Service::is_service ( ) const
inline

Definition at line 54 of file winsvc.hpp.

Here is the caller graph for this function:

◆ OPENVPN_EXCEPTION()

openvpn::Win::Service::OPENVPN_EXCEPTION ( winsvc_error  )

◆ remove()

void openvpn::Win::Service::remove ( )
inline

Definition at line 127 of file winsvc.hpp.

Here is the caller graph for this function:

◆ report_service_running()

void openvpn::Win::Service::report_service_running ( )
inline

Definition at line 182 of file winsvc.hpp.

Here is the caller graph for this function:

◆ report_service_status()

void openvpn::Win::Service::report_service_status ( DWORD  dwCurrentState,
DWORD  dwWin32ExitCode,
DWORD  dwWaitHint 
)
inlineprivate

Definition at line 369 of file winsvc.hpp.

Here is the caller graph for this function:

◆ service_stop()

virtual void openvpn::Win::Service::service_stop ( )
pure virtual

Implemented in MyService.

Here is the caller graph for this function:

◆ service_work()

virtual void openvpn::Win::Service::service_work ( DWORD  argc,
LPWSTR *  argv 
)
pure virtual

Implemented in MyService.

Here is the caller graph for this function:

◆ start()

void openvpn::Win::Service::start ( )
inline

Definition at line 162 of file winsvc.hpp.

Here is the caller graph for this function:

◆ svc_ctrl_handler()

void openvpn::Win::Service::svc_ctrl_handler ( DWORD  dwCtrl)
inlineprivate

Definition at line 329 of file winsvc.hpp.

Here is the caller graph for this function:

◆ svc_ctrl_handler_static()

static VOID WINAPI openvpn::Win::Service::svc_ctrl_handler_static ( DWORD  dwCtrl)
inlinestaticprivate

Definition at line 357 of file winsvc.hpp.

Here is the caller graph for this function:

◆ svc_main()

void openvpn::Win::Service::svc_main ( DWORD  argc,
LPWSTR *  argv 
)
inlineprivate

Definition at line 286 of file winsvc.hpp.

Here is the caller graph for this function:

◆ svc_main_static()

static VOID WINAPI openvpn::Win::Service::svc_main_static ( DWORD  argc,
LPWSTR *  argv 
)
inlinestaticprivate

Definition at line 281 of file winsvc.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ checkpoint

DWORD openvpn::Win::Service::checkpoint
private

Definition at line 400 of file winsvc.hpp.

◆ config

const Config openvpn::Win::Service::config
private

Definition at line 396 of file winsvc.hpp.

◆ mutex

std::mutex openvpn::Win::Service::mutex
private

Definition at line 402 of file winsvc.hpp.

◆ service

Service * openvpn::Win::Service::service = nullptr
staticprivate

Definition at line 394 of file winsvc.hpp.

◆ status

SERVICE_STATUS openvpn::Win::Service::status
private

Definition at line 398 of file winsvc.hpp.

◆ status_handle

SERVICE_STATUS_HANDLE openvpn::Win::Service::status_handle
private

Definition at line 399 of file winsvc.hpp.


The documentation for this class was generated from the following file: