diff --git a/src/python/loxi/of12/__init__.py b/src/python/loxi/of12/__init__.py
index 5610646..ca8395c 100644
--- a/src/python/loxi/of12/__init__.py
+++ b/src/python/loxi/of12/__init__.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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 init.py
 # Do not modify
diff --git a/src/python/loxi/of12/action.py b/src/python/loxi/of12/action.py
index 8775b88..f1f9272 100644
--- a/src/python/loxi/of12/action.py
+++ b/src/python/loxi/of12/action.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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 action.py
 # Do not modify
@@ -23,8 +24,8 @@
     pass
 
 class bsn_mirror(Action):
-    type = const.OFPAT_EXPERIMENTER
-    experimenter = 0x5c16c7
+    type = 65535
+    experimenter = 6035143
     subtype = 1
 
     def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
@@ -63,16 +64,16 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_EXPERIMENTER)
-        _len = reader.read('!H')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 65535)
+        _len = reader.read("!H")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 1)
-        obj.dest_port = reader.read('!L')[0]
-        obj.vlan_tag = reader.read('!L')[0]
-        obj.copy_stage = reader.read('!B')[0]
+        obj.dest_port = reader.read("!L")[0]
+        obj.vlan_tag = reader.read("!L")[0]
+        obj.copy_stage = reader.read("!B")[0]
         reader.skip(3)
         return obj
 
@@ -107,8 +108,8 @@
         q.text('}')
 
 class bsn_set_tunnel_dst(Action):
-    type = const.OFPAT_EXPERIMENTER
-    experimenter = 0x5c16c7
+    type = 65535
+    experimenter = 6035143
     subtype = 2
 
     def __init__(self, dst=None):
@@ -136,14 +137,14 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_EXPERIMENTER)
-        _len = reader.read('!H')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 65535)
+        _len = reader.read("!H")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 2)
-        obj.dst = reader.read('!L')[0]
+        obj.dst = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -169,7 +170,7 @@
         q.text('}')
 
 class copy_ttl_in(Action):
-    type = const.OFPAT_COPY_TTL_IN
+    type = 12
 
     def __init__(self):
         return
@@ -190,9 +191,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_COPY_TTL_IN)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 12)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -216,7 +217,7 @@
         q.text('}')
 
 class copy_ttl_out(Action):
-    type = const.OFPAT_COPY_TTL_OUT
+    type = 11
 
     def __init__(self):
         return
@@ -237,9 +238,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_COPY_TTL_OUT)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 11)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -263,7 +264,7 @@
         q.text('}')
 
 class dec_mpls_ttl(Action):
-    type = const.OFPAT_DEC_MPLS_TTL
+    type = 16
 
     def __init__(self):
         return
@@ -284,9 +285,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_DEC_MPLS_TTL)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 16)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -310,7 +311,7 @@
         q.text('}')
 
 class dec_nw_ttl(Action):
-    type = const.OFPAT_DEC_NW_TTL
+    type = 24
 
     def __init__(self):
         return
@@ -331,9 +332,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_DEC_NW_TTL)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 24)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -357,7 +358,7 @@
         q.text('}')
 
 class group(Action):
-    type = const.OFPAT_GROUP
+    type = 22
 
     def __init__(self, group_id=None):
         if group_id != None:
@@ -382,10 +383,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_GROUP)
-        _len = reader.read('!H')[0]
-        obj.group_id = reader.read('!L')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 22)
+        _len = reader.read("!H")[0]
+        obj.group_id = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -411,8 +412,8 @@
         q.text('}')
 
 class nicira_dec_ttl(Action):
-    type = const.OFPAT_EXPERIMENTER
-    experimenter = 0x2320
+    type = 65535
+    experimenter = 8992
     subtype = 18
 
     def __init__(self):
@@ -437,12 +438,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_EXPERIMENTER)
-        _len = reader.read('!H')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x2320)
-        _subtype = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 65535)
+        _len = reader.read("!H")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 8992)
+        _subtype = reader.read("!H")[0]
         assert(_subtype == 18)
         reader.skip(2)
         reader.skip(4)
@@ -468,7 +469,7 @@
         q.text('}')
 
 class output(Action):
-    type = const.OFPAT_OUTPUT
+    type = 0
 
     def __init__(self, port=None, max_len=None):
         if port != None:
@@ -485,7 +486,7 @@
         packed = []
         packed.append(struct.pack("!H", self.type))
         packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
-        packed.append(struct.pack("!L", self.port))
+        packed.append(util.pack_port_no(self.port))
         packed.append(struct.pack("!H", self.max_len))
         packed.append('\x00' * 6)
         length = sum([len(x) for x in packed])
@@ -499,11 +500,11 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_OUTPUT)
-        _len = reader.read('!H')[0]
-        obj.port = reader.read('!L')[0]
-        obj.max_len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 0)
+        _len = reader.read("!H")[0]
+        obj.port = util.unpack_port_no(reader)
+        obj.max_len = reader.read("!H")[0]
         reader.skip(6)
         return obj
 
@@ -534,7 +535,7 @@
         q.text('}')
 
 class pop_mpls(Action):
-    type = const.OFPAT_POP_MPLS
+    type = 20
 
     def __init__(self, ethertype=None):
         if ethertype != None:
@@ -560,10 +561,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_POP_MPLS)
-        _len = reader.read('!H')[0]
-        obj.ethertype = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 20)
+        _len = reader.read("!H")[0]
+        obj.ethertype = reader.read("!H")[0]
         reader.skip(2)
         return obj
 
@@ -590,7 +591,7 @@
         q.text('}')
 
 class pop_vlan(Action):
-    type = const.OFPAT_POP_VLAN
+    type = 18
 
     def __init__(self):
         return
@@ -611,9 +612,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_POP_VLAN)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 18)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -637,7 +638,7 @@
         q.text('}')
 
 class push_mpls(Action):
-    type = const.OFPAT_PUSH_MPLS
+    type = 19
 
     def __init__(self, ethertype=None):
         if ethertype != None:
@@ -663,10 +664,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_PUSH_MPLS)
-        _len = reader.read('!H')[0]
-        obj.ethertype = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 19)
+        _len = reader.read("!H")[0]
+        obj.ethertype = reader.read("!H")[0]
         reader.skip(2)
         return obj
 
@@ -693,7 +694,7 @@
         q.text('}')
 
 class push_vlan(Action):
-    type = const.OFPAT_PUSH_VLAN
+    type = 17
 
     def __init__(self, ethertype=None):
         if ethertype != None:
@@ -719,10 +720,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_PUSH_VLAN)
-        _len = reader.read('!H')[0]
-        obj.ethertype = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 17)
+        _len = reader.read("!H")[0]
+        obj.ethertype = reader.read("!H")[0]
         reader.skip(2)
         return obj
 
@@ -749,13 +750,13 @@
         q.text('}')
 
 class set_field(Action):
-    type = const.OFPAT_SET_FIELD
+    type = 25
 
     def __init__(self, field=None):
         if field != None:
             self.field = field
         else:
-            self.field = ""
+            self.field = ''
         return
 
     def pack(self):
@@ -774,9 +775,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_SET_FIELD)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 25)
+        _len = reader.read("!H")[0]
         obj.field = str(reader.read_all())
         return obj
 
@@ -803,7 +804,7 @@
         q.text('}')
 
 class set_mpls_ttl(Action):
-    type = const.OFPAT_SET_MPLS_TTL
+    type = 15
 
     def __init__(self, mpls_ttl=None):
         if mpls_ttl != None:
@@ -829,10 +830,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_SET_MPLS_TTL)
-        _len = reader.read('!H')[0]
-        obj.mpls_ttl = reader.read('!B')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 15)
+        _len = reader.read("!H")[0]
+        obj.mpls_ttl = reader.read("!B")[0]
         reader.skip(3)
         return obj
 
@@ -859,7 +860,7 @@
         q.text('}')
 
 class set_nw_ttl(Action):
-    type = const.OFPAT_SET_NW_TTL
+    type = 23
 
     def __init__(self, nw_ttl=None):
         if nw_ttl != None:
@@ -885,10 +886,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_SET_NW_TTL)
-        _len = reader.read('!H')[0]
-        obj.nw_ttl = reader.read('!B')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 23)
+        _len = reader.read("!H")[0]
+        obj.nw_ttl = reader.read("!B")[0]
         reader.skip(3)
         return obj
 
@@ -915,7 +916,7 @@
         q.text('}')
 
 class set_queue(Action):
-    type = const.OFPAT_SET_QUEUE
+    type = 21
 
     def __init__(self, queue_id=None):
         if queue_id != None:
@@ -940,10 +941,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPAT_SET_QUEUE)
-        _len = reader.read('!H')[0]
-        obj.queue_id = reader.read('!L')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 21)
+        _len = reader.read("!H")[0]
+        obj.queue_id = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -985,22 +986,29 @@
         raise loxi.ProtocolError("unexpected BSN experimenter subtype %#x" % subtype)
 
 parsers = {
-    const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
-    const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
-    const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
-    const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
-    const.OFPAT_EXPERIMENTER : parse_experimenter,
-    const.OFPAT_GROUP : group.unpack,
     const.OFPAT_OUTPUT : output.unpack,
-    const.OFPAT_POP_MPLS : pop_mpls.unpack,
+    const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
+    const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
+    const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
+    const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
+    const.OFPAT_PUSH_VLAN : push_vlan.unpack,
     const.OFPAT_POP_VLAN : pop_vlan.unpack,
     const.OFPAT_PUSH_MPLS : push_mpls.unpack,
-    const.OFPAT_PUSH_VLAN : push_vlan.unpack,
-    const.OFPAT_SET_FIELD : set_field.unpack,
-    const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
-    const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+    const.OFPAT_POP_MPLS : pop_mpls.unpack,
     const.OFPAT_SET_QUEUE : set_queue.unpack,
+    const.OFPAT_GROUP : group.unpack,
+    const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+    const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
+    const.OFPAT_SET_FIELD : set_field.unpack,
+    const.OFPAT_EXPERIMENTER : parse_experimenter,
 }
 
 experimenter_parsers = {
+    8992 : {
+        18: nicira_dec_ttl.unpack,
+    },
+    6035143 : {
+        1: bsn_mirror.unpack,
+        2: bsn_set_tunnel_dst.unpack,
+    },
 }
diff --git a/src/python/loxi/of12/common.py b/src/python/loxi/of12/common.py
index 13cc2f4..f2d2493 100644
--- a/src/python/loxi/of12/common.py
+++ b/src/python/loxi/of12/common.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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 common.py
 # Do not modify
@@ -98,8 +99,8 @@
         obj.hw_addr = list(reader.read('!6B'))
         reader.skip(2)
         obj.name = reader.read("!16s")[0].rstrip("\x00")
-        obj.ipv4_addr = reader.read('!L')[0]
-        obj.ipv4_netmask = reader.read('!L')[0]
+        obj.ipv4_addr = reader.read("!L")[0]
+        obj.ipv4_netmask = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -136,6 +137,100 @@
             q.breakable()
         q.text('}')
 
+class bsn_vport_q_in_q(object):
+    type = 0
+
+    def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None):
+        if port_no != None:
+            self.port_no = port_no
+        else:
+            self.port_no = 0
+        if ingress_tpid != None:
+            self.ingress_tpid = ingress_tpid
+        else:
+            self.ingress_tpid = 0
+        if ingress_vlan_id != None:
+            self.ingress_vlan_id = ingress_vlan_id
+        else:
+            self.ingress_vlan_id = 0
+        if egress_tpid != None:
+            self.egress_tpid = egress_tpid
+        else:
+            self.egress_tpid = 0
+        if egress_vlan_id != None:
+            self.egress_vlan_id = egress_vlan_id
+        else:
+            self.egress_vlan_id = 0
+        return
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!H", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
+        packed.append(struct.pack("!L", self.port_no))
+        packed.append(struct.pack("!H", self.ingress_tpid))
+        packed.append(struct.pack("!H", self.ingress_vlan_id))
+        packed.append(struct.pack("!H", self.egress_tpid))
+        packed.append(struct.pack("!H", self.egress_vlan_id))
+        length = sum([len(x) for x in packed])
+        packed[1] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        obj = bsn_vport_q_in_q()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _type = reader.read("!H")[0]
+        assert(_type == 0)
+        _length = reader.read("!H")[0]
+        obj.port_no = reader.read("!L")[0]
+        obj.ingress_tpid = reader.read("!H")[0]
+        obj.ingress_vlan_id = reader.read("!H")[0]
+        obj.egress_tpid = reader.read("!H")[0]
+        obj.egress_vlan_id = reader.read("!H")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.port_no != other.port_no: return False
+        if self.ingress_tpid != other.ingress_tpid: return False
+        if self.ingress_vlan_id != other.ingress_vlan_id: return False
+        if self.egress_tpid != other.egress_tpid: return False
+        if self.egress_vlan_id != other.egress_vlan_id: 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_vport_q_in_q {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("port_no = ");
+                q.text("%#x" % self.port_no)
+                q.text(","); q.breakable()
+                q.text("ingress_tpid = ");
+                q.text("%#x" % self.ingress_tpid)
+                q.text(","); q.breakable()
+                q.text("ingress_vlan_id = ");
+                q.text("%#x" % self.ingress_vlan_id)
+                q.text(","); q.breakable()
+                q.text("egress_tpid = ");
+                q.text("%#x" % self.egress_tpid)
+                q.text(","); q.breakable()
+                q.text("egress_vlan_id = ");
+                q.text("%#x" % self.egress_vlan_id)
+            q.breakable()
+        q.text('}')
+
 class bucket(object):
 
     def __init__(self, weight=None, watch_port=None, watch_group=None, actions=None):
@@ -161,10 +256,10 @@
         packed = []
         packed.append(struct.pack("!H", 0)) # placeholder for len at index 0
         packed.append(struct.pack("!H", self.weight))
-        packed.append(struct.pack("!L", self.watch_port))
+        packed.append(util.pack_port_no(self.watch_port))
         packed.append(struct.pack("!L", self.watch_group))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.actions]))
+        packed.append(util.pack_list(self.actions))
         length = sum([len(x) for x in packed])
         packed[0] = struct.pack("!H", length)
         return ''.join(packed)
