OpenVPN 3 Core Library
Loading...
Searching...
No Matches
clilife.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#ifndef OPENVPN_CLIENT_CLILIFE_H
13#define OPENVPN_CLIENT_CLILIFE_H
14
15#include <string>
16
17#include <openvpn/common/rc.hpp>
18
19namespace openvpn {
20// Base class for managing connection lifecycle notifications,
21// such as sleep, wakeup, network-unavailable, network-available.
22class ClientLifeCycle : public RC<thread_unsafe_refcount>
23{
24 public:
26 {
27 virtual ~NotifyCallback() = default;
28
29 virtual void cln_stop() = 0;
30 virtual void cln_pause(const std::string &reason) = 0;
31 virtual void cln_resume() = 0;
32 virtual void cln_reconnect(int seconds) = 0;
33 };
34
36
37 virtual bool network_available() = 0;
38
39 virtual void start(NotifyCallback *) = 0;
40 virtual void stop() = 0;
41};
42} // namespace openvpn
43
44#endif
virtual void start(NotifyCallback *)=0
RCPtr< ClientLifeCycle > Ptr
Definition clilife.hpp:35
virtual bool network_available()=0
virtual void stop()=0
The smart pointer class.
Definition rc.hpp:119
Reference count base class for objects tracked by RCPtr. Disallows copying and assignment.
Definition rc.hpp:912
virtual void cln_reconnect(int seconds)=0
virtual void cln_pause(const std::string &reason)=0