2018-08-08 06:12:38 -05:00
|
|
|
// SPDX-License-Identifier: AGPL-1.0-only
|
|
|
|
// Copyright (C) 2018 Ludvig Strigeus <info@tunsafe.com>. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
2018-08-11 20:27:14 -05:00
|
|
|
class DnsBlocker {
|
|
|
|
public:
|
|
|
|
DnsBlocker();
|
|
|
|
~DnsBlocker();
|
|
|
|
|
|
|
|
bool BlockDnsExceptOnAdapter(const NET_LUID &luid, bool also_ipv6);
|
|
|
|
void RestoreDns();
|
|
|
|
bool IsActive() { return handle_ != NULL; }
|
|
|
|
|
|
|
|
// Current state
|
|
|
|
NET_LUID luid_;
|
|
|
|
HANDLE handle_;
|
|
|
|
bool also_ipv6_;
|
|
|
|
};
|
2018-08-08 06:12:38 -05:00
|
|
|
|
2018-10-21 14:53:02 -05:00
|
|
|
bool AddKillSwitchFirewall(const NET_LUID &luid_to_allow, bool also_ipv6, bool allow_local_networks);
|
2018-09-11 14:10:10 -05:00
|
|
|
void RemoveKillSwitchFirewall();
|
|
|
|
bool GetKillSwitchFirewallActive();
|