update pyloxi to floodlight/loxigen-artifacts @ cb7d6d4063ed4d311d105e20f0844a54c4bd9916
diff --git a/src/python/loxi/of12/message.py b/src/python/loxi/of12/message.py
index e61b6da..5c7b032 100644
--- a/src/python/loxi/of12/message.py
+++ b/src/python/loxi/of12/message.py
@@ -8,15 +8,12 @@
 
 import struct
 import loxi
-import const
-import action
-import oxm
-import message
-import instruction
-import common
 import util
 import loxi.generic_util
 
+import sys
+ofp = sys.modules['loxi.of12']
+
 class message(loxi.OFObject):
     subtypes = {}
 
@@ -379,7 +376,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         return
 
     def pack(self):
@@ -425,7 +422,7 @@
         reader.skip(4)
         obj.cookie = reader.read("!Q")[0]
         obj.cookie_mask = reader.read("!Q")[0]
-        obj.match = common.match.unpack(reader)
+        obj.match = ofp.match.unpack(reader)
         return obj
 
     def __eq__(self, other):
@@ -1591,7 +1588,7 @@
         assert(_experimenter == 6035143)
         _subtype = reader.read("!L")[0]
         assert(_subtype == 10)
-        obj.interfaces = loxi.generic_util.unpack_list(reader, common.bsn_interface.unpack)
+        obj.interfaces = loxi.generic_util.unpack_list(reader, ofp.common.bsn_interface.unpack)
         return obj
 
     def __eq__(self, other):
@@ -3042,7 +3039,7 @@
         if vport != None:
             self.vport = vport
         else:
-            self.vport = common.bsn_vport()
+            self.vport = ofp.bsn_vport()
         return
 
     def pack(self):
@@ -3073,7 +3070,7 @@
         assert(_experimenter == 6035143)
         _subtype = reader.read("!L")[0]
         assert(_subtype == 15)
-        obj.vport = common.bsn_vport.unpack(reader)
+        obj.vport = ofp.bsn_vport.unpack(reader)
         return obj
 
     def __eq__(self, other):
@@ -3719,7 +3716,7 @@
         reader.skip(3)
         obj.capabilities = reader.read("!L")[0]
         obj.reserved = reader.read("!L")[0]
-        obj.ports = loxi.generic_util.unpack_list(reader, common.port_desc.unpack)
+        obj.ports = loxi.generic_util.unpack_list(reader, ofp.common.port_desc.unpack)
         return obj
 
     def __eq__(self, other):
@@ -3878,7 +3875,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         if instructions != None:
             self.instructions = instructions
         else:
@@ -3937,8 +3934,8 @@
         obj.out_group = reader.read("!L")[0]
         obj.flags = reader.read("!H")[0]
         reader.skip(2)
-        obj.match = common.match.unpack(reader)
-        obj.instructions = loxi.generic_util.unpack_list(reader, instruction.instruction.unpack)
+        obj.match = ofp.match.unpack(reader)
+        obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack)
         return obj
 
     def __eq__(self, other):
@@ -4063,7 +4060,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         if instructions != None:
             self.instructions = instructions
         else:
@@ -4118,8 +4115,8 @@
         obj.out_group = reader.read("!L")[0]
         obj.flags = reader.read("!H")[0]
         reader.skip(2)
-        obj.match = common.match.unpack(reader)
-        obj.instructions = loxi.generic_util.unpack_list(reader, instruction.instruction.unpack)
+        obj.match = ofp.match.unpack(reader)
+        obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack)
         return obj
 
     def __eq__(self, other):
@@ -4243,7 +4240,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         if instructions != None:
             self.instructions = instructions
         else:
@@ -4298,8 +4295,8 @@
         obj.out_group = reader.read("!L")[0]
         obj.flags = reader.read("!H")[0]
         reader.skip(2)
