| OpenVPN
    | 
#include "syshead.h"#include <fwpmu.h>#include <initguid.h>#include <fwpmtypes.h>#include <winsock2.h>#include <ws2ipdef.h>#include <iphlpapi.h>#include "block_dns.h"
Go to the source code of this file.
| Macros | |
| #define | FWPM_SESSION_FLAG_DYNAMIC 0x00000001 | 
| #define | CHECK_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 (OPENVPN_BLOCK_OUTSIDE_DNS_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_block_dns_filters (HANDLE *engine_handle, int index, const WCHAR *exe_path, block_dns_msg_handler_t msg_handler) | 
| DWORD | delete_block_dns_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" | 
Definition at line 116 of file block_dns.c.
| #define FWPM_SESSION_FLAG_DYNAMIC 0x00000001 | 
Definition at line 47 of file block_dns.c.
| DWORD add_block_dns_filters | ( | HANDLE * | engine_handle, | 
| int | index, | ||
| const WCHAR * | exe_path, | ||
| block_dns_msg_handler_t | msg_handler | ||
| ) | 
Definition at line 174 of file block_dns.c.
References add_sublayer(), CHECK_ERROR, default_msg_handler(), FIREWALL_NAME, FWPM_SESSION_FLAG_DYNAMIC, and UINT64.
Referenced by AddBlockDNS(), and win_wfp_block_dns().
| 
 | static | 
Definition at line 123 of file block_dns.c.
References FIREWALL_NAME.
Referenced by add_block_dns_filters().
| 
 | inlinestatic | 
Definition at line 111 of file block_dns.c.
Referenced by add_block_dns_filters().
| DEFINE_GUID | ( | FWPM_CONDITION_ALE_APP_ID | , | 
| 0xd78e1e87 | , | ||
| 0x8644 | , | ||
| 0x4ea5 | , | ||
| 0x94 | , | ||
| 0x37 | , | ||
| 0xd8 | , | ||
| 0x09 | , | ||
| 0xec | , | ||
| 0xef | , | ||
| 0xc9 | , | ||
| 0x71 | |||
| ) | 
| 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_BLOCK_OUTSIDE_DNS_SUBLAYER | , | 
| 0x2f660d7e | , | ||
| 0x6a37 | , | ||
| 0x11e6 | , | ||
| 0xa1 | , | ||
| 0x81 | , | ||
| 0x00 | , | ||
| 0x1e | , | ||
| 0x8c | , | ||
| 0x6e | , | ||
| 0x04 | , | ||
| 0xa2 | |||
| ) | 
| DWORD delete_block_dns_filters | ( | HANDLE | engine_handle | ) | 
Definition at line 325 of file block_dns.c.
Referenced by AddBlockDNS(), DeleteBlockDNS(), 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 350 of file block_dns.c.
Referenced by adapter_index_of_ip(), AddBlockDNS(), and win_wfp_block_dns().
| 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 389 of file block_dns.c.
Referenced by AddBlockDNS(), DeleteBlockDNS(), Undo(), win_wfp_block_dns(), and win_wfp_uninit().
| 
 | static | 
Definition at line 105 of file block_dns.c.
Referenced by add_block_dns_filters(), and add_sublayer().
 1.8.17
 1.8.17