OpenVPN
|
#include "syshead.h"
#include <fwpmu.h>
#include <initguid.h>
#include <fwpmtypes.h>
#include <winsock2.h>
#include <ws2ipdef.h>
#include <iphlpapi.h>
#include "wfp_block.h"
Go to the source code of this file.
Macros | |
#define | FWPM_SESSION_FLAG_DYNAMIC 0x00000001 |
#define | OUT_ON_ERROR(err, msg) if (err) { msg_handler(err, msg); goto out; } |
Functions | |
DEFINE_GUID (FWPM_LAYER_ALE_AUTH_CONNECT_V4, 0xc38d57d1, 0x05a7, 0x4c33, 0x90, 0x4f, 0x7f, 0xbc, 0xee, 0xe6, 0x0e, 0x82) | |
DEFINE_GUID (FWPM_LAYER_ALE_AUTH_CONNECT_V6, 0x4a72393b, 0x319f, 0x44bc, 0x84, 0xc3, 0xba, 0x54, 0xdc, 0xb3, 0xb6, 0xb4) | |
DEFINE_GUID (FWPM_CONDITION_ALE_APP_ID, 0xd78e1e87, 0x8644, 0x4ea5, 0x94, 0x37, 0xd8, 0x09, 0xec, 0xef, 0xc9, 0x71) | |
DEFINE_GUID (FWPM_CONDITION_IP_REMOTE_PORT, 0xc35a604d, 0xd22b, 0x4e1a, 0x91, 0xb4, 0x68, 0xf6, 0x74, 0xee, 0x67, 0x4b) | |
DEFINE_GUID (FWPM_CONDITION_IP_LOCAL_INTERFACE, 0x4cd62a49, 0x59c3, 0x4969, 0xb7, 0xf3, 0xbd, 0xa5, 0xd3, 0x28, 0x90, 0xa4) | |
DEFINE_GUID (FWPM_CONDITION_FLAGS, 0x632ce23b, 0x5167, 0x435c, 0x86, 0xd7, 0xe9, 0x03, 0x68, 0x4a, 0xa8, 0x0c) | |
DEFINE_GUID (OPENVPN_WFP_BLOCK_SUBLAYER, 0x2f660d7e, 0x6a37, 0x11e6, 0xa1, 0x81, 0x00, 0x1e, 0x8c, 0x6e, 0x04, 0xa2) | |
static void | default_msg_handler (DWORD err, const char *msg) |
static DWORD | add_sublayer (GUID uuid) |
DWORD | add_wfp_block_filters (HANDLE *engine_handle, int index, const WCHAR *exe_path, wfp_block_msg_handler_t msg_handler, BOOL dns_only) |
DWORD | delete_wfp_block_filters (HANDLE engine_handle) |
int | get_interface_metric (const NET_IFINDEX index, const ADDRESS_FAMILY family, int *is_auto) |
Return interface metric value for the specified interface index. More... | |
DWORD | set_interface_metric (const NET_IFINDEX index, const ADDRESS_FAMILY family, const ULONG metric) |
Sets interface metric value for specified interface index. More... | |
Variables | |
static WCHAR * | FIREWALL_NAME = L"OpenVPN" |
#define FWPM_SESSION_FLAG_DYNAMIC 0x00000001 |
Definition at line 48 of file wfp_block.c.
Definition at line 126 of file wfp_block.c.
|
static |
Definition at line 133 of file wfp_block.c.
References FIREWALL_NAME.
Referenced by add_wfp_block_filters().
DWORD add_wfp_block_filters | ( | HANDLE * | engine_handle, |
int | index, | ||
const WCHAR * | exe_path, | ||
wfp_block_msg_handler_t | msg_handler, | ||
BOOL | dns_only | ||
) |
Definition at line 185 of file wfp_block.c.
References add_sublayer(), default_msg_handler(), FIREWALL_NAME, FWPM_SESSION_FLAG_DYNAMIC, OUT_ON_ERROR, and UINT64.
Referenced by AddWfpBlock(), and win_wfp_block().
|
inlinestatic |
Definition at line 121 of file wfp_block.c.
Referenced by add_wfp_block_filters().
DEFINE_GUID | ( | FWPM_CONDITION_ALE_APP_ID | , |
0xd78e1e87 | , | ||
0x8644 | , | ||
0x4ea5 | , | ||
0x94 | , | ||
0x37 | , | ||
0xd8 | , | ||
0x09 | , | ||
0xec | , | ||
0xef | , | ||
0xc9 | , | ||
0x71 | |||
) |
DEFINE_GUID | ( | FWPM_CONDITION_FLAGS | , |
0x632ce23b | , | ||
0x5167 | , | ||
0x435c | , | ||
0x86 | , | ||
0xd7 | , | ||
0xe9 | , | ||
0x03 | , | ||
0x68 | , | ||
0x4a | , | ||
0xa8 | , | ||
0x0c | |||
) |
DEFINE_GUID | ( | FWPM_CONDITION_IP_LOCAL_INTERFACE | , |
0x4cd62a49 | , | ||
0x59c3 | , | ||
0x4969 | , | ||
0xb7 | , | ||
0xf3 | , | ||
0xbd | , | ||
0xa5 | , | ||
0xd3 | , | ||
0x28 | , | ||
0x90 | , | ||
0xa4 | |||
) |
DEFINE_GUID | ( | FWPM_CONDITION_IP_REMOTE_PORT | , |
0xc35a604d | , | ||
0xd22b | , | ||
0x4e1a | , | ||
0x91 | , | ||
0xb4 | , | ||
0x68 | , | ||
0xf6 | , | ||
0x74 | , | ||
0xee | , | ||
0x67 | , | ||
0x4b | |||
) |
DEFINE_GUID | ( | FWPM_LAYER_ALE_AUTH_CONNECT_V4 | , |
0xc38d57d1 | , | ||
0x05a7 | , | ||
0x4c33 | , | ||
0x90 | , | ||
0x4f | , | ||
0x7f | , | ||
0xbc | , | ||
0xee | , | ||
0xe6 | , | ||
0x0e | , | ||
0x82 | |||
) |
DEFINE_GUID | ( | FWPM_LAYER_ALE_AUTH_CONNECT_V6 | , |
0x4a72393b | , | ||
0x319f | , | ||
0x44bc | , | ||
0x84 | , | ||
0xc3 | , | ||
0xba | , | ||
0x54 | , | ||
0xdc | , | ||
0xb3 | , | ||
0xb6 | , | ||
0xb4 | |||
) |
DEFINE_GUID | ( | OPENVPN_WFP_BLOCK_SUBLAYER | , |
0x2f660d7e | , | ||
0x6a37 | , | ||
0x11e6 | , | ||
0xa1 | , | ||
0x81 | , | ||
0x00 | , | ||
0x1e | , | ||
0x8c | , | ||
0x6e | , | ||
0x04 | , | ||
0xa2 | |||
) |
DWORD delete_wfp_block_filters | ( | HANDLE | engine_handle | ) |
Definition at line 379 of file wfp_block.c.
Referenced by AddWfpBlock(), DeleteWfpBlock(), Undo(), and win_wfp_uninit().
int get_interface_metric | ( | const NET_IFINDEX | index, |
const ADDRESS_FAMILY | family, | ||
int * | is_auto | ||
) |
Return interface metric value for the specified interface index.
index | The index of TAP adapter. |
family | Address family (AF_INET for IPv4 and AF_INET6 for IPv6). |
is_auto | On return set to true if automatic metric is in use. Unused if NULL. |
Definition at line 404 of file wfp_block.c.
Referenced by adapter_index_of_ip(), AddWfpBlock(), and win_wfp_block().
DWORD set_interface_metric | ( | const NET_IFINDEX | index, |
const ADDRESS_FAMILY | family, | ||
const ULONG | metric | ||
) |
Sets interface metric value for specified interface index.
index | The index of TAP adapter |
family | Address family (AF_INET for IPv4 and AF_INET6 for IPv6) |
metric | Metric value. 0 for automatic metric |
Definition at line 443 of file wfp_block.c.
Referenced by AddWfpBlock(), DeleteWfpBlock(), Undo(), win_wfp_block(), and win_wfp_uninit().
|
static |
Definition at line 115 of file wfp_block.c.
Referenced by add_sublayer(), and add_wfp_block_filters().