-        obj.match = common.match.unpack(reader)
-        obj.instructions = loxi.generic_util.unpack_list(reader, instruction.instruction.unpack)
+        obj.match = ofp.match.unpack(reader)
+        obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack)
         return obj
 
     def __eq__(self, other):
@@ -4423,7 +4420,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         if instructions != None:
             self.instructions = instructions
         else:
@@ -4478,8 +4475,8 @@
         obj.out_group = reader.read("!L")[0]
         obj.flags = reader.read("!H")[0]
         reader.skip(2)
-        obj.match = common.match.unpack(reader)
-        obj.instructions = loxi.generic_util.unpack_list(reader, instruction.instruction.unpack)
+        obj.match = ofp.match.unpack(reader)
+        obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack)
         return obj
 
     def __eq__(self, other):
@@ -4681,7 +4678,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         if instructions != None:
             self.instructions = instructions
         else:
@@ -4736,8 +4733,8 @@
         obj.out_group = reader.read("!L")[0]
         obj.flags = reader.read("!H")[0]
         reader.skip(2)
-        obj.match = common.match.unpack(reader)
-        obj.instructions = loxi.generic_util.unpack_list(reader, instruction.instruction.unpack)
+        obj.match = ofp.match.unpack(reader)
+        obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack)
         return obj
 
     def __eq__(self, other):
@@ -4861,7 +4858,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         if instructions != None:
             self.instructions = instructions
         else:
@@ -4916,8 +4913,8 @@
         obj.out_group = reader.read("!L")[0]
         obj.flags = reader.read("!H")[0]
         reader.skip(2)
-        obj.match = common.match.unpack(reader)
-        obj.instructions = loxi.generic_util.unpack_list(reader, instruction.instruction.unpack)
+        obj.match = ofp.match.unpack(reader)
+        obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack)
         return obj
 
     def __eq__(self, other):
@@ -5040,7 +5037,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         return
 
     def pack(self):
@@ -5085,7 +5082,7 @@
         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)
+        obj.match = ofp.match.unpack(reader)
         return obj
 
     def __eq__(self, other):
@@ -5201,7 +5198,7 @@
         assert(_stats_type == 1)
         obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.entries = loxi.generic_util.unpack_list(reader, common.flow_stats_entry.unpack)
+        obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.flow_stats_entry.unpack)
         return obj
 
     def __eq__(self, other):
@@ -5269,7 +5266,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         return
 
     def pack(self):
@@ -5315,7 +5312,7 @@
         reader.skip(4)
         obj.cookie = reader.read("!Q")[0]
         obj.cookie_mask = reader.read("!Q")[0]
-        obj.match = common.match.unpack(reader)
+        obj.match = ofp.match.unpack(reader)
         return obj
 
     def __eq__(self, other):
@@ -5558,7 +5555,7 @@
         obj.group_type = reader.read("!B")[0]
         reader.skip(1)
         obj.group_id = reader.read("!L")[0]
-        obj.buckets = loxi.generic_util.unpack_list(reader, common.bucket.unpack)
+        obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack)
         return obj
 
     def __eq__(self, other):
@@ -5649,7 +5646,7 @@
         obj.group_type = reader.read("!B")[0]
         reader.skip(1)
         obj.group_id = reader.read("!L")[0]
-        obj.buckets = loxi.generic_util.unpack_list(reader, common.bucket.unpack)
+        obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack)
         return obj
 
     def __eq__(self, other):
@@ -5739,7 +5736,7 @@
         obj.group_type = reader.read("!B")[0]
         reader.skip(1)
         obj.group_id = reader.read("!L")[0]
-        obj.buckets = loxi.generic_util.unpack_list(reader, common.bucket.unpack)
+        obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack)
         return obj
 
     def __eq__(self, other):
@@ -5823,7 +5820,7 @@
         assert(_stats_type == 7)
         obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.entries = loxi.generic_util.unpack_list(reader, common.group_desc_stats_entry.unpack)
