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

#include <maclife.hpp>

Inheritance diagram for openvpn::MacLifeCycle:
[legend]
Collaboration diagram for openvpn::MacLifeCycle:
[legend]

Classes

struct  State
 

Public Member Functions

 OPENVPN_EXCEPTION (mac_lifecycle_error)
 
 MacLifeCycle ()
 
virtual ~MacLifeCycle ()
 
bool network_available () override
 
void start (NotifyCallback *nc_arg) override
 
void stop () override
 
- Public Member Functions inherited from openvpn::RC< thread_unsafe_refcount >
 RC () noexcept=default
 
 RC (const RC &)=delete
 
virtual ~RC ()=default
 
RCoperator= (const RC &)=delete
 
olong use_count () const noexcept
 Delegates call to RCImpl and returns the result.
 

Private Member Functions

void stop_thread ()
 
void thread_func ()
 
std::string primary_interface ()
 
bool net_up ()
 
void iface_watch ()
 
void iface_watch_callback (SCDynamicStoreRef store, CFArrayRef changedKeys)
 
void notify_sleep () override
 
void notify_wakeup () override
 
void reachability_tracker_event (const ReachabilityBase &rb, SCNetworkReachabilityFlags flags) override
 
void schedule_action_timer (const int seconds, bool force_runloop=false)
 
void cancel_action_timer ()
 
void action_timer_callback (CFRunLoopTimerRef timer)
 
- Private Member Functions inherited from openvpn::MacSleep
 MacSleep ()
 
virtual ~MacSleep ()
 
bool mac_sleep_start ()
 
void mac_sleep_stop ()
 
- Private Member Functions inherited from openvpn::ReachabilityTracker
 ReachabilityTracker (const bool enable_internet, const bool enable_wifi)
 
void reachability_tracker_schedule ()
 
void reachability_tracker_cancel ()
 
virtual ~ReachabilityTracker ()
 

Static Private Member Functions

static void iface_watch_callback_static (SCDynamicStoreRef store, CFArrayRef changedKeys, void *arg)
 
static void action_timer_callback_static (CFRunLoopTimerRef timer, void *info)
 

Private Attributes

NotifyCallbacknc = nullptr
 
std::thread * thread = nullptr
 
CF::RunLoop runloop
 
CF::DynamicStore dstore
 
State state
 
State prev_state
 
bool paused = false
 
std::atomic< bool > halt {false}
 
CF::Timer action_timer
 
Log::Context::Wrapper logwrap
 

Additional Inherited Members

- Public Types inherited from openvpn::ClientLifeCycle
typedef RCPtr< ClientLifeCyclePtr
 
- Public Types inherited from openvpn::RC< thread_unsafe_refcount >
typedef RCPtr< RCPtr
 
- Static Public Member Functions inherited from openvpn::RC< thread_unsafe_refcount >
static constexpr bool is_thread_safe ()
 Delegates call to RCImpl and returns the result.
 

Detailed Description

Definition at line 30 of file maclife.hpp.

Constructor & Destructor Documentation

◆ MacLifeCycle()

openvpn::MacLifeCycle::MacLifeCycle ( )
inline

Definition at line 35 of file maclife.hpp.

◆ ~MacLifeCycle()

virtual openvpn::MacLifeCycle::~MacLifeCycle ( )
inlinevirtual

Definition at line 40 of file maclife.hpp.

Member Function Documentation

◆ action_timer_callback()

void openvpn::MacLifeCycle::action_timer_callback ( CFRunLoopTimerRef  timer)
inlineprivate

Definition at line 266 of file maclife.hpp.

Here is the caller graph for this function:

◆ action_timer_callback_static()

static void openvpn::MacLifeCycle::action_timer_callback_static ( CFRunLoopTimerRef  timer,
void *  info 
)
inlinestaticprivate

Definition at line 260 of file maclife.hpp.

Here is the caller graph for this function:

◆ cancel_action_timer()

void openvpn::MacLifeCycle::cancel_action_timer ( )
inlineprivate

Definition at line 251 of file maclife.hpp.

Here is the caller graph for this function:

◆ iface_watch()

void openvpn::MacLifeCycle::iface_watch ( )
inlineprivate

Definition at line 173 of file maclife.hpp.

Here is the caller graph for this function:

◆ iface_watch_callback()

