pkt_gen: MoonGen updated to keep parity with master
[vswitchperf.git] / core / vswitch_controller.py
index 1caf94f..855de8b 100644 (file)
@@ -20,12 +20,13 @@ class IVswitchController(object):
     This interface is used to setup and control a vSwitch provider for a
     particular deployment scenario.
     """
-    def setup(self):
+    def __enter__(self):
         """Sets up the switch for the particular deployment scenario
         """
         raise NotImplementedError(
             "The VswitchController does not implement the \"setup\" function.")
-    def stop(self):
+
+    def __exit__(self, type_, value, traceback):
         """Tears down the switch created in setup()
         """
         raise NotImplementedError(
@@ -48,3 +49,10 @@ class IVswitchController(object):
         raise NotImplementedError(
             "The VswitchController does not implement the \"get_ports_info\" "
             "function.")
+
+    def dump_vswitch_flows(self):
+        """ Dumps flows from vswitch
+        """
+        raise NotImplementedError(
+            "The VswitchController does not implement the "
+            "\"dump_vswitch_flows\" function.")