diff options
| author | Odd Stranne <odd@mullvad.net> | 2018-04-11 22:45:33 +0200 |
|---|---|---|
| committer | Odd Stranne <odd@mullvad.net> | 2018-04-11 22:45:33 +0200 |
| commit | d6bdf09ae0fd53b4541a99837a03c8aa6e31cee1 (patch) | |
| tree | ca09499334010ea620a092f32886e5996ad08370 /wfpctl/src/extras/cli | |
| parent | 0c6c767e265e186495dbaabc859c5844aeb15b41 (diff) | |
| download | mullvadvpn-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.cpp | 15 | ||||
| -rw-r--r-- | wfpctl/src/extras/cli/commands/wfpctl/policy.h | 1 |
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(); }; |