void openvpn::MacLifeCycle::iface_watch_callback ( SCDynamicStoreRef  store,
CFArrayRef  changedKeys 
)
inlineprivate

Definition at line 203 of file maclife.hpp.

Here is the caller graph for this function:

◆ iface_watch_callback_static()

static void openvpn::MacLifeCycle::iface_watch_callback_static ( SCDynamicStoreRef  store,
CFArrayRef  changedKeys,
void *  arg 
)
inlinestaticprivate

Definition at line 197 of file maclife.hpp.

Here is the caller graph for this function:

◆ net_up()

bool openvpn::MacLifeCycle::net_up ( )
inlineprivate

Definition at line 167 of file maclife.hpp.

Here is the caller graph for this function:

◆ network_available()

bool openvpn::MacLifeCycle::network_available ( )
inlineoverridevirtual

Implements openvpn::ClientLifeCycle.

Definition at line 45 of file maclife.hpp.

◆ notify_sleep()

void openvpn::MacLifeCycle::notify_sleep ( )
inlineoverrideprivatevirtual

Implements openvpn::MacSleep.

Definition at line 210 of file maclife.hpp.

◆ notify_wakeup()

void openvpn::MacLifeCycle::notify_wakeup ( )
inlineoverrideprivatevirtual

Implements openvpn::MacSleep.

Definition at line 217 of file maclife.hpp.

◆ OPENVPN_EXCEPTION()

openvpn::MacLifeCycle::OPENVPN_EXCEPTION ( mac_lifecycle_error  )

◆ primary_interface()

std::string openvpn::MacLifeCycle::primary_interface ( )
inlineprivate

Definition at line 161 of file maclife.hpp.

Here is the caller graph for this function:

◆ reachability_tracker_event()

void openvpn::MacLifeCycle::reachability_tracker_event ( const ReachabilityBase rb,
SCNetworkReachabilityFlags  flags 
)
inlineoverrideprivatevirtual

Implements openvpn::ReachabilityTracker.

Definition at line 224 of file maclife.hpp.

◆ schedule_action_timer()

void openvpn::MacLifeCycle::schedule_action_timer ( const int  seconds,
bool  force_runloop = false 
)
inlineprivate

Definition at line 235 of file maclife.hpp.

Here is the caller graph for this function:

◆ start()

void openvpn::MacLifeCycle::start ( NotifyCallback nc_arg)
inlineoverridevirtual

Implements openvpn::ClientLifeCycle.

Definition at line 50 of file maclife.hpp.

◆ stop()

void openvpn::MacLifeCycle::stop ( )
inlineoverridevirtual

Implements openvpn::ClientLifeCycle.

Definition at line 59 of file maclife.hpp.

◆ stop_thread()

void openvpn::MacLifeCycle::stop_thread ( )
inlineprivate

Definition at line 102 of file maclife.hpp.

Here is the caller graph for this function:

◆ thread_func()

void openvpn::MacLifeCycle::thread_func ( )
inlineprivate

Definition at line 115 of file maclife.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ action_timer

CF::Timer openvpn::MacLifeCycle::action_timer
private

Definition at line 322 of file maclife.hpp.

◆ dstore

CF::DynamicStore openvpn::MacLifeCycle::dstore
private

Definition at line 317 of file maclife.hpp.

◆ halt

std::atomic<bool> openvpn::MacLifeCycle::halt {false}
private

Definition at line 321 of file maclife.hpp.

◆ logwrap

Log::Context::Wrapper openvpn::MacLifeCycle::logwrap
private

Definition at line 323 of file maclife.hpp.

◆ nc

NotifyCallback* openvpn::MacLifeCycle::nc = nullptr
private

Definition at line 314 of file maclife.hpp.

◆ paused

bool openvpn::MacLifeCycle::paused = false
private

Definition at line 320 of file maclife.hpp.

◆ prev_state

State openvpn::MacLifeCycle::prev_state
private

Definition at line 319 of file maclife.hpp.

◆ runloop

CF::RunLoop openvpn::MacLifeCycle::runloop
private

Definition at line 316 of file maclife.hpp.

◆ state

State openvpn::MacLifeCycle::state
private

Definition at line 318 of file maclife.hpp.

◆ thread

std::thread* openvpn::MacLifeCycle::thread = nullptr
private

Definition at line 315 of file maclife.hpp.


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