update pyloxi to 026ff024585f1588a7f11fa4c1a9a48d44dc098d
diff --git a/src/python/loxi/of13/oxm.py b/src/python/loxi/of13/oxm.py
index de53112..2abee43 100644
--- a/src/python/loxi/of13/oxm.py
+++ b/src/python/loxi/of13/oxm.py
@@ -3,31 +3,36 @@
 # Copyright (c) 2012, 2013 Big Switch Networks, Inc.
 # See the file LICENSE.pyloxi which should have been included in the source distribution
 
-# Automatically generated by LOXI from template oxm.py
+# Automatically generated by LOXI from template module.py
 # Do not modify
 
 import struct
+import loxi
 import const
+import common
+import action
+import instruction
+import oxm
+import action_id
+import instruction_id
+import meter_band
 import util
 import loxi.generic_util
-import loxi
 
-def unpack(reader):
-    type_len, = reader.peek('!L')
-    if type_len in parsers:
-        return parsers[type_len](reader)
-    else:
-        raise loxi.ProtocolError("unknown OXM cls=%#x type=%#x masked=%d len=%d (%#x)" % \
-            ((type_len >> 16) & 0xffff, (type_len >> 9) & 0x7f, (type_len >> 8) & 1, type_len & 0xff, type_len))
+class oxm(loxi.OFObject):
+    subtypes = {}
 
-def unpack_list(reader):
-    return loxi.generic_util.unpack_list(reader, unpack)
+    @staticmethod
+    def unpack(reader):
+        subtype, = reader.peek('!L', 0)
+        try:
+            subclass = oxm.subtypes[subtype]
+        except KeyError:
+            raise loxi.ProtocolError("unknown oxm subtype %#x" % subtype)
+        return subclass.unpack(reader)
 
-class OXM(object):
-    type_len = None # override in subclass
-    pass
 
-class arp_op(OXM):
+class arp_op(oxm):
     type_len = 2147494402
 
     def __init__(self, value=None):
@@ -35,6 +40,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -43,12 +49,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_op()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147494402)
         obj.value = reader.read("!H")[0]
@@ -59,13 +61,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_op {")
         with q.group():
@@ -76,7 +71,9 @@
             q.breakable()
         q.text('}')
 
-class arp_op_masked(OXM):
+oxm.subtypes[2147494402] = arp_op
+
+class arp_op_masked(oxm):
     type_len = 2147494660
 
     def __init__(self, value=None, value_mask=None):
@@ -88,6 +85,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -97,12 +95,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_op_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147494660)
         obj.value = reader.read("!H")[0]
@@ -115,13 +109,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_op_masked {")
         with q.group():
@@ -135,7 +122,9 @@
             q.breakable()
         q.text('}')
 
-class arp_sha(OXM):
+oxm.subtypes[2147494660] = arp_op_masked
+
+class arp_sha(oxm):
     type_len = 2147495942
 
     def __init__(self, value=None):
@@ -143,6 +132,7 @@
             self.value = value
         else:
             self.value = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -151,12 +141,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_sha()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147495942)
         obj.value = list(reader.read('!6B'))
@@ -167,13 +153,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_sha {")
         with q.group():
@@ -184,7 +163,9 @@
             q.breakable()
         q.text('}')
 
-class arp_sha_masked(OXM):
+oxm.subtypes[2147495942] = arp_sha
+
+class arp_sha_masked(oxm):
     type_len = 2147496204
 
     def __init__(self, value=None, value_mask=None):
@@ -196,6 +177,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -205,12 +187,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_sha_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147496204)
         obj.value = list(reader.read('!6B'))
@@ -223,13 +201,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_sha_masked {")
         with q.group():
@@ -243,7 +214,9 @@
             q.breakable()
         q.text('}')
 
-class arp_spa(OXM):
+oxm.subtypes[2147496204] = arp_sha_masked
+
+class arp_spa(oxm):
     type_len = 2147494916
 
     def __init__(self, value=None):
@@ -251,6 +224,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -259,12 +233,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_spa()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147494916)
         obj.value = reader.read("!L")[0]
@@ -275,13 +245,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_spa {")
         with q.group():
@@ -292,7 +255,9 @@
             q.breakable()
         q.text('}')
 
-class arp_spa_masked(OXM):
+oxm.subtypes[2147494916] = arp_spa
+
+class arp_spa_masked(oxm):
     type_len = 2147495176
 
     def __init__(self, value=None, value_mask=None):
@@ -304,6 +269,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -313,12 +279,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_spa_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147495176)
         obj.value = reader.read("!L")[0]
@@ -331,13 +293,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_spa_masked {")
         with q.group():
@@ -351,7 +306,9 @@
             q.breakable()
         q.text('}')
 
-class arp_tha(OXM):
+oxm.subtypes[2147495176] = arp_spa_masked
+
+class arp_tha(oxm):
     type_len = 2147496454
 
     def __init__(self, value=None):
@@ -359,6 +316,7 @@
             self.value = value
         else:
             self.value = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -367,12 +325,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_tha()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147496454)
         obj.value = list(reader.read('!6B'))
@@ -383,13 +337,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_tha {")
         with q.group():
@@ -400,7 +347,9 @@
             q.breakable()
         q.text('}')
 
-class arp_tha_masked(OXM):
+oxm.subtypes[2147496454] = arp_tha
+
+class arp_tha_masked(oxm):
     type_len = 2147496716
 
     def __init__(self, value=None, value_mask=None):
@@ -412,6 +361,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -421,12 +371,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_tha_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147496716)
         obj.value = list(reader.read('!6B'))
@@ -439,13 +385,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_tha_masked {")
         with q.group():
@@ -459,7 +398,9 @@
             q.breakable()
         q.text('}')
 
-class arp_tpa(OXM):
+oxm.subtypes[2147496716] = arp_tha_masked
+
+class arp_tpa(oxm):
     type_len = 2147495428
 
     def __init__(self, value=None):
@@ -467,6 +408,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -475,12 +417,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_tpa()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147495428)
         obj.value = reader.read("!L")[0]
@@ -491,13 +429,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_tpa {")
         with q.group():
@@ -508,7 +439,9 @@
             q.breakable()
         q.text('}')
 
-class arp_tpa_masked(OXM):
+oxm.subtypes[2147495428] = arp_tpa
+
+class arp_tpa_masked(oxm):
     type_len = 2147495688
 
     def __init__(self, value=None, value_mask=None):
@@ -520,6 +453,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -529,12 +463,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = arp_tpa_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147495688)
         obj.value = reader.read("!L")[0]
@@ -547,13 +477,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("arp_tpa_masked {")
         with q.group():
