summaryrefslogtreecommitdiffhomepage
path: root/wfpctl/src/extras/cli
diff options
context:
space:
mode:
authorOdd Stranne <odd@mullvad.net>2018-04-11 22:45:33 +0200
committerOdd Stranne <odd@mullvad.net>2018-04-11 22:45:33 +0200
commitd6bdf09ae0fd53b4541a99837a03c8aa6e31cee1 (patch)
treeca09499334010ea620a092f32886e5996ad08370 /wfpctl/src/extras/cli
parent0c6c767e265e186495dbaabc859c5844aeb15b41 (diff)
downloadmullvadvpn-d6bdf09ae0fd53b4541a99837a03c8aa6e31cee1.tar.xz
mullvadvpn-d6bdf09ae0fd53b4541a99837a03c8aa6e31cee1.zip
Make default state in wfpctl permit network comms
Diffstat (limited to 'wfpctl/src/extras/cli')
-rw-r--r--wfpctl/src/extras/cli/commands/wfpctl/policy.cpp15
-rw-r--r--wfpctl/src/extras/cli/commands/wfpctl/policy.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/wfpctl/src/extras/cli/commands/wfpctl/policy.cpp b/wfpctl/src/extras/cli/commands/wfpctl/policy.cpp
index e323260e48..3d4ce2aaf6 100644
--- a/wfpctl/src/extras/cli/commands/wfpctl/policy.cpp
+++ b/wfpctl/src/extras/cli/commands/wfpctl/policy.cpp
@@ -55,6 +55,12 @@ Policy::Policy(MessageSink messageSink)
m_dispatcher.addSubcommand
(
+ L"netblocked",
+ std::bind(&Policy::processNetBlocked, this)
+ );
+
+ m_dispatcher.addSubcommand
+ (
L"reset",
std::bind(&Policy::processReset, this)
);
@@ -143,6 +149,15 @@ void Policy::processConnected(const KeyValuePairs &arguments)
: L"Failed to apply policy."));
}
+void Policy::processNetBlocked()
+{
+ auto success = Wfpctl_ApplyPolicyNetBlocked();
+
+ m_messageSink((success
+ ? L"Successfully applied policy."
+ : L"Failed to apply policy."));
+}
+
void Policy::processReset()
{
auto success = Wfpctl_Reset();
diff --git a/wfpctl/src/extras/cli/commands/wfpctl/policy.h b/wfpctl/src/extras/cli/commands/wfpctl/policy.h
index 28d966fa21..524640d3e6 100644
--- a/wfpctl/src/extras/cli/commands/wfpctl/policy.h
+++ b/wfpctl/src/extras/cli/commands/wfpctl/policy.h
@@ -28,6 +28,7 @@ private:
void processConnecting(const KeyValuePairs &arguments);
void processConnected(const KeyValuePairs &arguments);
+ void processNetBlocked();
void processReset();
};