@@ -176,10 +271,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _len = reader.read('!H')[0]
-        obj.weight = reader.read('!H')[0]
-        obj.watch_port = reader.read('!L')[0]
-        obj.watch_group = reader.read('!L')[0]
+        _len = reader.read("!H")[0]
+        obj.weight = reader.read("!H")[0]
+        obj.watch_port = util.unpack_port_no(reader)
+        obj.watch_group = reader.read("!L")[0]
         reader.skip(4)
         obj.actions = action.unpack_list(reader)
         return obj
@@ -244,8 +339,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        obj.packet_count = reader.read('!Q')[0]
-        obj.byte_count = reader.read('!Q')[0]
+        obj.packet_count = reader.read("!Q")[0]
+        obj.byte_count = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -338,7 +433,7 @@
         packed.append(struct.pack("!Q", self.packet_count))
         packed.append(struct.pack("!Q", self.byte_count))
         packed.append(self.match.pack())
-        packed.append("".join([x.pack() for x in self.instructions]))
+        packed.append(util.pack_list(self.instructions))
         length = sum([len(x) for x in packed])
         packed[0] = struct.pack("!H", length)
         return ''.join(packed)
@@ -350,18 +445,18 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _length = reader.read('!H')[0]
-        obj.table_id = reader.read('!B')[0]
+        _length = reader.read("!H")[0]
+        obj.table_id = reader.read("!B")[0]
         reader.skip(1)
-        obj.duration_sec = reader.read('!L')[0]
-        obj.duration_nsec = reader.read('!L')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
+        obj.duration_sec = reader.read("!L")[0]
+        obj.duration_nsec = reader.read("!L")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
         reader.skip(6)
-        obj.cookie = reader.read('!Q')[0]
-        obj.packet_count = reader.read('!Q')[0]
-        obj.byte_count = reader.read('!Q')[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.packet_count = reader.read("!Q")[0]
+        obj.byte_count = reader.read("!Q")[0]
         obj.match = common.match.unpack(reader)
         obj.instructions = instruction.unpack_list(reader)
         return obj
@@ -451,7 +546,7 @@
         packed.append(struct.pack("!B", self.type))
         packed.append('\x00' * 1)
         packed.append(struct.pack("!L", self.group_id))
-        packed.append("".join([x.pack() for x in self.buckets]))
+        packed.append(util.pack_list(self.buckets))
         length = sum([len(x) for x in packed])
         packed[0] = struct.pack("!H", length)
         return ''.join(packed)
@@ -463,10 +558,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _length = reader.read('!H')[0]
-        obj.type = reader.read('!B')[0]
+        _length = reader.read("!H")[0]
+        obj.type = reader.read("!B")[0]
         reader.skip(1)
-        obj.group_id = reader.read('!L')[0]
+        obj.group_id = reader.read("!L")[0]
         obj.buckets = common.unpack_list_bucket(reader)
         return obj
 
@@ -534,7 +629,7 @@
         packed.append('\x00' * 4)
         packed.append(struct.pack("!Q", self.packet_count))
         packed.append(struct.pack("!Q", self.byte_count))
-        packed.append("".join([x.pack() for x in self.bucket_stats]))
+        packed.append(util.pack_list(self.bucket_stats))
         length = sum([len(x) for x in packed])
         packed[0] = struct.pack("!H", length)
         return ''.join(packed)
@@ -546,13 +641,13 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _length = reader.read('!H')[0]
+        _length = reader.read("!H")[0]
         reader.skip(2)
-        obj.group_id = reader.read('!L')[0]
-        obj.ref_count = reader.read('!L')[0]
+        obj.group_id = reader.read("!L")[0]
+        obj.ref_count = reader.read("!L")[0]
         reader.skip(4)
-        obj.packet_count = reader.read('!Q')[0]
-        obj.byte_count = reader.read('!Q')[0]
+        obj.packet_count = reader.read("!Q")[0]
+        obj.byte_count = reader.read("!Q")[0]
         obj.bucket_stats = loxi.generic_util.unpack_list(reader, common.bucket_counter.unpack)
         return obj
 
@@ -608,7 +703,7 @@
         packed = []
         packed.append(struct.pack("!H", self.type))
         packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
-        packed.append("".join([x.pack() for x in self.oxm_list]))
+        packed.append(util.pack_list(self.oxm_list))
         length = sum([len(x) for x in packed])
         packed[1] = struct.pack("!H", length)
         packed.append('\x00' * ((length + 7)/8*8 - length))
@@ -621,9 +716,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
         assert(_type == 1)
-        _length = reader.read('!H')[0]
+        _length = reader.read("!H")[0]
         obj.oxm_list = oxm.unpack_list(reader.slice(_length-4))
         reader.skip((_length + 7)/8*8 - _length)
         return obj
@@ -670,10 +765,10 @@
     def pack(self):
         packed = []
         packed.append(struct.pack("!L", self.queue_id))
-        packed.append(struct.pack("!L", self.port))
+        packed.append(util.pack_port_no(self.port))
         packed.append(struct.pack("!H", 0)) # placeholder for len at index 2
         packed.append('\x00' * 6)
-        packed.append("".join([x.pack() for x in self.properties]))
+        packed.append(util.pack_list(self.properties))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -685,9 +780,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        obj.queue_id = reader.read('!L')[0]
-        obj.port = reader.read('!L')[0]
-        _len = reader.read('!H')[0]
+        obj.queue_id = reader.read("!L")[0]
+        obj.port = util.unpack_port_no(reader)
+        _len = reader.read("!H")[0]
         reader.skip(6)
         obj.properties = common.unpack_list_queue_prop(reader)
         return obj
@@ -773,7 +868,7 @@
 
     def pack(self):
         packed = []
-        packed.append(struct.pack("!L", self.port_no))
+        packed.append(util.pack_port_no(self.port_no))
         packed.append('\x00' * 4)
         packed.append(struct.pack("!6B", *self.hw_addr))
         packed.append('\x00' * 2)
@@ -795,19 +890,19 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        obj.port_no = reader.read('!L')[0]
+        obj.port_no = util.unpack_port_no(reader)
         reader.skip(4)
         obj.hw_addr = list(reader.read('!6B'))
         reader.skip(2)
         obj.name = reader.read("!16s")[0].rstrip("\x00")
-        obj.config = reader.read('!L')[0]
-        obj.state = reader.read('!L')[0]
-        obj.curr = reader.read('!L')[0]
-        obj.advertised = reader.read('!L')[0]
-        obj.supported = reader.read('!L')[0]
-        obj.peer = reader.read('!L')[0]
-        obj.curr_speed = reader.read('!L')[0]
-        obj.max_speed = reader.read('!L')[0]
+        obj.config = reader.read("!L")[0]
+        obj.state = reader.read("!L")[0]
+        obj.curr = reader.read("!L")[0]
+        obj.advertised = reader.read("!L")[0]
+        obj.supported = reader.read("!L")[0]
+        obj.peer = reader.read("!L")[0]
+        obj.curr_speed = reader.read("!L")[0]
+        obj.max_speed = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -931,7 +1026,7 @@
 
     def pack(self):
         packed = []
-        packed.append(struct.pack("!L", self.port_no))
+        packed.append(util.pack_port_no(self.port_no))
         packed.append('\x00' * 4)
         packed.append(struct.pack("!Q", self.rx_packets))
         packed.append(struct.pack("!Q", self.tx_packets))
@@ -954,20 +1049,20 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        obj.port_no = reader.read('!L')[0]
+        obj.port_no = util.unpack_port_no(reader)
         reader.skip(4)
-        obj.rx_packets = reader.read('!Q')[0]
-        obj.tx_packets = reader.read('!Q')[0]
-        obj.rx_bytes = reader.read('!Q')[0]
-        obj.tx_bytes = reader.read('!Q')[0]
-        obj.rx_dropped = reader.read('!Q')[0]
-        obj.tx_dropped = reader.read('!Q')[0]
-        obj.rx_errors = reader.read('!Q')[0]
-        obj.tx_errors = reader.read('!Q')[0]
-        obj.rx_frame_err = reader.read('!Q')[0]
-        obj.rx_over_err = reader.read('!Q')[0]
-        obj.rx_crc_err = reader.read('!Q')[0]
-        obj.collisions = reader.read('!Q')[0]
+        obj.rx_packets = reader.read("!Q")[0]
+        obj.tx_packets = reader.read("!Q")[0]
+        obj.rx_bytes = reader.read("!Q")[0]
+        obj.tx_bytes = reader.read("!Q")[0]
+        obj.rx_dropped = reader.read("!Q")[0]
+        obj.tx_dropped = reader.read("!Q")[0]
+        obj.rx_errors = reader.read("!Q")[0]
+        obj.tx_errors = reader.read("!Q")[0]
+        obj.rx_frame_err = reader.read("!Q")[0]
+        obj.rx_over_err = reader.read("!Q")[0]
+        obj.rx_crc_err = reader.read("!Q")[0]
+        obj.collisions = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -1041,7 +1136,7 @@
         q.text('}')
 
 class queue_prop_experimenter(object):
-    type = const.OFPQT_EXPERIMENTER
+    type = 65535
 
     def __init__(self, experimenter=None, data=None):
         if experimenter != None:
@@ -1051,7 +1146,7 @@
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
         return
 
     def pack(self):
@@ -1073,11 +1168,11 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPQT_EXPERIMENTER)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 65535)
+        _len = reader.read("!H")[0]
         reader.skip(4)
-        obj.experimenter = reader.read('!L')[0]
+        obj.experimenter = reader.read("!L")[0]
         reader.skip(4)
         obj.data = str(reader.read_all())
         return obj
@@ -1109,7 +1204,7 @@
         q.text('}')
 
 class queue_prop_max_rate(object):
-    type = const.OFPQT_MAX_RATE
+    type = 2
 
     def __init__(self, rate=None):
         if rate != None:
@@ -1136,11 +1231,11 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPQT_MAX_RATE)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 2)
+        _len = reader.read("!H")[0]
         reader.skip(4)
-        obj.rate = reader.read('!H')[0]
+        obj.rate = reader.read("!H")[0]
         reader.skip(6)
         return obj
 
@@ -1167,7 +1262,7 @@
         q.text('}')
 
 class queue_prop_min_rate(object):
-    type = const.OFPQT_MIN_RATE
+    type = 1
 
     def __init__(self, rate=None):
         if rate != None:
@@ -1194,11 +1289,11 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPQT_MIN_RATE)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 1)
+        _len = reader.read("!H")[0]
         reader.skip(4)
-        obj.rate = reader.read('!H')[0]
+        obj.rate = reader.read("!H")[0]
         reader.skip(6)
         return obj
 
@@ -1251,7 +1346,7 @@
 
     def pack(self):
         packed = []
-        packed.append(struct.pack("!L", self.port_no))
+        packed.append(util.pack_port_no(self.port_no))
         packed.append(struct.pack("!L", self.queue_id))
         packed.append(struct.pack("!Q", self.tx_bytes))
         packed.append(struct.pack("!Q", self.tx_packets))
@@ -1265,11 +1360,11 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        obj.port_no = reader.read('!L')[0]
-        obj.queue_id = reader.read('!L')[0]
-        obj.tx_bytes = reader.read('!Q')[0]
-        obj.tx_packets = reader.read('!Q')[0]
-        obj.tx_errors = reader.read('!Q')[0]
+        obj.port_no = util.unpack_port_no(reader)
+        obj.queue_id = reader.read("!L")[0]
+        obj.tx_bytes = reader.read("!Q")[0]
+        obj.tx_packets = reader.read("!Q")[0]
+        obj.tx_errors = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -1324,11 +1419,11 @@
         if match != None:
             self.match = match
         else:
-            self.match = 0
+            self.match = util.init_match_bmap()
         if wildcards != None:
             self.wildcards = wildcards
         else:
-            self.wildcards = 0
+            self.wildcards = util.init_wc_bmap()
         if write_actions != None:
             self.write_actions = write_actions
         else:
@@ -1384,8 +1479,8 @@
         packed.append(struct.pack("!B", self.table_id))
         packed.append('\x00' * 7)
         packed.append(struct.pack("!32s", self.name))
-        packed.append(struct.pack("!Q", self.match))
-        packed.append(struct.pack("!Q", self.wildcards))
+        packed.append(util.pack_match_bmap(self.match))
+        packed.append(util.pack_wc_bmap(self.wildcards))
         packed.append(struct.pack("!L", self.write_actions))
         packed.append(struct.pack("!L", self.apply_actions))
         packed.append(struct.pack("!Q", self.write_setfields))
@@ -1407,23 +1502,23 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        obj.table_id = reader.read('!B')[0]
+        obj.table_id = reader.read("!B")[0]
         reader.skip(7)
         obj.name = reader.read("!32s")[0].rstrip("\x00")
-        obj.match = reader.read('!Q')[0]
-        obj.wildcards = reader.read('!Q')[0]
-        obj.write_actions = reader.read('!L')[0]
-        obj.apply_actions = reader.read('!L')[0]
-        obj.write_setfields = reader.read('!Q')[0]
-        obj.apply_setfields = reader.read('!Q')[0]
-        obj.metadata_match = reader.read('!Q')[0]
-        obj.metadata_write = reader.read('!Q')[0]
-        obj.instructions = reader.read('!L')[0]
-        obj.config = reader.read('!L')[0]
-        obj.max_entries = reader.read('!L')[0]
-        obj.active_count = reader.read('!L')[0]
-        obj.lookup_count = reader.read('!Q')[0]
-        obj.matched_count = reader.read('!Q')[0]
+        obj.match = util.unpack_match_bmap(reader)
+        obj.wildcards = util.unpack_wc_bmap(reader)
+        obj.write_actions = reader.read("!L")[0]
+        obj.apply_actions = reader.read("!L")[0]
+        obj.write_setfields = reader.read("!Q")[0]
+        obj.apply_setfields = reader.read("!Q")[0]
+        obj.metadata_match = reader.read("!Q")[0]
+        obj.metadata_write = reader.read("!Q")[0]
+        obj.instructions = reader.read("!L")[0]
+        obj.config = reader.read("!L")[0]
+        obj.max_entries = reader.read("!L")[0]
+        obj.active_count = reader.read("!L")[0]
+        obj.lookup_count = reader.read("!Q")[0]
+        obj.matched_count = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
diff --git a/src/python/loxi/of12/const.py b/src/python/loxi/of12/const.py
index fa9c93c..20f99bb 100644
--- a/src/python/loxi/of12/const.py
+++ b/src/python/loxi/of12/const.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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 const.py
 # Do not modify