@@ -567,7 +490,9 @@
             q.breakable()
         q.text('}')
 
-class bsn_global_vrf_allowed(OXM):
+oxm.subtypes[2147495688] = arp_tpa_masked
+
+class bsn_global_vrf_allowed(oxm):
     type_len = 198145
 
     def __init__(self, value=None):
@@ -575,6 +500,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -583,12 +509,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_global_vrf_allowed()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 198145)
         obj.value = reader.read("!B")[0]
@@ -599,13 +521,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_global_vrf_allowed {")
         with q.group():
@@ -616,8 +531,10 @@
             q.breakable()
         q.text('}')
 
-class bsn_global_vrf_allowed_masked(OXM):
-    type_len = 198401
+oxm.subtypes[198145] = bsn_global_vrf_allowed
+
+class bsn_global_vrf_allowed_masked(oxm):
+    type_len = 198402
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -628,6 +545,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -637,14 +555,10 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_global_vrf_allowed_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
-        assert(_type_len == 198401)
+        assert(_type_len == 198402)
         obj.value = reader.read("!B")[0]
         obj.value_mask = reader.read("!B")[0]
         return obj
@@ -655,13 +569,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_global_vrf_allowed_masked {")
         with q.group():
@@ -675,14 +582,17 @@
             q.breakable()
         q.text('}')
 
-class bsn_in_ports_128(OXM):
-    type_len = 196640
+oxm.subtypes[198402] = bsn_global_vrf_allowed_masked
+
+class bsn_in_ports_128(oxm):
+    type_len = 196624
 
     def __init__(self, value=None):
         if value != None:
             self.value = value
         else:
             self.value = set()
+        return
 
     def pack(self):
         packed = []
@@ -691,14 +601,10 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_in_ports_128()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
-        assert(_type_len == 196640)
+        assert(_type_len == 196624)
         obj.value = util.unpack_bitmap_128(reader)
         return obj
 
@@ -707,13 +613,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_in_ports_128 {")
         with q.group():
@@ -724,7 +623,9 @@
             q.breakable()
         q.text('}')
 
-class bsn_in_ports_128_masked(OXM):
+oxm.subtypes[196624] = bsn_in_ports_128
+
+class bsn_in_ports_128_masked(oxm):
     type_len = 196896
 
     def __init__(self, value=None, value_mask=None):
@@ -736,6 +637,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = set()
+        return
 
     def pack(self):
         packed = []
@@ -745,12 +647,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_in_ports_128_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 196896)
         obj.value = util.unpack_bitmap_128(reader)
@@ -763,13 +661,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_in_ports_128_masked {")
         with q.group():
@@ -783,7 +674,9 @@
             q.breakable()
         q.text('}')
 
-class bsn_l3_dst_class_id(OXM):
+oxm.subtypes[196896] = bsn_in_ports_128_masked
+
+class bsn_l3_dst_class_id(oxm):
     type_len = 199684
 
     def __init__(self, value=None):
@@ -791,6 +684,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -799,12 +693,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_l3_dst_class_id()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 199684)
         obj.value = reader.read("!L")[0]
@@ -815,13 +705,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_l3_dst_class_id {")
         with q.group():
@@ -832,8 +715,10 @@
             q.breakable()
         q.text('}')
 
-class bsn_l3_dst_class_id_masked(OXM):
-    type_len = 199940
+oxm.subtypes[199684] = bsn_l3_dst_class_id
+
+class bsn_l3_dst_class_id_masked(oxm):
+    type_len = 199944
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -844,6 +729,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -853,14 +739,10 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_l3_dst_class_id_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
-        assert(_type_len == 199940)
+        assert(_type_len == 199944)
         obj.value = reader.read("!L")[0]
         obj.value_mask = reader.read("!L")[0]
         return obj
@@ -871,13 +753,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_l3_dst_class_id_masked {")
         with q.group():
@@ -891,7 +766,9 @@
             q.breakable()
         q.text('}')
 
-class bsn_l3_interface_class_id(OXM):
+oxm.subtypes[199944] = bsn_l3_dst_class_id_masked
+
+class bsn_l3_interface_class_id(oxm):
     type_len = 198660
 
     def __init__(self, value=None):
@@ -899,6 +776,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -907,12 +785,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_l3_interface_class_id()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 198660)
         obj.value = reader.read("!L")[0]
@@ -923,13 +797,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_l3_interface_class_id {")
         with q.group():
@@ -940,8 +807,10 @@
             q.breakable()
         q.text('}')
 
-class bsn_l3_interface_class_id_masked(OXM):
-    type_len = 198916
+oxm.subtypes[198660] = bsn_l3_interface_class_id
+
+class bsn_l3_interface_class_id_masked(oxm):
+    type_len = 198920
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -952,6 +821,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -961,14 +831,10 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_l3_interface_class_id_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
-        assert(_type_len == 198916)
+        assert(_type_len == 198920)
         obj.value = reader.read("!L")[0]
         obj.value_mask = reader.read("!L")[0]
         return obj
@@ -979,13 +845,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_l3_interface_class_id_masked {")
         with q.group():
@@ -999,7 +858,9 @@
             q.breakable()
         q.text('}')
 
-class bsn_l3_src_class_id(OXM):
+oxm.subtypes[198920] = bsn_l3_interface_class_id_masked
+
+class bsn_l3_src_class_id(oxm):
     type_len = 199172
 
     def __init__(self, value=None):
@@ -1007,6 +868,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1015,12 +877,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_l3_src_class_id()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 199172)
         obj.value = reader.read("!L")[0]
@@ -1031,13 +889,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_l3_src_class_id {")
         with q.group():
@@ -1048,8 +899,10 @@
             q.breakable()
         q.text('}')
 
-class bsn_l3_src_class_id_masked(OXM):
-    type_len = 199428
+oxm.subtypes[199172] = bsn_l3_src_class_id
+
+class bsn_l3_src_class_id_masked(oxm):
+    type_len = 199432
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1060,6 +913,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -1069,14 +923,10 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_l3_src_class_id_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
-        assert(_type_len == 199428)
+        assert(_type_len == 199432)
         obj.value = reader.read("!L")[0]
         obj.value_mask = reader.read("!L")[0]
         return obj
@@ -1087,13 +937,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_l3_src_class_id_masked {")
         with q.group():
@@ -1107,7 +950,9 @@
             q.breakable()
         q.text('}')
 
-class bsn_lag_id(OXM):
+oxm.subtypes[199432] = bsn_l3_src_class_id_masked
+
+class bsn_lag_id(oxm):
     type_len = 197124
 
     def __init__(self, value=None):
@@ -1115,6 +960,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1123,12 +969,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_lag_id()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 197124)
         obj.value = reader.read("!L")[0]
@@ -1139,13 +981,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_lag_id {")
         with q.group():
@@ -1156,8 +991,10 @@
             q.breakable()
         q.text('}')
 
-class bsn_lag_id_masked(OXM):
-    type_len = 197380
+oxm.subtypes[197124] = bsn_lag_id
+
+class bsn_lag_id_masked(oxm):
+    type_len = 197384
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1168,6 +1005,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -1177,14 +1015,10 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_lag_id_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
-        assert(_type_len == 197380)
+        assert(_type_len == 197384)
         obj.value = reader.read("!L")[0]
         obj.value_mask = reader.read("!L")[0]
         return obj
@@ -1195,13 +1029,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_lag_id_masked {")
         with q.group():
@@ -1215,7 +1042,9 @@
             q.breakable()
         q.text('}')
 
-class bsn_vrf(OXM):
+oxm.subtypes[197384] = bsn_lag_id_masked
+
+class bsn_vrf(oxm):
     type_len = 197636
 
     def __init__(self, value=None):
@@ -1223,6 +1052,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1231,12 +1061,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_vrf()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 197636)
         obj.value = reader.read("!L")[0]
@@ -1247,13 +1073,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_vrf {")
         with q.group():
@@ -1264,8 +1083,10 @@
             q.breakable()
         q.text('}')
 
-class bsn_vrf_masked(OXM):
-    type_len = 197892
+oxm.subtypes[197636] = bsn_vrf
+
+class bsn_vrf_masked(oxm):
+    type_len = 197896
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1276,6 +1097,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -1285,14 +1107,10 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = bsn_vrf_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
-        assert(_type_len == 197892)
+        assert(_type_len == 197896)
         obj.value = reader.read("!L")[0]
         obj.value_mask = reader.read("!L")[0]
         return obj
@@ -1303,13 +1121,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("bsn_vrf_masked {")
         with q.group():
@@ -1323,7 +1134,9 @@
             q.breakable()
         q.text('}')
 
-class eth_dst(OXM):
+oxm.subtypes[197896] = bsn_vrf_masked
+
+class eth_dst(oxm):
     type_len = 2147485190
 
     def __init__(self, value=None):
@@ -1331,6 +1144,7 @@
             self.value = value
         else:
             self.value = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -1339,12 +1153,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = eth_dst()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147485190)
         obj.value = list(reader.read('!6B'))
@@ -1355,13 +1165,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("eth_dst {")
         with q.group():
@@ -1372,7 +1175,9 @@
             q.breakable()
         q.text('}')
 
-class eth_dst_masked(OXM):
+oxm.subtypes[2147485190] = eth_dst
+
+class eth_dst_masked(oxm):
     type_len = 2147485452
 
     def __init__(self, value=None, value_mask=None):
@@ -1384,6 +1189,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -1393,12 +1199,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = eth_dst_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147485452)
         obj.value = list(reader.read('!6B'))
@@ -1411,13 +1213,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("eth_dst_masked {")
         with q.group():
@@ -1431,7 +1226,9 @@
             q.breakable()
         q.text('}')
 
-class eth_src(OXM):
+oxm.subtypes[2147485452] = eth_dst_masked
+
+class eth_src(oxm):
     type_len = 2147485702
 
     def __init__(self, value=None):
@@ -1439,6 +1236,7 @@
             self.value = value
         else:
             self.value = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -1447,12 +1245,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = eth_src()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147485702)
         obj.value = list(reader.read('!6B'))
@@ -1463,13 +1257,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("eth_src {")
         with q.group():
@@ -1480,7 +1267,9 @@
             q.breakable()
         q.text('}')
 
-class eth_src_masked(OXM):
+oxm.subtypes[2147485702] = eth_src
+
+class eth_src_masked(oxm):
     type_len = 2147485964
 
     def __init__(self, value=None, value_mask=None):
@@ -1492,6 +1281,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -1501,12 +1291,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = eth_src_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147485964)
         obj.value = list(reader.read('!6B'))
@@ -1519,13 +1305,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("eth_src_masked {")
         with q.group():
@@ -1539,7 +1318,9 @@
             q.breakable()
         q.text('}')
 
-class eth_type(OXM):
+oxm.subtypes[2147485964] = eth_src_masked
+
+class eth_type(oxm):
     type_len = 2147486210
 
     def __init__(self, value=None):
@@ -1547,6 +1328,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1555,12 +1337,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = eth_type()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147486210)
         obj.value = reader.read("!H")[0]
@@ -1571,13 +1349,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("eth_type {")
         with q.group():
@@ -1588,7 +1359,9 @@
             q.breakable()
         q.text('}')
 
-class eth_type_masked(OXM):
+oxm.subtypes[2147486210] = eth_type
+
+class eth_type_masked(oxm):
     type_len = 2147486468
 
     def __init__(self, value=None, value_mask=None):
@@ -1600,6 +1373,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -1609,12 +1383,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = eth_type_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147486468)
         obj.value = reader.read("!H")[0]
@@ -1627,13 +1397,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("eth_type_masked {")
         with q.group():
@@ -1647,7 +1410,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv4_code(OXM):
+oxm.subtypes[2147486468] = eth_type_masked
+
+class icmpv4_code(oxm):
     type_len = 2147493889
 
     def __init__(self, value=None):
@@ -1655,6 +1420,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1663,12 +1429,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv4_code()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147493889)
         obj.value = reader.read("!B")[0]
