do not include experimenter OXMs in of_oxm_type_to_id
This table is keyed by OXM type, not including the class. OXMs in different
classes will collide.
diff --git a/c_gen/c_type_maps.py b/c_gen/c_type_maps.py
index 9644fdb..49606ac 100644
--- a/c_gen/c_type_maps.py
+++ b/c_gen/c_type_maps.py
@@ -75,7 +75,8 @@
out.write(" %d%s /* %s */\n" %
(type_maps.type_val[("of_flow_mod", version)],
comma, cls))
- elif (cls, version) in type_maps.type_val:
+ elif (cls, version) in type_maps.type_val and \
+ type_maps.type_val[(cls, version)] != type_maps.invalid_type:
out.write(" %d%s /* %s */\n" %
(type_maps.type_val[(cls, version)], comma, cls))
elif type_maps.message_is_extension(cls, version):
diff --git a/loxigen.py b/loxigen.py
index f756dc0..05dd6b5 100755
--- a/loxigen.py
+++ b/loxigen.py
@@ -499,7 +499,13 @@
if not (parent and subcls):
continue
if parent == 'of_oxm':
- val = (find_type_value(ofclass, 'type_len') >> 8) & 0xff
+ type_len = find_type_value(ofclass, 'type_len')
+ oxm_class = (type_len >> 16) & 0xffff
+ if oxm_class != 0x8000:
+ # Do not include experimenter OXMs in the main table
+ val = type_maps.invalid_type
+ else:
+ val = (type_len >> 8) & 0xff
else:
val = find_type_value(ofclass, 'type')
type_maps.inheritance_data[parent][wire_version][subcls] = val