@@ -8,21 +9,21 @@
 OFP_VERSION = 3
 
 # Identifiers from group macro_definitions
-OFP_VLAN_NONE = 0
-OFP_FLOW_PERMANENT = 0
-OFP_ETH_ALEN = 6
-OFP_MAX_PORT_NAME_LEN = 16
 OFP_MAX_TABLE_NAME_LEN = 32
-SERIAL_NUM_LEN = 32
-OFP_DEFAULT_MISS_SEND_LEN = 128
-DESC_STR_LEN = 256
+OFP_MAX_PORT_NAME_LEN = 16
 OFP_TCP_PORT = 6633
 OFP_SSL_PORT = 6633
+OFP_ETH_ALEN = 6
+OFP_DEFAULT_MISS_SEND_LEN = 128
+OFP_VLAN_NONE = 0
+OFP_FLOW_PERMANENT = 0
 OFP_DEFAULT_PRIORITY = 32768
+OFP_NO_BUFFER = 4294967295
+DESC_STR_LEN = 256
+SERIAL_NUM_LEN = 32
+OFPQ_ALL = 4294967295
 OFPQ_MIN_RATE_UNCFG = 65535
 OFPQ_MAX_RATE_UNCFG = 65535
-OFPQ_ALL = 4294967295
-OFP_NO_BUFFER = 4294967295
 
 # Identifiers from group ofp_action_type
 OFPAT_OUTPUT = 0
@@ -179,6 +180,13 @@
     12: 'OFPBRC_BAD_PACKET',
 }
 
+# Identifiers from group ofp_bsn_vport_q_in_q_untagged
+OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
+
+ofp_bsn_vport_q_in_q_untagged_map = {
+    65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
+}
+
 # Identifiers from group ofp_capabilities
 OFPC_FLOW_STATS = 1
 OFPC_TABLE_STATS = 2
diff --git a/src/python/loxi/of12/instruction.py b/src/python/loxi/of12/instruction.py
index 52ee289..961f3c6 100644
--- a/src/python/loxi/of12/instruction.py
+++ b/src/python/loxi/of12/instruction.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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 instruction.py
 # Do not modify
@@ -24,7 +25,7 @@
     pass
 
 class apply_actions(Instruction):
-    type = const.OFPIT_APPLY_ACTIONS
+    type = 4
 
     def __init__(self, actions=None):
         if actions != None:
@@ -38,7 +39,7 @@
         packed.append(struct.pack("!H", self.type))
         packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.actions]))
+        packed.append(util.pack_list(self.actions))
         length = sum([len(x) for x in packed])
         packed[1] = struct.pack("!H", length)
         return ''.join(packed)
@@ -50,9 +51,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPIT_APPLY_ACTIONS)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 4)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         obj.actions = action.unpack_list(reader)
         return obj
@@ -80,7 +81,7 @@
         q.text('}')
 
 class clear_actions(Instruction):
-    type = const.OFPIT_CLEAR_ACTIONS
+    type = 5
 
     def __init__(self):
         return
@@ -101,9 +102,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPIT_CLEAR_ACTIONS)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 5)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -127,7 +128,7 @@
         q.text('}')
 
 class experimenter(Instruction):
-    type = const.OFPIT_EXPERIMENTER
+    type = 65535
 
     def __init__(self, experimenter=None, data=None):
         if experimenter != None:
@@ -137,7 +138,7 @@
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
         return
 
     def pack(self):
@@ -157,10 +158,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPIT_EXPERIMENTER)
-        _len = reader.read('!H')[0]
-        obj.experimenter = reader.read('!L')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 65535)
+        _len = reader.read("!H")[0]
+        obj.experimenter = reader.read("!L")[0]
         obj.data = str(reader.read_all())
         return obj
 
@@ -191,7 +192,7 @@
         q.text('}')
 
 class goto_table(Instruction):
-    type = const.OFPIT_GOTO_TABLE
+    type = 1
 
     def __init__(self, table_id=None):
         if table_id != None:
@@ -217,10 +218,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPIT_GOTO_TABLE)
-        _len = reader.read('!H')[0]
-        obj.table_id = reader.read('!B')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 1)
+        _len = reader.read("!H")[0]
+        obj.table_id = reader.read("!B")[0]
         reader.skip(3)
         return obj
 
@@ -247,7 +248,7 @@
         q.text('}')
 
 class write_actions(Instruction):
-    type = const.OFPIT_WRITE_ACTIONS
+    type = 3
 
     def __init__(self, actions=None):
         if actions != None:
@@ -261,7 +262,7 @@
         packed.append(struct.pack("!H", self.type))
         packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.actions]))
+        packed.append(util.pack_list(self.actions))
         length = sum([len(x) for x in packed])
         packed[1] = struct.pack("!H", length)
         return ''.join(packed)
@@ -273,9 +274,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPIT_WRITE_ACTIONS)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 3)
+        _len = reader.read("!H")[0]
         reader.skip(4)
         obj.actions = action.unpack_list(reader)
         return obj
@@ -303,7 +304,7 @@
         q.text('}')
 
 class write_metadata(Instruction):
-    type = const.OFPIT_WRITE_METADATA
+    type = 2
 
     def __init__(self, metadata=None, metadata_mask=None):
         if metadata != None:
@@ -334,12 +335,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type = reader.read('!H')[0]
-        assert(_type == const.OFPIT_WRITE_METADATA)
-        _len = reader.read('!H')[0]
+        _type = reader.read("!H")[0]
+        assert(_type == 2)
+        _len = reader.read("!H")[0]
         reader.skip(4)
-        obj.metadata = reader.read('!Q')[0]
-        obj.metadata_mask = reader.read('!Q')[0]
+        obj.metadata = reader.read("!Q")[0]
+        obj.metadata_mask = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -370,10 +371,10 @@
 
 
 parsers = {
+    const.OFPIT_GOTO_TABLE : goto_table.unpack,
+    const.OFPIT_WRITE_METADATA : write_metadata.unpack,
+    const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
     const.OFPIT_APPLY_ACTIONS : apply_actions.unpack,
     const.OFPIT_CLEAR_ACTIONS : clear_actions.unpack,
     const.OFPIT_EXPERIMENTER : experimenter.unpack,
-    const.OFPIT_GOTO_TABLE : goto_table.unpack,
-    const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
-    const.OFPIT_WRITE_METADATA : write_metadata.unpack,
 }
diff --git a/src/python/loxi/of12/message.py b/src/python/loxi/of12/message.py
index f5b75e4..76424fe 100644
--- a/src/python/loxi/of12/message.py
+++ b/src/python/loxi/of12/message.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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 message.py
 # Do not modify
@@ -20,9 +21,9 @@
     xid = None
 
 class aggregate_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_AGGREGATE
+    version = 3
+    type = 19
+    stats_type = 2
 
     def __init__(self, xid=None, flags=None, packet_count=None, byte_count=None, flow_count=None):
         self.xid = xid
@@ -68,19 +69,19 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_AGGREGATE)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 2)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.packet_count = reader.read('!Q')[0]
-        obj.byte_count = reader.read('!Q')[0]
-        obj.flow_count = reader.read('!L')[0]
+        obj.packet_count = reader.read("!Q")[0]
+        obj.byte_count = reader.read("!Q")[0]
+        obj.flow_count = reader.read("!L")[0]
         reader.skip(4)
         return obj
 
@@ -131,9 +132,9 @@
         q.text('}')
 
 class aggregate_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_AGGREGATE
+    version = 3
+    type = 18
+    stats_type = 2
 
     def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
         self.xid = xid
@@ -177,7 +178,7 @@
         packed.append('\x00' * 4)
         packed.append(struct.pack("!B", self.table_id))
         packed.append('\x00' * 3)
-        packed.append(struct.pack("!L", self.out_port))
+        packed.append(util.pack_port_no(self.out_port))
         packed.append(struct.pack("!L", self.out_group))
         packed.append('\x00' * 4)
         packed.append(struct.pack("!Q", self.cookie))
@@ -195,23 +196,23 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_AGGREGATE)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 2)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.table_id = reader.read('!B')[0]
+        obj.table_id = reader.read("!B")[0]
         reader.skip(3)
-        obj.out_port = reader.read('!L')[0]
-        obj.out_group = reader.read('!L')[0]
+        obj.out_port = util.unpack_port_no(reader)
+        obj.out_group = reader.read("!L")[0]
         reader.skip(4)
-        obj.cookie = reader.read('!Q')[0]
-        obj.cookie_mask = reader.read('!Q')[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.cookie_mask = reader.read("!Q")[0]
         obj.match = common.match.unpack(reader)
         return obj
 
@@ -274,8 +275,8 @@
         q.text('}')
 
 class barrier_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_BARRIER_REPLY
+    version = 3
+    type = 21
 
     def __init__(self, xid=None):
         self.xid = xid
@@ -298,12 +299,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_BARRIER_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 21)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -337,8 +338,8 @@
         q.text('}')
 
 class barrier_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_BARRIER_REQUEST
+    version = 3
+    type = 20
 
     def __init__(self, xid=None):
         self.xid = xid
@@ -361,12 +362,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_BARRIER_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 20)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -399,10 +400,486 @@
             q.breakable()
         q.text('}')
 
+class bsn_bw_clear_data_reply(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 22
+
+    def __init__(self, xid=None, status=None):
+        self.xid = xid
+        if status != None:
+            self.status = status
+        else:
+            self.status = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.status))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_bw_clear_data_reply()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 22)
+        obj.status = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.status != other.status: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_bw_clear_data_reply {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("status = ");
+                q.text("%#x" % self.status)
+            q.breakable()
+        q.text('}')
+
+class bsn_bw_clear_data_request(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 21
+
+    def __init__(self, xid=None):
+        self.xid = xid
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_bw_clear_data_request()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 21)
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_bw_clear_data_request {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+            q.breakable()
+        q.text('}')
+
+class bsn_bw_enable_get_reply(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 20
+
+    def __init__(self, xid=None, enabled=None):
+        self.xid = xid
+        if enabled != None:
+            self.enabled = enabled
+        else:
+            self.enabled = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.enabled))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_bw_enable_get_reply()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 20)
+        obj.enabled = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.enabled != other.enabled: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_bw_enable_get_reply {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("enabled = ");
+                q.text("%#x" % self.enabled)
+            q.breakable()
+        q.text('}')
+
+class bsn_bw_enable_get_request(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 19
+
+    def __init__(self, xid=None):
+        self.xid = xid
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_bw_enable_get_request()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 19)
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_bw_enable_get_request {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+            q.breakable()
+        q.text('}')
+
+class bsn_bw_enable_set_reply(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 23
+
+    def __init__(self, xid=None, enable=None, status=None):
+        self.xid = xid
+        if enable != None:
+            self.enable = enable
+        else:
+            self.enable = 0
+        if status != None:
+            self.status = status
+        else:
+            self.status = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.enable))
+        packed.append(struct.pack("!L", self.status))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_bw_enable_set_reply()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 23)
+        obj.enable = reader.read("!L")[0]
+        obj.status = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.enable != other.enable: return False
+        if self.status != other.status: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_bw_enable_set_reply {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("enable = ");
+                q.text("%#x" % self.enable)
+                q.text(","); q.breakable()
+                q.text("status = ");
+                q.text("%#x" % self.status)
+            q.breakable()
+        q.text('}')
+
+class bsn_bw_enable_set_request(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 18
+
+    def __init__(self, xid=None, enable=None):
+        self.xid = xid
+        if enable != None:
+            self.enable = enable
+        else:
+            self.enable = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.enable))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_bw_enable_set_request()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 18)
+        obj.enable = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.enable != other.enable: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_bw_enable_set_request {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("enable = ");
+                q.text("%#x" % self.enable)
+            q.breakable()
+        q.text('}')
+
 class bsn_get_interfaces_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_EXPERIMENTER
-    experimenter = 0x5c16c7
+    version = 3
+    type = 4
+    experimenter = 6035143
     subtype = 10
 
     def __init__(self, xid=None, interfaces=None):
@@ -420,7 +897,7 @@
         packed.append(struct.pack("!L", self.xid))
         packed.append(struct.pack("!L", self.experimenter))
         packed.append(struct.pack("!L", self.subtype))
-        packed.append("".join([x.pack() for x in self.interfaces]))
+        packed.append(util.pack_list(self.interfaces))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -433,15 +910,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_EXPERIMENTER)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 10)
         obj.interfaces = loxi.generic_util.unpack_list(reader, common.bsn_interface.unpack)
         return obj
@@ -481,9 +958,9 @@
         q.text('}')
 
 class bsn_get_interfaces_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_EXPERIMENTER
-    experimenter = 0x5c16c7
+    version = 3
+    type = 4
+    experimenter = 6035143
     subtype = 9
 
     def __init__(self, xid=None):
@@ -509,15 +986,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_EXPERIMENTER)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 9)
         return obj
 
@@ -552,9 +1029,9 @@
         q.text('}')
 
 class bsn_get_mirroring_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_EXPERIMENTER
-    experimenter = 0x5c16c7
+    version = 3
+    type = 4
+    experimenter = 6035143
     subtype = 5
 
     def __init__(self, xid=None, report_mirror_ports=None):
@@ -586,17 +1063,17 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_EXPERIMENTER)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 5)
-        obj.report_mirror_ports = reader.read('!B')[0]
+        obj.report_mirror_ports = reader.read("!B")[0]
         reader.skip(3)
         return obj
 
@@ -635,9 +1112,9 @@
         q.text('}')
 
 class bsn_get_mirroring_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_EXPERIMENTER
-    experimenter = 0x5c16c7
+    version = 3
+    type = 4
+    experimenter = 6035143
     subtype = 4
 
     def __init__(self, xid=None, report_mirror_ports=None):
@@ -669,17 +1146,17 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_EXPERIMENTER)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 4)
-        obj.report_mirror_ports = reader.read('!B')[0]
+        obj.report_mirror_ports = reader.read("!B")[0]
         reader.skip(3)
         return obj
 