+        obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.group_desc_stats_entry.unpack)
         return obj
 
     def __eq__(self, other):
@@ -6297,7 +6294,7 @@
         obj.group_type = reader.read("!B")[0]
         reader.skip(1)
         obj.group_id = reader.read("!L")[0]
-        obj.buckets = loxi.generic_util.unpack_list(reader, common.bucket.unpack)
+        obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack)
         return obj
 
     def __eq__(self, other):
@@ -6381,7 +6378,7 @@
         assert(_stats_type == 6)
         obj.flags = reader.read("!H")[0]
         reader.skip(4)
-        obj.entries = loxi.generic_util.unpack_list(reader, common.group_stats_entry.unpack)
+        obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.group_stats_entry.unpack)
         return obj
 
     def __eq__(self, other):
@@ -6726,7 +6723,7 @@
         if match != None:
             self.match = match
         else:
-            self.match = common.match()
+            self.match = ofp.match()
         if data != None:
             self.data = data
         else:
@@ -6765,7 +6762,7 @@
         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)
+        obj.match = ofp.match.unpack(reader)
         reader.skip(2)
         obj.data = str(reader.read_all())
         return obj
@@ -6873,7 +6870,7 @@
         obj.in_port = util.unpack_port_no(reader)
         _actions_len = reader.read("!H")[0]
         reader.skip(6)
-        obj.actions = loxi.generic_util.unpack_list(reader.slice(_actions_len), action.action.unpack)
+        obj.actions = loxi.generic_util.unpack_list(reader.slice(_actions_len), ofp.action.action.unpack)
         obj.data = str(reader.read_all())
         return obj
 
@@ -7150,7 +7147,7 @@
         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)
+        obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.port_stats_entry.unpack)
         return obj
 
     def __eq__(self, other):
@@ -7279,7 +7276,7 @@
         if desc != None:
             self.desc = desc
         else:
-            self.desc = common.port_desc()
+            self.desc = ofp.port_desc()
         return
 
     def pack(self):
@@ -7308,7 +7305,7 @@
         obj.xid = reader.read("!L")[0]
         obj.reason = reader.read("!B")[0]
         reader.skip(7)
-        obj.desc = common.port_desc.unpack(reader)
+        obj.desc = ofp.port_desc.unpack(reader)
         return obj
 
     def __eq__(self, other):
@@ -7384,7 +7381,7 @@
         obj.xid = reader.read("!L")[0]
         obj.port = util.unpack_port_no(reader)
         reader.skip(4)
-        obj.queues = loxi.generic_util.unpack_list(reader, common.packet_queue.unpack)
+        obj.queues = loxi.generic_util.unpack_list(reader, ofp.common.packet_queue.unpack)
         return obj
 
     def __eq__(self, other):
@@ -7608,7 +7605,7 @@
         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)
+        obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.queue_stats_entry.unpack)
         return obj
 
     def __eq__(self, other):
@@ -8314,7 +8311,7 @@
         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)
+        obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.table_stats_entry.unpack)
         return obj
 
     def __eq__(self, other):
@@ -8423,8 +8420,8 @@
 
 def parse_message(buf):
     msg_ver, msg_type, msg_len, msg_xid = parse_header(buf)
-    if msg_ver != const.OFP_VERSION and msg_type != const.OFPT_HELLO:
-        raise loxi.ProtocolError("wrong OpenFlow version (expected %d, got %d)" % (const.OFP_VERSION, msg_ver))
+    if msg_ver != ofp.OFP_VERSION and msg_type != ofp.OFPT_HELLO:
+        raise loxi.ProtocolError("wrong OpenFlow version (expected %d, got %d)" % (ofp.OFP_VERSION, msg_ver))
     if len(buf) != msg_len:
         raise loxi.ProtocolError("incorrect message size")
     return message.unpack(loxi.generic_util.OFReader(buf))