loxi-prep: remove uses of cstruct module
This module does not exist in PyLoxi.
diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index 4d44c14..6fd88f5 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -224,12 +224,12 @@
continue
self.logger.debug("Msg in: buf len %d. hdr.type %s. hdr.len %d hdr.version %d hdr.xid %d" %
- (len(pkt), ofp.cstruct.ofp_type_map[hdr.type], hdr.length, hdr.version, hdr.xid))
- if hdr.version < ofp.cstruct.OFP_VERSION:
+ (len(pkt), ofp.ofp_type_map[hdr.type], hdr.length, hdr.version, hdr.xid))
+ if hdr.version < ofp.OFP_VERSION:
self.logger.error("Switch only supports up to OpenFlow version %d (OFTest version is %d)",
- hdr.version, ofp.cstruct.OFP_VERSION)
+ hdr.version, ofp.OFP_VERSION)
print "Switch only supports up to OpenFlow version %d (OFTest version is %d)" % \
- (hdr.version, ofp.cstruct.OFP_VERSION)
+ (hdr.version, ofp.OFP_VERSION)
self.disconnect()
return
@@ -251,7 +251,7 @@
# Check if keep alive is set; if so, respond to echo requests
if self.keep_alive:
- if hdr.type == ofp.cstruct.OFPT_ECHO_REQUEST:
+ if hdr.type == ofp.OFPT_ECHO_REQUEST:
self.logger.debug("Responding to echo request")
rep = ofp.message.echo_reply()
rep.header.xid = hdr.xid
@@ -296,7 +296,7 @@
handled = self.handlers["all"](self, msg, rawmsg)
if not handled: # Not handled, enqueue
- self.logger.debug("Enqueuing pkt type " + ofp.cstruct.ofp_type_map[hdr.type])
+ self.logger.debug("Enqueuing pkt type " + ofp.ofp_type_map[hdr.type])
with self.packets_cv:
if len(self.packets) >= self.max_pkts:
self.packets.pop(0)
@@ -577,7 +577,7 @@
"""
if exp_msg is not None:
- self.logger.debug("Poll for %s" % ofp.cstruct.ofp_type_map[exp_msg])
+ self.logger.debug("Poll for %s" % ofp.ofp_type_map[exp_msg])
else:
self.logger.debug("Poll for any OF message")
@@ -589,10 +589,10 @@
(msg, pkt) = self.packets.pop(0)
return (msg, pkt)
else:
- self.logger.debug("Looking for %s" % ofp.cstruct.ofp_type_map[exp_msg])
+ self.logger.debug("Looking for %s" % ofp.ofp_type_map[exp_msg])
for i in range(len(self.packets)):
msg = self.packets[i][0]
- self.logger.debug("Checking packets[%d] (%s)" % (i, ofp.cstruct.ofp_type_map[msg.header.type]))
+ self.logger.debug("Checking packets[%d] (%s)" % (i, ofp.ofp_type_map[msg.header.type]))
if msg.header.type == exp_msg:
(msg, pkt) = self.packets.pop(i)
return (msg, pkt)
@@ -679,7 +679,7 @@
msg_version, msg_type, msg_len, msg_xid = struct.unpack_from("!BBHL", outpkt)
self.logger.debug("Msg out: buf len %d. hdr.type %s. hdr.len %d hdr.version %d hdr.xid %d",
len(outpkt),
- ofp.cstruct.ofp_type_map.get(msg_type, "unknown (%d)" % msg_type),
+ ofp.ofp_type_map.get(msg_type, "unknown (%d)" % msg_type),
msg_len,
msg_version,
msg_xid)