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

#include <tunsetup.hpp>

Inheritance diagram for openvpn::TunMac::Setup:
[legend]
Collaboration diagram for openvpn::TunMac::Setup:
[legend]

Classes

struct  Config
 

Public Types

typedef RCPtr< SetupPtr
 
- Public Types inherited from openvpn::TunBuilderSetup::Base
typedef RCPtr< BasePtr
 
- Public Types inherited from openvpn::DestructorBase
typedef RCPtr< DestructorBasePtr
 
- Public Types inherited from openvpn::RC< thread_unsafe_refcount >
typedef RCPtr< RCPtr
 

Public Member Functions

 OPENVPN_EXCEPTION (tun_mac_setup)
 
bool add_bypass_route (const std::string &address, bool ipv6, std::ostream &os)
 
int establish (const TunBuilderCapture &pull, TunBuilderSetup::Config *config, Stop *stop, std::ostream &os) override
 
void destroy (std::ostream &os) override
 
virtual ~Setup ()
 
- Public Member Functions inherited from openvpn::DestructorBase
virtual ~DestructorBase ()=default
 
- 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.
 

Static Public Member Functions

static void add_bypass_route (const std::string &route, bool ipv6, ActionList &add_cmds, ActionList &remove_cmds_bypass_gw)
 
- 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.
 

Private Types

enum  {
  R_IPv6 = (1 << 0) , R_IFACE = (1 << 1) , R_IFACE_HINT = (1 << 2) , R_ONLINK = (1 << 3) ,
  R_REJECT = (1 << 4) , R_BLACKHOLE = (1 << 5)
}
 

Static Private Member Functions

static void add_del_route (const std::string &addr_str, const int prefix_len, const std::string &gateway_str, const std::string &iface, const unsigned int flags, Action::Ptr &create, Action::Ptr &destroy)
 
static void add_del_route (const std::string &addr_str, const int prefix_len, const std::string &gateway_str, const std::string &iface, const unsigned int flags, ActionList &create, ActionList &destroy)
 
static void tun_config (const std::string &iface_name, const TunBuilderCapture &pull, ActionList &create, ActionList &destroy, std::ostream &os)
 

Private Attributes

ActionList::Ptr remove_cmds
 

Detailed Description

Definition at line 44 of file tunsetup.hpp.

Member Typedef Documentation

◆ Ptr

Definition at line 47 of file tunsetup.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
R_IPv6 
R_IFACE 
R_IFACE_HINT 
R_ONLINK 
R_REJECT 
R_BLACKHOLE 

Definition at line 172 of file tunsetup.hpp.

Constructor & Destructor Documentation

◆ ~Setup()

virtual openvpn::TunMac::Setup::~Setup ( )
inlinevirtual

Definition at line 165 of file tunsetup.hpp.

Member Function Documentation

◆ add_bypass_route() [1/2]

bool openvpn::TunMac::Setup::add_bypass_route ( const std::string &  address,
bool  ipv6,
std::ostream &  os 
)
inline

Definition at line 78 of file tunsetup.hpp.

Here is the caller graph for this function:

◆ add_bypass_route() [2/2]

static void openvpn::TunMac::Setup::add_bypass_route ( const std::string &  route,
bool  ipv6,
ActionList add_cmds,
ActionList remove_cmds_bypass_gw 
)
inlinestatic

Definition at line 505 of file tunsetup.hpp.

◆ add_del_route() [1/2]

static void openvpn::TunMac::Setup::add_del_route ( const std::string &  addr_str,
const int  prefix_len,
const std::string &  gateway_str,
const std::string &  iface,
const unsigned int  flags,
Action::Ptr create,
Action::Ptr destroy 
)
inlinestaticprivate

Definition at line 182 of file tunsetup.hpp.

Here is the caller graph for this function:

◆ add_del_route() [2/2]

static void openvpn::TunMac::Setup::add_del_route ( const std::string &  addr_str,
const int  prefix_len,
const std::string &  gateway_str,
const std::string &  iface,
const unsigned int  flags,
ActionList create,
ActionList destroy 
)
inlinestaticprivate

Definition at line 280 of file tunsetup.hpp.

◆ destroy()

void openvpn::TunMac::Setup::destroy ( std::ostream &  os)
inlineoverridevirtual

Implements openvpn::DestructorBase.

Definition at line 156 of file tunsetup.hpp.

Here is the caller graph for this function:

◆ establish()

int openvpn::TunMac::Setup::establish ( const TunBuilderCapture pull,
TunBuilderSetup::Config config,
Stop stop,
std::ostream &  os 
)
inlineoverridevirtual

Implements openvpn::TunBuilderSetup::Base.

Definition at line 86 of file tunsetup.hpp.

◆ OPENVPN_EXCEPTION()

openvpn::TunMac::Setup::OPENVPN_EXCEPTION ( tun_mac_setup  )

◆ tun_config()

static void openvpn::TunMac::Setup::tun_config ( const std::string &  iface_name,
const TunBuilderCapture pull,
ActionList create,
ActionList destroy,
std::ostream &  os 
)
inlinestaticprivate

Definition at line 294 of file tunsetup.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ remove_cmds

ActionList::Ptr openvpn::TunMac::Setup::remove_cmds
private

Definition at line 502 of file tunsetup.hpp.


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