@@ -718,9 +1195,9 @@
         q.text('}')
 
 class bsn_set_mirroring(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_EXPERIMENTER
-    experimenter = 0x5c16c7
+    version = 3
+    type = 4
+    experimenter = 6035143
     subtype = 3
 
     def __init__(self, xid=None, report_mirror_ports=None):
@@ -752,17 +1229,17 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_EXPERIMENTER)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 3)
-        obj.report_mirror_ports = reader.read('!B')[0]
+        obj.report_mirror_ports = reader.read("!B")[0]
         reader.skip(3)
         return obj
 
@@ -800,10 +1277,91 @@
             q.breakable()
         q.text('}')
 
-class bsn_set_pktin_suppression(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_EXPERIMENTER
-    experimenter = 0x5c16c7
+class bsn_set_pktin_suppression_reply(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 25
+
+    def __init__(self, xid=None, status=None):
+        self.xid = xid
+        if status != None:
+            self.status = status
+        else:
+            self.status = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.status))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_set_pktin_suppression_reply()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 25)
+        obj.status = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.status != other.status: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_set_pktin_suppression_reply {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("status = ");
+                q.text("%#x" % self.status)
+            q.breakable()
+        q.text('}')
+
+class bsn_set_pktin_suppression_request(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
     subtype = 11
 
     def __init__(self, xid=None, enabled=None, idle_timeout=None, hard_timeout=None, priority=None, cookie=None):
@@ -850,27 +1408,27 @@
     @staticmethod
     def unpack(buf):
         if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
-        obj = bsn_set_pktin_suppression()
+        obj = bsn_set_pktin_suppression_request()
         if type(buf) == loxi.generic_util.OFReader:
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_EXPERIMENTER)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _experimenter = reader.read('!L')[0]
-        assert(_experimenter == 0x5c16c7)
-        _subtype = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
         assert(_subtype == 11)
-        obj.enabled = reader.read('!B')[0]
+        obj.enabled = reader.read("!B")[0]
         reader.skip(1)
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.cookie = reader.read('!Q')[0]
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.cookie = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -896,7 +1454,7 @@
         return loxi.pp.pp(self)
 
     def pretty_print(self, q):
-        q.text("bsn_set_pktin_suppression {")
+        q.text("bsn_set_pktin_suppression_request {")
         with q.group():
             with q.indent(2):
                 q.breakable()
@@ -923,10 +1481,344 @@
             q.breakable()
         q.text('}')
 
+class bsn_virtual_port_create_reply(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 16
+
+    def __init__(self, xid=None, status=None, vport_no=None):
+        self.xid = xid
+        if status != None:
+            self.status = status
+        else:
+            self.status = 0
+        if vport_no != None:
+            self.vport_no = vport_no
+        else:
+            self.vport_no = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.status))
+        packed.append(struct.pack("!L", self.vport_no))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_virtual_port_create_reply()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 16)
+        obj.status = reader.read("!L")[0]
+        obj.vport_no = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.status != other.status: return False
+        if self.vport_no != other.vport_no: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_virtual_port_create_reply {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("status = ");
+                q.text("%#x" % self.status)
+                q.text(","); q.breakable()
+                q.text("vport_no = ");
+                q.text("%#x" % self.vport_no)
+            q.breakable()
+        q.text('}')
+
+class bsn_virtual_port_create_request(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 15
+
+    def __init__(self, xid=None, vport=None):
+        self.xid = xid
+        if vport != None:
+            self.vport = vport
+        else:
+            self.vport = common.bsn_vport_q_in_q()
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(self.vport.pack())
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_virtual_port_create_request()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 15)
+        obj.vport = common.bsn_vport_q_in_q.unpack(reader)
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.vport != other.vport: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_virtual_port_create_request {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("vport = ");
+                q.pp(self.vport)
+            q.breakable()
+        q.text('}')
+
+class bsn_virtual_port_remove_reply(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 26
+
+    def __init__(self, xid=None, status=None):
+        self.xid = xid
+        if status != None:
+            self.status = status
+        else:
+            self.status = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.status))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_virtual_port_remove_reply()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 26)
+        obj.status = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.status != other.status: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_virtual_port_remove_reply {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("status = ");
+                q.text("%#x" % self.status)
+            q.breakable()
+        q.text('}')
+
+class bsn_virtual_port_remove_request(Message):
+    version = 3
+    type = 4
+    experimenter = 6035143
+    subtype = 17
+
+    def __init__(self, xid=None, vport_no=None):
+        self.xid = xid
+        if vport_no != None:
+            self.vport_no = vport_no
+        else:
+            self.vport_no = 0
+
+    def pack(self):
+        packed = []
+        packed.append(struct.pack("!B", self.version))
+        packed.append(struct.pack("!B", self.type))
+        packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
+        packed.append(struct.pack("!L", self.xid))
+        packed.append(struct.pack("!L", self.experimenter))
+        packed.append(struct.pack("!L", self.subtype))
+        packed.append(struct.pack("!L", self.vport_no))
+        length = sum([len(x) for x in packed])
+        packed[2] = struct.pack("!H", length)
+        return ''.join(packed)
+
+    @staticmethod
+    def unpack(buf):
+        if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
+        obj = bsn_virtual_port_remove_request()
+        if type(buf) == loxi.generic_util.OFReader:
+            reader = buf
+        else:
+            reader = loxi.generic_util.OFReader(buf)
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 4)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _experimenter = reader.read("!L")[0]
+        assert(_experimenter == 6035143)
+        _subtype = reader.read("!L")[0]
+        assert(_subtype == 17)
+        obj.vport_no = reader.read("!L")[0]
+        return obj
+
+    def __eq__(self, other):
+        if type(self) != type(other): return False
+        if self.version != other.version: return False
+        if self.type != other.type: return False
+        if self.xid != other.xid: return False
+        if self.vport_no != other.vport_no: return False
+        return True
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    def __str__(self):
+        return self.show()
+
+    def show(self):
+        import loxi.pp
+        return loxi.pp.pp(self)
+
+    def pretty_print(self, q):
+        q.text("bsn_virtual_port_remove_request {")
+        with q.group():
+            with q.indent(2):
+                q.breakable()
+                q.text("xid = ");
+                if self.xid != None:
+                    q.text("%#x" % self.xid)
+                else:
+                    q.text('None')
+                q.text(","); q.breakable()
+                q.text("vport_no = ");
+                q.text("%#x" % self.vport_no)
+            q.breakable()
+        q.text('}')
+
 class desc_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_DESC
+    version = 3
+    type = 19
+    stats_type = 0
 
     def __init__(self, xid=None, flags=None, mfr_desc=None, hw_desc=None, sw_desc=None, serial_num=None, dp_desc=None):
         self.xid = xid
@@ -981,15 +1873,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_DESC)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 0)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         obj.mfr_desc = reader.read("!256s")[0].rstrip("\x00")
         obj.hw_desc = reader.read("!256s")[0].rstrip("\x00")
@@ -1053,9 +1945,9 @@
         q.text('}')
 
 class desc_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_DESC
+    version = 3
+    type = 18
+    stats_type = 0
 
     def __init__(self, xid=None, flags=None):
         self.xid = xid
@@ -1085,15 +1977,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_DESC)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 0)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -1132,15 +2024,15 @@
         q.text('}')
 
 class echo_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_ECHO_REPLY
+    version = 3
+    type = 3
 
     def __init__(self, xid=None, data=None):
         self.xid = xid
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -1161,12 +2053,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_ECHO_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 3)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         obj.data = str(reader.read_all())
         return obj
 
@@ -1205,15 +2097,15 @@
         q.text('}')
 
 class echo_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_ECHO_REQUEST
+    version = 3
+    type = 2
 
     def __init__(self, xid=None, data=None):
         self.xid = xid
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -1234,12 +2126,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_ECHO_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 2)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         obj.data = str(reader.read_all())
         return obj
 
@@ -1278,8 +2170,8 @@
         q.text('}')
 
 class error_msg(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_ERROR
+    version = 3
+    type = 1
 
     def __init__(self, xid=None, err_type=None, code=None, data=None):
         self.xid = xid
@@ -1294,7 +2186,7 @@
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -1317,14 +2209,14 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_ERROR)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.err_type = reader.read('!H')[0]
-        obj.code = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 1)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.err_type = reader.read("!H")[0]
+        obj.code = reader.read("!H")[0]
         obj.data = str(reader.read_all())
         return obj
 
@@ -1371,9 +2263,9 @@
         q.text('}')
 
 class experimenter_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_EXPERIMENTER
+    version = 3
+    type = 19
+    stats_type = 65535
 
     def __init__(self, xid=None, flags=None, experimenter=None, subtype=None, data=None):
         self.xid = xid
@@ -1392,7 +2284,7 @@
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -1418,18 +2310,18 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_EXPERIMENTER)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 65535)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.experimenter = reader.read('!L')[0]
-        obj.subtype = reader.read('!L')[0]
+        obj.experimenter = reader.read("!L")[0]
+        obj.subtype = reader.read("!L")[0]
         obj.data = str(reader.read_all())
         return obj
 
@@ -1480,9 +2372,9 @@
         q.text('}')
 
 class experimenter_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_EXPERIMENTER
+    version = 3
+    type = 18
+    stats_type = 65535
 
     def __init__(self, xid=None, flags=None, experimenter=None, subtype=None, data=None):
         self.xid = xid
@@ -1501,7 +2393,7 @@
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -1527,18 +2419,18 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_EXPERIMENTER)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 65535)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.experimenter = reader.read('!L')[0]
-        obj.subtype = reader.read('!L')[0]
+        obj.experimenter = reader.read("!L")[0]
+        obj.subtype = reader.read("!L")[0]
         obj.data = str(reader.read_all())
         return obj
 
@@ -1589,8 +2481,8 @@
         q.text('}')
 
 class features_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FEATURES_REPLY
+    version = 3
+    type = 6
 
     def __init__(self, xid=None, datapath_id=None, n_buffers=None, n_tables=None, capabilities=None, reserved=None, ports=None):
         self.xid = xid
@@ -1631,7 +2523,7 @@
         packed.append('\x00' * 3)
         packed.append(struct.pack("!L", self.capabilities))
         packed.append(struct.pack("!L", self.reserved))
-        packed.append("".join([x.pack() for x in self.ports]))
+        packed.append(util.pack_list(self.ports))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -1644,18 +2536,18 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FEATURES_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.datapath_id = reader.read('!Q')[0]
-        obj.n_buffers = reader.read('!L')[0]
-        obj.n_tables = reader.read('!B')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 6)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.datapath_id = reader.read("!Q")[0]
+        obj.n_buffers = reader.read("!L")[0]
+        obj.n_tables = reader.read("!B")[0]
         reader.skip(3)
-        obj.capabilities = reader.read('!L')[0]
-        obj.reserved = reader.read('!L')[0]
+        obj.capabilities = reader.read("!L")[0]
+        obj.reserved = reader.read("!L")[0]
         obj.ports = loxi.generic_util.unpack_list(reader, common.port_desc.unpack)
         return obj
 
@@ -1714,8 +2606,8 @@
         q.text('}')
 
 class features_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FEATURES_REQUEST
+    version = 3
+    type = 5
 
     def __init__(self, xid=None):
         self.xid = xid
@@ -1738,12 +2630,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FEATURES_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 5)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -1777,9 +2669,9 @@
         q.text('}')
 
 class flow_add(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FLOW_MOD
-    _command = const.OFPFC_ADD
+    version = 3
+    type = 14
+    _command = 0
 
     def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
         self.xid = xid
@@ -1841,17 +2733,17 @@
         packed.append(struct.pack("!Q", self.cookie))
         packed.append(struct.pack("!Q", self.cookie_mask))
         packed.append(struct.pack("!B", self.table_id))
-        packed.append(struct.pack("!B", self._command))
+        packed.append(util.pack_fm_cmd(self._command))
         packed.append(struct.pack("!H", self.idle_timeout))
         packed.append(struct.pack("!H", self.hard_timeout))
         packed.append(struct.pack("!H", self.priority))
         packed.append(struct.pack("!L", self.buffer_id))
-        packed.append(struct.pack("!L", self.out_port))
+        packed.append(util.pack_port_no(self.out_port))
         packed.append(struct.pack("!L", self.out_group))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 2)
         packed.append(self.match.pack())
-        packed.append("".join([x.pack() for x in self.instructions]))
+        packed.append(util.pack_list(self.instructions))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -1864,24 +2756,24 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FLOW_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.cookie = reader.read('!Q')[0]
-        obj.cookie_mask = reader.read('!Q')[0]
-        obj.table_id = reader.read('!B')[0]
-        __command = reader.read('!B')[0]
-        assert(__command == const.OFPFC_ADD)
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.buffer_id = reader.read('!L')[0]
-        obj.out_port = reader.read('!L')[0]
-        obj.out_group = reader.read('!L')[0]
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 14)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.cookie_mask = reader.read("!Q")[0]
+        obj.table_id = reader.read("!B")[0]
+        __command = util.unpack_fm_cmd(reader)
+        assert(__command == 0)
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.buffer_id = reader.read("!L")[0]
+        obj.out_port = util.unpack_port_no(reader)
+        obj.out_group = reader.read("!L")[0]
+        obj.flags = reader.read("!H")[0]
         reader.skip(2)
         obj.match = common.match.unpack(reader)
         obj.instructions = instruction.unpack_list(reader)
@@ -1966,9 +2858,9 @@
         q.text('}')
 
 class flow_delete(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FLOW_MOD
-    _command = const.OFPFC_DELETE
+    version = 3
+    type = 14
+    _command = 3
 
     def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
         self.xid = xid
@@ -2030,17 +2922,17 @@
         packed.append(struct.pack("!Q", self.cookie))
         packed.append(struct.pack("!Q", self.cookie_mask))
         packed.append(struct.pack("!B", self.table_id))
-        packed.append(struct.pack("!B", self._command))
+        packed.append(util.pack_fm_cmd(self._command))
         packed.append(struct.pack("!H", self.idle_timeout))
         packed.append(struct.pack("!H", self.hard_timeout))
         packed.append(struct.pack("!H", self.priority))
         packed.append(struct.pack("!L", self.buffer_id))
-        packed.append(struct.pack("!L", self.out_port))
+        packed.append(util.pack_port_no(self.out_port))
         packed.append(struct.pack("!L", self.out_group))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 2)
         packed.append(self.match.pack())
