OpenVPN 3 Core Library
Loading...
Searching...
No Matches
setup.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// Client tun setup base class for unix
13
14#ifndef OPENVPN_TUN_BUILDER_SETUP_H
15#define OPENVPN_TUN_BUILDER_SETUP_H
16
21
23struct Config
24{
25#ifdef HAVE_JSON
26 virtual Json::Value to_json() = 0;
27 virtual void from_json(const Json::Value &root, const std::string &title) = 0;
28#endif
29 virtual ~Config() = default;
30};
31
32struct Base : public DestructorBase
33{
35
36 virtual int establish(const TunBuilderCapture &pull, Config *config, Stop *stop, std::ostream &os) = 0;
37};
38
39struct Factory : public RC<thread_unsafe_refcount>
40{
42
43 virtual Base::Ptr new_setup_obj() = 0;
44};
45} // namespace openvpn::TunBuilderSetup
46
47#endif
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 int establish(const TunBuilderCapture &pull, Config *config, Stop *stop, std::ostream &os)=0
virtual Json::Value to_json()=0
virtual void from_json(const Json::Value &root, const std::string &title)=0
virtual Base::Ptr new_setup_obj()=0
std::ostringstream os
static const char config[]