OpenVPN 3 Core Library
Loading...
Searching...
No Matches
emuexr.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// Base classes for Emulate Excluded Routes
13
14#ifndef OPENVPN_TUN_CLIENT_EMUEXR_H
15#define OPENVPN_TUN_CLIENT_EMUEXR_H
16
17#include <openvpn/common/rc.hpp>
20
21namespace openvpn {
22struct EmulateExcludeRoute : public RC<thread_unsafe_refcount>
23{
25
26 virtual void add_route(const bool add, const IP::Addr &addr, const int prefix_len) = 0;
27 virtual bool enabled(const IPVerFlags &ipv) const = 0;
28 virtual void emulate(TunBuilderBase *tb, IPVerFlags &ipv, const IP::Addr &server_addr) const = 0;
29 virtual void add_default_routes(bool ipv4, bool ipv6) = 0;
30};
31
32struct EmulateExcludeRouteFactory : public RC<thread_unsafe_refcount>
33{
35
36 virtual EmulateExcludeRoute::Ptr new_obj() const = 0;
37};
38} // namespace openvpn
39
40#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
TunBuilder methods, loosely based on the Android VpnService.Builder abstraction.
Definition base.hpp:42
RCPtr< EmulateExcludeRouteFactory > Ptr
Definition emuexr.hpp:34
virtual EmulateExcludeRoute::Ptr new_obj() const =0
virtual void emulate(TunBuilderBase *tb, IPVerFlags &ipv, const IP::Addr &server_addr) const =0
virtual void add_default_routes(bool ipv4, bool ipv6)=0
virtual bool enabled(const IPVerFlags &ipv) const =0
RCPtr< EmulateExcludeRoute > Ptr
Definition emuexr.hpp:24
virtual void add_route(const bool add, const IP::Addr &addr, const int prefix_len)=0
remote_address ipv6
reroute_gw ipv4
int prefix_len(const IPv4::Addr::base_type mask)
static void add(const Time &t1, const Time::Duration &d1)