diff --git a/src/python/loxi/of10/common.py b/src/python/loxi/of10/common.py
index 616cf75..28b079a 100644
--- a/src/python/loxi/of10/common.py
+++ b/src/python/loxi/of10/common.py
@@ -385,7 +385,7 @@
 
 class match_v1(object):
 
-    def __init__(self, wildcards=None, in_port=None, eth_src=None, eth_dst=None, vlan_vid=None, vlan_pcp=None, eth_type=None, ip_dscp=None, ip_proto=None, src_meta_id=None, dst_meta_id=None, ipv4_src=None, ipv4_dst=None, tcp_src=None, tcp_dst=None):
+    def __init__(self, wildcards=None, in_port=None, eth_src=None, eth_dst=None, vlan_vid=None, vlan_pcp=None, eth_type=None, ip_dscp=None, ip_proto=None, ipv4_src=None, ipv4_dst=None, tcp_src=None, tcp_dst=None):
         if wildcards != None:
             self.wildcards = wildcards
         else:
@@ -422,14 +422,6 @@
             self.ip_proto = ip_proto
         else:
             self.ip_proto = 0
-        if src_meta_id != None:
-            self.src_meta_id = src_meta_id
-        else:
-            self.src_meta_id = 0
-        if dst_meta_id != None:
-            self.dst_meta_id = dst_meta_id
-        else:
-            self.dst_meta_id = 0
         if ipv4_src != None:
             self.ipv4_src = ipv4_src
         else:
@@ -460,8 +452,7 @@
         packed.append(struct.pack("!H", self.eth_type))
         packed.append(struct.pack("!B", self.ip_dscp))
         packed.append(struct.pack("!B", self.ip_proto))
-        packed.append(struct.pack("!B", self.src_meta_id))
-        packed.append(struct.pack("!B", self.dst_meta_id))
+        packed.append('\x00' * 2)
         packed.append(struct.pack("!L", self.ipv4_src))
         packed.append(struct.pack("!L", self.ipv4_dst))
         packed.append(struct.pack("!H", self.tcp_src))
@@ -485,8 +476,7 @@
         obj.eth_type = reader.read("!H")[0]
         obj.ip_dscp = reader.read("!B")[0]
         obj.ip_proto = reader.read("!B")[0]
-        obj.src_meta_id = reader.read("!B")[0]
-        obj.dst_meta_id = reader.read("!B")[0]
+        reader.skip(2)
         obj.ipv4_src = reader.read("!L")[0]
         obj.ipv4_dst = reader.read("!L")[0]
         obj.tcp_src = reader.read("!H")[0]
@@ -504,8 +494,6 @@
         if self.eth_type != other.eth_type: return False
         if self.ip_dscp != other.ip_dscp: return False
         if self.ip_proto != other.ip_proto: return False
-        if self.src_meta_id != other.src_meta_id: return False
-        if self.dst_meta_id != other.dst_meta_id: return False
         if self.ipv4_src != other.ipv4_src: return False
         if self.ipv4_dst != other.ipv4_dst: return False
         if self.tcp_src != other.tcp_src: return False
@@ -551,12 +539,6 @@
                 q.text("ip_proto = ");
                 q.text("%#x" % self.ip_proto)
                 q.text(","); q.breakable()
-                q.text("src_meta_id = ");
-                q.text("%#x" % self.src_meta_id)
-                q.text(","); q.breakable()
-                q.text("dst_meta_id = ");
-                q.text("%#x" % self.dst_meta_id)
-                q.text(","); q.breakable()
                 q.text("ipv4_src = ");
                 q.text(util.pretty_ipv4(self.ipv4_src))
                 q.text(","); q.breakable()
diff --git a/src/python/loxi/of10/const.py b/src/python/loxi/of10/const.py
index 0273c7a..1d29975 100644
--- a/src/python/loxi/of10/const.py
+++ b/src/python/loxi/of10/const.py
@@ -235,8 +235,6 @@
 OFPFW_NW_DST_MASK = 1032192
 OFPFW_DL_VLAN_PCP = 1048576
 OFPFW_NW_TOS = 2097152
-OFPFW_SRC_META_ID = 4194304
-OFPFW_DST_META_ID = 8388608
 OFPFW_ALL = 4194303
 
 ofp_flow_wildcards_map = {
@@ -250,8 +248,6 @@
     128: 'OFPFW_TP_DST',
     1048576: 'OFPFW_DL_VLAN_PCP',
     2097152: 'OFPFW_NW_TOS',
-    4194304: 'OFPFW_SRC_META_ID',
-    8388608: 'OFPFW_DST_META_ID',
 }
 
 # Identifiers from group ofp_hello_failed_code
