patchpanel: Implement ModifyPortRule API
Firewall is now moved from permission_broker to
patchpanel. Implement ModifyPortRule by calling
firewall.
BUG=b:160130580
TEST=tast run <DUT_IP> platform.Firewall
with chromium:2291865
Change-Id: I25e1cfdf512d63b05a83a532b05798e1df2dd9a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2291867
Commit-Queue: Jason Jeremy Iman <jasongustaman@chromium.org>
Tested-by: Jason Jeremy Iman <jasongustaman@chromium.org>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
Reviewed-by: Garrick Evans <garrick@chromium.org>
diff --git a/patchpanel/manager.h b/patchpanel/manager.h
index 5b83543..70f5a54 100644
--- a/patchpanel/manager.h
+++ b/patchpanel/manager.h
@@ -21,6 +21,7 @@
#include "patchpanel/address_manager.h"
#include "patchpanel/arc_service.h"
#include "patchpanel/crostini_service.h"
+#include "patchpanel/firewall.h"
#include "patchpanel/helper_process.h"
#include "patchpanel/network_monitor_service.h"
#include "patchpanel/routing_service.h"
@@ -156,6 +157,8 @@
// fd found.
void CheckConnectedNamespaces();
+ bool ModifyPortRule(const patchpanel::ModifyPortRuleRequest& request);
+
// Dispatch |msg| to child processes.
void SendGuestMessage(const GuestMessage& msg);
@@ -171,6 +174,9 @@
// DBus service.
dbus::ExportedObject* dbus_svc_path_; // Owned by |bus_|.
+ // Firewall service.
+ Firewall firewall_;
+
// Other services.
brillo::ProcessReaper process_reaper_;
std::unique_ptr<HelperProcess> adb_proxy_;