OpenVPN
wfp_block.h File Reference
#include <windef.h>
#include <iphlpapi.h>
#include <ws2tcpip.h>
Include dependency graph for wfp_block.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WFP_BLOCK_IFACE_METRIC   3

Typedefs

typedef void(* wfp_block_msg_handler_t) (DWORD err, const char *msg)

Functions

DWORD delete_wfp_block_filters (HANDLE engine)
DWORD add_wfp_block_filters (HANDLE *engine, int iface_index, const WCHAR *exe_path, wfp_block_msg_handler_t msg_handler_callback, BOOL dns_only)
int get_interface_metric (const NET_IFINDEX index, const ADDRESS_FAMILY family, int *is_auto)
 Return interface metric value for the specified interface index.
DWORD set_interface_metric (const NET_IFINDEX index, const ADDRESS_FAMILY family, const ULONG metric)
 Sets interface metric value for specified interface index.

Macro Definition Documentation

◆ WFP_BLOCK_IFACE_METRIC

#define WFP_BLOCK_IFACE_METRIC   3

Definition at line 33 of file wfp_block.h.

Referenced by AddWfpBlock(), and win_wfp_block().

Typedef Documentation

◆ wfp_block_msg_handler_t

typedef void(* wfp_block_msg_handler_t) (DWORD err, const char *msg)

Definition at line 35 of file wfp_block.h.

Function Documentation

◆ add_wfp_block_filters()

DWORD add_wfp_block_filters ( HANDLE * engine,
int iface_index,
const WCHAR * exe_path,
wfp_block_msg_handler_t msg_handler_callback,
BOOL dns_only )

◆ delete_wfp_block_filters()

DWORD delete_wfp_block_filters ( HANDLE engine)

Definition at line 344 of file wfp_block.c.

Referenced by AddWfpBlock(), DeleteWfpBlock(), Undo(), and win_wfp_uninit().

◆ get_interface_metric()

int get_interface_metric ( const NET_IFINDEX index,
const ADDRESS_FAMILY family,
int * is_auto )

Return interface metric value for the specified interface index.

Parameters
indexThe index of TAP adapter.
familyAddress family (AF_INET for IPv4 and AF_INET6 for IPv6).
is_autoOn return set to true if automatic metric is in use. Unused if NULL.
Returns
positive interface metric on success or -1 on error

Definition at line 369 of file wfp_block.c.

Referenced by adapter_index_of_ip(), AddWfpBlock(), and win_wfp_block().

◆ set_interface_metric()

DWORD set_interface_metric ( const NET_IFINDEX index,
const ADDRESS_FAMILY family,
const ULONG metric )

Sets interface metric value for specified interface index.

Parameters
indexThe index of TAP adapter
familyAddress family (AF_INET for IPv4 and AF_INET6 for IPv6)
metricMetric value. 0 for automatic metric
Returns
0 on success, a non-zero status code of the last failed action on failure.

Definition at line 408 of file wfp_block.c.

Referenced by AddWfpBlock(), DeleteWfpBlock(), Undo(), win_wfp_block(), and win_wfp_uninit().