OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::Signal Class Reference

#include <signal.hpp>

Public Types

enum  {
  F_SIGINT = (1 << 0) , F_SIGTERM = (1 << 1) , F_SIGHUP = (1 << 2) , F_SIGUSR1 = (1 << 3) ,
  F_SIGUSR2 = (1 << 4) , F_SIGPIPE = (1 << 5)
}
 
typedef void(* handler_t) (int signum)
 

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (signal_error)
 
 Signal (const handler_t handler, const unsigned int flags)
 
 ~Signal () noexcept(false)
 

Static Public Member Functions

static void reset_all_to_defaults ()
 
static void reset_to_defaults (const unsigned int flags)
 

Static Private Member Functions

static void sigconf (struct sigaction &sa, const unsigned int flags)
 
static void sigact (struct sigaction &sa, const int sig)
 

Private Attributes

unsigned int flags_
 

Detailed Description

Definition at line 25 of file signal.hpp.

Member Typedef Documentation

◆ handler_t

typedef void(* openvpn::Signal::handler_t) (int signum)

Definition at line 30 of file signal.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
F_SIGINT 
F_SIGTERM 
F_SIGHUP 
F_SIGUSR1 
F_SIGUSR2 
F_SIGPIPE 

Definition at line 32 of file signal.hpp.

Constructor & Destructor Documentation

◆ Signal()

openvpn::Signal::Signal ( const handler_t  handler,
const unsigned int  flags 
)
inline

configure a signal handler to be active on the signal specified in the flags parameter. The signal handler will receive the original system signal numbers and not the ones from the enum of this class.

Parameters
handler
flags

Definition at line 49 of file signal.hpp.

◆ ~Signal()

openvpn::Signal::~Signal ( )
inline

Definition at line 58 of file signal.hpp.

Member Function Documentation

◆ OPENVPN_SIMPLE_EXCEPTION()

openvpn::Signal::OPENVPN_SIMPLE_EXCEPTION ( signal_error  )

◆ reset_all_to_defaults()

static void openvpn::Signal::reset_all_to_defaults ( )
inlinestatic

Definition at line 63 of file signal.hpp.

◆ reset_to_defaults()

static void openvpn::Signal::reset_to_defaults ( const unsigned int  flags)
inlinestatic

Definition at line 68 of file signal.hpp.

Here is the caller graph for this function:

◆ sigact()

static void openvpn::Signal::sigact ( struct sigaction &  sa,
const int  sig 
)
inlinestaticprivate

Definition at line 94 of file signal.hpp.

Here is the caller graph for this function:

◆ sigconf()

static void openvpn::Signal::sigconf ( struct sigaction &  sa,
const unsigned int  flags 
)
inlinestaticprivate

Definition at line 78 of file signal.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ flags_

unsigned int openvpn::Signal::flags_
private

Definition at line 100 of file signal.hpp.


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