Add WFP rules to block traffic from escaping the VPN.
More...
#include <wfp.hpp>
|
void | block (const std::wstring &openvpn_app_path, NET_IFINDEX itf_index, Block block_type, std::ostream &log) |
| Add WFP block filters to prevent VPN traffic from leaking.
|
|
void | reset (std::ostream &log) |
| Remove WFP block filters.
|
|
void | add_filter (const FWPM_FILTER0 *filter, PSECURITY_DESCRIPTOR sd, UINT64 *id) |
|
|
static constexpr bool | is_thread_safe () |
| Delegates call to RCImpl and returns the result.
|
|
Add WFP rules to block traffic from escaping the VPN.
Definition at line 141 of file wfp.hpp.
◆ Ptr
◆ Block
Enum for type of local traffic to block.
Enumerator |
---|
All | |
AllButLocalDns | |
Dns | |
Definition at line 151 of file wfp.hpp.
◆ adapter_index_to_luid()
static NET_LUID openvpn::TunWin::WFP::adapter_index_to_luid |
( |
const NET_IFINDEX |
index | ) |
|
|
inlinestaticprivate |
◆ add_filter()
void openvpn::TunWin::WFP::add_filter |
( |
const FWPM_FILTER0 * |
filter, |
|
|
PSECURITY_DESCRIPTOR |
sd, |
|
|
UINT64 * |
id |
|
) |
| |
|
inlineprivate |
◆ block()
void openvpn::TunWin::WFP::block |
( |
const std::wstring & |
openvpn_app_path, |
|
|
NET_IFINDEX |
itf_index, |
|
|
Block |
block_type, |
|
|
std::ostream & |
log |
|
) |
| |
|
inlineprivate |
Add WFP block filters to prevent VPN traffic from leaking.
Block traffic to all interfaces besides the VPN interface. The OpenVPN process gets an exception to this rule. If dns_only is set this only concerns traffic to port 53.
Derived from code in openvpn 2, originally: https://github.com/ValdikSS/openvpn-with-patches/commit/3bd4d503d21aa34636e4f97b3e32ae0acca407f0
- Parameters
-
openvpn_app_path | path to the openvpn executable |
itf_index | interface index of the VPN interface |
block_type | which type of traffic should be blocked |
log | the log ostream to use for diagnostics |
Definition at line 287 of file wfp.hpp.
◆ get_app_id_blob()
static unique_ptr_del< FWP_BYTE_BLOB > openvpn::TunWin::WFP::get_app_id_blob |
( |
const std::wstring & |
app_path | ) |
|
|
inlinestaticprivate |
◆ new_guid()
static GUID openvpn::TunWin::WFP::new_guid |
( |
| ) |
|
|
inlinestaticprivate |
◆ OPENVPN_EXCEPTION()
openvpn::TunWin::WFP::OPENVPN_EXCEPTION |
( |
wfp_error |
| ) |
|
◆ reset()
void openvpn::TunWin::WFP::reset |
( |
std::ostream & |
log | ) |
|
|
inlineprivate |
Remove WFP block filters.
- Parameters
-
log | the log ostream to use for disgnostics |
Definition at line 431 of file wfp.hpp.
◆ Context
◆ engineHandle
◆ subLayerGUID
const GUID openvpn::TunWin::WFP::subLayerGUID {new_guid()} |
|
private |
The documentation for this class was generated from the following file: