fix inheritance fallout
Several places need updating to handle the new virtual classes.
diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py
index 9910b7f..c58a70a 100644
--- a/c_gen/c_test_gen.py
+++ b/c_gen/c_test_gen.py
@@ -1083,6 +1083,8 @@
for cls in of_g.ordered_messages:
if not (cls, version) in of_g.base_length:
continue
+ if type_maps.class_is_virtual(cls):
+ continue
bytes = of_g.base_length[(cls, version)] + of_g.extra_length.get((cls, version), 0)
out.write("""
static int
@@ -1136,6 +1138,8 @@
for cls in of_g.ordered_messages:
if not (cls, version) in of_g.base_length:
continue
+ if type_maps.class_is_virtual(cls):
+ continue
test_name = "%s_create_%s" % (cls, loxi_utils.version_to_name(version))
out.write(" RUN_TEST(%s);\n" % test_name)
diff --git a/loxi_front_end/type_maps.py b/loxi_front_end/type_maps.py
index f9a66f6..b64f1b5 100644
--- a/loxi_front_end/type_maps.py
+++ b/loxi_front_end/type_maps.py
@@ -154,6 +154,9 @@
return True
if loxi_utils.class_is_list(cls):
return True
+ # TODO get this from the input file when we have virtual class syntax
+ if cls in ["of_flow_mod", "of_stats_request", "of_stats_reply", "of_bsn_header", "of_nicira_header", "of_action_bsn", "of_action_nicira", "of_action_id_bsn", "of_action_id_nicira"]:
+ return True
return False
################################################################
diff --git a/loxi_utils/loxi_utils.py b/loxi_utils/loxi_utils.py
index 648e109..f5f9b63 100644
--- a/loxi_utils/loxi_utils.py
+++ b/loxi_utils/loxi_utils.py
@@ -417,7 +417,7 @@
# Is class a flow modify of some sort?
def cls_is_flow_mod(cls):
- return cls in ["of_flow_modify", "of_flow_add", "of_flow_delete",
+ return cls in ["of_flow_mod", "of_flow_modify", "of_flow_add", "of_flow_delete",
"of_flow_modify_strict", "of_flow_delete_strict"]
diff --git a/loxigen.py b/loxigen.py
index 36d6872..9bddf4b 100755
--- a/loxigen.py
+++ b/loxigen.py
@@ -359,10 +359,6 @@
else:
of_g.ordered_non_messages.append(cls)
- of_g.ordered_pseudo_objects.append("of_stats_request")
- of_g.ordered_pseudo_objects.append("of_stats_reply")
- of_g.ordered_pseudo_objects.append("of_flow_mod")
-
of_g.ordered_messages.sort()
of_g.ordered_pseudo_objects.sort()
of_g.ordered_non_messages.sort()
@@ -481,7 +477,7 @@
def find_experimenter(parent, cls):
for experimenter in sorted(of_g.experimenter_name_to_id.keys(), reverse=True):
prefix = parent + '_' + experimenter
- if cls.startswith(prefix):
+ if cls.startswith(prefix) and cls != prefix:
return experimenter
return None
@@ -520,7 +516,7 @@
# HACK (though this is what loxi_utils.class_is_message() does)
if not [x for x in ofclass.members if isinstance(x, OFDataMember) and x.name == 'xid']:
continue
- if cls == 'of_header':
+ if type_maps.class_is_virtual(cls):
continue
subcls = cls[3:]
val = find_type_value(ofclass, 'type')