-        packed.append("".join([x.pack() for x in self.instructions]))
+        packed.append(util.pack_list(self.instructions))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -2053,24 +2945,24 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FLOW_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.cookie = reader.read('!Q')[0]
-        obj.cookie_mask = reader.read('!Q')[0]
-        obj.table_id = reader.read('!B')[0]
-        __command = reader.read('!B')[0]
-        assert(__command == const.OFPFC_DELETE)
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.buffer_id = reader.read('!L')[0]
-        obj.out_port = reader.read('!L')[0]
-        obj.out_group = reader.read('!L')[0]
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 14)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.cookie_mask = reader.read("!Q")[0]
+        obj.table_id = reader.read("!B")[0]
+        __command = util.unpack_fm_cmd(reader)
+        assert(__command == 3)
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.buffer_id = reader.read("!L")[0]
+        obj.out_port = util.unpack_port_no(reader)
+        obj.out_group = reader.read("!L")[0]
+        obj.flags = reader.read("!H")[0]
         reader.skip(2)
         obj.match = common.match.unpack(reader)
         obj.instructions = instruction.unpack_list(reader)
@@ -2155,9 +3047,9 @@
         q.text('}')
 
 class flow_delete_strict(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FLOW_MOD
-    _command = const.OFPFC_DELETE_STRICT
+    version = 3
+    type = 14
+    _command = 4
 
     def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
         self.xid = xid
@@ -2219,17 +3111,17 @@
         packed.append(struct.pack("!Q", self.cookie))
         packed.append(struct.pack("!Q", self.cookie_mask))
         packed.append(struct.pack("!B", self.table_id))
-        packed.append(struct.pack("!B", self._command))
+        packed.append(util.pack_fm_cmd(self._command))
         packed.append(struct.pack("!H", self.idle_timeout))
         packed.append(struct.pack("!H", self.hard_timeout))
         packed.append(struct.pack("!H", self.priority))
         packed.append(struct.pack("!L", self.buffer_id))
-        packed.append(struct.pack("!L", self.out_port))
+        packed.append(util.pack_port_no(self.out_port))
         packed.append(struct.pack("!L", self.out_group))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 2)
         packed.append(self.match.pack())
-        packed.append("".join([x.pack() for x in self.instructions]))
+        packed.append(util.pack_list(self.instructions))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -2242,24 +3134,24 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FLOW_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.cookie = reader.read('!Q')[0]
-        obj.cookie_mask = reader.read('!Q')[0]
-        obj.table_id = reader.read('!B')[0]
-        __command = reader.read('!B')[0]
-        assert(__command == const.OFPFC_DELETE_STRICT)
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.buffer_id = reader.read('!L')[0]
-        obj.out_port = reader.read('!L')[0]
-        obj.out_group = reader.read('!L')[0]
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 14)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.cookie_mask = reader.read("!Q")[0]
+        obj.table_id = reader.read("!B")[0]
+        __command = util.unpack_fm_cmd(reader)
+        assert(__command == 4)
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.buffer_id = reader.read("!L")[0]
+        obj.out_port = util.unpack_port_no(reader)
+        obj.out_group = reader.read("!L")[0]
+        obj.flags = reader.read("!H")[0]
         reader.skip(2)
         obj.match = common.match.unpack(reader)
         obj.instructions = instruction.unpack_list(reader)
@@ -2344,9 +3236,9 @@
         q.text('}')
 
 class flow_modify(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FLOW_MOD
-    _command = const.OFPFC_MODIFY
+    version = 3
+    type = 14
+    _command = 1
 
     def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
         self.xid = xid
@@ -2408,17 +3300,17 @@
         packed.append(struct.pack("!Q", self.cookie))
         packed.append(struct.pack("!Q", self.cookie_mask))
         packed.append(struct.pack("!B", self.table_id))
-        packed.append(struct.pack("!B", self._command))
+        packed.append(util.pack_fm_cmd(self._command))
         packed.append(struct.pack("!H", self.idle_timeout))
         packed.append(struct.pack("!H", self.hard_timeout))
         packed.append(struct.pack("!H", self.priority))
         packed.append(struct.pack("!L", self.buffer_id))
-        packed.append(struct.pack("!L", self.out_port))
+        packed.append(util.pack_port_no(self.out_port))
         packed.append(struct.pack("!L", self.out_group))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 2)
         packed.append(self.match.pack())
-        packed.append("".join([x.pack() for x in self.instructions]))
+        packed.append(util.pack_list(self.instructions))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -2431,24 +3323,24 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FLOW_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.cookie = reader.read('!Q')[0]
-        obj.cookie_mask = reader.read('!Q')[0]
-        obj.table_id = reader.read('!B')[0]
-        __command = reader.read('!B')[0]
-        assert(__command == const.OFPFC_MODIFY)
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.buffer_id = reader.read('!L')[0]
-        obj.out_port = reader.read('!L')[0]
-        obj.out_group = reader.read('!L')[0]
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 14)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.cookie_mask = reader.read("!Q")[0]
+        obj.table_id = reader.read("!B")[0]
+        __command = util.unpack_fm_cmd(reader)
+        assert(__command == 1)
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.buffer_id = reader.read("!L")[0]
+        obj.out_port = util.unpack_port_no(reader)
+        obj.out_group = reader.read("!L")[0]
+        obj.flags = reader.read("!H")[0]
         reader.skip(2)
         obj.match = common.match.unpack(reader)
         obj.instructions = instruction.unpack_list(reader)
@@ -2533,9 +3425,9 @@
         q.text('}')
 
 class flow_modify_strict(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FLOW_MOD
-    _command = const.OFPFC_MODIFY_STRICT
+    version = 3
+    type = 14
+    _command = 2
 
     def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
         self.xid = xid
@@ -2597,17 +3489,17 @@
         packed.append(struct.pack("!Q", self.cookie))
         packed.append(struct.pack("!Q", self.cookie_mask))
         packed.append(struct.pack("!B", self.table_id))
-        packed.append(struct.pack("!B", self._command))
+        packed.append(util.pack_fm_cmd(self._command))
         packed.append(struct.pack("!H", self.idle_timeout))
         packed.append(struct.pack("!H", self.hard_timeout))
         packed.append(struct.pack("!H", self.priority))
         packed.append(struct.pack("!L", self.buffer_id))
-        packed.append(struct.pack("!L", self.out_port))
+        packed.append(util.pack_port_no(self.out_port))
         packed.append(struct.pack("!L", self.out_group))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 2)
         packed.append(self.match.pack())
-        packed.append("".join([x.pack() for x in self.instructions]))
+        packed.append(util.pack_list(self.instructions))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -2620,24 +3512,24 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FLOW_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.cookie = reader.read('!Q')[0]
-        obj.cookie_mask = reader.read('!Q')[0]
-        obj.table_id = reader.read('!B')[0]
-        __command = reader.read('!B')[0]
-        assert(__command == const.OFPFC_MODIFY_STRICT)
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.buffer_id = reader.read('!L')[0]
-        obj.out_port = reader.read('!L')[0]
-        obj.out_group = reader.read('!L')[0]
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 14)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.cookie_mask = reader.read("!Q")[0]
+        obj.table_id = reader.read("!B")[0]
+        __command = util.unpack_fm_cmd(reader)
+        assert(__command == 2)
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.buffer_id = reader.read("!L")[0]
+        obj.out_port = util.unpack_port_no(reader)
+        obj.out_group = reader.read("!L")[0]
+        obj.flags = reader.read("!H")[0]
         reader.skip(2)
         obj.match = common.match.unpack(reader)
         obj.instructions = instruction.unpack_list(reader)
@@ -2722,8 +3614,8 @@
         q.text('}')
 
 class flow_removed(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_FLOW_REMOVED
+    version = 3
+    type = 11
 
     def __init__(self, xid=None, cookie=None, priority=None, reason=None, table_id=None, duration_sec=None, duration_nsec=None, idle_timeout=None, hard_timeout=None, packet_count=None, byte_count=None, match=None):
         self.xid = xid
@@ -2801,22 +3693,22 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_FLOW_REMOVED)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.cookie = reader.read('!Q')[0]
-        obj.priority = reader.read('!H')[0]
-        obj.reason = reader.read('!B')[0]
-        obj.table_id = reader.read('!B')[0]
-        obj.duration_sec = reader.read('!L')[0]
-        obj.duration_nsec = reader.read('!L')[0]
-        obj.idle_timeout = reader.read('!H')[0]
-        obj.hard_timeout = reader.read('!H')[0]
-        obj.packet_count = reader.read('!Q')[0]
-        obj.byte_count = reader.read('!Q')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 11)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.priority = reader.read("!H")[0]
+        obj.reason = reader.read("!B")[0]
+        obj.table_id = reader.read("!B")[0]
+        obj.duration_sec = reader.read("!L")[0]
+        obj.duration_nsec = reader.read("!L")[0]
+        obj.idle_timeout = reader.read("!H")[0]
+        obj.hard_timeout = reader.read("!H")[0]
+        obj.packet_count = reader.read("!Q")[0]
+        obj.byte_count = reader.read("!Q")[0]
         obj.match = common.match.unpack(reader)
         return obj
 
@@ -2895,9 +3787,9 @@
         q.text('}')
 
 class flow_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_FLOW
+    version = 3
+    type = 19
+    stats_type = 1
 
     def __init__(self, xid=None, flags=None, entries=None):
         self.xid = xid
@@ -2919,7 +3811,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.entries]))
+        packed.append(util.pack_list(self.entries))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -2932,15 +3824,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_FLOW)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 1)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         obj.entries = common.unpack_list_flow_stats_entry(reader)
         return obj
@@ -2984,9 +3876,9 @@
         q.text('}')
 
 class flow_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_FLOW
+    version = 3
+    type = 18
+    stats_type = 1
 
     def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
         self.xid = xid
@@ -3030,7 +3922,7 @@
         packed.append('\x00' * 4)
         packed.append(struct.pack("!B", self.table_id))
         packed.append('\x00' * 3)
-        packed.append(struct.pack("!L", self.out_port))
+        packed.append(util.pack_port_no(self.out_port))
         packed.append(struct.pack("!L", self.out_group))
         packed.append('\x00' * 4)
         packed.append(struct.pack("!Q", self.cookie))
@@ -3048,23 +3940,23 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_FLOW)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 1)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.table_id = reader.read('!B')[0]
+        obj.table_id = reader.read("!B")[0]
         reader.skip(3)
-        obj.out_port = reader.read('!L')[0]
-        obj.out_group = reader.read('!L')[0]
+        obj.out_port = util.unpack_port_no(reader)
+        obj.out_group = reader.read("!L")[0]
         reader.skip(4)
-        obj.cookie = reader.read('!Q')[0]
-        obj.cookie_mask = reader.read('!Q')[0]
+        obj.cookie = reader.read("!Q")[0]
+        obj.cookie_mask = reader.read("!Q")[0]
         obj.match = common.match.unpack(reader)
         return obj
 
@@ -3127,8 +4019,8 @@
         q.text('}')
 
 class get_config_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_GET_CONFIG_REPLY
+    version = 3
+    type = 8
 
     def __init__(self, xid=None, flags=None, miss_send_len=None):
         self.xid = xid
@@ -3161,14 +4053,14 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_GET_CONFIG_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.flags = reader.read('!H')[0]
-        obj.miss_send_len = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 8)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.flags = reader.read("!H")[0]
+        obj.miss_send_len = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3210,8 +4102,8 @@
         q.text('}')
 
 class get_config_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_GET_CONFIG_REQUEST
+    version = 3
+    type = 7
 
     def __init__(self, xid=None):
         self.xid = xid
@@ -3234,12 +4126,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_GET_CONFIG_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 7)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -3273,9 +4165,9 @@
         q.text('}')
 
 class group_desc_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_GROUP_DESC
+    version = 3
+    type = 19
+    stats_type = 7
 
     def __init__(self, xid=None, flags=None, entries=None):
         self.xid = xid
@@ -3297,7 +4189,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.entries]))
+        packed.append(util.pack_list(self.entries))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -3310,15 +4202,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_GROUP_DESC)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 7)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         obj.entries = common.unpack_list_group_desc_stats_entry(reader)
         return obj
@@ -3362,9 +4254,9 @@
         q.text('}')
 
 class group_desc_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_GROUP_DESC
+    version = 3
+    type = 18
+    stats_type = 7
 
     def __init__(self, xid=None, flags=None):
         self.xid = xid
@@ -3394,15 +4286,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_GROUP_DESC)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 7)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -3441,9 +4333,9 @@
         q.text('}')
 
 class group_features_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_GROUP_FEATURES
+    version = 3
+    type = 19
+    stats_type = 8
 
     def __init__(self, xid=None, flags=None, types=None, capabilities=None, max_groups_all=None, max_groups_select=None, max_groups_indirect=None, max_groups_ff=None, actions_all=None, actions_select=None, actions_indirect=None, actions_ff=None):
         self.xid = xid
@@ -3523,26 +4415,26 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_GROUP_FEATURES)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 8)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.types = reader.read('!L')[0]
-        obj.capabilities = reader.read('!L')[0]
-        obj.max_groups_all = reader.read('!L')[0]
-        obj.max_groups_select = reader.read('!L')[0]
-        obj.max_groups_indirect = reader.read('!L')[0]
-        obj.max_groups_ff = reader.read('!L')[0]
-        obj.actions_all = reader.read('!L')[0]
-        obj.actions_select = reader.read('!L')[0]
-        obj.actions_indirect = reader.read('!L')[0]
-        obj.actions_ff = reader.read('!L')[0]
+        obj.types = reader.read("!L")[0]
+        obj.capabilities = reader.read("!L")[0]
+        obj.max_groups_all = reader.read("!L")[0]
+        obj.max_groups_select = reader.read("!L")[0]
+        obj.max_groups_indirect = reader.read("!L")[0]
+        obj.max_groups_ff = reader.read("!L")[0]
+        obj.actions_all = reader.read("!L")[0]
+        obj.actions_select = reader.read("!L")[0]
+        obj.actions_indirect = reader.read("!L")[0]
+        obj.actions_ff = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -3620,9 +4512,9 @@
         q.text('}')
 
 class group_features_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_GROUP_FEATURES
+    version = 3
+    type = 18
+    stats_type = 8
 
     def __init__(self, xid=None, flags=None):
         self.xid = xid