@@ -1679,13 +1441,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv4_code {")
         with q.group():
@@ -1696,7 +1451,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv4_code_masked(OXM):
+oxm.subtypes[2147493889] = icmpv4_code
+
+class icmpv4_code_masked(oxm):
     type_len = 2147494146
 
     def __init__(self, value=None, value_mask=None):
@@ -1708,6 +1465,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -1717,12 +1475,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv4_code_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147494146)
         obj.value = reader.read("!B")[0]
@@ -1735,13 +1489,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv4_code_masked {")
         with q.group():
@@ -1755,7 +1502,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv4_type(OXM):
+oxm.subtypes[2147494146] = icmpv4_code_masked
+
+class icmpv4_type(oxm):
     type_len = 2147493377
 
     def __init__(self, value=None):
@@ -1763,6 +1512,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1771,12 +1521,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv4_type()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147493377)
         obj.value = reader.read("!B")[0]
@@ -1787,13 +1533,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv4_type {")
         with q.group():
@@ -1804,7 +1543,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv4_type_masked(OXM):
+oxm.subtypes[2147493377] = icmpv4_type
+
+class icmpv4_type_masked(oxm):
     type_len = 2147493634
 
     def __init__(self, value=None, value_mask=None):
@@ -1816,6 +1557,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -1825,12 +1567,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv4_type_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147493634)
         obj.value = reader.read("!B")[0]
