loxi-prep: subtype flow_mod classes
diff --git a/src/python/of10/message.py b/src/python/of10/message.py
index 6acb063..b52d40f 100644
--- a/src/python/of10/message.py
+++ b/src/python/of10/message.py
@@ -3448,3 +3448,32 @@
vendor
)
+
+_flow_mod = flow_mod
+flow_mod = None
+
+class flow_add(_flow_mod):
+ def __init__(self, **kwargs):
+ _flow_mod.__init__(self, **kwargs)
+ self.command = OFPFC_ADD
+
+class flow_modify(_flow_mod):
+ def __init__(self, **kwargs):
+ _flow_mod.__init__(self, **kwargs)
+ self.command = OFPFC_MODIFY
+
+class flow_modify_strict(_flow_mod):
+ def __init__(self, **kwargs):
+ _flow_mod.__init__(self, **kwargs)
+ self.command = OFPFC_MODIFY_STRICT
+
+class flow_delete(_flow_mod):
+ def __init__(self, **kwargs):
+ _flow_mod.__init__(self, **kwargs)
+ self.command = OFPFC_DELETE
+
+class flow_delete_strict(_flow_mod):
+ def __init__(self, **kwargs):
+ _flow_mod.__init__(self, **kwargs)
+ self.command = OFPFC_DELETE_STRICT
+
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index a14eab1..a1db2e0 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -40,10 +40,9 @@
"""
logging.info("Deleting all flows")
- msg = of10.message.flow_mod()
+ msg = of10.message.flow_delete()
msg.match.wildcards = of10.OFPFW_ALL
msg.out_port = of10.OFPP_NONE
- msg.command = of10.OFPFC_DELETE
msg.buffer_id = 0xffffffff
ctrl.message_send(msg)
return 0 # for backwards compatibility
@@ -574,7 +573,7 @@
else:
egr_port_list = [egr_ports]
- request = of10.message.flow_mod()
+ request = of10.message.flow_add()
request.match = match
request.buffer_id = 0xffffffff
if check_expire:
@@ -969,7 +968,7 @@
# Generate a simple "drop" flow mod
# If in_band is true, then only drop from first test port
def flow_mod_gen(port_map, in_band):
- request = of10.message.flow_mod()
+ request = of10.message.flow_add()
request.match.wildcards = of10.OFPFW_ALL
if in_band:
request.match.wildcards = of10.OFPFW_ALL - of10.OFPFW_IN_PORT