@@ -3652,15 +4544,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_GROUP_FEATURES)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 8)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -3699,8 +4591,8 @@
         q.text('}')
 
 class group_mod(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_GROUP_MOD
+    version = 3
+    type = 15
 
     def __init__(self, xid=None, command=None, group_type=None, group_id=None, buckets=None):
         self.xid = xid
@@ -3731,7 +4623,7 @@
         packed.append(struct.pack("!B", self.group_type))
         packed.append('\x00' * 1)
         packed.append(struct.pack("!L", self.group_id))
-        packed.append("".join([x.pack() for x in self.buckets]))
+        packed.append(util.pack_list(self.buckets))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -3744,16 +4636,16 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_GROUP_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.command = reader.read('!H')[0]
-        obj.group_type = reader.read('!B')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 15)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.command = reader.read("!H")[0]
+        obj.group_type = reader.read("!B")[0]
         reader.skip(1)
-        obj.group_id = reader.read('!L')[0]
+        obj.group_id = reader.read("!L")[0]
         obj.buckets = common.unpack_list_bucket(reader)
         return obj
 
@@ -3804,9 +4696,9 @@
         q.text('}')
 
 class group_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_GROUP
+    version = 3
+    type = 19
+    stats_type = 6
 
     def __init__(self, xid=None, flags=None, entries=None):
         self.xid = xid
@@ -3828,7 +4720,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.entries]))
+        packed.append(util.pack_list(self.entries))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -3841,15 +4733,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_GROUP)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 6)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         obj.entries = common.unpack_list_group_stats_entry(reader)
         return obj
@@ -3893,9 +4785,9 @@
         q.text('}')
 
 class group_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_GROUP
+    version = 3
+    type = 18
+    stats_type = 6
 
     def __init__(self, xid=None, flags=None, group_id=None):
         self.xid = xid
@@ -3931,17 +4823,17 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_GROUP)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 6)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.group_id = reader.read('!L')[0]
+        obj.group_id = reader.read("!L")[0]
         reader.skip(4)
         return obj
 
@@ -3984,8 +4876,8 @@
         q.text('}')
 
 class hello(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_HELLO
+    version = 3
+    type = 0
 
     def __init__(self, xid=None):
         self.xid = xid
@@ -4008,12 +4900,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_HELLO)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 0)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -4047,8 +4939,8 @@
         q.text('}')
 
 class packet_in(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_PACKET_IN
+    version = 3
+    type = 10
 
     def __init__(self, xid=None, buffer_id=None, total_len=None, reason=None, table_id=None, match=None, data=None):
         self.xid = xid
@@ -4075,7 +4967,7 @@
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -4102,16 +4994,16 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_PACKET_IN)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.buffer_id = reader.read('!L')[0]
-        obj.total_len = reader.read('!H')[0]
-        obj.reason = reader.read('!B')[0]
-        obj.table_id = reader.read('!B')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 10)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.buffer_id = reader.read("!L")[0]
+        obj.total_len = reader.read("!H")[0]
+        obj.reason = reader.read("!B")[0]
+        obj.table_id = reader.read("!B")[0]
         obj.match = common.match.unpack(reader)
         reader.skip(2)
         obj.data = str(reader.read_all())
@@ -4172,8 +5064,8 @@
         q.text('}')
 
 class packet_out(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_PACKET_OUT
+    version = 3
+    type = 13
 
     def __init__(self, xid=None, buffer_id=None, in_port=None, actions=None, data=None):
         self.xid = xid
@@ -4192,7 +5084,7 @@
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -4201,10 +5093,10 @@
         packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
         packed.append(struct.pack("!L", self.xid))
         packed.append(struct.pack("!L", self.buffer_id))
-        packed.append(struct.pack("!L", self.in_port))
+        packed.append(util.pack_port_no(self.in_port))
         packed.append(struct.pack("!H", 0)) # placeholder for actions_len at index 6
         packed.append('\x00' * 6)
-        packed.append("".join([x.pack() for x in self.actions]))
+        packed.append(util.pack_list(self.actions))
         packed[6] = struct.pack("!H", len(packed[-1]))
         packed.append(self.data)
         length = sum([len(x) for x in packed])
@@ -4219,15 +5111,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_PACKET_OUT)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.buffer_id = reader.read('!L')[0]
-        obj.in_port = reader.read('!L')[0]
-        _actions_len = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 13)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.buffer_id = reader.read("!L")[0]
+        obj.in_port = util.unpack_port_no(reader)
+        _actions_len = reader.read("!H")[0]
         reader.skip(6)
         obj.actions = action.unpack_list(reader.slice(_actions_len))
         obj.data = str(reader.read_all())
@@ -4280,8 +5172,8 @@
         q.text('}')
 
 class port_mod(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_PORT_MOD
+    version = 3
+    type = 16
 
     def __init__(self, xid=None, port_no=None, hw_addr=None, config=None, mask=None, advertise=None):
         self.xid = xid
@@ -4312,7 +5204,7 @@
         packed.append(struct.pack("!B", self.type))
         packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
         packed.append(struct.pack("!L", self.xid))
-        packed.append(struct.pack("!L", self.port_no))
+        packed.append(util.pack_port_no(self.port_no))
         packed.append('\x00' * 4)
         packed.append(struct.pack("!6B", *self.hw_addr))
         packed.append('\x00' * 2)
@@ -4332,19 +5224,19 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_PORT_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.port_no = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 16)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.port_no = util.unpack_port_no(reader)
         reader.skip(4)
         obj.hw_addr = list(reader.read('!6B'))
         reader.skip(2)
-        obj.config = reader.read('!L')[0]
-        obj.mask = reader.read('!L')[0]
-        obj.advertise = reader.read('!L')[0]
+        obj.config = reader.read("!L")[0]
+        obj.mask = reader.read("!L")[0]
+        obj.advertise = reader.read("!L")[0]
         reader.skip(4)
         return obj
 
@@ -4399,9 +5291,9 @@
         q.text('}')
 
 class port_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_PORT
+    version = 3
+    type = 19
+    stats_type = 4
 
     def __init__(self, xid=None, flags=None, entries=None):
         self.xid = xid
@@ -4423,7 +5315,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.entries]))
+        packed.append(util.pack_list(self.entries))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -4436,15 +5328,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_PORT)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 4)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         obj.entries = loxi.generic_util.unpack_list(reader, common.port_stats_entry.unpack)
         return obj
@@ -4488,9 +5380,9 @@
         q.text('}')
 
 class port_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_PORT
+    version = 3
+    type = 18
+    stats_type = 4
 
     def __init__(self, xid=None, flags=None, port_no=None):
         self.xid = xid
@@ -4512,7 +5404,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append(struct.pack("!L", self.port_no))
+        packed.append(util.pack_port_no(self.port_no))
         packed.append('\x00' * 4)
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
@@ -4526,17 +5418,17 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_PORT)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 4)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.port_no = reader.read('!L')[0]
+        obj.port_no = util.unpack_port_no(reader)
         reader.skip(4)
         return obj
 
@@ -4579,8 +5471,8 @@
         q.text('}')
 
 class port_status(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_PORT_STATUS
+    version = 3
+    type = 12
 
     def __init__(self, xid=None, reason=None, desc=None):
         self.xid = xid
@@ -4614,13 +5506,13 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_PORT_STATUS)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.reason = reader.read('!B')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 12)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.reason = reader.read("!B")[0]
         reader.skip(7)
         obj.desc = common.port_desc.unpack(reader)
         return obj
@@ -4664,8 +5556,8 @@
         q.text('}')
 
 class queue_get_config_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_QUEUE_GET_CONFIG_REPLY
+    version = 3
+    type = 23
 
     def __init__(self, xid=None, port=None, queues=None):
         self.xid = xid
@@ -4684,9 +5576,9 @@
         packed.append(struct.pack("!B", self.type))
         packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
         packed.append(struct.pack("!L", self.xid))
-        packed.append(struct.pack("!L", self.port))
+        packed.append(util.pack_port_no(self.port))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.queues]))
+        packed.append(util.pack_list(self.queues))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -4699,13 +5591,13 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_QUEUE_GET_CONFIG_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.port = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 23)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.port = util.unpack_port_no(reader)
         reader.skip(4)
         obj.queues = common.unpack_list_packet_queue(reader)
         return obj
@@ -4749,8 +5641,8 @@
         q.text('}')
 
 class queue_get_config_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_QUEUE_GET_CONFIG_REQUEST
+    version = 3
+    type = 22
 
     def __init__(self, xid=None, port=None):
         self.xid = xid
@@ -4765,7 +5657,7 @@
         packed.append(struct.pack("!B", self.type))
         packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
         packed.append(struct.pack("!L", self.xid))
-        packed.append(struct.pack("!L", self.port))
+        packed.append(util.pack_port_no(self.port))
         packed.append('\x00' * 4)
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
@@ -4779,13 +5671,13 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_QUEUE_GET_CONFIG_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.port = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 22)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.port = util.unpack_port_no(reader)
         reader.skip(4)
         return obj
 
@@ -4824,9 +5716,9 @@
         q.text('}')
 
 class queue_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_QUEUE
+    version = 3
+    type = 19
+    stats_type = 5
 
     def __init__(self, xid=None, flags=None, entries=None):
         self.xid = xid
@@ -4848,7 +5740,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.entries]))
+        packed.append(util.pack_list(self.entries))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -4861,15 +5753,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_QUEUE)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 5)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         obj.entries = loxi.generic_util.unpack_list(reader, common.queue_stats_entry.unpack)
         return obj
@@ -4913,9 +5805,9 @@
         q.text('}')
 
 class queue_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_QUEUE
+    version = 3
+    type = 18
+    stats_type = 5
 
     def __init__(self, xid=None, flags=None, port_no=None, queue_id=None):
         self.xid = xid
@@ -4941,7 +5833,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append(struct.pack("!L", self.port_no))
+        packed.append(util.pack_port_no(self.port_no))
         packed.append(struct.pack("!L", self.queue_id))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
@@ -4955,18 +5847,18 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_QUEUE)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 5)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.port_no = reader.read('!L')[0]
-        obj.queue_id = reader.read('!L')[0]
+        obj.port_no = util.unpack_port_no(reader)
+        obj.queue_id = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -5012,15 +5904,15 @@
         q.text('}')
 
 class role_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_ROLE_REPLY
+    version = 3
+    type = 25
 
     def __init__(self, xid=None, data=None):
         self.xid = xid
         if data != None:
             self.data = data
         else:
-            self.data = ""
+            self.data = ''
 
     def pack(self):
         packed = []
@@ -5041,12 +5933,12 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_ROLE_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 25)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
         obj.data = str(reader.read_all())
         return obj
 
@@ -5085,8 +5977,8 @@
         q.text('}')
 
 class role_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_ROLE_REQUEST
+    version = 3
+    type = 24
 
     def __init__(self, xid=None, role=None, generation_id=None):
         self.xid = xid
@@ -5120,15 +6012,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_ROLE_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.role = reader.read('!L')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 24)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.role = reader.read("!L")[0]
         reader.skip(4)
-        obj.generation_id = reader.read('!Q')[0]
+        obj.generation_id = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -5170,8 +6062,8 @@
         q.text('}')
 
 class set_config(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_SET_CONFIG
+    version = 3
+    type = 9
 
     def __init__(self, xid=None, flags=None, miss_send_len=None):
         self.xid = xid
@@ -5204,14 +6096,14 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_SET_CONFIG)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.flags = reader.read('!H')[0]
-        obj.miss_send_len = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 9)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.flags = reader.read("!H")[0]
+        obj.miss_send_len = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -5253,8 +6145,8 @@
         q.text('}')
 
 class table_mod(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_TABLE_MOD
+    version = 3
+    type = 17
 
     def __init__(self, xid=None, table_id=None, config=None):
         self.xid = xid
@@ -5288,15 +6180,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_TABLE_MOD)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        obj.table_id = reader.read('!B')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 17)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        obj.table_id = reader.read("!B")[0]
         reader.skip(3)
-        obj.config = reader.read('!L')[0]
+        obj.config = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -5338,9 +6230,9 @@
         q.text('}')
 
 class table_stats_reply(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REPLY
-    stats_type = const.OFPST_TABLE
+    version = 3
+    type = 19
+    stats_type = 3
 
     def __init__(self, xid=None, flags=None, entries=None):
         self.xid = xid
@@ -5362,7 +6254,7 @@
         packed.append(struct.pack("!H", self.stats_type))
         packed.append(struct.pack("!H", self.flags))
         packed.append('\x00' * 4)
-        packed.append("".join([x.pack() for x in self.entries]))
+        packed.append(util.pack_list(self.entries))
         length = sum([len(x) for x in packed])
         packed[2] = struct.pack("!H", length)
         return ''.join(packed)
@@ -5375,15 +6267,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REPLY)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_TABLE)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 19)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 3)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         obj.entries = loxi.generic_util.unpack_list(reader, common.table_stats_entry.unpack)
         return obj
@@ -5427,9 +6319,9 @@
         q.text('}')
 
 class table_stats_request(Message):
-    version = const.OFP_VERSION
-    type = const.OFPT_STATS_REQUEST
-    stats_type = const.OFPST_TABLE
+    version = 3
+    type = 18
+    stats_type = 3
 
     def __init__(self, xid=None, flags=None):
         self.xid = xid
@@ -5459,15 +6351,15 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _version = reader.read('!B')[0]
-        assert(_version == const.OFP_VERSION)
-        _type = reader.read('!B')[0]
-        assert(_type == const.OFPT_STATS_REQUEST)
-        _length = reader.read('!H')[0]
-        obj.xid = reader.read('!L')[0]
-        _stats_type = reader.read('!H')[0]
-        assert(_stats_type == const.OFPST_TABLE)
-        obj.flags = reader.read('!H')[0]
+        _version = reader.read("!B")[0]
+        assert(_version == 3)
+        _type = reader.read("!B")[0]
+        assert(_type == 18)
+        _length = reader.read("!H")[0]
+        obj.xid = reader.read("!L")[0]
+        _stats_type = reader.read("!H")[0]
+        assert(_stats_type == 3)
+        obj.flags = reader.read("!H")[0]
         reader.skip(4)
         return obj
 