diff --git a/src/python/loxi/of10/message.py b/src/python/loxi/of10/message.py
index e01c342..6e6649e 100644
--- a/src/python/loxi/of10/message.py
+++ b/src/python/loxi/of10/message.py
@@ -6281,8 +6281,8 @@
 
 def parse_message(buf):
     msg_ver, msg_type, msg_len, msg_xid = parse_header(buf)
-    if msg_ver != const.OFP_VERSION and msg_type != ofp.OFPT_HELLO:
-        raise loxi.ProtocolError("wrong OpenFlow version")
+    if msg_ver != const.OFP_VERSION and msg_type != const.OFPT_HELLO:
+        raise loxi.ProtocolError("wrong OpenFlow version (expected %d, got %d)" % (const.OFP_VERSION, msg_ver))
     if len(buf) != msg_len:
         raise loxi.ProtocolError("incorrect message size")
     if msg_type in parsers:
@@ -6291,9 +6291,10 @@
         raise loxi.ProtocolError("unexpected message type")
 
 def parse_flow_mod(buf):
-    if len(buf) < 56 + 2:
+    if len(buf) < 57 + 1:
         raise loxi.ProtocolError("message too short")
-    cmd, = struct.unpack_from("!H", buf, 56)
+    # Technically uint16_t for OF 1.0
+    cmd, = struct.unpack_from("!B", buf, 57)
     if cmd in flow_mod_parsers:
         return flow_mod_parsers[cmd](buf)
     else:
diff --git a/src/python/loxi/of11/message.py b/src/python/loxi/of11/message.py
index 12aa4a1..091e70c 100644
--- a/src/python/loxi/of11/message.py
+++ b/src/python/loxi/of11/message.py
@@ -5973,8 +5973,8 @@
 
 def parse_message(buf):
     msg_ver, msg_type, msg_len, msg_xid = parse_header(buf)
-    if msg_ver != const.OFP_VERSION and msg_type != ofp.OFPT_HELLO:
-        raise loxi.ProtocolError("wrong OpenFlow version")
+    if msg_ver != const.OFP_VERSION and msg_type != const.OFPT_HELLO:
+        raise loxi.ProtocolError("wrong OpenFlow version (expected %d, got %d)" % (const.OFP_VERSION, msg_ver))
     if len(buf) != msg_len:
         raise loxi.ProtocolError("incorrect message size")
     if msg_type in parsers:
@@ -5983,9 +5983,10 @@
         raise loxi.ProtocolError("unexpected message type")
 
 def parse_flow_mod(buf):
-    if len(buf) < 56 + 2:
+    if len(buf) < 25 + 1:
         raise loxi.ProtocolError("message too short")
-    cmd, = struct.unpack_from("!H", buf, 56)
+    # Technically uint16_t for OF 1.0
+    cmd, = struct.unpack_from("!B", buf, 25)
     if cmd in flow_mod_parsers:
         return flow_mod_parsers[cmd](buf)
     else:
diff --git a/src/python/loxi/of12/message.py b/src/python/loxi/of12/message.py
index 76424fe..ed1f04f 100644
--- a/src/python/loxi/of12/message.py
+++ b/src/python/loxi/of12/message.py
@@ -6405,8 +6405,8 @@
 
 def parse_message(buf):
     msg_ver, msg_type, msg_len, msg_xid = parse_header(buf)
-    if msg_ver != const.OFP_VERSION and msg_type != ofp.OFPT_HELLO:
-        raise loxi.ProtocolError("wrong OpenFlow version")
+    if msg_ver != const.OFP_VERSION and msg_type != const.OFPT_HELLO:
+        raise loxi.ProtocolError("wrong OpenFlow version (expected %d, got %d)" % (const.OFP_VERSION, msg_ver))
     if len(buf) != msg_len:
         raise loxi.ProtocolError("incorrect message size")
     if msg_type in parsers:
@@ -6415,9 +6415,10 @@
         raise loxi.ProtocolError("unexpected message type")
 
 def parse_flow_mod(buf):
-    if len(buf) < 56 + 2:
+    if len(buf) < 25 + 1:
         raise loxi.ProtocolError("message too short")
-    cmd, = struct.unpack_from("!H", buf, 56)
+    # Technically uint16_t for OF 1.0
+    cmd, = struct.unpack_from("!B", buf, 25)
     if cmd in flow_mod_parsers:
         return flow_mod_parsers[cmd](buf)
     else:
diff --git a/src/python/loxi/of12/oxm.py b/src/python/loxi/of12/oxm.py
index fb1291d..f17151e 100644
--- a/src/python/loxi/of12/oxm.py
+++ b/src/python/loxi/of12/oxm.py
@@ -566,114 +566,6 @@
             q.breakable()
         q.text('}')
 