@@ -1843,13 +1581,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv4_type_masked {")
         with q.group():
@@ -1863,7 +1594,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv6_code(OXM):
+oxm.subtypes[2147493634] = icmpv4_type_masked
+
+class icmpv6_code(oxm):
     type_len = 2147499009
 
     def __init__(self, value=None):
@@ -1871,6 +1604,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1879,12 +1613,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv6_code()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147499009)
         obj.value = reader.read("!B")[0]
@@ -1895,13 +1625,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv6_code {")
         with q.group():
@@ -1912,7 +1635,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv6_code_masked(OXM):
+oxm.subtypes[2147499009] = icmpv6_code
+
+class icmpv6_code_masked(oxm):
     type_len = 2147499266
 
     def __init__(self, value=None, value_mask=None):
@@ -1924,6 +1649,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -1933,12 +1659,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv6_code_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147499266)
         obj.value = reader.read("!B")[0]
@@ -1951,13 +1673,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv6_code_masked {")
         with q.group():
@@ -1971,7 +1686,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv6_type(OXM):
+oxm.subtypes[2147499266] = icmpv6_code_masked
+
+class icmpv6_type(oxm):
     type_len = 2147498497
 
     def __init__(self, value=None):
@@ -1979,6 +1696,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -1987,12 +1705,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv6_type()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147498497)
         obj.value = reader.read("!B")[0]
@@ -2003,13 +1717,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv6_type {")
         with q.group():
@@ -2020,7 +1727,9 @@
             q.breakable()
         q.text('}')
 
-class icmpv6_type_masked(OXM):
+oxm.subtypes[2147498497] = icmpv6_type
+
+class icmpv6_type_masked(oxm):
     type_len = 2147498754
 
     def __init__(self, value=None, value_mask=None):
@@ -2032,6 +1741,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2041,12 +1751,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = icmpv6_type_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147498754)
         obj.value = reader.read("!B")[0]
@@ -2059,13 +1765,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("icmpv6_type_masked {")
         with q.group():
@@ -2079,7 +1778,9 @@
             q.breakable()
         q.text('}')
 
-class in_phy_port(OXM):
+oxm.subtypes[2147498754] = icmpv6_type_masked
+
+class in_phy_port(oxm):
     type_len = 2147484164
 
     def __init__(self, value=None):
@@ -2087,6 +1788,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2095,12 +1797,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = in_phy_port()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147484164)
         obj.value = util.unpack_port_no(reader)
@@ -2111,13 +1809,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("in_phy_port {")
         with q.group():
@@ -2128,7 +1819,9 @@
             q.breakable()
         q.text('}')
 
-class in_phy_port_masked(OXM):
+oxm.subtypes[2147484164] = in_phy_port
+
+class in_phy_port_masked(oxm):
     type_len = 2147484424
 
     def __init__(self, value=None, value_mask=None):
@@ -2140,6 +1833,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2149,12 +1843,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = in_phy_port_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147484424)
         obj.value = util.unpack_port_no(reader)
@@ -2167,13 +1857,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("in_phy_port_masked {")
         with q.group():
@@ -2187,7 +1870,9 @@
             q.breakable()
         q.text('}')
 
-class in_port(OXM):
+oxm.subtypes[2147484424] = in_phy_port_masked
+
+class in_port(oxm):
     type_len = 2147483652
 
     def __init__(self, value=None):
@@ -2195,6 +1880,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2203,12 +1889,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = in_port()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147483652)
         obj.value = util.unpack_port_no(reader)
@@ -2219,13 +1901,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("in_port {")
         with q.group():
@@ -2236,7 +1911,9 @@
             q.breakable()
         q.text('}')
 
-class in_port_masked(OXM):
+oxm.subtypes[2147483652] = in_port
+
+class in_port_masked(oxm):
     type_len = 2147483912
 
     def __init__(self, value=None, value_mask=None):
@@ -2248,6 +1925,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2257,12 +1935,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = in_port_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147483912)
         obj.value = util.unpack_port_no(reader)
@@ -2275,13 +1949,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("in_port_masked {")
         with q.group():
@@ -2295,7 +1962,9 @@
             q.breakable()
         q.text('}')
 
-class ip_dscp(OXM):
+oxm.subtypes[2147483912] = in_port_masked
+
+class ip_dscp(oxm):
     type_len = 2147487745
 
     def __init__(self, value=None):
@@ -2303,6 +1972,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2311,12 +1981,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ip_dscp()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147487745)
         obj.value = reader.read("!B")[0]
@@ -2327,13 +1993,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ip_dscp {")
         with q.group():
@@ -2344,7 +2003,9 @@
             q.breakable()
         q.text('}')
 
-class ip_dscp_masked(OXM):
+oxm.subtypes[2147487745] = ip_dscp
+
+class ip_dscp_masked(oxm):
     type_len = 2147488002
 
     def __init__(self, value=None, value_mask=None):
@@ -2356,6 +2017,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2365,12 +2027,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ip_dscp_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147488002)
         obj.value = reader.read("!B")[0]
@@ -2383,13 +2041,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ip_dscp_masked {")
         with q.group():
@@ -2403,7 +2054,9 @@
             q.breakable()
         q.text('}')
 
-class ip_ecn(OXM):
+oxm.subtypes[2147488002] = ip_dscp_masked
+
+class ip_ecn(oxm):
     type_len = 2147488257
 
     def __init__(self, value=None):
@@ -2411,6 +2064,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2419,12 +2073,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ip_ecn()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147488257)
         obj.value = reader.read("!B")[0]
@@ -2435,13 +2085,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ip_ecn {")
         with q.group():
@@ -2452,7 +2095,9 @@
             q.breakable()
         q.text('}')
 
-class ip_ecn_masked(OXM):
+oxm.subtypes[2147488257] = ip_ecn
+
+class ip_ecn_masked(oxm):
     type_len = 2147488514
 
     def __init__(self, value=None, value_mask=None):
@@ -2464,6 +2109,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2473,12 +2119,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ip_ecn_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147488514)
         obj.value = reader.read("!B")[0]
@@ -2491,13 +2133,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ip_ecn_masked {")
         with q.group():
@@ -2511,7 +2146,9 @@
             q.breakable()
         q.text('}')
 
-class ip_proto(OXM):
+oxm.subtypes[2147488514] = ip_ecn_masked
+
+class ip_proto(oxm):
     type_len = 2147488769
 
     def __init__(self, value=None):
@@ -2519,6 +2156,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2527,12 +2165,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ip_proto()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147488769)
         obj.value = reader.read("!B")[0]