@@ -5567,32 +6459,32 @@
         raise loxi.ProtocolError("unexpected experimenter %#x subtype %#x" % (experimenter, subtype))
 
 parsers = {
-    const.OFPT_BARRIER_REPLY : barrier_reply.unpack,
-    const.OFPT_BARRIER_REQUEST : barrier_request.unpack,
-    const.OFPT_ECHO_REPLY : echo_reply.unpack,
-    const.OFPT_ECHO_REQUEST : echo_request.unpack,
-    const.OFPT_ERROR : error_msg.unpack,
-    const.OFPT_EXPERIMENTER : parse_experimenter,
-    const.OFPT_FEATURES_REPLY : features_reply.unpack,
-    const.OFPT_FEATURES_REQUEST : features_request.unpack,
-    const.OFPT_FLOW_MOD : parse_flow_mod,
-    const.OFPT_FLOW_REMOVED : flow_removed.unpack,
-    const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
-    const.OFPT_GET_CONFIG_REQUEST : get_config_request.unpack,
-    const.OFPT_GROUP_MOD : group_mod.unpack,
     const.OFPT_HELLO : hello.unpack,
-    const.OFPT_PACKET_IN : packet_in.unpack,
-    const.OFPT_PACKET_OUT : packet_out.unpack,
-    const.OFPT_PORT_MOD : port_mod.unpack,
-    const.OFPT_PORT_STATUS : port_status.unpack,
-    const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
-    const.OFPT_QUEUE_GET_CONFIG_REQUEST : queue_get_config_request.unpack,
-    const.OFPT_ROLE_REPLY : role_reply.unpack,
-    const.OFPT_ROLE_REQUEST : role_request.unpack,
+    const.OFPT_ERROR : error_msg.unpack,
+    const.OFPT_ECHO_REQUEST : echo_request.unpack,
+    const.OFPT_ECHO_REPLY : echo_reply.unpack,
+    const.OFPT_EXPERIMENTER : parse_experimenter,
+    const.OFPT_FEATURES_REQUEST : features_request.unpack,
+    const.OFPT_FEATURES_REPLY : features_reply.unpack,
+    const.OFPT_GET_CONFIG_REQUEST : get_config_request.unpack,
+    const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
     const.OFPT_SET_CONFIG : set_config.unpack,
-    const.OFPT_STATS_REPLY : parse_stats_reply,
-    const.OFPT_STATS_REQUEST : parse_stats_request,
+    const.OFPT_PACKET_IN : packet_in.unpack,
+    const.OFPT_FLOW_REMOVED : flow_removed.unpack,
+    const.OFPT_PORT_STATUS : port_status.unpack,
+    const.OFPT_PACKET_OUT : packet_out.unpack,
+    const.OFPT_FLOW_MOD : parse_flow_mod,
+    const.OFPT_GROUP_MOD : group_mod.unpack,
+    const.OFPT_PORT_MOD : port_mod.unpack,
     const.OFPT_TABLE_MOD : table_mod.unpack,
+    const.OFPT_STATS_REQUEST : parse_stats_request,
+    const.OFPT_STATS_REPLY : parse_stats_reply,
+    const.OFPT_BARRIER_REQUEST : barrier_request.unpack,
+    const.OFPT_BARRIER_REPLY : barrier_reply.unpack,
+    const.OFPT_QUEUE_GET_CONFIG_REQUEST : queue_get_config_request.unpack,
+    const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
+    const.OFPT_ROLE_REQUEST : role_request.unpack,
+    const.OFPT_ROLE_REPLY : role_reply.unpack,
 }
 
 flow_mod_parsers = {
@@ -5630,4 +6522,23 @@
 }
 
 experimenter_parsers = {
+    6035143 : {
+        22: bsn_bw_clear_data_reply.unpack,
+        21: bsn_bw_clear_data_request.unpack,
+        20: bsn_bw_enable_get_reply.unpack,
+        19: bsn_bw_enable_get_request.unpack,
+        23: bsn_bw_enable_set_reply.unpack,
+        18: bsn_bw_enable_set_request.unpack,
+        10: bsn_get_interfaces_reply.unpack,
+        9: bsn_get_interfaces_request.unpack,
+        5: bsn_get_mirroring_reply.unpack,
+        4: bsn_get_mirroring_request.unpack,
+        3: bsn_set_mirroring.unpack,
+        25: bsn_set_pktin_suppression_reply.unpack,
+        11: bsn_set_pktin_suppression_request.unpack,
+        16: bsn_virtual_port_create_reply.unpack,
+        15: bsn_virtual_port_create_request.unpack,
+        26: bsn_virtual_port_remove_reply.unpack,
+        17: bsn_virtual_port_remove_request.unpack,
+    },
 }
diff --git a/src/python/loxi/of12/oxm.py b/src/python/loxi/of12/oxm.py
index d3bc046..fb1291d 100644
--- a/src/python/loxi/of12/oxm.py
+++ b/src/python/loxi/of12/oxm.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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
 # Do not modify
@@ -26,7 +27,7 @@
     pass
 
 class arp_op(OXM):
-    type_len = 0x80002a02
+    type_len = 2147494402
 
     def __init__(self, value=None):
         if value != None:
@@ -47,9 +48,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002a02)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147494402)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -75,7 +76,7 @@
         q.text('}')
 
 class arp_op_masked(OXM):
-    type_len = 0x80002b04
+    type_len = 2147494660
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -101,10 +102,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002b04)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147494660)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -134,7 +135,7 @@
         q.text('}')
 
 class arp_sha(OXM):
-    type_len = 0x80003006
+    type_len = 2147495942
 
     def __init__(self, value=None):
         if value != None:
@@ -155,8 +156,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003006)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147495942)
         obj.value = list(reader.read('!6B'))
         return obj
 
@@ -183,7 +184,7 @@
         q.text('}')
 
 class arp_sha_masked(OXM):
-    type_len = 0x8000310c
+    type_len = 2147496204
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -209,8 +210,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x8000310c)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147496204)
         obj.value = list(reader.read('!6B'))
         obj.value_mask = list(reader.read('!6B'))
         return obj
@@ -242,7 +243,7 @@
         q.text('}')
 
 class arp_spa(OXM):
-    type_len = 0x80002c04
+    type_len = 2147494916
 
     def __init__(self, value=None):
         if value != None:
@@ -263,9 +264,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002c04)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147494916)
+        obj.value = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -291,7 +292,7 @@
         q.text('}')
 
 class arp_spa_masked(OXM):
-    type_len = 0x80002d08
+    type_len = 2147495176
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -317,10 +318,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002d08)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147495176)
+        obj.value = reader.read("!L")[0]
+        obj.value_mask = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -350,7 +351,7 @@
         q.text('}')
 
 class arp_tha(OXM):
-    type_len = 0x80003206
+    type_len = 2147496454
 
     def __init__(self, value=None):
         if value != None:
@@ -371,8 +372,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003206)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147496454)
         obj.value = list(reader.read('!6B'))
         return obj
 
@@ -399,7 +400,7 @@
         q.text('}')
 
 class arp_tha_masked(OXM):
-    type_len = 0x8000330c
+    type_len = 2147496716
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -425,8 +426,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x8000330c)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147496716)
         obj.value = list(reader.read('!6B'))
         obj.value_mask = list(reader.read('!6B'))
         return obj
@@ -458,7 +459,7 @@
         q.text('}')
 
 class arp_tpa(OXM):
-    type_len = 0x80002e04
+    type_len = 2147495428
 
     def __init__(self, value=None):
         if value != None:
@@ -479,9 +480,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002e04)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147495428)
+        obj.value = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -507,7 +508,7 @@
         q.text('}')
 
 class arp_tpa_masked(OXM):
-    type_len = 0x80002f08
+    type_len = 2147495688
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -533,10 +534,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002f08)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147495688)
+        obj.value = reader.read("!L")[0]
+        obj.value_mask = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -565,8 +566,116 @@
             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 = 0x80000606
+    type_len = 2147485190
 
     def __init__(self, value=None):
         if value != None:
@@ -587,8 +696,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000606)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147485190)
         obj.value = list(reader.read('!6B'))
         return obj
 
@@ -615,7 +724,7 @@
         q.text('}')
 
 class eth_dst_masked(OXM):
-    type_len = 0x8000070c
+    type_len = 2147485452
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -641,8 +750,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x8000070c)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147485452)
         obj.value = list(reader.read('!6B'))
         obj.value_mask = list(reader.read('!6B'))
         return obj
@@ -674,7 +783,7 @@
         q.text('}')
 
 class eth_src(OXM):
-    type_len = 0x80000806
+    type_len = 2147485702
 
     def __init__(self, value=None):
         if value != None:
@@ -695,8 +804,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000806)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147485702)
         obj.value = list(reader.read('!6B'))
         return obj
 
@@ -723,7 +832,7 @@
         q.text('}')
 
 class eth_src_masked(OXM):
-    type_len = 0x8000090c
+    type_len = 2147485964
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -749,8 +858,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x8000090c)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147485964)
         obj.value = list(reader.read('!6B'))
         obj.value_mask = list(reader.read('!6B'))
         return obj
@@ -782,7 +891,7 @@
         q.text('}')
 
 class eth_type(OXM):
-    type_len = 0x80000a02
+    type_len = 2147486210
 
     def __init__(self, value=None):
         if value != None:
@@ -803,9 +912,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000a02)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147486210)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -831,7 +940,7 @@
         q.text('}')
 
 class eth_type_masked(OXM):
-    type_len = 0x80000b04
+    type_len = 2147486468
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -857,10 +966,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000b04)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147486468)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -890,7 +999,7 @@
         q.text('}')
 
 class icmpv4_code(OXM):
-    type_len = 0x80002801
+    type_len = 2147493889
 
     def __init__(self, value=None):
         if value != None:
@@ -911,9 +1020,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002801)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147493889)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -939,7 +1048,7 @@
         q.text('}')
 
 class icmpv4_code_masked(OXM):
-    type_len = 0x80002902
+    type_len = 2147494146
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -965,10 +1074,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002902)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147494146)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -998,7 +1107,7 @@
         q.text('}')
 
 class icmpv4_type(OXM):
-    type_len = 0x80002601
+    type_len = 2147493377
 
     def __init__(self, value=None):
         if value != None:
@@ -1019,9 +1128,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002601)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147493377)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1047,7 +1156,7 @@
         q.text('}')
 
 class icmpv4_type_masked(OXM):
-    type_len = 0x80002702
+    type_len = 2147493634
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1073,10 +1182,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002702)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147493634)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1106,7 +1215,7 @@
         q.text('}')
 
 class icmpv6_code(OXM):
-    type_len = 0x80003c01
+    type_len = 2147499009
 
     def __init__(self, value=None):
         if value != None:
@@ -1127,9 +1236,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003c01)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147499009)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1155,7 +1264,7 @@
         q.text('}')
 
 class icmpv6_code_masked(OXM):
-    type_len = 0x80003d02
+    type_len = 2147499266
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1181,10 +1290,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003d02)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147499266)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1214,7 +1323,7 @@
         q.text('}')
 
 class icmpv6_type(OXM):
-    type_len = 0x80003a01
+    type_len = 2147498497
 
     def __init__(self, value=None):
         if value != None:
@@ -1235,9 +1344,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003a01)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147498497)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1263,7 +1372,7 @@
         q.text('}')
 
 class icmpv6_type_masked(OXM):
-    type_len = 0x80003b02
+    type_len = 2147498754
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1289,10 +1398,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003b02)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147498754)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1322,7 +1431,7 @@
         q.text('}')
 
 class in_phy_port(OXM):
-    type_len = 0x80000204
+    type_len = 2147484164
 
     def __init__(self, value=None):
         if value != None:
@@ -1333,7 +1442,7 @@
     def pack(self):
         packed = []
         packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!L", self.value))
+        packed.append(util.pack_port_no(self.value))
         return ''.join(packed)
 
     @staticmethod
@@ -1343,9 +1452,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000204)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147484164)
+        obj.value = util.unpack_port_no(reader)
         return obj
 
     def __eq__(self, other):
@@ -1371,7 +1480,7 @@
         q.text('}')
 
 class in_phy_port_masked(OXM):
-    type_len = 0x80000308
+    type_len = 2147484424
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1386,8 +1495,8 @@
     def pack(self):
         packed = []
         packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!L", self.value))
-        packed.append(struct.pack("!L", self.value_mask))
+        packed.append(util.pack_port_no(self.value))
+        packed.append(util.pack_port_no(self.value_mask))
         return ''.join(packed)
 
     @staticmethod
@@ -1397,10 +1506,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000308)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147484424)
+        obj.value = util.unpack_port_no(reader)
+        obj.value_mask = util.unpack_port_no(reader)
         return obj
 
     def __eq__(self, other):
@@ -1430,7 +1539,7 @@
         q.text('}')
 
 class in_port(OXM):
-    type_len = 0x80000004
+    type_len = 2147483652
 
     def __init__(self, value=None):
         if value != None:
@@ -1441,7 +1550,7 @@
     def pack(self):
         packed = []
         packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!L", self.value))
+        packed.append(util.pack_port_no(self.value))
         return ''.join(packed)
 
     @staticmethod
@@ -1451,9 +1560,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000004)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147483652)
+        obj.value = util.unpack_port_no(reader)
         return obj
 
     def __eq__(self, other):
@@ -1479,7 +1588,7 @@
         q.text('}')
 
 class in_port_masked(OXM):
-    type_len = 0x80000108
+    type_len = 2147483912
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1494,8 +1603,8 @@
     def pack(self):
         packed = []
         packed.append(struct.pack("!L", self.type_len))
-        packed.append(struct.pack("!L", self.value))
-        packed.append(struct.pack("!L", self.value_mask))
+        packed.append(util.pack_port_no(self.value))
+        packed.append(util.pack_port_no(self.value_mask))
         return ''.join(packed)
 
     @staticmethod
@@ -1505,10 +1614,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000108)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147483912)
+        obj.value = util.unpack_port_no(reader)
+        obj.value_mask = util.unpack_port_no(reader)
         return obj
 
     def __eq__(self, other):
@@ -1538,7 +1647,7 @@
         q.text('}')
 
 class ip_dscp(OXM):
-    type_len = 0x80001001
+    type_len = 2147487745
 
     def __init__(self, value=None):
         if value != None:
@@ -1559,9 +1668,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001001)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147487745)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1587,7 +1696,7 @@
         q.text('}')
 
 class ip_dscp_masked(OXM):
