OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::TunWin::WFP::ActionBase Class Reference

Base class for WFP actions. More...

#include <wfp.hpp>

Inheritance diagram for openvpn::TunWin::WFP::ActionBase:
[legend]
Collaboration diagram for openvpn::TunWin::WFP::ActionBase:
[legend]

Public Member Functions

void execute (std::ostream &log) override
 Invoke the context class to block / unblock traffic.
 
std::string to_string () const override
 
- Public Member Functions inherited from openvpn::Action
virtual Json::Value to_json () const
 
virtual ~Action ()=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.
 

Protected Member Functions

 ActionBase (const bool block, const std::wstring &openvpn_app_path, const NET_IFINDEX itf_index, const Block block_type, const Context::Ptr &ctx)
 

Private Attributes

const bool block_
 
const std::wstring openvpn_app_path_
 
const NET_IFINDEX itf_index_
 
const Block block_type_
 
Context::Ptr ctx_
 

Additional Inherited Members

- Public Types inherited from openvpn::Action
typedef RCPtr< ActionPtr
 
- 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.
 
- Public Attributes inherited from openvpn::Action
std::string mark
 

Detailed Description

Base class for WFP actions.

It holds a pointer to the WFP context and blocks / unblocks using the context, when it is invoked. This class cannot be constructed, use the derived ActionBlock and ActionUnblock classes to manage the firewall rules.

Definition at line 201 of file wfp.hpp.

Constructor & Destructor Documentation

◆ ActionBase()

openvpn::TunWin::WFP::ActionBase::ActionBase ( const bool  block,
const std::wstring &  openvpn_app_path,
const NET_IFINDEX  itf_index,
const Block  block_type,
const Context::Ptr ctx 
)
inlineprotected

Definition at line 226 of file wfp.hpp.

Member Function Documentation

◆ execute()

void openvpn::TunWin::WFP::ActionBase::execute ( std::ostream &  log)
inlineoverridevirtual

Invoke the context class to block / unblock traffic.

Parameters
logthe log stream for diagnostics

Implements openvpn::Action.

Definition at line 209 of file wfp.hpp.

◆ to_string()

std::string openvpn::TunWin::WFP::ActionBase::to_string ( ) const
inlineoverridevirtual

Implements openvpn::Action.

Definition at line 218 of file wfp.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ block_

const bool openvpn::TunWin::WFP::ActionBase::block_
private

Definition at line 240 of file wfp.hpp.

◆ block_type_

const Block openvpn::TunWin::WFP::ActionBase::block_type_
private

Definition at line 243 of file wfp.hpp.

◆ ctx_

Context::Ptr openvpn::TunWin::WFP::ActionBase::ctx_
private

Definition at line 244 of file wfp.hpp.

◆ itf_index_

const NET_IFINDEX openvpn::TunWin::WFP::ActionBase::itf_index_
private

Definition at line 242 of file wfp.hpp.

◆ openvpn_app_path_

const std::wstring openvpn::TunWin::WFP::ActionBase::openvpn_app_path_
private

Definition at line 241 of file wfp.hpp.


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