@@ -2543,13 +2177,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ip_proto {")
         with q.group():
@@ -2560,7 +2187,9 @@
             q.breakable()
         q.text('}')
 
-class ip_proto_masked(OXM):
+oxm.subtypes[2147488769] = ip_proto
+
+class ip_proto_masked(oxm):
     type_len = 2147489026
 
     def __init__(self, value=None, value_mask=None):
@@ -2572,6 +2201,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2581,12 +2211,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ip_proto_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147489026)
         obj.value = reader.read("!B")[0]
@@ -2599,13 +2225,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ip_proto_masked {")
         with q.group():
@@ -2619,7 +2238,9 @@
             q.breakable()
         q.text('}')
 
-class ipv4_dst(OXM):
+oxm.subtypes[2147489026] = ip_proto_masked
+
+class ipv4_dst(oxm):
     type_len = 2147489796
 
     def __init__(self, value=None):
@@ -2627,6 +2248,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2635,12 +2257,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv4_dst()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147489796)
         obj.value = reader.read("!L")[0]
@@ -2651,13 +2269,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv4_dst {")
         with q.group():
@@ -2668,7 +2279,9 @@
             q.breakable()
         q.text('}')
 
-class ipv4_dst_masked(OXM):
+oxm.subtypes[2147489796] = ipv4_dst
+
+class ipv4_dst_masked(oxm):
     type_len = 2147490056
 
     def __init__(self, value=None, value_mask=None):
@@ -2680,6 +2293,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2689,12 +2303,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv4_dst_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147490056)
         obj.value = reader.read("!L")[0]
@@ -2707,13 +2317,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv4_dst_masked {")
         with q.group():
@@ -2727,7 +2330,9 @@
             q.breakable()
         q.text('}')
 
-class ipv4_src(OXM):
+oxm.subtypes[2147490056] = ipv4_dst_masked
+
+class ipv4_src(oxm):
     type_len = 2147489284
 
     def __init__(self, value=None):
@@ -2735,6 +2340,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2743,12 +2349,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv4_src()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147489284)
         obj.value = reader.read("!L")[0]
@@ -2759,13 +2361,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv4_src {")
         with q.group():
@@ -2776,7 +2371,9 @@
             q.breakable()
         q.text('}')
 
-class ipv4_src_masked(OXM):
+oxm.subtypes[2147489284] = ipv4_src
+
+class ipv4_src_masked(oxm):
     type_len = 2147489544
 
     def __init__(self, value=None, value_mask=None):
@@ -2788,6 +2385,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -2797,12 +2395,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv4_src_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147489544)
         obj.value = reader.read("!L")[0]
@@ -2815,13 +2409,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv4_src_masked {")
         with q.group():
@@ -2835,7 +2422,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_dst(OXM):
+oxm.subtypes[2147489544] = ipv4_src_masked
+
+class ipv6_dst(oxm):
     type_len = 2147497488
 
     def __init__(self, value=None):
@@ -2843,6 +2432,7 @@
             self.value = value
         else:
             self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+        return
 
     def pack(self):
         packed = []
@@ -2851,12 +2441,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_dst()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147497488)
         obj.value = reader.read('!16s')[0]
@@ -2867,13 +2453,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_dst {")
         with q.group():
@@ -2884,7 +2463,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_dst_masked(OXM):
+oxm.subtypes[2147497488] = ipv6_dst
+
+class ipv6_dst_masked(oxm):
     type_len = 2147497760
 
     def __init__(self, value=None, value_mask=None):
@@ -2896,6 +2477,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+        return
 
     def pack(self):
         packed = []
@@ -2905,12 +2487,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_dst_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147497760)
         obj.value = reader.read('!16s')[0]
@@ -2923,13 +2501,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_dst_masked {")
         with q.group():
@@ -2943,7 +2514,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_flabel(OXM):
+oxm.subtypes[2147497760] = ipv6_dst_masked
+
+class ipv6_flabel(oxm):
     type_len = 2147497988
 
     def __init__(self, value=None):
@@ -2951,6 +2524,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -2959,12 +2533,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_flabel()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147497988)
         obj.value = reader.read("!L")[0]
@@ -2975,13 +2545,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_flabel {")
         with q.group():
@@ -2992,7 +2555,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_flabel_masked(OXM):
+oxm.subtypes[2147497988] = ipv6_flabel
+
+class ipv6_flabel_masked(oxm):
     type_len = 2147498248
 
     def __init__(self, value=None, value_mask=None):
@@ -3004,6 +2569,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -3013,12 +2579,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_flabel_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147498248)
         obj.value = reader.read("!L")[0]
@@ -3031,13 +2593,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_flabel_masked {")
         with q.group():
@@ -3051,7 +2606,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_nd_sll(OXM):
+oxm.subtypes[2147498248] = ipv6_flabel_masked
+
+class ipv6_nd_sll(oxm):
     type_len = 2147500038
 
     def __init__(self, value=None):
@@ -3059,6 +2616,7 @@
             self.value = value
         else:
             self.value = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -3067,12 +2625,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_nd_sll()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147500038)
         obj.value = list(reader.read('!6B'))
@@ -3083,13 +2637,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_nd_sll {")
         with q.group():
@@ -3100,7 +2647,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_nd_sll_masked(OXM):
+oxm.subtypes[2147500038] = ipv6_nd_sll
+
+class ipv6_nd_sll_masked(oxm):
     type_len = 2147500300
 
     def __init__(self, value=None, value_mask=None):
@@ -3112,6 +2661,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -3121,12 +2671,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_nd_sll_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147500300)
         obj.value = list(reader.read('!6B'))
@@ -3139,13 +2685,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_nd_sll_masked {")
         with q.group():
@@ -3159,7 +2698,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_nd_target(OXM):
+oxm.subtypes[2147500300] = ipv6_nd_sll_masked
+
+class ipv6_nd_target(oxm):
     type_len = 2147499536
 
     def __init__(self, value=None):
@@ -3167,6 +2708,7 @@
             self.value = value
         else:
             self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+        return
 
     def pack(self):
         packed = []
@@ -3175,12 +2717,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_nd_target()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147499536)
         obj.value = reader.read('!16s')[0]