-    type_len = 0x80001102
+    type_len = 2147488002
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1613,10 +1722,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001102)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147488002)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1646,7 +1755,7 @@
         q.text('}')
 
 class ip_ecn(OXM):
-    type_len = 0x80001201
+    type_len = 2147488257
 
     def __init__(self, value=None):
         if value != None:
@@ -1667,9 +1776,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001201)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147488257)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1695,7 +1804,7 @@
         q.text('}')
 
 class ip_ecn_masked(OXM):
-    type_len = 0x80001302
+    type_len = 2147488514
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1721,10 +1830,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001302)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147488514)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1754,7 +1863,7 @@
         q.text('}')
 
 class ip_proto(OXM):
-    type_len = 0x80001401
+    type_len = 2147488769
 
     def __init__(self, value=None):
         if value != None:
@@ -1775,9 +1884,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001401)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147488769)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1803,7 +1912,7 @@
         q.text('}')
 
 class ip_proto_masked(OXM):
-    type_len = 0x80001502
+    type_len = 2147489026
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1829,10 +1938,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001502)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147489026)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -1862,7 +1971,7 @@
         q.text('}')
 
 class ipv4_dst(OXM):
-    type_len = 0x80001804
+    type_len = 2147489796
 
     def __init__(self, value=None):
         if value != None:
@@ -1883,9 +1992,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001804)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147489796)
+        obj.value = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -1911,7 +2020,7 @@
         q.text('}')
 
 class ipv4_dst_masked(OXM):
-    type_len = 0x80001908
+    type_len = 2147490056
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -1937,10 +2046,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001908)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147490056)
+        obj.value = reader.read("!L")[0]
+        obj.value_mask = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -1970,7 +2079,7 @@
         q.text('}')
 
 class ipv4_src(OXM):
-    type_len = 0x80001604
+    type_len = 2147489284
 
     def __init__(self, value=None):
         if value != None:
@@ -1991,9 +2100,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001604)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147489284)
+        obj.value = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -2019,7 +2128,7 @@
         q.text('}')
 
 class ipv4_src_masked(OXM):
-    type_len = 0x80001708
+    type_len = 2147489544
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2045,10 +2154,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001708)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147489544)
+        obj.value = reader.read("!L")[0]
+        obj.value_mask = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -2078,7 +2187,7 @@
         q.text('}')
 
 class ipv6_dst(OXM):
-    type_len = 0x80003610
+    type_len = 2147497488
 
     def __init__(self, value=None):
         if value != None:
@@ -2099,8 +2208,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003610)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147497488)
         obj.value = reader.read('!16s')[0]
         return obj
 
@@ -2127,7 +2236,7 @@
         q.text('}')
 
 class ipv6_dst_masked(OXM):
-    type_len = 0x80003720
+    type_len = 2147497760
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2153,8 +2262,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003720)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147497760)
         obj.value = reader.read('!16s')[0]
         obj.value_mask = reader.read('!16s')[0]
         return obj
@@ -2186,7 +2295,7 @@
         q.text('}')
 
 class ipv6_flabel(OXM):
-    type_len = 0x80003804
+    type_len = 2147497988
 
     def __init__(self, value=None):
         if value != None:
@@ -2207,9 +2316,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003804)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147497988)
+        obj.value = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -2235,7 +2344,7 @@
         q.text('}')
 
 class ipv6_flabel_masked(OXM):
-    type_len = 0x80003908
+    type_len = 2147498248
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2261,10 +2370,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003908)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147498248)
+        obj.value = reader.read("!L")[0]
+        obj.value_mask = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -2294,7 +2403,7 @@
         q.text('}')
 
 class ipv6_nd_sll(OXM):
-    type_len = 0x80004006
+    type_len = 2147500038
 
     def __init__(self, value=None):
         if value != None:
@@ -2315,8 +2424,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80004006)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147500038)
         obj.value = list(reader.read('!6B'))
         return obj
 
@@ -2343,7 +2452,7 @@
         q.text('}')
 
 class ipv6_nd_sll_masked(OXM):
-    type_len = 0x8000410c
+    type_len = 2147500300
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2369,8 +2478,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x8000410c)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147500300)
         obj.value = list(reader.read('!6B'))
         obj.value_mask = list(reader.read('!6B'))
         return obj
@@ -2402,7 +2511,7 @@
         q.text('}')
 
 class ipv6_nd_target(OXM):
-    type_len = 0x80003e10
+    type_len = 2147499536
 
     def __init__(self, value=None):
         if value != None:
@@ -2423,8 +2532,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003e10)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147499536)
         obj.value = reader.read('!16s')[0]
         return obj
 
@@ -2451,7 +2560,7 @@
         q.text('}')
 
 class ipv6_nd_target_masked(OXM):
-    type_len = 0x80003f20
+    type_len = 2147499808
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2477,8 +2586,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003f20)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147499808)
         obj.value = reader.read('!16s')[0]
         obj.value_mask = reader.read('!16s')[0]
         return obj
@@ -2510,7 +2619,7 @@
         q.text('}')
 
 class ipv6_nd_tll(OXM):
-    type_len = 0x80004206
+    type_len = 2147500550
 
     def __init__(self, value=None):
         if value != None:
@@ -2531,8 +2640,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80004206)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147500550)
         obj.value = list(reader.read('!6B'))
         return obj
 
@@ -2559,7 +2668,7 @@
         q.text('}')
 
 class ipv6_nd_tll_masked(OXM):
-    type_len = 0x8000430c
+    type_len = 2147500812
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2585,8 +2694,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x8000430c)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147500812)
         obj.value = list(reader.read('!6B'))
         obj.value_mask = list(reader.read('!6B'))
         return obj
@@ -2618,7 +2727,7 @@
         q.text('}')
 
 class ipv6_src(OXM):
-    type_len = 0x80003410
+    type_len = 2147496976
 
     def __init__(self, value=None):
         if value != None:
@@ -2639,8 +2748,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003410)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147496976)
         obj.value = reader.read('!16s')[0]
         return obj
 
@@ -2667,7 +2776,7 @@
         q.text('}')
 
 class ipv6_src_masked(OXM):
-    type_len = 0x80003520
+    type_len = 2147497248
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2693,8 +2802,8 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80003520)
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147497248)
         obj.value = reader.read('!16s')[0]
         obj.value_mask = reader.read('!16s')[0]
         return obj
@@ -2726,7 +2835,7 @@
         q.text('}')
 
 class metadata(OXM):
-    type_len = 0x80000408
+    type_len = 2147484680
 
     def __init__(self, value=None):
         if value != None:
@@ -2747,9 +2856,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000408)
-        obj.value = reader.read('!Q')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147484680)
+        obj.value = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -2775,7 +2884,7 @@
         q.text('}')
 
 class metadata_masked(OXM):
-    type_len = 0x80000510
+    type_len = 2147484944
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2801,10 +2910,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000510)
-        obj.value = reader.read('!Q')[0]
-        obj.value_mask = reader.read('!Q')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147484944)
+        obj.value = reader.read("!Q")[0]
+        obj.value_mask = reader.read("!Q")[0]
         return obj
 
     def __eq__(self, other):
@@ -2834,7 +2943,7 @@
         q.text('}')
 
 class mpls_label(OXM):
-    type_len = 0x80004404
+    type_len = 2147501060
 
     def __init__(self, value=None):
         if value != None:
@@ -2855,9 +2964,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80004404)
-        obj.value = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147501060)
+        obj.value = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -2883,7 +2992,7 @@
         q.text('}')
 
 class mpls_label_masked(OXM):
-    type_len = 0x80004508
+    type_len = 2147501320
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -2909,10 +3018,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80004508)
-        obj.value = reader.read('!L')[0]
-        obj.value_mask = reader.read('!L')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147501320)
+        obj.value = reader.read("!L")[0]
+        obj.value_mask = reader.read("!L")[0]
         return obj
 
     def __eq__(self, other):
@@ -2942,7 +3051,7 @@
         q.text('}')
 
 class mpls_tc(OXM):
-    type_len = 0x80004601
+    type_len = 2147501569
 
     def __init__(self, value=None):
         if value != None:
@@ -2963,9 +3072,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80004601)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147501569)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -2991,7 +3100,7 @@
         q.text('}')
 
 class mpls_tc_masked(OXM):
-    type_len = 0x80004702
+    type_len = 2147501826
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3017,10 +3126,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80004702)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147501826)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -3050,7 +3159,7 @@
         q.text('}')
 
 class sctp_dst(OXM):
-    type_len = 0x80002402
+    type_len = 2147492866
 
     def __init__(self, value=None):
         if value != None:
@@ -3071,9 +3180,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002402)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147492866)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3099,7 +3208,7 @@
         q.text('}')
 
 class sctp_dst_masked(OXM):
-    type_len = 0x80002504
+    type_len = 2147493124
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3125,10 +3234,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002504)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147493124)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3158,7 +3267,7 @@
         q.text('}')
 
 class sctp_src(OXM):
-    type_len = 0x80002202
+    type_len = 2147492354
 
     def __init__(self, value=None):
         if value != None:
@@ -3179,9 +3288,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002202)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147492354)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3207,7 +3316,7 @@
         q.text('}')
 
 class sctp_src_masked(OXM):
-    type_len = 0x80002304
+    type_len = 2147492612
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3233,10 +3342,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002304)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147492612)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3265,8 +3374,116 @@
             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 = 0x80001c02
+    type_len = 2147490818
 
     def __init__(self, value=None):
         if value != None:
@@ -3287,9 +3504,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001c02)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147490818)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3315,7 +3532,7 @@
         q.text('}')
 
 class tcp_dst_masked(OXM):
-    type_len = 0x80001d04
+    type_len = 2147491076
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3341,10 +3558,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001d04)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147491076)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3374,7 +3591,7 @@
         q.text('}')
 
 class tcp_src(OXM):
-    type_len = 0x80001a02
+    type_len = 2147490306
 
     def __init__(self, value=None):
         if value != None:
@@ -3395,9 +3612,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001a02)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147490306)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3423,7 +3640,7 @@
         q.text('}')
 
 class tcp_src_masked(OXM):
-    type_len = 0x80001b04
+    type_len = 2147490564
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3449,10 +3666,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001b04)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147490564)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3482,7 +3699,7 @@
         q.text('}')
 
 class udp_dst(OXM):
-    type_len = 0x80002002
+    type_len = 2147491842
 
     def __init__(self, value=None):
         if value != None:
@@ -3503,9 +3720,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002002)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147491842)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3531,7 +3748,7 @@
         q.text('}')
 
 class udp_dst_masked(OXM):
-    type_len = 0x80002104
+    type_len = 2147492100
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3557,10 +3774,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80002104)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147492100)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3590,7 +3807,7 @@
         q.text('}')
 
 class udp_src(OXM):
-    type_len = 0x80001e02
+    type_len = 2147491330
 
     def __init__(self, value=None):
         if value != None:
@@ -3611,9 +3828,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001e02)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147491330)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3639,7 +3856,7 @@
         q.text('}')
 
 class udp_src_masked(OXM):
-    type_len = 0x80001f04
+    type_len = 2147491588
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3665,10 +3882,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80001f04)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147491588)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3698,7 +3915,7 @@
         q.text('}')
 
 class vlan_pcp(OXM):
-    type_len = 0x80000e01
+    type_len = 2147487233
 
     def __init__(self, value=None):
         if value != None:
@@ -3719,9 +3936,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000e01)
-        obj.value = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147487233)
+        obj.value = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -3747,7 +3964,7 @@
         q.text('}')
 
 class vlan_pcp_masked(OXM):
-    type_len = 0x80000f02
+    type_len = 2147487490
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3773,10 +3990,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000f02)
-        obj.value = reader.read('!B')[0]
-        obj.value_mask = reader.read('!B')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147487490)
+        obj.value = reader.read("!B")[0]
+        obj.value_mask = reader.read("!B")[0]
         return obj
 
     def __eq__(self, other):
@@ -3806,7 +4023,7 @@
         q.text('}')
 
 class vlan_vid(OXM):
-    type_len = 0x80000c02
+    type_len = 2147486722
 
     def __init__(self, value=None):
         if value != None:
@@ -3827,9 +4044,9 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000c02)
-        obj.value = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147486722)
+        obj.value = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3855,7 +4072,7 @@
         q.text('}')
 
 class vlan_vid_masked(OXM):
-    type_len = 0x80000d04
+    type_len = 2147486980
 
     def __init__(self, value=None, value_mask=None):
         if value != None:
@@ -3881,10 +4098,10 @@
             reader = buf
         else:
             reader = loxi.generic_util.OFReader(buf)
-        _type_len = reader.read('!L')[0]
-        assert(_type_len == 0x80000d04)
-        obj.value = reader.read('!H')[0]
-        obj.value_mask = reader.read('!H')[0]
+        _type_len = reader.read("!L")[0]
+        assert(_type_len == 2147486980)
+        obj.value = reader.read("!H")[0]
+        obj.value_mask = reader.read("!H")[0]
         return obj
 
     def __eq__(self, other):
@@ -3915,6 +4132,10 @@
 
 
 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/of12/util.py b/src/python/loxi/of12/util.py
index d431d4c..56b5729 100644
--- a/src/python/loxi/of12/util.py
+++ b/src/python/loxi/of12/util.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
 # Copyright (c) 2011, 2012 Open Networking Foundation
 # 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 util.py
 # Do not modify
@@ -35,3 +36,36 @@
         if v == v2:
             return k
     return v
+
+def pack_port_no(value):
+    return struct.pack("!L", value)
+
+def unpack_port_no(reader):
+    return reader.read("!L")[0]
+
+def pack_fm_cmd(value):
+    return struct.pack("!B", value)
+
+def unpack_fm_cmd(reader):
+    return reader.read("!B")[0]
+
+def init_wc_bmap():
+    return 0
+
+def pack_wc_bmap(value):
+    return struct.pack("!Q", value)
+
+def unpack_wc_bmap(reader):
+    return reader.read("!Q")[0]
+
+def init_match_bmap():
+    return 0
+
+def pack_match_bmap(value):
+    return struct.pack("!Q", value)
+
+def unpack_match_bmap(reader):
+    return reader.read("!Q")[0]
+
+def pack_list(values):
+    return "".join([x.pack() for x in values])
