update pyloxi to floodlight/loxigen-artifacts @ cb7d6d4063ed4d311d105e20f0844a54c4bd9916
diff --git a/src/python/loxi/of10/message.py b/src/python/loxi/of10/message.py
index 07f7dca..039891c 100644
--- a/src/python/loxi/of10/message.py
+++ b/src/python/loxi/of10/message.py
@@ -8,13 +8,12 @@
import struct
import loxi
-import const
-import action
-import message
-import common
import util
import loxi.generic_util
+import sys
+ofp = sys.modules['loxi.of10']
+
class message(loxi.OFObject):
subtypes = {}
@@ -351,7 +350,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if table_id != None:
self.table_id = table_id
else:
@@ -392,7 +391,7 @@
_stats_type = reader.read("!H")[0]
assert(_stats_type == 2)
obj.flags = reader.read("!H")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.table_id = reader.read("!B")[0]
reader.skip(1)
obj.out_port = util.unpack_port_no(reader)
@@ -1383,7 +1382,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):
@@ -3754,7 +3753,7 @@
if vport != None:
self.vport = vport
else:
- self.vport = common.bsn_vport()
+ self.vport = ofp.bsn_vport()
return
def pack(self):
@@ -3785,7 +3784,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):
@@ -4339,7 +4338,7 @@
reader.skip(3)
obj.capabilities = reader.read("!L")[0]
obj.actions = 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):
@@ -4454,7 +4453,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if cookie != None:
self.cookie = cookie
else:
@@ -4529,7 +4528,7 @@
orig_reader = reader
reader = orig_reader.slice(_length, 4)
obj.xid = reader.read("!L")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.cookie = reader.read("!Q")[0]
obj._command = util.unpack_fm_cmd(reader)
obj.idle_timeout = reader.read("!H")[0]
@@ -4538,7 +4537,7 @@
obj.buffer_id = reader.read("!L")[0]
obj.out_port = util.unpack_port_no(reader)
obj.flags = reader.read("!H")[0]
- obj.actions = loxi.generic_util.unpack_list(reader, action.action.unpack)
+ obj.actions = loxi.generic_util.unpack_list(reader, ofp.action.action.unpack)
return obj
def __eq__(self, other):
@@ -4611,7 +4610,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if cookie != None:
self.cookie = cookie
else:
@@ -4677,7 +4676,7 @@
orig_reader = reader
reader = orig_reader.slice(_length, 4)
obj.xid = reader.read("!L")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.cookie = reader.read("!Q")[0]
__command = util.unpack_fm_cmd(reader)
assert(__command == 0)
@@ -4687,7 +4686,7 @@
obj.buffer_id = reader.read("!L")[0]
obj.out_port = util.unpack_port_no(reader)
obj.flags = reader.read("!H")[0]
- obj.actions = loxi.generic_util.unpack_list(reader, action.action.unpack)
+ obj.actions = loxi.generic_util.unpack_list(reader, ofp.action.action.unpack)
return obj
def __eq__(self, other):
@@ -4759,7 +4758,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if cookie != None:
self.cookie = cookie
else:
@@ -4825,7 +4824,7 @@
orig_reader = reader
reader = orig_reader.slice(_length, 4)
obj.xid = reader.read("!L")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.cookie = reader.read("!Q")[0]
__command = util.unpack_fm_cmd(reader)
assert(__command == 3)
@@ -4835,7 +4834,7 @@
obj.buffer_id = reader.read("!L")[0]
obj.out_port = util.unpack_port_no(reader)
obj.flags = reader.read("!H")[0]
- obj.actions = loxi.generic_util.unpack_list(reader, action.action.unpack)
+ obj.actions = loxi.generic_util.unpack_list(reader, ofp.action.action.unpack)
return obj
def __eq__(self, other):
@@ -4907,7 +4906,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if cookie != None:
self.cookie = cookie
else:
@@ -4973,7 +4972,7 @@
orig_reader = reader
reader = orig_reader.slice(_length, 4)
obj.xid = reader.read("!L")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.cookie = reader.read("!Q")[0]
__command = util.unpack_fm_cmd(reader)
assert(__command == 4)
@@ -4983,7 +4982,7 @@
obj.buffer_id = reader.read("!L")[0]
obj.out_port = util.unpack_port_no(reader)
obj.flags = reader.read("!H")[0]
- obj.actions = loxi.generic_util.unpack_list(reader, action.action.unpack)
+ obj.actions = loxi.generic_util.unpack_list(reader, ofp.action.action.unpack)
return obj
def __eq__(self, other):
@@ -5133,7 +5132,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if cookie != None:
self.cookie = cookie
else:
@@ -5199,7 +5198,7 @@
orig_reader = reader
reader = orig_reader.slice(_length, 4)
obj.xid = reader.read("!L")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.cookie = reader.read("!Q")[0]
__command = util.unpack_fm_cmd(reader)
assert(__command == 1)
@@ -5209,7 +5208,7 @@
obj.buffer_id = reader.read("!L")[0]
obj.out_port = util.unpack_port_no(reader)
obj.flags = reader.read("!H")[0]
- obj.actions = loxi.generic_util.unpack_list(reader, action.action.unpack)
+ obj.actions = loxi.generic_util.unpack_list(reader, ofp.action.action.unpack)
return obj
def __eq__(self, other):
@@ -5281,7 +5280,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if cookie != None:
self.cookie = cookie
else:
@@ -5347,7 +5346,7 @@
orig_reader = reader
reader = orig_reader.slice(_length, 4)
obj.xid = reader.read("!L")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.cookie = reader.read("!Q")[0]
__command = util.unpack_fm_cmd(reader)
assert(__command == 2)
@@ -5357,7 +5356,7 @@
obj.buffer_id = reader.read("!L")[0]
obj.out_port = util.unpack_port_no(reader)
obj.flags = reader.read("!H")[0]
- obj.actions = loxi.generic_util.unpack_list(reader, action.action.unpack)
+ obj.actions = loxi.generic_util.unpack_list(reader, ofp.action.action.unpack)
return obj
def __eq__(self, other):
@@ -5428,7 +5427,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if cookie != None:
self.cookie = cookie
else:
@@ -5495,7 +5494,7 @@
orig_reader = reader
reader = orig_reader.slice(_length, 4)
obj.xid = reader.read("!L")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.cookie = reader.read("!Q")[0]
obj.priority = reader.read("!H")[0]
obj.reason = reader.read("!B")[0]
@@ -5611,7 +5610,7 @@
_stats_type = reader.read("!H")[0]
assert(_stats_type == 1)
obj.flags = reader.read("!H")[0]
- 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):
@@ -5659,7 +5658,7 @@
if match != None:
self.match = match
else:
- self.match = common.match()
+ self.match = ofp.match()
if table_id != None:
self.table_id = table_id
else:
@@ -5700,7 +5699,7 @@
_stats_type = reader.read("!H")[0]
assert(_stats_type == 1)
obj.flags = reader.read("!H")[0]
- obj.match = common.match.unpack(reader)
+ obj.match = ofp.match.unpack(reader)
obj.table_id = reader.read("!B")[0]
reader.skip(1)
obj.out_port = util.unpack_port_no(reader)
@@ -6381,7 +6380,7 @@
obj.buffer_id = reader.read("!L")[0]
obj.in_port = util.unpack_port_no(reader)
_actions_len = reader.read("!H")[0]
- 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
@@ -6652,7 +6651,7 @@
_stats_type = reader.read("!H")[0]
assert(_stats_type == 4)
obj.flags = reader.read("!H")[0]
- 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):
@@ -6779,7 +6778,7 @@
if desc != None:
self.desc = desc
else:
- self.desc = common.port_desc()
+ self.desc = ofp.port_desc()
return
def pack(self):
@@ -6808,7 +6807,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):
@@ -6884,7 +6883,7 @@
obj.xid = reader.read("!L")[0]
obj.port = util.unpack_port_no(reader)
reader.skip(6)
- 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):
@@ -7106,7 +7105,7 @@
_stats_type = reader.read("!H")[0]
assert(_stats_type == 5)
obj.flags = reader.read("!H")[0]
- 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):
@@ -7424,7 +7423,7 @@
_stats_type = reader.read("!H")[0]
assert(_stats_type == 3)
obj.flags = reader.read("!H")[0]
- 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):
@@ -7531,8 +7530,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))