of12: remove redundant action_ prefix from action classes
diff --git a/src/python/of12/action.py b/src/python/of12/action.py
index d67a16c..2ec7cfa 100644
--- a/src/python/of12/action.py
+++ b/src/python/of12/action.py
@@ -5,7 +5,7 @@
from match import roundup
from match_list import match_list
-class action_pop_mpls(ofp_action_pop_mpls):
+class pop_mpls(ofp_action_pop_mpls):
"""
Wrapper class for pop_mpls action object
@@ -25,7 +25,7 @@
return outstr
-class action_push_vlan(ofp_action_push):
+class push_vlan(ofp_action_push):
"""
Wrapper class for push_vlan action object
@@ -45,7 +45,7 @@
return outstr
-class action_experimenter(ofp_action_experimenter_header):
+class experimenter(ofp_action_experimenter_header):
"""
Wrapper class for experimenter action object
@@ -65,7 +65,7 @@
return outstr
-class action_dec_mpls_ttl(ofp_action_header):
+class dec_mpls_ttl(ofp_action_header):
"""
Wrapper class for dec_mpls_ttl action object
@@ -84,7 +84,7 @@
return outstr
-class action_set_nw_ttl(ofp_action_nw_ttl):
+class set_nw_ttl(ofp_action_nw_ttl):
"""
Wrapper class for set_nw_ttl action object
@@ -104,7 +104,7 @@
return outstr
-class action_copy_ttl_in(ofp_action_header):
+class copy_ttl_in(ofp_action_header):
"""
Wrapper class for copy_ttl_in action object
@@ -123,7 +123,7 @@
return outstr
-class action_group(ofp_action_group):
+class group(ofp_action_group):
"""
Wrapper class for group action object
@@ -145,7 +145,7 @@
return roundup(4 + 4,8)
-class action_set_queue(ofp_action_set_queue):
+class set_queue(ofp_action_set_queue):
"""
Wrapper class for set_queue action object
@@ -165,7 +165,7 @@
return outstr
-class action_push_mpls(ofp_action_push):
+class push_mpls(ofp_action_push):
"""
Wrapper class for push_mpls action object
@@ -185,7 +185,7 @@
return outstr
-class action_copy_ttl_out(ofp_action_header):
+class copy_ttl_out(ofp_action_header):
"""
Wrapper class for copy_ttl_out action object
@@ -204,7 +204,7 @@
return outstr
-class action_set_field(ofp_action_set_field):
+class set_field(ofp_action_set_field):
"""
Wrapper class for set_field action object
@@ -255,7 +255,7 @@
return roundup(4 + len(self.field),8)
-class action_set_mpls_ttl(ofp_action_mpls_ttl):
+class set_mpls_ttl(ofp_action_mpls_ttl):
"""
Wrapper class for set_mpls_ttl action object
@@ -275,7 +275,7 @@
return outstr
-class action_pop_vlan(ofp_action_header):
+class pop_vlan(ofp_action_header):
"""
Wrapper class for pop_vlan action object
@@ -294,7 +294,7 @@
return outstr
-class action_dec_nw_ttl(ofp_action_header):
+class dec_nw_ttl(ofp_action_header):
"""
Wrapper class for dec_nw_ttl action object
@@ -313,7 +313,7 @@
return outstr
-class action_output(ofp_action_output):
+class output(ofp_action_output):
"""
Wrapper class for output action object
@@ -334,19 +334,19 @@
return outstr
action_class_list = (
- action_copy_ttl_in,
- action_copy_ttl_out,
- action_dec_mpls_ttl,
- action_dec_nw_ttl,
- action_experimenter,
- action_group,
- action_output,
- action_pop_mpls,
- action_pop_vlan,
- action_push_mpls,
- action_push_vlan,
- action_set_field,
- action_set_mpls_ttl,
- action_set_nw_ttl,
- action_set_queue)
+ copy_ttl_in,
+ copy_ttl_out,
+ dec_mpls_ttl,
+ dec_nw_ttl,
+ experimenter,
+ group,
+ output,
+ pop_mpls,
+ pop_vlan,
+ push_mpls,
+ push_vlan,
+ set_field,
+ set_mpls_ttl,
+ set_nw_ttl,
+ set_queue)
diff --git a/src/python/of12/action_list.py b/src/python/of12/action_list.py
index c34f6af..f3c0723 100644
--- a/src/python/of12/action_list.py
+++ b/src/python/of12/action_list.py
@@ -8,21 +8,21 @@
import copy
action_object_map = {
- OFPAT_OUTPUT : action_output,
- OFPAT_SET_FIELD : action_set_field,
- OFPAT_COPY_TTL_OUT : action_copy_ttl_out,
- OFPAT_COPY_TTL_IN : action_copy_ttl_in,
- OFPAT_SET_MPLS_TTL : action_set_mpls_ttl,
- OFPAT_DEC_MPLS_TTL : action_dec_mpls_ttl,
- OFPAT_PUSH_VLAN : action_push_vlan,
- OFPAT_POP_VLAN : action_pop_vlan,
- OFPAT_PUSH_MPLS : action_push_mpls,
- OFPAT_POP_MPLS : action_pop_mpls,
- OFPAT_SET_QUEUE : action_set_queue,
- OFPAT_GROUP : action_group,
- OFPAT_SET_NW_TTL : action_set_nw_ttl,
- OFPAT_DEC_NW_TTL : action_dec_nw_ttl,
- OFPAT_EXPERIMENTER : action_experimenter
+ OFPAT_OUTPUT : output,
+ OFPAT_SET_FIELD : set_field,
+ OFPAT_COPY_TTL_OUT : copy_ttl_out,
+ OFPAT_COPY_TTL_IN : copy_ttl_in,
+ OFPAT_SET_MPLS_TTL : set_mpls_ttl,
+ OFPAT_DEC_MPLS_TTL : dec_mpls_ttl,
+ OFPAT_PUSH_VLAN : push_vlan,
+ OFPAT_POP_VLAN : pop_vlan,
+ OFPAT_PUSH_MPLS : push_mpls,
+ OFPAT_POP_MPLS : pop_mpls,
+ OFPAT_SET_QUEUE : set_queue,
+ OFPAT_GROUP : group,
+ OFPAT_SET_NW_TTL : set_nw_ttl,
+ OFPAT_DEC_NW_TTL : dec_nw_ttl,
+ OFPAT_EXPERIMENTER : experimenter
}
class action_list(ofp_base_list):
diff --git a/src/python/oftest/oft12/testutils.py b/src/python/oftest/oft12/testutils.py
index fbc1ad0..9a4325b 100644
--- a/src/python/oftest/oft12/testutils.py
+++ b/src/python/oftest/oft12/testutils.py
@@ -641,12 +641,12 @@
# Set up output/enqueue action if directed
if egr_queue is not None:
parent.assertTrue(egr_port is not None, "Egress port not set")
- act = action.action_set_queue()
+ act = action.set_queue()
act.port = egr_port
act.queue_id = egr_queue
action_list.append(act)
elif egr_port is not None:
- act = action.action_output()
+ act = action.output()
act.port = egr_port
action_list.append(act)
@@ -1042,41 +1042,41 @@
return None
if field_to_mod == 'dl_dst':
- act = action.action_set_dl_dst()
+ act = action.set_dl_dst()
act.dl_addr = parse.parse_mac(mod_field_vals['dl_dst'])
elif field_to_mod == 'dl_src':
- act = action.action_set_dl_src()
+ act = action.set_dl_src()
act.dl_addr = parse.parse_mac(mod_field_vals['dl_src'])
elif field_to_mod == 'vlan_tags':
if len(mod_field_vals['vlan_tags']):
- act = action.action_pop_vlan()
+ act = action.pop_vlan()
else:
pass
# elif field_to_mod == 'dl_vlan_enable':
# if not mod_field_vals['dl_vlan_enable']: # Strip VLAN tag
-# act = action.action_pop_vlan()
+# act = action.pop_vlan()
# # Add VLAN tag is handled by dl_vlan field
# # Will return None in this case
# elif field_to_mod == 'dl_vlan':
-# act = action.action_set_vlan_vid()
+# act = action.set_vlan_vid()
# act.vlan_vid = mod_field_vals['dl_vlan']
# elif field_to_mod == 'dl_vlan_pcp':
-# act = action.action_set_vlan_pcp()
+# act = action.set_vlan_pcp()
# act.vlan_pcp = mod_field_vals['dl_vlan_pcp']
elif field_to_mod == 'ip_src':
- act = action.action_set_nw_src()
+ act = action.set_nw_src()
act.nw_addr = parse.parse_ip(mod_field_vals['ip_src'])
elif field_to_mod == 'ip_dst':
- act = action.action_set_nw_dst()
+ act = action.set_nw_dst()
act.nw_addr = parse.parse_ip(mod_field_vals['ip_dst'])
elif field_to_mod == 'ip_tos':
- act = action.action_set_nw_tos()
+ act = action.set_nw_tos()
act.nw_tos = mod_field_vals['ip_tos']
elif field_to_mod == 'tcp_sport':
- act = action.action_set_tp_src()
+ act = action.set_tp_src()
act.tp_port = mod_field_vals['tcp_sport']
elif field_to_mod == 'tcp_dport':
- act = action.action_set_tp_dst()
+ act = action.set_tp_dst()
act.tp_port = mod_field_vals['tcp_dport']
else:
parent.assertTrue(0, "Unknown field to modify: " + str(field_to_mod))