@@ -3191,13 +2729,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_nd_target {")
         with q.group():
@@ -3208,7 +2739,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_nd_target_masked(OXM):
+oxm.subtypes[2147499536] = ipv6_nd_target
+
+class ipv6_nd_target_masked(oxm):
     type_len = 2147499808
 
     def __init__(self, value=None, value_mask=None):
@@ -3220,6 +2753,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+        return
 
     def pack(self):
         packed = []
@@ -3229,12 +2763,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_nd_target_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147499808)
         obj.value = reader.read('!16s')[0]
@@ -3247,13 +2777,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_nd_target_masked {")
         with q.group():
@@ -3267,7 +2790,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_nd_tll(OXM):
+oxm.subtypes[2147499808] = ipv6_nd_target_masked
+
+class ipv6_nd_tll(oxm):
     type_len = 2147500550
 
     def __init__(self, value=None):
@@ -3275,6 +2800,7 @@
             self.value = value
         else:
             self.value = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -3283,12 +2809,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_nd_tll()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147500550)
         obj.value = list(reader.read('!6B'))
@@ -3299,13 +2821,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_nd_tll {")
         with q.group():
@@ -3316,7 +2831,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_nd_tll_masked(OXM):
+oxm.subtypes[2147500550] = ipv6_nd_tll
+
+class ipv6_nd_tll_masked(oxm):
     type_len = 2147500812
 
     def __init__(self, value=None, value_mask=None):
@@ -3328,6 +2845,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = [0,0,0,0,0,0]
+        return
 
     def pack(self):
         packed = []
@@ -3337,12 +2855,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_nd_tll_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147500812)
         obj.value = list(reader.read('!6B'))
@@ -3355,13 +2869,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_nd_tll_masked {")
         with q.group():
@@ -3375,7 +2882,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_src(OXM):
+oxm.subtypes[2147500812] = ipv6_nd_tll_masked
+
+class ipv6_src(oxm):
     type_len = 2147496976
 
     def __init__(self, value=None):
@@ -3383,6 +2892,7 @@
             self.value = value
         else:
             self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+        return
 
     def pack(self):
         packed = []
@@ -3391,12 +2901,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_src()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147496976)
         obj.value = reader.read('!16s')[0]
@@ -3407,13 +2913,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_src {")
         with q.group():
@@ -3424,7 +2923,9 @@
             q.breakable()
         q.text('}')
 
-class ipv6_src_masked(OXM):
+oxm.subtypes[2147496976] = ipv6_src
+
+class ipv6_src_masked(oxm):
     type_len = 2147497248
 
     def __init__(self, value=None, value_mask=None):
@@ -3436,6 +2937,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+        return
 
     def pack(self):
         packed = []
@@ -3445,12 +2947,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = ipv6_src_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147497248)
         obj.value = reader.read('!16s')[0]
@@ -3463,13 +2961,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("ipv6_src_masked {")
         with q.group():
@@ -3483,7 +2974,9 @@
             q.breakable()
         q.text('}')
 
-class metadata(OXM):
+oxm.subtypes[2147497248] = ipv6_src_masked
+
+class metadata(oxm):
     type_len = 2147484680
 
     def __init__(self, value=None):
@@ -3491,6 +2984,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -3499,12 +2993,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = metadata()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147484680)
         obj.value = reader.read("!Q")[0]
@@ -3515,13 +3005,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("metadata {")
         with q.group():
@@ -3532,7 +3015,9 @@
             q.breakable()
         q.text('}')
 
-class metadata_masked(OXM):
+oxm.subtypes[2147484680] = metadata
+
+class metadata_masked(oxm):
     type_len = 2147484944
 
     def __init__(self, value=None, value_mask=None):
@@ -3544,6 +3029,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -3553,12 +3039,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = metadata_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147484944)
         obj.value = reader.read("!Q")[0]
@@ -3571,13 +3053,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("metadata_masked {")
         with q.group():
@@ -3591,7 +3066,9 @@
             q.breakable()
         q.text('}')
 
-class mpls_label(OXM):
+oxm.subtypes[2147484944] = metadata_masked
+
+class mpls_label(oxm):
     type_len = 2147501060
 
     def __init__(self, value=None):
@@ -3599,6 +3076,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -3607,12 +3085,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = mpls_label()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147501060)
         obj.value = reader.read("!L")[0]
@@ -3623,13 +3097,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("mpls_label {")
         with q.group():
@@ -3640,7 +3107,9 @@
             q.breakable()
         q.text('}')
 
-class mpls_label_masked(OXM):
+oxm.subtypes[2147501060] = mpls_label
+
+class mpls_label_masked(oxm):
     type_len = 2147501320
 
     def __init__(self, value=None, value_mask=None):
@@ -3652,6 +3121,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -3661,12 +3131,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = mpls_label_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147501320)
         obj.value = reader.read("!L")[0]
@@ -3679,13 +3145,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("mpls_label_masked {")
         with q.group():
@@ -3699,7 +3158,9 @@
             q.breakable()
         q.text('}')
 
-class mpls_tc(OXM):
+oxm.subtypes[2147501320] = mpls_label_masked
+
+class mpls_tc(oxm):
     type_len = 2147501569
 
     def __init__(self, value=None):
@@ -3707,6 +3168,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -3715,12 +3177,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = mpls_tc()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147501569)
         obj.value = reader.read("!B")[0]
@@ -3731,13 +3189,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("mpls_tc {")
         with q.group():
@@ -3748,7 +3199,9 @@
             q.breakable()
         q.text('}')
 
-class mpls_tc_masked(OXM):
+oxm.subtypes[2147501569] = mpls_tc
+
+class mpls_tc_masked(oxm):
     type_len = 2147501826
 
     def __init__(self, value=None, value_mask=None):
@@ -3760,6 +3213,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -3769,12 +3223,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = mpls_tc_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147501826)
         obj.value = reader.read("!B")[0]
@@ -3787,13 +3237,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("mpls_tc_masked {")
         with q.group():
@@ -3807,7 +3250,9 @@
             q.breakable()
         q.text('}')
 
-class sctp_dst(OXM):
+oxm.subtypes[2147501826] = mpls_tc_masked
+
+class sctp_dst(oxm):
     type_len = 2147492866
 
     def __init__(self, value=None):
@@ -3815,6 +3260,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -3823,12 +3269,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = sctp_dst()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147492866)
         obj.value = reader.read("!H")[0]
@@ -3839,13 +3281,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("sctp_dst {")
         with q.group():
@@ -3856,7 +3291,9 @@
             q.breakable()
         q.text('}')
 
-class sctp_dst_masked(OXM):
+oxm.subtypes[2147492866] = sctp_dst
+
+class sctp_dst_masked(oxm):
     type_len = 2147493124
 
     def __init__(self, value=None, value_mask=None):
