changes from loxigen e8e6401509
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])