patchpanel: move Datapath setup to Datapath

This patch moves all the initial setup for configuring the routing layer
from Manager to Datapath, making it all internal to Datapath. This
allows to refactor Datapath internals without impacting Manager and
allows to hide implementation details from the upper layer.

Incidentally, new unit tests are added for exercising the initial setup
and final tear down of the routing layer.

There is no functional change in this patch.

BUG=b:161507671
TEST=Unit tests.

Change-Id: Ia16648d70f15d741ae95d69becc6e41294e76abc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2397097
Tested-by: Hugo Benichi <hugobenichi@google.com>
Commit-Queue: Hugo Benichi <hugobenichi@google.com>
Reviewed-by: Garrick Evans <garrick@chromium.org>
diff --git a/patchpanel/datapath.h b/patchpanel/datapath.h
index ea7ae28..5ec53a5 100644
--- a/patchpanel/datapath.h
+++ b/patchpanel/datapath.h
@@ -53,6 +53,12 @@
            ioctl_t ioctl_hook);
   virtual ~Datapath() = default;
 
+  // Start and stop the Datapath, creating or destroying the initial iptables
+  // setup needed for forwarding traffic from VMs and containers and for
+  // fwmark based routing.
+  virtual void Start();
+  virtual void Stop();
+
   // Attaches the name |netns_name| to a network namespace identified by
   // |netns_pid|. If |netns_name| had already been created, it will be deleted
   // first.