@@ -3868,6 +3305,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -3877,12 +3315,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = sctp_dst_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147493124)
         obj.value = reader.read("!H")[0]
@@ -3895,13 +3329,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("sctp_dst_masked {")
         with q.group():
@@ -3915,7 +3342,9 @@
             q.breakable()
         q.text('}')
 
-class sctp_src(OXM):
+oxm.subtypes[2147493124] = sctp_dst_masked
+
+class sctp_src(oxm):
     type_len = 2147492354
 
     def __init__(self, value=None):
@@ -3923,6 +3352,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -3931,12 +3361,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = sctp_src()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147492354)
         obj.value = reader.read("!H")[0]
@@ -3947,13 +3373,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("sctp_src {")
         with q.group():
@@ -3964,7 +3383,9 @@
             q.breakable()
         q.text('}')
 
-class sctp_src_masked(OXM):
+oxm.subtypes[2147492354] = sctp_src
+
+class sctp_src_masked(oxm):
     type_len = 2147492612
 
     def __init__(self, value=None, value_mask=None):
@@ -3976,6 +3397,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -3985,12 +3407,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = sctp_src_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147492612)
         obj.value = reader.read("!H")[0]
@@ -4003,13 +3421,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("sctp_src_masked {")
         with q.group():
@@ -4023,7 +3434,9 @@
             q.breakable()
         q.text('}')
 
-class tcp_dst(OXM):
+oxm.subtypes[2147492612] = sctp_src_masked
+
+class tcp_dst(oxm):
     type_len = 2147490818
 
     def __init__(self, value=None):
@@ -4031,6 +3444,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -4039,12 +3453,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = tcp_dst()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147490818)
         obj.value = reader.read("!H")[0]
@@ -4055,13 +3465,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("tcp_dst {")
         with q.group():
@@ -4072,7 +3475,9 @@
             q.breakable()
         q.text('}')
 
-class tcp_dst_masked(OXM):
+oxm.subtypes[2147490818] = tcp_dst
+
+class tcp_dst_masked(oxm):
     type_len = 2147491076
 
     def __init__(self, value=None, value_mask=None):
@@ -4084,6 +3489,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -4093,12 +3499,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = tcp_dst_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147491076)
         obj.value = reader.read("!H")[0]
@@ -4111,13 +3513,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("tcp_dst_masked {")
         with q.group():
@@ -4131,7 +3526,9 @@
             q.breakable()
         q.text('}')
 
-class tcp_src(OXM):
+oxm.subtypes[2147491076] = tcp_dst_masked
+
+class tcp_src(oxm):
     type_len = 2147490306
 
     def __init__(self, value=None):
@@ -4139,6 +3536,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -4147,12 +3545,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = tcp_src()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147490306)
         obj.value = reader.read("!H")[0]
@@ -4163,13 +3557,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("tcp_src {")
         with q.group():
@@ -4180,7 +3567,9 @@
             q.breakable()
         q.text('}')
 
-class tcp_src_masked(OXM):
+oxm.subtypes[2147490306] = tcp_src
+
+class tcp_src_masked(oxm):
     type_len = 2147490564
 
     def __init__(self, value=None, value_mask=None):
@@ -4192,6 +3581,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -4201,12 +3591,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = tcp_src_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147490564)
         obj.value = reader.read("!H")[0]
@@ -4219,13 +3605,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("tcp_src_masked {")
         with q.group():
@@ -4239,7 +3618,9 @@
             q.breakable()
         q.text('}')
 
-class udp_dst(OXM):
+oxm.subtypes[2147490564] = tcp_src_masked
+
+class udp_dst(oxm):
     type_len = 2147491842
 
     def __init__(self, value=None):
@@ -4247,6 +3628,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -4255,12 +3637,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = udp_dst()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147491842)
         obj.value = reader.read("!H")[0]
@@ -4271,13 +3649,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("udp_dst {")
         with q.group():
@@ -4288,7 +3659,9 @@
             q.breakable()
         q.text('}')
 
-class udp_dst_masked(OXM):
+oxm.subtypes[2147491842] = udp_dst
+
+class udp_dst_masked(oxm):
     type_len = 2147492100
 
     def __init__(self, value=None, value_mask=None):
@@ -4300,6 +3673,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -4309,12 +3683,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = udp_dst_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147492100)
         obj.value = reader.read("!H")[0]
@@ -4327,13 +3697,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("udp_dst_masked {")
         with q.group():
@@ -4347,7 +3710,9 @@
             q.breakable()
         q.text('}')
 
-class udp_src(OXM):
+oxm.subtypes[2147492100] = udp_dst_masked
+
+class udp_src(oxm):
     type_len = 2147491330
 
     def __init__(self, value=None):
@@ -4355,6 +3720,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -4363,12 +3729,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = udp_src()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147491330)
         obj.value = reader.read("!H")[0]
@@ -4379,13 +3741,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("udp_src {")
         with q.group():
@@ -4396,7 +3751,9 @@
             q.breakable()
         q.text('}')
 
-class udp_src_masked(OXM):
+oxm.subtypes[2147491330] = udp_src
+
+class udp_src_masked(oxm):
     type_len = 2147491588
 
     def __init__(self, value=None, value_mask=None):
@@ -4408,6 +3765,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -4417,12 +3775,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = udp_src_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147491588)
         obj.value = reader.read("!H")[0]
@@ -4435,13 +3789,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("udp_src_masked {")
         with q.group():
@@ -4455,7 +3802,9 @@
             q.breakable()
         q.text('}')
 
-class vlan_pcp(OXM):
+oxm.subtypes[2147491588] = udp_src_masked
+
+class vlan_pcp(oxm):
     type_len = 2147487233
 
     def __init__(self, value=None):
@@ -4463,6 +3812,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -4471,12 +3821,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = vlan_pcp()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147487233)
         obj.value = reader.read("!B")[0]
@@ -4487,13 +3833,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("vlan_pcp {")
         with q.group():
@@ -4504,7 +3843,9 @@
             q.breakable()
         q.text('}')
 
-class vlan_pcp_masked(OXM):
+oxm.subtypes[2147487233] = vlan_pcp
+
+class vlan_pcp_masked(oxm):
     type_len = 2147487490
 
     def __init__(self, value=None, value_mask=None):
@@ -4516,6 +3857,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -4525,12 +3867,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = vlan_pcp_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147487490)
         obj.value = reader.read("!B")[0]
@@ -4543,13 +3881,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("vlan_pcp_masked {")
         with q.group():
@@ -4563,7 +3894,9 @@
             q.breakable()
         q.text('}')
 