-class dst_meta_id(OXM):
-    type_len = 258561
-
-    def __init__(self, value=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = dst_meta_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 == 258561)
-        obj.value = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        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("dst_meta_id {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-            q.breakable()
-        q.text('}')
-
-class dst_meta_id_masked(OXM):
-    type_len = 258818
-
-    def __init__(self, value=None, value_mask=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-        if value_mask != None:
-            self.value_mask = value_mask
-        else:
-            self.value_mask = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        packed.append(struct.pack("!B", self.value_mask))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = dst_meta_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 == 258818)
-        obj.value = reader.read("!B")[0]
-        obj.value_mask = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        if self.value != other.value: return False
-        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("dst_meta_id_masked {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-                q.text(","); q.breakable()
-                q.text("value_mask = ");
-                q.text("%#x" % self.value_mask)
-            q.breakable()
-        q.text('}')
-
 class eth_dst(OXM):
     type_len = 2147485190
 
@@ -3374,114 +3266,6 @@
             q.breakable()
         q.text('}')
 
-class src_meta_id(OXM):
-    type_len = 258049
-
-    def __init__(self, value=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = src_meta_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 == 258049)
-        obj.value = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        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("src_meta_id {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-            q.breakable()
-        q.text('}')
-
-class src_meta_id_masked(OXM):
-    type_len = 258306
-
-    def __init__(self, value=None, value_mask=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-        if value_mask != None:
-            self.value_mask = value_mask
-        else:
-            self.value_mask = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        packed.append(struct.pack("!B", self.value_mask))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = src_meta_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 == 258306)
-        obj.value = reader.read("!B")[0]
-        obj.value_mask = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        if self.value != other.value: return False
-        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("src_meta_id_masked {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-                q.text(","); q.breakable()
-                q.text("value_mask = ");
-                q.text("%#x" % self.value_mask)
-            q.breakable()
-        q.text('}')
-
 class tcp_dst(OXM):
     type_len = 2147490818
 
@@ -4132,10 +3916,6 @@
 
 
 parsers = {
-    258049 : src_meta_id.unpack,
-    258306 : src_meta_id_masked.unpack,
-    258561 : dst_meta_id.unpack,
-    258818 : dst_meta_id_masked.unpack,
     2147483652 : in_port.unpack,
     2147483912 : in_port_masked.unpack,
     2147484164 : in_phy_port.unpack,
diff --git a/src/python/loxi/of13/message.py b/src/python/loxi/of13/message.py
index 543442b..4c22e45 100644
--- a/src/python/loxi/of13/message.py
+++ b/src/python/loxi/of13/message.py
@@ -7554,8 +7554,8 @@
 
 def parse_message(buf):
     msg_ver, msg_type, msg_len, msg_xid = parse_header(buf)
-    if msg_ver != const.OFP_VERSION and msg_type != ofp.OFPT_HELLO:
-        raise loxi.ProtocolError("wrong OpenFlow version")
+    if msg_ver != const.OFP_VERSION and msg_type != const.OFPT_HELLO:
+        raise loxi.ProtocolError("wrong OpenFlow version (expected %d, got %d)" % (const.OFP_VERSION, msg_ver))
     if len(buf) != msg_len:
         raise loxi.ProtocolError("incorrect message size")
     if msg_type in parsers:
@@ -7564,9 +7564,10 @@
         raise loxi.ProtocolError("unexpected message type")
 
 def parse_flow_mod(buf):
-    if len(buf) < 56 + 2:
+    if len(buf) < 25 + 1:
         raise loxi.ProtocolError("message too short")
-    cmd, = struct.unpack_from("!H", buf, 56)
+    # Technically uint16_t for OF 1.0
+    cmd, = struct.unpack_from("!B", buf, 25)
     if cmd in flow_mod_parsers:
         return flow_mod_parsers[cmd](buf)
     else:
@@ -7648,7 +7649,39 @@
     const.OFPFC_DELETE_STRICT : flow_delete_strict.unpack,
 }
 
-# TODO OF 1.3 multipart messages
+multipart_reply_parsers = {
+    const.OFPMP_DESC : desc_stats_reply.unpack,
+    const.OFPMP_FLOW : flow_stats_reply.unpack,
+    const.OFPMP_AGGREGATE : aggregate_stats_reply.unpack,
+    const.OFPMP_TABLE : table_stats_reply.unpack,
+    const.OFPMP_PORT_STATS : port_stats_reply.unpack,
+    const.OFPMP_QUEUE : queue_stats_reply.unpack,
+    const.OFPMP_GROUP : group_stats_reply.unpack,
+    const.OFPMP_GROUP_DESC : group_desc_stats_reply.unpack,
+    const.OFPMP_GROUP_FEATURES : group_features_stats_reply.unpack,
+    const.OFPMP_METER : meter_stats_reply.unpack,
+    const.OFPMP_METER_CONFIG : meter_config_stats_reply.unpack,
+    const.OFPMP_METER_FEATURES : meter_features_stats_reply.unpack,
+    const.OFPMP_TABLE_FEATURES : table_features_stats_reply.unpack,
+    const.OFPMP_PORT_DESC : port_desc_stats_reply.unpack,
+}
+
+multipart_request_parsers = {
+    const.OFPMP_DESC : desc_stats_request.unpack,
+    const.OFPMP_FLOW : flow_stats_request.unpack,
+    const.OFPMP_AGGREGATE : aggregate_stats_request.unpack,
+    const.OFPMP_TABLE : table_stats_request.unpack,
+    const.OFPMP_PORT_STATS : port_stats_request.unpack,
+    const.OFPMP_QUEUE : queue_stats_request.unpack,
+    const.OFPMP_GROUP : group_stats_request.unpack,
+    const.OFPMP_GROUP_DESC : group_desc_stats_request.unpack,
+    const.OFPMP_GROUP_FEATURES : group_features_stats_request.unpack,
+    const.OFPMP_METER : meter_stats_request.unpack,
+    const.OFPMP_METER_CONFIG : meter_config_stats_request.unpack,
+    const.OFPMP_METER_FEATURES : meter_features_stats_request.unpack,
+    const.OFPMP_TABLE_FEATURES : table_features_stats_request.unpack,
+    const.OFPMP_PORT_DESC : port_desc_stats_request.unpack,
+}
 
 experimenter_parsers = {
     6035143 : {
diff --git a/src/python/loxi/of13/oxm.py b/src/python/loxi/of13/oxm.py
index fb1291d..f17151e 100644
--- a/src/python/loxi/of13/oxm.py
+++ b/src/python/loxi/of13/oxm.py
@@ -566,114 +566,6 @@
             q.breakable()
         q.text('}')
 
-class dst_meta_id(OXM):
-    type_len = 258561
-
-    def __init__(self, value=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = dst_meta_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 == 258561)
-        obj.value = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        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("dst_meta_id {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-            q.breakable()
-        q.text('}')
-
-class dst_meta_id_masked(OXM):
-    type_len = 258818
-
-    def __init__(self, value=None, value_mask=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-        if value_mask != None:
-            self.value_mask = value_mask
-        else:
-            self.value_mask = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        packed.append(struct.pack("!B", self.value_mask))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = dst_meta_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 == 258818)
-        obj.value = reader.read("!B")[0]
-        obj.value_mask = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        if self.value != other.value: return False
-        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("dst_meta_id_masked {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-                q.text(","); q.breakable()
-                q.text("value_mask = ");
-                q.text("%#x" % self.value_mask)
-            q.breakable()
-        q.text('}')
-
 class eth_dst(OXM):
     type_len = 2147485190
 
@@ -3374,114 +3266,6 @@
             q.breakable()
         q.text('}')
 
-class src_meta_id(OXM):
-    type_len = 258049
-
-    def __init__(self, value=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = src_meta_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 == 258049)
-        obj.value = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        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("src_meta_id {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-            q.breakable()
-        q.text('}')
-
-class src_meta_id_masked(OXM):
-    type_len = 258306
-
-    def __init__(self, value=None, value_mask=None):
-        if value != None:
-            self.value = value
-        else:
-            self.value = 0
-        if value_mask != None:
-            self.value_mask = value_mask
-        else:
-            self.value_mask = 0
-
-    def pack(self):
-        packed = []
-        packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!B", self.value))
-        packed.append(struct.pack("!B", self.value_mask))
-        return ''.join(packed)
-
-    @staticmethod
-    def unpack(buf):
-        obj = src_meta_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 == 258306)
-        obj.value = reader.read("!B")[0]
-        obj.value_mask = reader.read("!B")[0]
-        return obj
-
-    def __eq__(self, other):
-        if type(self) != type(other): return False
-        if self.value != other.value: return False
-        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("src_meta_id_masked {")
-        with q.group():
-            with q.indent(2):
-                q.breakable()
-                q.text("value = ");
-                q.text("%#x" % self.value)
-                q.text(","); q.breakable()
-                q.text("value_mask = ");
-                q.text("%#x" % self.value_mask)
-            q.breakable()
-        q.text('}')
-
 class tcp_dst(OXM):
     type_len = 2147490818
 
@@ -4132,10 +3916,6 @@
 
 
 parsers = {
-    258049 : src_meta_id.unpack,
-    258306 : src_meta_id_masked.unpack,
-    258561 : dst_meta_id.unpack,
-    258818 : dst_meta_id_masked.unpack,
     2147483652 : in_port.unpack,
     2147483912 : in_port_masked.unpack,
     2147484164 : in_phy_port.unpack,
