OpenVPN
Macros | Typedefs | Functions
block_dns.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BLOCK_DNS_IFACE_METRIC   3
 

Typedefs

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

Functions

DWORD delete_block_dns_filters (HANDLE engine)
 
DWORD add_block_dns_filters (HANDLE *engine, int iface_index, const WCHAR *exe_path, block_dns_msg_handler_t msg_handler_callback)
 
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...
 

Macro Definition Documentation

◆ BLOCK_DNS_IFACE_METRIC

#define BLOCK_DNS_IFACE_METRIC   3

Definition at line 30 of file block_dns.h.

Typedef Documentation

◆ block_dns_msg_handler_t

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

Definition at line 32 of file block_dns.h.

Function Documentation

◆ add_block_dns_filters()

DWORD add_block_dns_filters ( HANDLE *  engine,
int  iface_index,
const WCHAR *  exe_path,
block_dns_msg_handler_t  msg_handler_callback 
)

◆ delete_block_dns_filters()

DWORD delete_block_dns_filters ( HANDLE  engine)

Definition at line 325 of file block_dns.c.

Referenced by AddBlockDNS(), DeleteBlockDNS(), 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 350 of file block_dns.c.

Referenced by adapter_index_of_ip(), AddBlockDNS(), and win_wfp_block_dns().

◆ 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 389 of file block_dns.c.

Referenced by AddBlockDNS(), DeleteBlockDNS(), Undo(), win_wfp_block_dns(), and win_wfp_uninit().