-class vlan_vid(OXM):
+oxm.subtypes[2147487490] = vlan_pcp_masked
+
+class vlan_vid(oxm):
     type_len = 2147486722
 
     def __init__(self, value=None):
@@ -4571,6 +3904,7 @@
             self.value = value
         else:
             self.value = 0
+        return
 
     def pack(self):
         packed = []
@@ -4579,12 +3913,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = vlan_vid()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147486722)
         obj.value = reader.read("!H")[0]
@@ -4595,13 +3925,6 @@
         if self.value != other.value: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("vlan_vid {")
         with q.group():
@@ -4612,7 +3935,9 @@
             q.breakable()
         q.text('}')
 
-class vlan_vid_masked(OXM):
+oxm.subtypes[2147486722] = vlan_vid
+
+class vlan_vid_masked(oxm):
     type_len = 2147486980
 
     def __init__(self, value=None, value_mask=None):
@@ -4624,6 +3949,7 @@
             self.value_mask = value_mask
         else:
             self.value_mask = 0
+        return
 
     def pack(self):
         packed = []
@@ -4633,12 +3959,8 @@
         return ''.join(packed)
 
     @staticmethod
-    def unpack(buf):
+    def unpack(reader):
         obj = vlan_vid_masked()
-        if type(buf) == loxi.generic_util.OFReader:
-            reader = buf
-        else:
-            reader = loxi.generic_util.OFReader(buf)
         _type_len = reader.read("!L")[0]
         assert(_type_len == 2147486980)
         obj.value = reader.read("!H")[0]
@@ -4651,13 +3973,6 @@
         if self.value_mask != other.value_mask: return False
         return True
 
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def show(self):
-        import loxi.pp
-        return loxi.pp.pp(self)
-
     def pretty_print(self, q):
         q.text("vlan_vid_masked {")
         with q.group():
@@ -4671,92 +3986,6 @@
             q.breakable()
         q.text('}')
 
+oxm.subtypes[2147486980] = vlan_vid_masked
 
-parsers = {
-    196640 : bsn_in_ports_128.unpack,
-    196896 : bsn_in_ports_128_masked.unpack,
-    197124 : bsn_lag_id.unpack,
-    197380 : bsn_lag_id_masked.unpack,
-    197636 : bsn_vrf.unpack,
-    197892 : bsn_vrf_masked.unpack,
-    198145 : bsn_global_vrf_allowed.unpack,
-    198401 : bsn_global_vrf_allowed_masked.unpack,
-    198660 : bsn_l3_interface_class_id.unpack,
-    198916 : bsn_l3_interface_class_id_masked.unpack,
-    199172 : bsn_l3_src_class_id.unpack,
-    199428 : bsn_l3_src_class_id_masked.unpack,
-    199684 : bsn_l3_dst_class_id.unpack,
-    199940 : bsn_l3_dst_class_id_masked.unpack,
-    2147483652 : in_port.unpack,
-    2147483912 : in_port_masked.unpack,
-    2147484164 : in_phy_port.unpack,
-    2147484424 : in_phy_port_masked.unpack,
-    2147484680 : metadata.unpack,
-    2147484944 : metadata_masked.unpack,
-    2147485190 : eth_dst.unpack,
-    2147485452 : eth_dst_masked.unpack,
-    2147485702 : eth_src.unpack,
-    2147485964 : eth_src_masked.unpack,
-    2147486210 : eth_type.unpack,
-    2147486468 : eth_type_masked.unpack,
-    2147486722 : vlan_vid.unpack,
-    2147486980 : vlan_vid_masked.unpack,
-    2147487233 : vlan_pcp.unpack,
-    2147487490 : vlan_pcp_masked.unpack,
-    2147487745 : ip_dscp.unpack,
-    2147488002 : ip_dscp_masked.unpack,
-    2147488257 : ip_ecn.unpack,
-    2147488514 : ip_ecn_masked.unpack,
-    2147488769 : ip_proto.unpack,
-    2147489026 : ip_proto_masked.unpack,
-    2147489284 : ipv4_src.unpack,
-    2147489544 : ipv4_src_masked.unpack,
-    2147489796 : ipv4_dst.unpack,
-    2147490056 : ipv4_dst_masked.unpack,
-    2147490306 : tcp_src.unpack,
-    2147490564 : tcp_src_masked.unpack,
-    2147490818 : tcp_dst.unpack,
-    2147491076 : tcp_dst_masked.unpack,
-    2147491330 : udp_src.unpack,
-    2147491588 : udp_src_masked.unpack,
-    2147491842 : udp_dst.unpack,
-    2147492100 : udp_dst_masked.unpack,
-    2147492354 : sctp_src.unpack,
-    2147492612 : sctp_src_masked.unpack,
-    2147492866 : sctp_dst.unpack,
-    2147493124 : sctp_dst_masked.unpack,
-    2147493377 : icmpv4_type.unpack,
-    2147493634 : icmpv4_type_masked.unpack,
-    2147493889 : icmpv4_code.unpack,
-    2147494146 : icmpv4_code_masked.unpack,
-    2147494402 : arp_op.unpack,
-    2147494660 : arp_op_masked.unpack,
-    2147494916 : arp_spa.unpack,
-    2147495176 : arp_spa_masked.unpack,
-    2147495428 : arp_tpa.unpack,
-    2147495688 : arp_tpa_masked.unpack,
-    2147495942 : arp_sha.unpack,
-    2147496204 : arp_sha_masked.unpack,
-    2147496454 : arp_tha.unpack,
-    2147496716 : arp_tha_masked.unpack,
-    2147496976 : ipv6_src.unpack,
-    2147497248 : ipv6_src_masked.unpack,
-    2147497488 : ipv6_dst.unpack,
-    2147497760 : ipv6_dst_masked.unpack,
-    2147497988 : ipv6_flabel.unpack,
-    2147498248 : ipv6_flabel_masked.unpack,
-    2147498497 : icmpv6_type.unpack,
-    2147498754 : icmpv6_type_masked.unpack,
-    2147499009 : icmpv6_code.unpack,
-    2147499266 : icmpv6_code_masked.unpack,
-    2147499536 : ipv6_nd_target.unpack,
-    2147499808 : ipv6_nd_target_masked.unpack,
-    2147500038 : ipv6_nd_sll.unpack,
-    2147500300 : ipv6_nd_sll_masked.unpack,
-    2147500550 : ipv6_nd_tll.unpack,
-    2147500812 : ipv6_nd_tll_masked.unpack,
-    2147501060 : mpls_label.unpack,
-    2147501320 : mpls_label_masked.unpack,
-    2147501569 : mpls_tc.unpack,
-    2147501826 : mpls_tc_masked.unpack,
-}
+