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