update pyloxi to 6bf5db6105b7e83bad4d87791bf4ab07295dab11
diff --git a/src/python/loxi/of10/action.py b/src/python/loxi/of10/action.py
index 2de9ac9..6a3abfb 100644
--- a/src/python/loxi/of10/action.py
+++ b/src/python/loxi/of10/action.py
@@ -904,8 +904,7 @@
q.text('}')
-def parse_vendor(reader):
-
+def parse_experimenter(reader):
experimenter, = reader.peek("!4xL")
if experimenter == 0x005c16c7: # Big Switch Networks
subtype, = reader.peek("!8xL")
@@ -932,7 +931,7 @@
const.OFPAT_SET_TP_SRC : set_tp_src.unpack,
const.OFPAT_SET_TP_DST : set_tp_dst.unpack,
const.OFPAT_ENQUEUE : enqueue.unpack,
- const.OFPAT_VENDOR : parse_vendor,
+ const.OFPAT_EXPERIMENTER : parse_experimenter,
}
experimenter_parsers = {
diff --git a/src/python/loxi/of10/const.py b/src/python/loxi/of10/const.py
index dc768c6..cf4f6f5 100644
--- a/src/python/loxi/of10/const.py
+++ b/src/python/loxi/of10/const.py
@@ -11,8 +11,8 @@
# Identifiers from group macro_definitions
OFP_MAX_TABLE_NAME_LEN = 32
OFP_MAX_PORT_NAME_LEN = 16
-OFP_TCP_PORT = 6633
-OFP_SSL_PORT = 6633
+OFP_TCP_PORT = 6653
+OFP_SSL_PORT = 6653
OFP_ETH_ALEN = 6
OFP_DEFAULT_MISS_SEND_LEN = 128
OFP_VLAN_NONE = 65535
@@ -27,6 +27,13 @@
OFPQ_ALL = 4294967295
OFPQ_MIN_RATE_UNCFG = 65535
+# Identifiers from group of_bsn_pdu_slot_num_t
+BSN_PDU_SLOT_NUM_ANY = 255
+
+of_bsn_pdu_slot_num_t_map = {
+ 255: 'BSN_PDU_SLOT_NUM_ANY',
+}
+
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
OFPAT_SET_VLAN_VID = 1
@@ -40,7 +47,7 @@
OFPAT_SET_TP_SRC = 9
OFPAT_SET_TP_DST = 10
OFPAT_ENQUEUE = 11
-OFPAT_VENDOR = 65535
+OFPAT_EXPERIMENTER = 65535
ofp_action_type_map = {
0: 'OFPAT_OUTPUT',
@@ -55,14 +62,14 @@
9: 'OFPAT_SET_TP_SRC',
10: 'OFPAT_SET_TP_DST',
11: 'OFPAT_ENQUEUE',
- 65535: 'OFPAT_VENDOR',
+ 65535: 'OFPAT_EXPERIMENTER',
}
# Identifiers from group ofp_bad_action_code
OFPBAC_BAD_TYPE = 0
OFPBAC_BAD_LEN = 1
-OFPBAC_BAD_VENDOR = 2
-OFPBAC_BAD_VENDOR_TYPE = 3
+OFPBAC_BAD_EXPERIMENTER = 2
+OFPBAC_BAD_EXPERIMENTER_TYPE = 3
OFPBAC_BAD_OUT_PORT = 4
OFPBAC_BAD_ARGUMENT = 5
OFPBAC_EPERM = 6
@@ -72,8 +79,8 @@
ofp_bad_action_code_map = {
0: 'OFPBAC_BAD_TYPE',
1: 'OFPBAC_BAD_LEN',
- 2: 'OFPBAC_BAD_VENDOR',
- 3: 'OFPBAC_BAD_VENDOR_TYPE',
+ 2: 'OFPBAC_BAD_EXPERIMENTER',
+ 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
4: 'OFPBAC_BAD_OUT_PORT',
5: 'OFPBAC_BAD_ARGUMENT',
6: 'OFPBAC_EPERM',
@@ -85,7 +92,7 @@
OFPBRC_BAD_VERSION = 0
OFPBRC_BAD_TYPE = 1
OFPBRC_BAD_STAT = 2
-OFPBRC_BAD_VENDOR = 3
+OFPBRC_BAD_EXPERIMENTER = 3
OFPBRC_BAD_SUBTYPE = 4
OFPBRC_EPERM = 5
OFPBRC_BAD_LEN = 6
@@ -96,7 +103,7 @@
0: 'OFPBRC_BAD_VERSION',
1: 'OFPBRC_BAD_TYPE',
2: 'OFPBRC_BAD_STAT',
- 3: 'OFPBRC_BAD_VENDOR',
+ 3: 'OFPBRC_BAD_EXPERIMENTER',
4: 'OFPBRC_BAD_SUBTYPE',
5: 'OFPBRC_EPERM',
6: 'OFPBRC_BAD_LEN',
@@ -319,6 +326,7 @@
OFPPC_NO_FLOOD = 16
OFPPC_NO_FWD = 32
OFPPC_NO_PACKET_IN = 64
+OFPPC_BSN_MIRROR_DEST = 2147483648
ofp_port_config_map = {
1: 'OFPPC_PORT_DOWN',
@@ -328,6 +336,7 @@
16: 'OFPPC_NO_FLOOD',
32: 'OFPPC_NO_FWD',
64: 'OFPPC_NO_PACKET_IN',
+ 2147483648: 'OFPPC_BSN_MIRROR_DEST',
}
# Identifiers from group ofp_port_features
@@ -380,16 +389,16 @@
}
# Identifiers from group ofp_port_state
-OFPPS_STP_LISTEN = 0
OFPPS_LINK_DOWN = 1
+OFPPS_STP_LISTEN = 0
OFPPS_STP_LEARN = 256
OFPPS_STP_FORWARD = 512
OFPPS_STP_BLOCK = 768
OFPPS_STP_MASK = 768
ofp_port_state_map = {
- 0: 'OFPPS_STP_LISTEN',
1: 'OFPPS_LINK_DOWN',
+ 0: 'OFPPS_STP_LISTEN',
256: 'OFPPS_STP_LEARN',
512: 'OFPPS_STP_FORWARD',
768: 'OFPPS_STP_BLOCK',
@@ -423,23 +432,23 @@
1: 'OFPSF_REPLY_MORE',
}
-# Identifiers from group ofp_stats_types
+# Identifiers from group ofp_stats_type
OFPST_DESC = 0
OFPST_FLOW = 1
OFPST_AGGREGATE = 2
OFPST_TABLE = 3
OFPST_PORT = 4
OFPST_QUEUE = 5
-OFPST_VENDOR = 65535
+OFPST_EXPERIMENTER = 65535
-ofp_stats_types_map = {
+ofp_stats_type_map = {
0: 'OFPST_DESC',
1: 'OFPST_FLOW',
2: 'OFPST_AGGREGATE',
3: 'OFPST_TABLE',
4: 'OFPST_PORT',
5: 'OFPST_QUEUE',
- 65535: 'OFPST_VENDOR',
+ 65535: 'OFPST_EXPERIMENTER',
}
# Identifiers from group ofp_type
@@ -447,7 +456,7 @@
OFPT_ERROR = 1
OFPT_ECHO_REQUEST = 2
OFPT_ECHO_REPLY = 3
-OFPT_VENDOR = 4
+OFPT_EXPERIMENTER = 4
OFPT_FEATURES_REQUEST = 5
OFPT_FEATURES_REPLY = 6
OFPT_GET_CONFIG_REQUEST = 7
@@ -471,7 +480,7 @@
1: 'OFPT_ERROR',
2: 'OFPT_ECHO_REQUEST',
3: 'OFPT_ECHO_REPLY',
- 4: 'OFPT_VENDOR',
+ 4: 'OFPT_EXPERIMENTER',
5: 'OFPT_FEATURES_REQUEST',
6: 'OFPT_FEATURES_REPLY',
7: 'OFPT_GET_CONFIG_REQUEST',
diff --git a/src/python/loxi/of10/message.py b/src/python/loxi/of10/message.py
index c232a1d..4ed79ee 100644
--- a/src/python/loxi/of10/message.py
+++ b/src/python/loxi/of10/message.py
@@ -237,6 +237,180 @@
q.breakable()
q.text('}')
+class bad_action_error_msg(Message):
+ version = 1
+ type = 1
+ err_type = 2
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_action_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 2)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_action_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_request_error_msg(Message):
+ version = 1
+ type = 1
+ err_type = 1
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_request_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 1)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_request_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class barrier_reply(Message):
version = 1
type = 19
@@ -1499,6 +1673,651 @@
q.breakable()
q.text('}')
+class bsn_hybrid_get_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 28
+
+ def __init__(self, xid=None, hybrid_enable=None, hybrid_version=None):
+ self.xid = xid
+ if hybrid_enable != None:
+ self.hybrid_enable = hybrid_enable
+ else:
+ self.hybrid_enable = 0
+ if hybrid_version != None:
+ self.hybrid_version = hybrid_version
+ else:
+ self.hybrid_version = 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("!B", self.hybrid_enable))
+ packed.append('\x00' * 1)
+ packed.append(struct.pack("!H", self.hybrid_version))
+ packed.append('\x00' * 4)
+ 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_hybrid_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 == 1)
+ _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 == 28)
+ obj.hybrid_enable = reader.read("!B")[0]
+ reader.skip(1)
+ obj.hybrid_version = reader.read("!H")[0]
+ reader.skip(4)
+ 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.hybrid_enable != other.hybrid_enable: return False
+ if self.hybrid_version != other.hybrid_version: 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_hybrid_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("hybrid_enable = ");
+ q.text("%#x" % self.hybrid_enable)
+ q.text(","); q.breakable()
+ q.text("hybrid_version = ");
+ q.text("%#x" % self.hybrid_version)
+ q.breakable()
+ q.text('}')
+
+class bsn_hybrid_get_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 27
+
+ 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_hybrid_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 == 1)
+ _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 == 27)
+ 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_hybrid_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_pdu_rx_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 34
+
+ 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_pdu_rx_reply()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _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 == 34)
+ 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_pdu_rx_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_pdu_rx_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 33
+
+ def __init__(self, xid=None, timeout_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if timeout_ms != None:
+ self.timeout_ms = timeout_ms
+ else:
+ self.timeout_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.timeout_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_rx_request()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _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 == 33)
+ obj.timeout_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.timeout_ms != other.timeout_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_rx_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("timeout_ms = ");
+ q.text("%#x" % self.timeout_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_rx_timeout(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 35
+
+ def __init__(self, xid=None, port_no=None, slot_num=None):
+ self.xid = xid
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 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(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ 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_pdu_rx_timeout()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _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 == 35)
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[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.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: 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_pdu_rx_timeout {")
+ 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("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_tx_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 32
+
+ 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_pdu_tx_reply()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _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 == 32)
+ 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_pdu_tx_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_pdu_tx_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 31
+
+ def __init__(self, xid=None, tx_interval_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if tx_interval_ms != None:
+ self.tx_interval_ms = tx_interval_ms
+ else:
+ self.tx_interval_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.tx_interval_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_tx_request()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _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 == 31)
+ obj.tx_interval_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.tx_interval_ms != other.tx_interval_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_tx_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("tx_interval_ms = ");
+ q.text("%#x" % self.tx_interval_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class bsn_set_ip_mask(Message):
version = 1
type = 4
@@ -3014,99 +3833,6 @@
q.breakable()
q.text('}')
-class error_msg(Message):
- version = 1
- type = 1
-
- def __init__(self, xid=None, err_type=None, code=None, data=None):
- self.xid = xid
- if err_type != None:
- self.err_type = err_type
- else:
- self.err_type = 0
- if code != None:
- self.code = code
- else:
- self.code = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- 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("!H", self.err_type))
- packed.append(struct.pack("!H", self.code))
- packed.append(self.data)
- 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 = error_msg()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _version = reader.read("!B")[0]
- assert(_version == 1)
- _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
-
- 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.err_type != other.err_type: return False
- if self.code != other.code: return False
- if self.data != other.data: 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("error_msg {")
- 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("err_type = ");
- q.text("%#x" % self.err_type)
- q.text(","); q.breakable()
- q.text("code = ");
- q.text("%#x" % self.code)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class features_reply(Message):
version = 1
type = 6
@@ -3766,6 +4492,93 @@
q.breakable()
q.text('}')
+class flow_mod_failed_error_msg(Message):
+ version = 1
+ type = 1
+ err_type = 3
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = flow_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 3)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("flow_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class flow_modify(Message):
version = 1
type = 14
@@ -4642,6 +5455,93 @@
q.breakable()
q.text('}')
+class hello_failed_error_msg(Message):
+ version = 1
+ type = 1
+ err_type = 0
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = hello_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 0)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("hello_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class nicira_controller_role_reply(Message):
version = 1
type = 4
@@ -5140,6 +6040,93 @@
q.breakable()
q.text('}')
+class port_mod_failed_error_msg(Message):
+ version = 1
+ type = 1
+ err_type = 4
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = port_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 4)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("port_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class port_stats_reply(Message):
version = 1
type = 17
@@ -5561,6 +6548,93 @@
q.breakable()
q.text('}')
+class queue_op_failed_error_msg(Message):
+ version = 1
+ type = 1
+ err_type = 5
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = queue_op_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 5)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("queue_op_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class queue_stats_reply(Message):
version = 1
type = 17
@@ -6096,6 +7170,15 @@
else:
raise loxi.ProtocolError("unexpected message type")
+def parse_error(buf):
+ if len(buf) < 8 + 2:
+ raise loxi.ProtocolError("message too short")
+ err_type, = struct.unpack_from("!H", buf, 8)
+ if err_type in error_msg_parsers:
+ return error_msg_parsers[err_type](buf)
+ else:
+ raise loxi.ProtocolError("unexpected error type %u" % err_type)
+
def parse_flow_mod(buf):
if len(buf) < 57 + 1:
raise loxi.ProtocolError("message too short")
@@ -6124,7 +7207,7 @@
else:
raise loxi.ProtocolError("unexpected stats type %u" % stats_type)
-def parse_vendor(buf):
+def parse_experimenter(buf):
if len(buf) < 16:
raise loxi.ProtocolError("experimenter message too short")
@@ -6143,10 +7226,10 @@
parsers = {
const.OFPT_HELLO : hello.unpack,
- const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ERROR : parse_error,
const.OFPT_ECHO_REQUEST : echo_request.unpack,
const.OFPT_ECHO_REPLY : echo_reply.unpack,
- const.OFPT_VENDOR : parse_vendor,
+ 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,
@@ -6167,6 +7250,15 @@
22 : table_mod.unpack,
}
+error_msg_parsers = {
+ const.OFPET_HELLO_FAILED : hello_failed_error_msg.unpack,
+ const.OFPET_BAD_REQUEST : bad_request_error_msg.unpack,
+ const.OFPET_BAD_ACTION : bad_action_error_msg.unpack,
+ const.OFPET_FLOW_MOD_FAILED : flow_mod_failed_error_msg.unpack,
+ const.OFPET_PORT_MOD_FAILED : port_mod_failed_error_msg.unpack,
+ const.OFPET_QUEUE_OP_FAILED : queue_op_failed_error_msg.unpack,
+}
+
flow_mod_parsers = {
const.OFPFC_ADD : flow_add.unpack,
const.OFPFC_MODIFY : flow_modify.unpack,
@@ -6213,6 +7305,13 @@
13: bsn_get_l2_table_request.unpack,
5: bsn_get_mirroring_reply.unpack,
4: bsn_get_mirroring_request.unpack,
+ 28: bsn_hybrid_get_reply.unpack,
+ 27: bsn_hybrid_get_request.unpack,
+ 34: bsn_pdu_rx_reply.unpack,
+ 33: bsn_pdu_rx_request.unpack,
+ 35: bsn_pdu_rx_timeout.unpack,
+ 32: bsn_pdu_tx_reply.unpack,
+ 31: bsn_pdu_tx_request.unpack,
0: bsn_set_ip_mask.unpack,
24: bsn_set_l2_table_reply.unpack,
12: bsn_set_l2_table_request.unpack,
diff --git a/src/python/loxi/of10/util.py b/src/python/loxi/of10/util.py
index de54fa8..ddd603d 100644
--- a/src/python/loxi/of10/util.py
+++ b/src/python/loxi/of10/util.py
@@ -77,3 +77,23 @@
def pack_list(values):
return "".join([x.pack() for x in values])
+
+MASK64 = (1 << 64) - 1
+
+def pack_bitmap_128(value):
+ x = 0l
+ for y in value:
+ x |= 1 << y
+ return struct.pack("!QQ", (x >> 64) & MASK64, x & MASK64)
+
+def unpack_bitmap_128(reader):
+ hi, lo = reader.read("!QQ")
+ x = (hi << 64) | lo
+ i = 0
+ value = set()
+ while x != 0:
+ if x & 1 == 1:
+ value.add(i)
+ i += 1
+ x >>= 1
+ return value
diff --git a/src/python/loxi/of11/action.py b/src/python/loxi/of11/action.py
index 44a3b70..644319d 100644
--- a/src/python/loxi/of11/action.py
+++ b/src/python/loxi/of11/action.py
@@ -1583,7 +1583,6 @@
def parse_experimenter(reader):
-
experimenter, = reader.peek("!4xL")
if experimenter == 0x005c16c7: # Big Switch Networks
subtype, = reader.peek("!8xL")
diff --git a/src/python/loxi/of11/common.py b/src/python/loxi/of11/common.py
index 6b0e296..c264e65 100644
--- a/src/python/loxi/of11/common.py
+++ b/src/python/loxi/of11/common.py
@@ -534,11 +534,11 @@
class group_desc_stats_entry(object):
- def __init__(self, type=None, group_id=None, buckets=None):
- if type != None:
- self.type = type
+ def __init__(self, group_type=None, group_id=None, buckets=None):
+ if group_type != None:
+ self.group_type = group_type
else:
- self.type = 0
+ self.group_type = 0
if group_id != None:
self.group_id = group_id
else:
@@ -552,7 +552,7 @@
def pack(self):
packed = []
packed.append(struct.pack("!H", 0)) # placeholder for length at index 0
- packed.append(struct.pack("!B", self.type))
+ packed.append(struct.pack("!B", self.group_type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
packed.append(util.pack_list(self.buckets))
@@ -568,7 +568,7 @@
else:
reader = loxi.generic_util.OFReader(buf)
_length = reader.read("!H")[0]
- obj.type = reader.read("!B")[0]
+ obj.group_type = reader.read("!B")[0]
reader.skip(1)
obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
@@ -576,7 +576,7 @@
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
+ if self.group_type != other.group_type: return False
if self.group_id != other.group_id: return False
if self.buckets != other.buckets: return False
return True
@@ -593,8 +593,8 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
+ q.text("group_type = ");
+ q.text("%#x" % self.group_type)
q.text(","); q.breakable()
q.text("group_id = ");
q.text("%#x" % self.group_id)
diff --git a/src/python/loxi/of11/const.py b/src/python/loxi/of11/const.py
index 4360d37..47434d1 100644
--- a/src/python/loxi/of11/const.py
+++ b/src/python/loxi/of11/const.py
@@ -11,8 +11,8 @@
# Identifiers from group macro_definitions
OFP_MAX_TABLE_NAME_LEN = 32
OFP_MAX_PORT_NAME_LEN = 16
-OFP_TCP_PORT = 6633
-OFP_SSL_PORT = 6633
+OFP_TCP_PORT = 6653
+OFP_SSL_PORT = 6653
OFP_ETH_ALEN = 6
OFP_DEFAULT_MISS_SEND_LEN = 128
OFPFW_ICMP_TYPE = 64
@@ -28,6 +28,13 @@
OFPQ_ALL = 4294967295
OFPQ_MIN_RATE_UNCFG = 65535
+# Identifiers from group of_bsn_pdu_slot_num_t
+BSN_PDU_SLOT_NUM_ANY = 255
+
+of_bsn_pdu_slot_num_t_map = {
+ 255: 'BSN_PDU_SLOT_NUM_ANY',
+}
+
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
OFPAT_SET_VLAN_VID = 1
@@ -464,12 +471,14 @@
OFPPC_NO_RECV = 4
OFPPC_NO_FWD = 32
OFPPC_NO_PACKET_IN = 64
+OFPPC_BSN_MIRROR_DEST = 2147483648
ofp_port_config_map = {
1: 'OFPPC_PORT_DOWN',
4: 'OFPPC_NO_RECV',
32: 'OFPPC_NO_FWD',
64: 'OFPPC_NO_PACKET_IN',
+ 2147483648: 'OFPPC_BSN_MIRROR_DEST',
}
# Identifiers from group ofp_port_features
@@ -578,7 +587,7 @@
1: 'OFPSF_REPLY_MORE',
}
-# Identifiers from group ofp_stats_types
+# Identifiers from group ofp_stats_type
OFPST_DESC = 0
OFPST_FLOW = 1
OFPST_AGGREGATE = 2
@@ -589,7 +598,7 @@
OFPST_GROUP_DESC = 7
OFPST_EXPERIMENTER = 65535
-ofp_stats_types_map = {
+ofp_stats_type_map = {
0: 'OFPST_DESC',
1: 'OFPST_FLOW',
2: 'OFPST_AGGREGATE',
diff --git a/src/python/loxi/of11/message.py b/src/python/loxi/of11/message.py
index 1d32ee6..ab364e6 100644
--- a/src/python/loxi/of11/message.py
+++ b/src/python/loxi/of11/message.py
@@ -274,6 +274,354 @@
q.breakable()
q.text('}')
+class bad_action_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 2
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_action_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 2)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_action_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_instruction_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 3
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_instruction_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 3)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_instruction_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_match_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 4
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_match_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 4)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_match_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_request_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 1
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_request_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 1)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_request_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class barrier_reply(Message):
version = 2
type = 21
@@ -1194,6 +1542,485 @@
q.breakable()
q.text('}')
+class bsn_pdu_rx_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 34
+
+ 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_pdu_rx_reply()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _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 == 34)
+ 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_pdu_rx_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_pdu_rx_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 33
+
+ def __init__(self, xid=None, timeout_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if timeout_ms != None:
+ self.timeout_ms = timeout_ms
+ else:
+ self.timeout_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.timeout_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_rx_request()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _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 == 33)
+ obj.timeout_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.timeout_ms != other.timeout_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_rx_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("timeout_ms = ");
+ q.text("%#x" % self.timeout_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_rx_timeout(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 35
+
+ def __init__(self, xid=None, port_no=None, slot_num=None):
+ self.xid = xid
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 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(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ 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_pdu_rx_timeout()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _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 == 35)
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[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.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: 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_pdu_rx_timeout {")
+ 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("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_tx_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 32
+
+ 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_pdu_tx_reply()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _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 == 32)
+ 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_pdu_tx_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_pdu_tx_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 31
+
+ def __init__(self, xid=None, tx_interval_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if tx_interval_ms != None:
+ self.tx_interval_ms = tx_interval_ms
+ else:
+ self.tx_interval_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.tx_interval_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_tx_request()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _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 == 31)
+ obj.tx_interval_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.tx_interval_ms != other.tx_interval_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_tx_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("tx_interval_ms = ");
+ q.text("%#x" % self.tx_interval_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class bsn_set_mirroring(Message):
version = 2
type = 4
@@ -2169,99 +2996,6 @@
q.breakable()
q.text('}')
-class error_msg(Message):
- version = 2
- type = 1
-
- def __init__(self, xid=None, err_type=None, code=None, data=None):
- self.xid = xid
- if err_type != None:
- self.err_type = err_type
- else:
- self.err_type = 0
- if code != None:
- self.code = code
- else:
- self.code = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- 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("!H", self.err_type))
- packed.append(struct.pack("!H", self.code))
- packed.append(self.data)
- 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 = error_msg()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _version = reader.read("!B")[0]
- assert(_version == 2)
- _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
-
- 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.err_type != other.err_type: return False
- if self.code != other.code: return False
- if self.data != other.data: 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("error_msg {")
- 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("err_type = ");
- q.text("%#x" % self.err_type)
- q.text(","); q.breakable()
- q.text("code = ");
- q.text("%#x" % self.code)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class features_reply(Message):
version = 2
type = 6
@@ -3017,6 +3751,93 @@
q.breakable()
q.text('}')
+class flow_mod_failed_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 5
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = flow_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 5)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("flow_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class flow_modify(Message):
version = 2
type = 14
@@ -4211,6 +5032,93 @@
q.breakable()
q.text('}')
+class group_mod_failed_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 6
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = group_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 6)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("group_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class group_stats_reply(Message):
version = 2
type = 19
@@ -4454,6 +5362,93 @@
q.breakable()
q.text('}')
+class hello_failed_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 0
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = hello_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 0)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("hello_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class packet_in(Message):
version = 2
type = 10
@@ -4814,6 +5809,93 @@
q.breakable()
q.text('}')
+class port_mod_failed_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 7
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = port_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 7)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("port_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class port_stats_reply(Message):
version = 2
type = 19
@@ -5239,6 +6321,93 @@
q.breakable()
q.text('}')
+class queue_op_failed_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 9
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = queue_op_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 9)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("queue_op_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class queue_stats_reply(Message):
version = 2
type = 19
@@ -5510,6 +6679,93 @@
q.breakable()
q.text('}')
+class switch_config_failed_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 10
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = switch_config_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 10)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("switch_config_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class table_mod(Message):
version = 2
type = 17
@@ -5595,6 +6851,93 @@
q.breakable()
q.text('}')
+class table_mod_failed_error_msg(Message):
+ version = 2
+ type = 1
+ err_type = 8
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = table_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 8)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("table_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class table_stats_reply(Message):
version = 2
type = 19
@@ -5780,6 +7123,15 @@
else:
raise loxi.ProtocolError("unexpected message type")
+def parse_error(buf):
+ if len(buf) < 8 + 2:
+ raise loxi.ProtocolError("message too short")
+ err_type, = struct.unpack_from("!H", buf, 8)
+ if err_type in error_msg_parsers:
+ return error_msg_parsers[err_type](buf)
+ else:
+ raise loxi.ProtocolError("unexpected error type %u" % err_type)
+
def parse_flow_mod(buf):
if len(buf) < 25 + 1:
raise loxi.ProtocolError("message too short")
@@ -5827,7 +7179,7 @@
parsers = {
const.OFPT_HELLO : hello.unpack,
- const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ERROR : parse_error,
const.OFPT_ECHO_REQUEST : echo_request.unpack,
const.OFPT_ECHO_REPLY : echo_reply.unpack,
const.OFPT_EXPERIMENTER : parse_experimenter,
@@ -5852,6 +7204,20 @@
const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
}
+error_msg_parsers = {
+ const.OFPET_HELLO_FAILED : hello_failed_error_msg.unpack,
+ const.OFPET_BAD_REQUEST : bad_request_error_msg.unpack,
+ const.OFPET_BAD_ACTION : bad_action_error_msg.unpack,
+ const.OFPET_FLOW_MOD_FAILED : flow_mod_failed_error_msg.unpack,
+ const.OFPET_PORT_MOD_FAILED : port_mod_failed_error_msg.unpack,
+ const.OFPET_QUEUE_OP_FAILED : queue_op_failed_error_msg.unpack,
+ const.OFPET_BAD_INSTRUCTION : bad_instruction_error_msg.unpack,
+ const.OFPET_BAD_MATCH : bad_match_error_msg.unpack,
+ const.OFPET_GROUP_MOD_FAILED : group_mod_failed_error_msg.unpack,
+ const.OFPET_TABLE_MOD_FAILED : table_mod_failed_error_msg.unpack,
+ const.OFPET_SWITCH_CONFIG_FAILED : switch_config_failed_error_msg.unpack,
+}
+
flow_mod_parsers = {
const.OFPFC_ADD : flow_add.unpack,
const.OFPFC_MODIFY : flow_modify.unpack,
@@ -5894,6 +7260,11 @@
9: bsn_get_interfaces_request.unpack,
5: bsn_get_mirroring_reply.unpack,
4: bsn_get_mirroring_request.unpack,
+ 34: bsn_pdu_rx_reply.unpack,
+ 33: bsn_pdu_rx_request.unpack,
+ 35: bsn_pdu_rx_timeout.unpack,
+ 32: bsn_pdu_tx_reply.unpack,
+ 31: bsn_pdu_tx_request.unpack,
3: bsn_set_mirroring.unpack,
25: bsn_set_pktin_suppression_reply.unpack,
11: bsn_set_pktin_suppression_request.unpack,
diff --git a/src/python/loxi/of11/util.py b/src/python/loxi/of11/util.py
index 13c927a..d15b33b 100644
--- a/src/python/loxi/of11/util.py
+++ b/src/python/loxi/of11/util.py
@@ -77,3 +77,23 @@
def pack_list(values):
return "".join([x.pack() for x in values])
+
+MASK64 = (1 << 64) - 1
+
+def pack_bitmap_128(value):
+ x = 0l
+ for y in value:
+ x |= 1 << y
+ return struct.pack("!QQ", (x >> 64) & MASK64, x & MASK64)
+
+def unpack_bitmap_128(reader):
+ hi, lo = reader.read("!QQ")
+ x = (hi << 64) | lo
+ i = 0
+ value = set()
+ while x != 0:
+ if x & 1 == 1:
+ value.add(i)
+ i += 1
+ x >>= 1
+ return value
diff --git a/src/python/loxi/of12/action.py b/src/python/loxi/of12/action.py
index 9ae3d8f..141d118 100644
--- a/src/python/loxi/of12/action.py
+++ b/src/python/loxi/of12/action.py
@@ -975,7 +975,6 @@
def parse_experimenter(reader):
-
experimenter, = reader.peek("!4xL")
if experimenter == 0x005c16c7: # Big Switch Networks
subtype, = reader.peek("!8xL")
diff --git a/src/python/loxi/of12/common.py b/src/python/loxi/of12/common.py
index dee40f1..ef59c20 100644
--- a/src/python/loxi/of12/common.py
+++ b/src/python/loxi/of12/common.py
@@ -535,11 +535,11 @@
class group_desc_stats_entry(object):
- def __init__(self, type=None, group_id=None, buckets=None):
- if type != None:
- self.type = type
+ def __init__(self, group_type=None, group_id=None, buckets=None):
+ if group_type != None:
+ self.group_type = group_type
else:
- self.type = 0
+ self.group_type = 0
if group_id != None:
self.group_id = group_id
else:
@@ -553,7 +553,7 @@
def pack(self):
packed = []
packed.append(struct.pack("!H", 0)) # placeholder for length at index 0
- packed.append(struct.pack("!B", self.type))
+ packed.append(struct.pack("!B", self.group_type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
packed.append(util.pack_list(self.buckets))
@@ -569,7 +569,7 @@
else:
reader = loxi.generic_util.OFReader(buf)
_length = reader.read("!H")[0]
- obj.type = reader.read("!B")[0]
+ obj.group_type = reader.read("!B")[0]
reader.skip(1)
obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
@@ -577,7 +577,7 @@
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
+ if self.group_type != other.group_type: return False
if self.group_id != other.group_id: return False
if self.buckets != other.buckets: return False
return True
@@ -594,8 +594,8 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
+ q.text("group_type = ");
+ q.text("%#x" % self.group_type)
q.text(","); q.breakable()
q.text("group_id = ");
q.text("%#x" % self.group_id)
diff --git a/src/python/loxi/of12/const.py b/src/python/loxi/of12/const.py
index b654b1a..5024b70 100644
--- a/src/python/loxi/of12/const.py
+++ b/src/python/loxi/of12/const.py
@@ -11,8 +11,8 @@
# Identifiers from group macro_definitions
OFP_MAX_TABLE_NAME_LEN = 32
OFP_MAX_PORT_NAME_LEN = 16
-OFP_TCP_PORT = 6633
-OFP_SSL_PORT = 6633
+OFP_TCP_PORT = 6653
+OFP_SSL_PORT = 6653
OFP_ETH_ALEN = 6
OFP_DEFAULT_MISS_SEND_LEN = 128
OFP_VLAN_NONE = 0
@@ -25,6 +25,13 @@
OFPQ_MIN_RATE_UNCFG = 65535
OFPQ_MAX_RATE_UNCFG = 65535
+# Identifiers from group of_bsn_pdu_slot_num_t
+BSN_PDU_SLOT_NUM_ANY = 255
+
+of_bsn_pdu_slot_num_t_map = {
+ 255: 'BSN_PDU_SLOT_NUM_ANY',
+}
+
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
OFPAT_COPY_TTL_OUT = 11
@@ -64,7 +71,7 @@
OFPBAC_BAD_TYPE = 0
OFPBAC_BAD_LEN = 1
OFPBAC_BAD_EXPERIMENTER = 2
-OFPBAC_BAD_EXP_TYPE = 3
+OFPBAC_BAD_EXPERIMENTER_TYPE = 3
OFPBAC_BAD_OUT_PORT = 4
OFPBAC_BAD_ARGUMENT = 5
OFPBAC_EPERM = 6
@@ -82,7 +89,7 @@
0: 'OFPBAC_BAD_TYPE',
1: 'OFPBAC_BAD_LEN',
2: 'OFPBAC_BAD_EXPERIMENTER',
- 3: 'OFPBAC_BAD_EXP_TYPE',
+ 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
4: 'OFPBAC_BAD_OUT_PORT',
5: 'OFPBAC_BAD_ARGUMENT',
6: 'OFPBAC_EPERM',
@@ -104,7 +111,7 @@
OFPBIC_UNSUP_METADATA = 3
OFPBIC_UNSUP_METADATA_MASK = 4
OFPBIC_BAD_EXPERIMENTER = 5
-OFPBIC_BAD_EXP_TYPE = 6
+OFPBIC_BAD_EXPERIMENTER_TYPE = 6
OFPBIC_BAD_LEN = 7
OFPBIC_EPERM = 8
@@ -115,7 +122,7 @@
3: 'OFPBIC_UNSUP_METADATA',
4: 'OFPBIC_UNSUP_METADATA_MASK',
5: 'OFPBIC_BAD_EXPERIMENTER',
- 6: 'OFPBIC_BAD_EXP_TYPE',
+ 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
7: 'OFPBIC_BAD_LEN',
8: 'OFPBIC_EPERM',
}
@@ -154,7 +161,7 @@
OFPBRC_BAD_TYPE = 1
OFPBRC_BAD_STAT = 2
OFPBRC_BAD_EXPERIMENTER = 3
-OFPBRC_BAD_EXP_TYPE = 4
+OFPBRC_BAD_EXPERIMENTER_TYPE = 4
OFPBRC_EPERM = 5
OFPBRC_BAD_LEN = 6
OFPBRC_BUFFER_EMPTY = 7
@@ -169,7 +176,7 @@
1: 'OFPBRC_BAD_TYPE',
2: 'OFPBRC_BAD_STAT',
3: 'OFPBRC_BAD_EXPERIMENTER',
- 4: 'OFPBRC_BAD_EXP_TYPE',
+ 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
5: 'OFPBRC_EPERM',
6: 'OFPBRC_BAD_LEN',
7: 'OFPBRC_BUFFER_EMPTY',
@@ -511,12 +518,14 @@
OFPPC_NO_RECV = 4
OFPPC_NO_FWD = 32
OFPPC_NO_PACKET_IN = 64
+OFPPC_BSN_MIRROR_DEST = 2147483648
ofp_port_config_map = {
1: 'OFPPC_PORT_DOWN',
4: 'OFPPC_NO_RECV',
32: 'OFPPC_NO_FWD',
64: 'OFPPC_NO_PACKET_IN',
+ 2147483648: 'OFPPC_BSN_MIRROR_DEST',
}
# Identifiers from group ofp_port_features
@@ -640,7 +649,7 @@
1: 'OFPSF_REPLY_MORE',
}
-# Identifiers from group ofp_stats_types
+# Identifiers from group ofp_stats_type
OFPST_DESC = 0
OFPST_FLOW = 1
OFPST_AGGREGATE = 2
@@ -652,7 +661,7 @@
OFPST_GROUP_FEATURES = 8
OFPST_EXPERIMENTER = 65535
-ofp_stats_types_map = {
+ofp_stats_type_map = {
0: 'OFPST_DESC',
1: 'OFPST_FLOW',
2: 'OFPST_AGGREGATE',
diff --git a/src/python/loxi/of12/message.py b/src/python/loxi/of12/message.py
index c595918..9bf3267 100644
--- a/src/python/loxi/of12/message.py
+++ b/src/python/loxi/of12/message.py
@@ -274,6 +274,354 @@
q.breakable()
q.text('}')
+class bad_action_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 2
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_action_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 2)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_action_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_instruction_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 3
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_instruction_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 3)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_instruction_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_match_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 4
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_match_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 4)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_match_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_request_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 1
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_request_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 1)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_request_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class barrier_reply(Message):
version = 3
type = 21
@@ -1194,6 +1542,485 @@
q.breakable()
q.text('}')
+class bsn_pdu_rx_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 34
+
+ 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_pdu_rx_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 == 34)
+ 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_pdu_rx_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_pdu_rx_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 33
+
+ def __init__(self, xid=None, timeout_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if timeout_ms != None:
+ self.timeout_ms = timeout_ms
+ else:
+ self.timeout_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.timeout_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_rx_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 == 33)
+ obj.timeout_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.timeout_ms != other.timeout_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_rx_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("timeout_ms = ");
+ q.text("%#x" % self.timeout_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_rx_timeout(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 35
+
+ def __init__(self, xid=None, port_no=None, slot_num=None):
+ self.xid = xid
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 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(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ 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_pdu_rx_timeout()
+ 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 == 35)
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[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.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: 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_pdu_rx_timeout {")
+ 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("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_tx_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 32
+
+ 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_pdu_tx_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 == 32)
+ 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_pdu_tx_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_pdu_tx_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 31
+
+ def __init__(self, xid=None, tx_interval_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if tx_interval_ms != None:
+ self.tx_interval_ms = tx_interval_ms
+ else:
+ self.tx_interval_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.tx_interval_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_tx_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 == 31)
+ obj.tx_interval_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.tx_interval_ms != other.tx_interval_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_tx_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("tx_interval_ms = ");
+ q.text("%#x" % self.tx_interval_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class bsn_set_mirroring(Message):
version = 3
type = 4
@@ -2169,20 +2996,21 @@
q.breakable()
q.text('}')
-class error_msg(Message):
+class experimenter_error_msg(Message):
version = 3
type = 1
+ err_type = 65535
- def __init__(self, xid=None, err_type=None, code=None, data=None):
+ def __init__(self, xid=None, subtype=None, experimenter=None, data=None):
self.xid = xid
- if err_type != None:
- self.err_type = err_type
+ if subtype != None:
+ self.subtype = subtype
else:
- self.err_type = 0
- if code != None:
- self.code = code
+ self.subtype = 0
+ if experimenter != None:
+ self.experimenter = experimenter
else:
- self.code = 0
+ self.experimenter = 0
if data != None:
self.data = data
else:
@@ -2195,7 +3023,8 @@
packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.err_type))
- packed.append(struct.pack("!H", self.code))
+ packed.append(struct.pack("!H", self.subtype))
+ packed.append(struct.pack("!L", self.experimenter))
packed.append(self.data)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -2204,7 +3033,7 @@
@staticmethod
def unpack(buf):
if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = error_msg()
+ obj = experimenter_error_msg()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
@@ -2215,8 +3044,10 @@
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]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 65535)
+ obj.subtype = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -2225,8 +3056,8 @@
if self.version != other.version: return False
if self.type != other.type: return False
if self.xid != other.xid: return False
- if self.err_type != other.err_type: return False
- if self.code != other.code: return False
+ if self.subtype != other.subtype: return False
+ if self.experimenter != other.experimenter: return False
if self.data != other.data: return False
return True
@@ -2241,7 +3072,7 @@
return loxi.pp.pp(self)
def pretty_print(self, q):
- q.text("error_msg {")
+ q.text("experimenter_error_msg {")
with q.group():
with q.indent(2):
q.breakable()
@@ -2251,11 +3082,11 @@
else:
q.text('None')
q.text(","); q.breakable()
- q.text("err_type = ");
- q.text("%#x" % self.err_type)
+ q.text("subtype = ");
+ q.text("%#x" % self.subtype)
q.text(","); q.breakable()
- q.text("code = ");
- q.text("%#x" % self.code)
+ q.text("experimenter = ");
+ q.text("%#x" % self.experimenter)
q.text(","); q.breakable()
q.text("data = ");
q.pp(self.data)
@@ -3017,6 +3848,93 @@
q.breakable()
q.text('}')
+class flow_mod_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 5
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = flow_mod_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 5)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("flow_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class flow_modify(Message):
version = 3
type = 14
@@ -4477,6 +5395,93 @@
q.breakable()
q.text('}')
+class group_mod_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 6
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = group_mod_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 6)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("group_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class group_stats_reply(Message):
version = 3
type = 19
@@ -4720,6 +5725,93 @@
q.breakable()
q.text('}')
+class hello_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 0
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = hello_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 0)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("hello_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class packet_in(Message):
version = 3
type = 10
@@ -5072,6 +6164,93 @@
q.breakable()
q.text('}')
+class port_mod_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 7
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = port_mod_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 7)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("port_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class port_stats_reply(Message):
version = 3
type = 19
@@ -5497,6 +6676,93 @@
q.breakable()
q.text('}')
+class queue_op_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 9
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = queue_op_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 9)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("queue_op_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class queue_stats_reply(Message):
version = 3
type = 19
@@ -5843,6 +7109,93 @@
q.breakable()
q.text('}')
+class role_request_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 11
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = role_request_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 11)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("role_request_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class set_config(Message):
version = 3
type = 9
@@ -5926,6 +7279,93 @@
q.breakable()
q.text('}')
+class switch_config_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 10
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = switch_config_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 10)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("switch_config_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class table_mod(Message):
version = 3
type = 17
@@ -6011,6 +7451,93 @@
q.breakable()
q.text('}')
+class table_mod_failed_error_msg(Message):
+ version = 3
+ type = 1
+ err_type = 8
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = table_mod_failed_error_msg()
+ 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 == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 8)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("table_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class table_stats_reply(Message):
version = 3
type = 19
@@ -6196,6 +7723,15 @@
else:
raise loxi.ProtocolError("unexpected message type")
+def parse_error(buf):
+ if len(buf) < 8 + 2:
+ raise loxi.ProtocolError("message too short")
+ err_type, = struct.unpack_from("!H", buf, 8)
+ if err_type in error_msg_parsers:
+ return error_msg_parsers[err_type](buf)
+ else:
+ raise loxi.ProtocolError("unexpected error type %u" % err_type)
+
def parse_flow_mod(buf):
if len(buf) < 25 + 1:
raise loxi.ProtocolError("message too short")
@@ -6243,7 +7779,7 @@
parsers = {
const.OFPT_HELLO : hello.unpack,
- const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ERROR : parse_error,
const.OFPT_ECHO_REQUEST : echo_request.unpack,
const.OFPT_ECHO_REPLY : echo_reply.unpack,
const.OFPT_EXPERIMENTER : parse_experimenter,
@@ -6270,6 +7806,22 @@
const.OFPT_ROLE_REPLY : role_reply.unpack,
}
+error_msg_parsers = {
+ const.OFPET_HELLO_FAILED : hello_failed_error_msg.unpack,
+ const.OFPET_BAD_REQUEST : bad_request_error_msg.unpack,
+ const.OFPET_BAD_ACTION : bad_action_error_msg.unpack,
+ const.OFPET_FLOW_MOD_FAILED : flow_mod_failed_error_msg.unpack,
+ const.OFPET_PORT_MOD_FAILED : port_mod_failed_error_msg.unpack,
+ const.OFPET_QUEUE_OP_FAILED : queue_op_failed_error_msg.unpack,
+ const.OFPET_BAD_INSTRUCTION : bad_instruction_error_msg.unpack,
+ const.OFPET_BAD_MATCH : bad_match_error_msg.unpack,
+ const.OFPET_GROUP_MOD_FAILED : group_mod_failed_error_msg.unpack,
+ const.OFPET_TABLE_MOD_FAILED : table_mod_failed_error_msg.unpack,
+ const.OFPET_SWITCH_CONFIG_FAILED : switch_config_failed_error_msg.unpack,
+ const.OFPET_ROLE_REQUEST_FAILED : role_request_failed_error_msg.unpack,
+ const.OFPET_EXPERIMENTER : experimenter_error_msg.unpack,
+}
+
flow_mod_parsers = {
const.OFPFC_ADD : flow_add.unpack,
const.OFPFC_MODIFY : flow_modify.unpack,
@@ -6314,6 +7866,11 @@
9: bsn_get_interfaces_request.unpack,
5: bsn_get_mirroring_reply.unpack,
4: bsn_get_mirroring_request.unpack,
+ 34: bsn_pdu_rx_reply.unpack,
+ 33: bsn_pdu_rx_request.unpack,
+ 35: bsn_pdu_rx_timeout.unpack,
+ 32: bsn_pdu_tx_reply.unpack,
+ 31: bsn_pdu_tx_request.unpack,
3: bsn_set_mirroring.unpack,
25: bsn_set_pktin_suppression_reply.unpack,
11: bsn_set_pktin_suppression_request.unpack,
diff --git a/src/python/loxi/of12/oxm.py b/src/python/loxi/of12/oxm.py
index 0fd7948..c3f1c94 100644
--- a/src/python/loxi/of12/oxm.py
+++ b/src/python/loxi/of12/oxm.py
@@ -567,6 +567,114 @@
q.breakable()
q.text('}')
+class bsn_in_ports_128(OXM):
+ type_len = 196640
+
+ def __init__(self, value=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = set()
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(util.pack_bitmap_128(self.value))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_in_ports_128()
+ 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 == 196640)
+ obj.value = util.unpack_bitmap_128(reader)
+ 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("bsn_in_ports_128 {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.pp(self.value)
+ q.breakable()
+ q.text('}')
+
+class bsn_in_ports_128_masked(OXM):
+ type_len = 196896
+
+ def __init__(self, value=None, value_mask=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = set()
+ if value_mask != None:
+ self.value_mask = value_mask
+ else:
+ self.value_mask = set()
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(util.pack_bitmap_128(self.value))
+ packed.append(util.pack_bitmap_128(self.value_mask))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_in_ports_128_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 == 196896)
+ obj.value = util.unpack_bitmap_128(reader)
+ obj.value_mask = util.unpack_bitmap_128(reader)
+ 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("bsn_in_ports_128_masked {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.pp(self.value)
+ q.text(","); q.breakable()
+ q.text("value_mask = ");
+ q.pp(self.value_mask)
+ q.breakable()
+ q.text('}')
+
class eth_dst(OXM):
type_len = 2147485190
@@ -3917,6 +4025,8 @@
parsers = {
+ 196640 : bsn_in_ports_128.unpack,
+ 196896 : bsn_in_ports_128_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 56b5729..27eb6fb 100644
--- a/src/python/loxi/of12/util.py
+++ b/src/python/loxi/of12/util.py
@@ -69,3 +69,23 @@
def pack_list(values):
return "".join([x.pack() for x in values])
+
+MASK64 = (1 << 64) - 1
+
+def pack_bitmap_128(value):
+ x = 0l
+ for y in value:
+ x |= 1 << y
+ return struct.pack("!QQ", (x >> 64) & MASK64, x & MASK64)
+
+def unpack_bitmap_128(reader):
+ hi, lo = reader.read("!QQ")
+ x = (hi << 64) | lo
+ i = 0
+ value = set()
+ while x != 0:
+ if x & 1 == 1:
+ value.add(i)
+ i += 1
+ x >>= 1
+ return value
diff --git a/src/python/loxi/of13/action.py b/src/python/loxi/of13/action.py
index a1e7877..819e724 100644
--- a/src/python/loxi/of13/action.py
+++ b/src/python/loxi/of13/action.py
@@ -1078,7 +1078,6 @@
def parse_experimenter(reader):
-
experimenter, = reader.peek("!4xL")
if experimenter == 0x005c16c7: # Big Switch Networks
subtype, = reader.peek("!8xL")
diff --git a/src/python/loxi/of13/common.py b/src/python/loxi/of13/common.py
index 820caad..fd16db6 100644
--- a/src/python/loxi/of13/common.py
+++ b/src/python/loxi/of13/common.py
@@ -598,11 +598,11 @@
class group_desc_stats_entry(object):
- def __init__(self, type=None, group_id=None, buckets=None):
- if type != None:
- self.type = type
+ def __init__(self, group_type=None, group_id=None, buckets=None):
+ if group_type != None:
+ self.group_type = group_type
else:
- self.type = 0
+ self.group_type = 0
if group_id != None:
self.group_id = group_id
else:
@@ -616,7 +616,7 @@
def pack(self):
packed = []
packed.append(struct.pack("!H", 0)) # placeholder for length at index 0
- packed.append(struct.pack("!B", self.type))
+ packed.append(struct.pack("!B", self.group_type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
packed.append(util.pack_list(self.buckets))
@@ -632,7 +632,7 @@
else:
reader = loxi.generic_util.OFReader(buf)
_length = reader.read("!H")[0]
- obj.type = reader.read("!B")[0]
+ obj.group_type = reader.read("!B")[0]
reader.skip(1)
obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
@@ -640,7 +640,7 @@
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
+ if self.group_type != other.group_type: return False
if self.group_id != other.group_id: return False
if self.buckets != other.buckets: return False
return True
@@ -657,8 +657,8 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
+ q.text("group_type = ");
+ q.text("%#x" % self.group_type)
q.text(","); q.breakable()
q.text("group_id = ");
q.text("%#x" % self.group_id)
@@ -1850,56 +1850,6 @@
q.breakable()
q.text('}')
-class table_feature_prop(object):
-
- def __init__(self, type=None):
- if type != None:
- self.type = type
- else:
- self.type = 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
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = table_feature_prop()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read("!H")[0]
- _length = reader.read("!H")[0]
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.type != other.type: 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("table_feature_prop {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
class table_feature_prop_apply_actions(object):
type = 6
diff --git a/src/python/loxi/of13/const.py b/src/python/loxi/of13/const.py
index 648617f..6d4902a 100644
--- a/src/python/loxi/of13/const.py
+++ b/src/python/loxi/of13/const.py
@@ -11,8 +11,8 @@
# Identifiers from group macro_definitions
OFP_MAX_TABLE_NAME_LEN = 32
OFP_MAX_PORT_NAME_LEN = 16
-OFP_TCP_PORT = 6633
-OFP_SSL_PORT = 6633
+OFP_TCP_PORT = 6653
+OFP_SSL_PORT = 6653
OFP_ETH_ALEN = 6
OFP_DEFAULT_MISS_SEND_LEN = 128
OFP_VLAN_NONE = 0
@@ -25,6 +25,13 @@
OFPQ_MAX_RATE_UNCFG = 65535
OFPQ_MIN_RATE_UNCFG = 65535
+# Identifiers from group of_bsn_pdu_slot_num_t
+BSN_PDU_SLOT_NUM_ANY = 255
+
+of_bsn_pdu_slot_num_t_map = {
+ 255: 'BSN_PDU_SLOT_NUM_ANY',
+}
+
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
OFPAT_COPY_TTL_OUT = 11
@@ -68,7 +75,7 @@
OFPBAC_BAD_TYPE = 0
OFPBAC_BAD_LEN = 1
OFPBAC_BAD_EXPERIMENTER = 2
-OFPBAC_BAD_EXP_TYPE = 3
+OFPBAC_BAD_EXPERIMENTER_TYPE = 3
OFPBAC_BAD_OUT_PORT = 4
OFPBAC_BAD_ARGUMENT = 5
OFPBAC_EPERM = 6
@@ -86,7 +93,7 @@
0: 'OFPBAC_BAD_TYPE',
1: 'OFPBAC_BAD_LEN',
2: 'OFPBAC_BAD_EXPERIMENTER',
- 3: 'OFPBAC_BAD_EXP_TYPE',
+ 3: 'OFPBAC_BAD_EXPERIMENTER_TYPE',
4: 'OFPBAC_BAD_OUT_PORT',
5: 'OFPBAC_BAD_ARGUMENT',
6: 'OFPBAC_EPERM',
@@ -108,7 +115,7 @@
OFPBIC_UNSUP_METADATA = 3
OFPBIC_UNSUP_METADATA_MASK = 4
OFPBIC_BAD_EXPERIMENTER = 5
-OFPBIC_BAD_EXP_TYPE = 6
+OFPBIC_BAD_EXPERIMENTER_TYPE = 6
OFPBIC_BAD_LEN = 7
OFPBIC_EPERM = 8
@@ -119,7 +126,7 @@
3: 'OFPBIC_UNSUP_METADATA',
4: 'OFPBIC_UNSUP_METADATA_MASK',
5: 'OFPBIC_BAD_EXPERIMENTER',
- 6: 'OFPBIC_BAD_EXP_TYPE',
+ 6: 'OFPBIC_BAD_EXPERIMENTER_TYPE',
7: 'OFPBIC_BAD_LEN',
8: 'OFPBIC_EPERM',
}
@@ -156,9 +163,9 @@
# Identifiers from group ofp_bad_request_code
OFPBRC_BAD_VERSION = 0
OFPBRC_BAD_TYPE = 1
-OFPBRC_BAD_MULTIPART = 2
+OFPBRC_BAD_STAT = 2
OFPBRC_BAD_EXPERIMENTER = 3
-OFPBRC_BAD_EXP_TYPE = 4
+OFPBRC_BAD_EXPERIMENTER_TYPE = 4
OFPBRC_EPERM = 5
OFPBRC_BAD_LEN = 6
OFPBRC_BUFFER_EMPTY = 7
@@ -172,9 +179,9 @@
ofp_bad_request_code_map = {
0: 'OFPBRC_BAD_VERSION',
1: 'OFPBRC_BAD_TYPE',
- 2: 'OFPBRC_BAD_MULTIPART',
+ 2: 'OFPBRC_BAD_STAT',
3: 'OFPBRC_BAD_EXPERIMENTER',
- 4: 'OFPBRC_BAD_EXP_TYPE',
+ 4: 'OFPBRC_BAD_EXPERIMENTER_TYPE',
5: 'OFPBRC_EPERM',
6: 'OFPBRC_BAD_LEN',
7: 'OFPBRC_BUFFER_EMPTY',
@@ -333,6 +340,7 @@
OFPFF_RESET_COUNTS = 4
OFPFF_NO_PKT_COUNTS = 8
OFPFF_NO_BYT_COUNTS = 16
+OFPFF_BSN_SEND_IDLE = 128
ofp_flow_mod_flags_map = {
1: 'OFPFF_SEND_FLOW_REM',
@@ -340,6 +348,7 @@
4: 'OFPFF_RESET_COUNTS',
8: 'OFPFF_NO_PKT_COUNTS',
16: 'OFPFF_NO_BYT_COUNTS',
+ 128: 'OFPFF_BSN_SEND_IDLE',
}
# Identifiers from group ofp_flow_removed_reason
@@ -582,55 +591,6 @@
11: 'OFPMMFC_OUT_OF_BANDS',
}
-# Identifiers from group ofp_multipart_reply_flags
-OFPMPF_REPLY_MORE = 1
-
-ofp_multipart_reply_flags_map = {
- 1: 'OFPMPF_REPLY_MORE',
-}
-
-# Identifiers from group ofp_multipart_request_flags
-OFPMPF_REQ_MORE = 1
-
-ofp_multipart_request_flags_map = {
- 1: 'OFPMPF_REQ_MORE',
-}
-
-# Identifiers from group ofp_multipart_types
-OFPMP_DESC = 0
-OFPMP_FLOW = 1
-OFPMP_AGGREGATE = 2
-OFPMP_TABLE = 3
-OFPMP_PORT_STATS = 4
-OFPMP_QUEUE = 5
-OFPMP_GROUP = 6
-OFPMP_GROUP_DESC = 7
-OFPMP_GROUP_FEATURES = 8
-OFPMP_METER = 9
-OFPMP_METER_CONFIG = 10
-OFPMP_METER_FEATURES = 11
-OFPMP_TABLE_FEATURES = 12
-OFPMP_PORT_DESC = 13
-OFPMP_EXPERIMENTER = 65535
-
-ofp_multipart_types_map = {
- 0: 'OFPMP_DESC',
- 1: 'OFPMP_FLOW',
- 2: 'OFPMP_AGGREGATE',
- 3: 'OFPMP_TABLE',
- 4: 'OFPMP_PORT_STATS',
- 5: 'OFPMP_QUEUE',
- 6: 'OFPMP_GROUP',
- 7: 'OFPMP_GROUP_DESC',
- 8: 'OFPMP_GROUP_FEATURES',
- 9: 'OFPMP_METER',
- 10: 'OFPMP_METER_CONFIG',
- 11: 'OFPMP_METER_FEATURES',
- 12: 'OFPMP_TABLE_FEATURES',
- 13: 'OFPMP_PORT_DESC',
- 65535: 'OFPMP_EXPERIMENTER',
-}
-
# Identifiers from group ofp_oxm_class
OFPXMC_NXM_0 = 0
OFPXMC_NXM_1 = 1
@@ -681,12 +641,14 @@
OFPPC_NO_RECV = 4
OFPPC_NO_FWD = 32
OFPPC_NO_PACKET_IN = 64
+OFPPC_BSN_MIRROR_DEST = 2147483648
ofp_port_config_map = {
1: 'OFPPC_PORT_DOWN',
4: 'OFPPC_NO_RECV',
32: 'OFPPC_NO_FWD',
64: 'OFPPC_NO_PACKET_IN',
+ 2147483648: 'OFPPC_BSN_MIRROR_DEST',
}
# Identifiers from group ofp_port_features
@@ -803,6 +765,55 @@
2: 'OFPRRFC_BAD_ROLE',
}
+# Identifiers from group ofp_stats_reply_flags
+OFPSF_REPLY_MORE = 1
+
+ofp_stats_reply_flags_map = {
+ 1: 'OFPSF_REPLY_MORE',
+}
+
+# Identifiers from group ofp_stats_request_flags
+OFPSF_REQ_MORE = 1
+
+ofp_stats_request_flags_map = {
+ 1: 'OFPSF_REQ_MORE',
+}
+
+# Identifiers from group ofp_stats_type
+OFPST_DESC = 0
+OFPST_FLOW = 1
+OFPST_AGGREGATE = 2
+OFPST_TABLE = 3
+OFPST_PORT = 4
+OFPST_QUEUE = 5
+OFPST_GROUP = 6
+OFPST_GROUP_DESC = 7
+OFPST_GROUP_FEATURES = 8
+OFPST_METER = 9
+OFPST_METER_CONFIG = 10
+OFPST_METER_FEATURES = 11
+OFPST_TABLE_FEATURES = 12
+OFPST_PORT_DESC = 13
+OFPST_EXPERIMENTER = 65535
+
+ofp_stats_type_map = {
+ 0: 'OFPST_DESC',
+ 1: 'OFPST_FLOW',
+ 2: 'OFPST_AGGREGATE',
+ 3: 'OFPST_TABLE',
+ 4: 'OFPST_PORT',
+ 5: 'OFPST_QUEUE',
+ 6: 'OFPST_GROUP',
+ 7: 'OFPST_GROUP_DESC',
+ 8: 'OFPST_GROUP_FEATURES',
+ 9: 'OFPST_METER',
+ 10: 'OFPST_METER_CONFIG',
+ 11: 'OFPST_METER_FEATURES',
+ 12: 'OFPST_TABLE_FEATURES',
+ 13: 'OFPST_PORT_DESC',
+ 65535: 'OFPST_EXPERIMENTER',
+}
+
# Identifiers from group ofp_switch_config_failed_code
OFPSCFC_BAD_FLAGS = 0
OFPSCFC_BAD_LEN = 1
@@ -914,8 +925,8 @@
OFPT_GROUP_MOD = 15
OFPT_PORT_MOD = 16
OFPT_TABLE_MOD = 17
-OFPT_MULTIPART_REQUEST = 18
-OFPT_MULTIPART_REPLY = 19
+OFPT_STATS_REQUEST = 18
+OFPT_STATS_REPLY = 19
OFPT_BARRIER_REQUEST = 20
OFPT_BARRIER_REPLY = 21
OFPT_QUEUE_GET_CONFIG_REQUEST = 22
@@ -946,8 +957,8 @@
15: 'OFPT_GROUP_MOD',
16: 'OFPT_PORT_MOD',
17: 'OFPT_TABLE_MOD',
- 18: 'OFPT_MULTIPART_REQUEST',
- 19: 'OFPT_MULTIPART_REPLY',
+ 18: 'OFPT_STATS_REQUEST',
+ 19: 'OFPT_STATS_REPLY',
20: 'OFPT_BARRIER_REQUEST',
21: 'OFPT_BARRIER_REPLY',
22: 'OFPT_QUEUE_GET_CONFIG_REQUEST',
diff --git a/src/python/loxi/of13/message.py b/src/python/loxi/of13/message.py
index 4c22e45..4cafeca 100644
--- a/src/python/loxi/of13/message.py
+++ b/src/python/loxi/of13/message.py
@@ -644,6 +644,354 @@
q.breakable()
q.text('}')
+class bad_action_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 2
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_action_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 2)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_action_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_instruction_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 3
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_instruction_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 3)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_instruction_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_match_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 4
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_match_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 4)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_match_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bad_request_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 1
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = bad_request_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 1)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("bad_request_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class barrier_reply(Message):
version = 4
type = 21
@@ -1246,6 +1594,443 @@
q.breakable()
q.text('}')
+class bsn_flow_idle(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 40
+
+ def __init__(self, xid=None, cookie=None, priority=None, table_id=None, match=None):
+ self.xid = xid
+ if cookie != None:
+ self.cookie = cookie
+ else:
+ self.cookie = 0
+ if priority != None:
+ self.priority = priority
+ else:
+ self.priority = 0
+ if table_id != None:
+ self.table_id = table_id
+ else:
+ self.table_id = 0
+ if match != None:
+ self.match = match
+ else:
+ self.match = common.match()
+
+ 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("!Q", self.cookie))
+ packed.append(struct.pack("!H", self.priority))
+ packed.append(struct.pack("!B", self.table_id))
+ packed.append('\x00' * 5)
+ packed.append(self.match.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_flow_idle()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _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 == 40)
+ obj.cookie = reader.read("!Q")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
+ reader.skip(5)
+ obj.match = common.match.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.cookie != other.cookie: return False
+ if self.priority != other.priority: return False
+ if self.table_id != other.table_id: return False
+ if self.match != other.match: 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_flow_idle {")
+ 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("cookie = ");
+ q.text("%#x" % self.cookie)
+ q.text(","); q.breakable()
+ q.text("priority = ");
+ q.text("%#x" % self.priority)
+ q.text(","); q.breakable()
+ q.text("table_id = ");
+ q.text("%#x" % self.table_id)
+ q.text(","); q.breakable()
+ q.text("match = ");
+ q.pp(self.match)
+ q.breakable()
+ q.text('}')
+
+class bsn_flow_idle_enable_get_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 39
+
+ 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_flow_idle_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 == 4)
+ _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 == 39)
+ 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_flow_idle_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_flow_idle_enable_get_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 38
+
+ 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_flow_idle_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 == 4)
+ _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 == 38)
+ 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_flow_idle_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_flow_idle_enable_set_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 37
+
+ 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_flow_idle_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 == 4)
+ _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 == 37)
+ 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_flow_idle_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_flow_idle_enable_set_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 36
+
+ 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_flow_idle_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 == 4)
+ _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 == 36)
+ 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_flow_idle_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 = 4
type = 4
@@ -1564,6 +2349,485 @@
q.breakable()
q.text('}')
+class bsn_pdu_rx_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 34
+
+ 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_pdu_rx_reply()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _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 == 34)
+ 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_pdu_rx_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_pdu_rx_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 33
+
+ def __init__(self, xid=None, timeout_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if timeout_ms != None:
+ self.timeout_ms = timeout_ms
+ else:
+ self.timeout_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.timeout_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_rx_request()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _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 == 33)
+ obj.timeout_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.timeout_ms != other.timeout_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_rx_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("timeout_ms = ");
+ q.text("%#x" % self.timeout_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_rx_timeout(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 35
+
+ def __init__(self, xid=None, port_no=None, slot_num=None):
+ self.xid = xid
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 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(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ 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_pdu_rx_timeout()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _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 == 35)
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[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.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: 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_pdu_rx_timeout {")
+ 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("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.breakable()
+ q.text('}')
+
+class bsn_pdu_tx_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 32
+
+ 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_pdu_tx_reply()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _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 == 32)
+ 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_pdu_tx_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_pdu_tx_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 31
+
+ def __init__(self, xid=None, tx_interval_ms=None, port_no=None, slot_num=None, data=None):
+ self.xid = xid
+ if tx_interval_ms != None:
+ self.tx_interval_ms = tx_interval_ms
+ else:
+ self.tx_interval_ms = 0
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if slot_num != None:
+ self.slot_num = slot_num
+ else:
+ self.slot_num = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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.tx_interval_ms))
+ packed.append(util.pack_port_no(self.port_no))
+ packed.append(struct.pack("!B", self.slot_num))
+ packed.append('\x00' * 3)
+ packed.append(self.data)
+ 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_pdu_tx_request()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _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 == 31)
+ obj.tx_interval_ms = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.slot_num = reader.read("!B")[0]
+ reader.skip(3)
+ obj.data = str(reader.read_all())
+ 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.tx_interval_ms != other.tx_interval_ms: return False
+ if self.port_no != other.port_no: return False
+ if self.slot_num != other.slot_num: return False
+ if self.data != other.data: 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_pdu_tx_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("tx_interval_ms = ");
+ q.text("%#x" % self.tx_interval_ms)
+ q.text(","); q.breakable()
+ q.text("port_no = ");
+ q.text(util.pretty_port(self.port_no))
+ q.text(","); q.breakable()
+ q.text("slot_num = ");
+ q.text("%#x" % self.slot_num)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class bsn_set_mirroring(Message):
version = 4
type = 4
@@ -2539,20 +3803,21 @@
q.breakable()
q.text('}')
-class error_msg(Message):
+class experimenter_error_msg(Message):
version = 4
type = 1
+ err_type = 65535
- def __init__(self, xid=None, err_type=None, code=None, data=None):
+ def __init__(self, xid=None, subtype=None, experimenter=None, data=None):
self.xid = xid
- if err_type != None:
- self.err_type = err_type
+ if subtype != None:
+ self.subtype = subtype
else:
- self.err_type = 0
- if code != None:
- self.code = code
+ self.subtype = 0
+ if experimenter != None:
+ self.experimenter = experimenter
else:
- self.code = 0
+ self.experimenter = 0
if data != None:
self.data = data
else:
@@ -2565,7 +3830,8 @@
packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.err_type))
- packed.append(struct.pack("!H", self.code))
+ packed.append(struct.pack("!H", self.subtype))
+ packed.append(struct.pack("!L", self.experimenter))
packed.append(self.data)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -2574,7 +3840,7 @@
@staticmethod
def unpack(buf):
if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = error_msg()
+ obj = experimenter_error_msg()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
@@ -2585,8 +3851,10 @@
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]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 65535)
+ obj.subtype = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -2595,8 +3863,8 @@
if self.version != other.version: return False
if self.type != other.type: return False
if self.xid != other.xid: return False
- if self.err_type != other.err_type: return False
- if self.code != other.code: return False
+ if self.subtype != other.subtype: return False
+ if self.experimenter != other.experimenter: return False
if self.data != other.data: return False
return True
@@ -2611,7 +3879,7 @@
return loxi.pp.pp(self)
def pretty_print(self, q):
- q.text("error_msg {")
+ q.text("experimenter_error_msg {")
with q.group():
with q.indent(2):
q.breakable()
@@ -2621,11 +3889,11 @@
else:
q.text('None')
q.text(","); q.breakable()
- q.text("err_type = ");
- q.text("%#x" % self.err_type)
+ q.text("subtype = ");
+ q.text("%#x" % self.subtype)
q.text(","); q.breakable()
- q.text("code = ");
- q.text("%#x" % self.code)
+ q.text("experimenter = ");
+ q.text("%#x" % self.experimenter)
q.text(","); q.breakable()
q.text("data = ");
q.pp(self.data)
@@ -3387,6 +4655,93 @@
q.breakable()
q.text('}')
+class flow_mod_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 5
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = flow_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 5)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("flow_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class flow_modify(Message):
version = 4
type = 14
@@ -4847,6 +6202,93 @@
q.breakable()
q.text('}')
+class group_mod_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 6
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = group_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 6)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("group_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class group_stats_reply(Message):
version = 4
type = 19
@@ -5100,6 +6542,93 @@
q.breakable()
q.text('}')
+class hello_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 0
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = hello_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 0)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("hello_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class meter_config_stats_reply(Message):
version = 4
type = 19
@@ -5551,6 +7080,93 @@
q.breakable()
q.text('}')
+class meter_mod_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 12
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = meter_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 12)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("meter_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class meter_stats_reply(Message):
version = 4
type = 19
@@ -6261,6 +7877,93 @@
q.breakable()
q.text('}')
+class port_mod_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 7
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = port_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 7)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("port_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class port_stats_reply(Message):
version = 4
type = 19
@@ -6686,6 +8389,93 @@
q.breakable()
q.text('}')
+class queue_op_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 9
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = queue_op_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 9)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("queue_op_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class queue_stats_reply(Message):
version = 4
type = 19
@@ -7032,6 +8822,93 @@
q.breakable()
q.text('}')
+class role_request_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 11
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = role_request_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 11)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("role_request_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class set_config(Message):
version = 4
type = 9
@@ -7115,6 +8992,180 @@
q.breakable()
q.text('}')
+class switch_config_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 10
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = switch_config_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 10)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("switch_config_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
+class table_features_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 13
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = table_features_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 13)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("table_features_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class table_features_stats_reply(Message):
version = 4
type = 19
@@ -7378,6 +9429,93 @@
q.breakable()
q.text('}')
+class table_mod_failed_error_msg(Message):
+ version = 4
+ type = 1
+ err_type = 8
+
+ def __init__(self, xid=None, code=None, data=None):
+ self.xid = xid
+ if code != None:
+ self.code = code
+ else:
+ self.code = 0
+ if data != None:
+ self.data = data
+ else:
+ self.data = ''
+
+ 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("!H", self.err_type))
+ packed.append(struct.pack("!H", self.code))
+ packed.append(self.data)
+ 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 = table_mod_failed_error_msg()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _err_type = reader.read("!H")[0]
+ assert(_err_type == 8)
+ obj.code = reader.read("!H")[0]
+ obj.data = str(reader.read_all())
+ 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.code != other.code: return False
+ if self.data != other.data: 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("table_mod_failed_error_msg {")
+ 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("code = ");
+ q.text("%#x" % self.code)
+ q.text(","); q.breakable()
+ q.text("data = ");
+ q.pp(self.data)
+ q.breakable()
+ q.text('}')
+
class table_stats_reply(Message):
version = 4
type = 19
@@ -7563,6 +9701,15 @@
else:
raise loxi.ProtocolError("unexpected message type")
+def parse_error(buf):
+ if len(buf) < 8 + 2:
+ raise loxi.ProtocolError("message too short")
+ err_type, = struct.unpack_from("!H", buf, 8)
+ if err_type in error_msg_parsers:
+ return error_msg_parsers[err_type](buf)
+ else:
+ raise loxi.ProtocolError("unexpected error type %u" % err_type)
+
def parse_flow_mod(buf):
if len(buf) < 25 + 1:
raise loxi.ProtocolError("message too short")
@@ -7573,23 +9720,23 @@
else:
raise loxi.ProtocolError("unexpected flow mod cmd %u" % cmd)
-def parse_multipart_reply(buf):
+def parse_stats_reply(buf):
if len(buf) < 8 + 2:
raise loxi.ProtocolError("message too short")
- multipart_type, = struct.unpack_from("!H", buf, 8)
- if multipart_type in multipart_reply_parsers:
- return multipart_reply_parsers[multipart_type](buf)
+ stats_type, = struct.unpack_from("!H", buf, 8)
+ if stats_type in stats_reply_parsers:
+ return stats_reply_parsers[stats_type](buf)
else:
- raise loxi.ProtocolError("unexpected multipart type %u" % multipart_type)
+ raise loxi.ProtocolError("unexpected stats type %u" % stats_type)
-def parse_multipart_request(buf):
+def parse_stats_request(buf):
if len(buf) < 8 + 2:
raise loxi.ProtocolError("message too short")
- multipart_type, = struct.unpack_from("!H", buf, 8)
- if multipart_type in multipart_request_parsers:
- return multipart_request_parsers[multipart_type](buf)
+ stats_type, = struct.unpack_from("!H", buf, 8)
+ if stats_type in stats_request_parsers:
+ return stats_request_parsers[stats_type](buf)
else:
- raise loxi.ProtocolError("unexpected multipart type %u" % multipart_type)
+ raise loxi.ProtocolError("unexpected stats type %u" % stats_type)
def parse_experimenter(buf):
if len(buf) < 16:
@@ -7610,7 +9757,7 @@
parsers = {
const.OFPT_HELLO : hello.unpack,
- const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ERROR : parse_error,
const.OFPT_ECHO_REQUEST : echo_request.unpack,
const.OFPT_ECHO_REPLY : echo_reply.unpack,
const.OFPT_EXPERIMENTER : parse_experimenter,
@@ -7627,8 +9774,8 @@
const.OFPT_GROUP_MOD : group_mod.unpack,
const.OFPT_PORT_MOD : port_mod.unpack,
const.OFPT_TABLE_MOD : table_mod.unpack,
- const.OFPT_MULTIPART_REQUEST : parse_multipart_request,
- const.OFPT_MULTIPART_REPLY : parse_multipart_reply,
+ 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,
@@ -7641,6 +9788,24 @@
const.OFPT_METER_MOD : meter_mod.unpack,
}
+error_msg_parsers = {
+ const.OFPET_HELLO_FAILED : hello_failed_error_msg.unpack,
+ const.OFPET_BAD_REQUEST : bad_request_error_msg.unpack,
+ const.OFPET_BAD_ACTION : bad_action_error_msg.unpack,
+ const.OFPET_FLOW_MOD_FAILED : flow_mod_failed_error_msg.unpack,
+ const.OFPET_PORT_MOD_FAILED : port_mod_failed_error_msg.unpack,
+ const.OFPET_QUEUE_OP_FAILED : queue_op_failed_error_msg.unpack,
+ const.OFPET_BAD_INSTRUCTION : bad_instruction_error_msg.unpack,
+ const.OFPET_BAD_MATCH : bad_match_error_msg.unpack,
+ const.OFPET_GROUP_MOD_FAILED : group_mod_failed_error_msg.unpack,
+ const.OFPET_TABLE_MOD_FAILED : table_mod_failed_error_msg.unpack,
+ const.OFPET_SWITCH_CONFIG_FAILED : switch_config_failed_error_msg.unpack,
+ const.OFPET_ROLE_REQUEST_FAILED : role_request_failed_error_msg.unpack,
+ const.OFPET_EXPERIMENTER : experimenter_error_msg.unpack,
+ const.OFPET_METER_MOD_FAILED : meter_mod_failed_error_msg.unpack,
+ const.OFPET_TABLE_FEATURES_FAILED : table_features_failed_error_msg.unpack,
+}
+
flow_mod_parsers = {
const.OFPFC_ADD : flow_add.unpack,
const.OFPFC_MODIFY : flow_modify.unpack,
@@ -7649,38 +9814,38 @@
const.OFPFC_DELETE_STRICT : flow_delete_strict.unpack,
}
-multipart_reply_parsers = {
- const.OFPMP_DESC : desc_stats_reply.unpack,
- const.OFPMP_FLOW : flow_stats_reply.unpack,
- const.OFPMP_AGGREGATE : aggregate_stats_reply.unpack,
- const.OFPMP_TABLE : table_stats_reply.unpack,
- const.OFPMP_PORT_STATS : port_stats_reply.unpack,
- const.OFPMP_QUEUE : queue_stats_reply.unpack,
- const.OFPMP_GROUP : group_stats_reply.unpack,
- const.OFPMP_GROUP_DESC : group_desc_stats_reply.unpack,
- const.OFPMP_GROUP_FEATURES : group_features_stats_reply.unpack,
- const.OFPMP_METER : meter_stats_reply.unpack,
- const.OFPMP_METER_CONFIG : meter_config_stats_reply.unpack,
- const.OFPMP_METER_FEATURES : meter_features_stats_reply.unpack,
- const.OFPMP_TABLE_FEATURES : table_features_stats_reply.unpack,
- const.OFPMP_PORT_DESC : port_desc_stats_reply.unpack,
+stats_reply_parsers = {
+ const.OFPST_DESC : desc_stats_reply.unpack,
+ const.OFPST_FLOW : flow_stats_reply.unpack,
+ const.OFPST_AGGREGATE : aggregate_stats_reply.unpack,
+ const.OFPST_TABLE : table_stats_reply.unpack,
+ const.OFPST_PORT : port_stats_reply.unpack,
+ const.OFPST_QUEUE : queue_stats_reply.unpack,
+ const.OFPST_GROUP : group_stats_reply.unpack,
+ const.OFPST_GROUP_DESC : group_desc_stats_reply.unpack,
+ const.OFPST_GROUP_FEATURES : group_features_stats_reply.unpack,
+ const.OFPST_METER : meter_stats_reply.unpack,
+ const.OFPST_METER_CONFIG : meter_config_stats_reply.unpack,
+ const.OFPST_METER_FEATURES : meter_features_stats_reply.unpack,
+ const.OFPST_TABLE_FEATURES : table_features_stats_reply.unpack,
+ const.OFPST_PORT_DESC : port_desc_stats_reply.unpack,
}
-multipart_request_parsers = {
- const.OFPMP_DESC : desc_stats_request.unpack,
- const.OFPMP_FLOW : flow_stats_request.unpack,
- const.OFPMP_AGGREGATE : aggregate_stats_request.unpack,
- const.OFPMP_TABLE : table_stats_request.unpack,
- const.OFPMP_PORT_STATS : port_stats_request.unpack,
- const.OFPMP_QUEUE : queue_stats_request.unpack,
- const.OFPMP_GROUP : group_stats_request.unpack,
- const.OFPMP_GROUP_DESC : group_desc_stats_request.unpack,
- const.OFPMP_GROUP_FEATURES : group_features_stats_request.unpack,
- const.OFPMP_METER : meter_stats_request.unpack,
- const.OFPMP_METER_CONFIG : meter_config_stats_request.unpack,
- const.OFPMP_METER_FEATURES : meter_features_stats_request.unpack,
- const.OFPMP_TABLE_FEATURES : table_features_stats_request.unpack,
- const.OFPMP_PORT_DESC : port_desc_stats_request.unpack,
+stats_request_parsers = {
+ const.OFPST_DESC : desc_stats_request.unpack,
+ const.OFPST_FLOW : flow_stats_request.unpack,
+ const.OFPST_AGGREGATE : aggregate_stats_request.unpack,
+ const.OFPST_TABLE : table_stats_request.unpack,
+ const.OFPST_PORT : port_stats_request.unpack,
+ const.OFPST_QUEUE : queue_stats_request.unpack,
+ const.OFPST_GROUP : group_stats_request.unpack,
+ const.OFPST_GROUP_DESC : group_desc_stats_request.unpack,
+ const.OFPST_GROUP_FEATURES : group_features_stats_request.unpack,
+ const.OFPST_METER : meter_stats_request.unpack,
+ const.OFPST_METER_CONFIG : meter_config_stats_request.unpack,
+ const.OFPST_METER_FEATURES : meter_features_stats_request.unpack,
+ const.OFPST_TABLE_FEATURES : table_features_stats_request.unpack,
+ const.OFPST_PORT_DESC : port_desc_stats_request.unpack,
}
experimenter_parsers = {
@@ -7691,10 +9856,20 @@
19: bsn_bw_enable_get_request.unpack,
23: bsn_bw_enable_set_reply.unpack,
18: bsn_bw_enable_set_request.unpack,
+ 40: bsn_flow_idle.unpack,
+ 39: bsn_flow_idle_enable_get_reply.unpack,
+ 38: bsn_flow_idle_enable_get_request.unpack,
+ 37: bsn_flow_idle_enable_set_reply.unpack,
+ 36: bsn_flow_idle_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,
+ 34: bsn_pdu_rx_reply.unpack,
+ 33: bsn_pdu_rx_request.unpack,
+ 35: bsn_pdu_rx_timeout.unpack,
+ 32: bsn_pdu_tx_reply.unpack,
+ 31: bsn_pdu_tx_request.unpack,
3: bsn_set_mirroring.unpack,
25: bsn_set_pktin_suppression_reply.unpack,
11: bsn_set_pktin_suppression_request.unpack,
diff --git a/src/python/loxi/of13/oxm.py b/src/python/loxi/of13/oxm.py
index 0fd7948..c3f1c94 100644
--- a/src/python/loxi/of13/oxm.py
+++ b/src/python/loxi/of13/oxm.py
@@ -567,6 +567,114 @@
q.breakable()
q.text('}')
+class bsn_in_ports_128(OXM):
+ type_len = 196640
+
+ def __init__(self, value=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = set()
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(util.pack_bitmap_128(self.value))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_in_ports_128()
+ 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 == 196640)
+ obj.value = util.unpack_bitmap_128(reader)
+ 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("bsn_in_ports_128 {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.pp(self.value)
+ q.breakable()
+ q.text('}')
+
+class bsn_in_ports_128_masked(OXM):
+ type_len = 196896
+
+ def __init__(self, value=None, value_mask=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = set()
+ if value_mask != None:
+ self.value_mask = value_mask
+ else:
+ self.value_mask = set()
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(util.pack_bitmap_128(self.value))
+ packed.append(util.pack_bitmap_128(self.value_mask))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_in_ports_128_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 == 196896)
+ obj.value = util.unpack_bitmap_128(reader)
+ obj.value_mask = util.unpack_bitmap_128(reader)
+ 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("bsn_in_ports_128_masked {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.pp(self.value)
+ q.text(","); q.breakable()
+ q.text("value_mask = ");
+ q.pp(self.value_mask)
+ q.breakable()
+ q.text('}')
+
class eth_dst(OXM):
type_len = 2147485190
@@ -3917,6 +4025,8 @@
parsers = {
+ 196640 : bsn_in_ports_128.unpack,
+ 196896 : bsn_in_ports_128_masked.unpack,
2147483652 : in_port.unpack,
2147483912 : in_port_masked.unpack,
2147484164 : in_phy_port.unpack,
diff --git a/src/python/loxi/of13/util.py b/src/python/loxi/of13/util.py
index 56b5729..27eb6fb 100644
--- a/src/python/loxi/of13/util.py
+++ b/src/python/loxi/of13/util.py
@@ -69,3 +69,23 @@
def pack_list(values):
return "".join([x.pack() for x in values])
+
+MASK64 = (1 << 64) - 1
+
+def pack_bitmap_128(value):
+ x = 0l
+ for y in value:
+ x |= 1 << y
+ return struct.pack("!QQ", (x >> 64) & MASK64, x & MASK64)
+
+def unpack_bitmap_128(reader):
+ hi, lo = reader.read("!QQ")
+ x = (hi << 64) | lo
+ i = 0
+ value = set()
+ while x != 0:
+ if x & 1 == 1:
+ value.add(i)
+ i += 1
+ x >>= 1
+ return value