Merge pull request #55 from rlane/barrier-after-delete
testutils: send barrier after deleting all flows
diff --git a/src/python/loxi/LICENSE.pyloxi b/src/python/loxi/LICENSE.pyloxi
new file mode 100644
index 0000000..44ebddd
--- /dev/null
+++ b/src/python/loxi/LICENSE.pyloxi
@@ -0,0 +1,36 @@
+OpenFlow Test Framework
+
+Copyright (c) 2010 The Board of Trustees of The Leland Stanford
+Junior University
+
+Except where otherwise noted, this software is distributed under
+the OpenFlow Software License. See
+http://www.openflowswitch.org/wp/legal/ for current details.
+
+We are making the OpenFlow specification and associated documentation
+(Software) available for public use and benefit with the expectation
+that others will use, modify and enhance the Software and contribute
+those enhancements back to the community. However, since we would like
+to make the Software available for broadest use, with as few
+restrictions as possible permission is hereby granted, free of charge,
+to any person obtaining a copy of this Software to deal in the
+Software under the copyrights without restriction, including without
+limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED -Y´AS IS¡, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+The name and trademarks of copyright holder(s) may NOT be used in
+advertising or publicity pertaining to the Software or any derivatives
+without specific, written prior permission.
diff --git a/src/python/loxi/__init__.py b/src/python/loxi/__init__.py
index 58fa3d7..dfab263 100644
--- a/src/python/loxi/__init__.py
+++ b/src/python/loxi/__init__.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template toplevel_init.py
# Do not modify
diff --git a/src/python/loxi/generic_util.py b/src/python/loxi/generic_util.py
index 6df9565..ce31049 100644
--- a/src/python/loxi/generic_util.py
+++ b/src/python/loxi/generic_util.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
"""
Utility functions independent of the protocol version
"""
diff --git a/src/python/loxi/of10/__init__.py b/src/python/loxi/of10/__init__.py
index 6f2680d..e1c5e3a 100644
--- a/src/python/loxi/of10/__init__.py
+++ b/src/python/loxi/of10/__init__.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template init.py
# Do not modify
diff --git a/src/python/loxi/of10/action.py b/src/python/loxi/of10/action.py
index 8fe2997..2de9ac9 100644
--- a/src/python/loxi/of10/action.py
+++ b/src/python/loxi/of10/action.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template action.py
# Do not modify
@@ -23,8 +24,8 @@
pass
class bsn_mirror(Action):
- type = const.OFPAT_VENDOR
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 1
def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
@@ -63,16 +64,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_VENDOR)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 1)
- obj.dest_port = reader.read('!L')[0]
- obj.vlan_tag = reader.read('!L')[0]
- obj.copy_stage = reader.read('!B')[0]
+ obj.dest_port = reader.read("!L")[0]
+ obj.vlan_tag = reader.read("!L")[0]
+ obj.copy_stage = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -107,8 +108,8 @@
q.text('}')
class bsn_set_tunnel_dst(Action):
- type = const.OFPAT_VENDOR
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 2
def __init__(self, dst=None):
@@ -136,14 +137,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_VENDOR)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 2)
- obj.dst = reader.read('!L')[0]
+ obj.dst = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -169,7 +170,7 @@
q.text('}')
class enqueue(Action):
- type = const.OFPAT_ENQUEUE
+ type = 11
def __init__(self, port=None, queue_id=None):
if port != None:
@@ -186,7 +187,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!H", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 6)
packed.append(struct.pack("!L", self.queue_id))
length = sum([len(x) for x in packed])
@@ -200,12 +201,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_ENQUEUE)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 11)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(6)
- obj.queue_id = reader.read('!L')[0]
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -235,8 +236,8 @@
q.text('}')
class nicira_dec_ttl(Action):
- type = const.OFPAT_VENDOR
- experimenter = 0x2320
+ type = 65535
+ experimenter = 8992
subtype = 18
def __init__(self):
@@ -261,12 +262,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_VENDOR)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 8992)
+ _subtype = reader.read("!H")[0]
assert(_subtype == 18)
reader.skip(2)
reader.skip(4)
@@ -292,7 +293,7 @@
q.text('}')
class output(Action):
- type = const.OFPAT_OUTPUT
+ type = 0
def __init__(self, port=None, max_len=None):
if port != None:
@@ -309,7 +310,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!H", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", self.max_len))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
@@ -322,11 +323,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_OUTPUT)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!H')[0]
- obj.max_len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
+ obj.max_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -356,7 +357,7 @@
q.text('}')
class set_dl_dst(Action):
- type = const.OFPAT_SET_DL_DST
+ type = 5
def __init__(self, dl_addr=None):
if dl_addr != None:
@@ -382,9 +383,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_DL_DST)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 5)
+ _len = reader.read("!H")[0]
obj.dl_addr = list(reader.read('!6B'))
reader.skip(6)
return obj
@@ -412,7 +413,7 @@
q.text('}')
class set_dl_src(Action):
- type = const.OFPAT_SET_DL_SRC
+ type = 4
def __init__(self, dl_addr=None):
if dl_addr != None:
@@ -438,9 +439,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_DL_SRC)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 4)
+ _len = reader.read("!H")[0]
obj.dl_addr = list(reader.read('!6B'))
reader.skip(6)
return obj
@@ -468,7 +469,7 @@
q.text('}')
class set_nw_dst(Action):
- type = const.OFPAT_SET_NW_DST
+ type = 7
def __init__(self, nw_addr=None):
if nw_addr != None:
@@ -493,10 +494,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_DST)
- _len = reader.read('!H')[0]
- obj.nw_addr = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 7)
+ _len = reader.read("!H")[0]
+ obj.nw_addr = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -522,7 +523,7 @@
q.text('}')
class set_nw_src(Action):
- type = const.OFPAT_SET_NW_SRC
+ type = 6
def __init__(self, nw_addr=None):
if nw_addr != None:
@@ -547,10 +548,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_SRC)
- _len = reader.read('!H')[0]
- obj.nw_addr = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 6)
+ _len = reader.read("!H")[0]
+ obj.nw_addr = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -576,7 +577,7 @@
q.text('}')
class set_nw_tos(Action):
- type = const.OFPAT_SET_NW_TOS
+ type = 8
def __init__(self, nw_tos=None):
if nw_tos != None:
@@ -602,10 +603,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_TOS)
- _len = reader.read('!H')[0]
- obj.nw_tos = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 8)
+ _len = reader.read("!H")[0]
+ obj.nw_tos = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -632,7 +633,7 @@
q.text('}')
class set_tp_dst(Action):
- type = const.OFPAT_SET_TP_DST
+ type = 10
def __init__(self, tp_port=None):
if tp_port != None:
@@ -658,10 +659,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_TP_DST)
- _len = reader.read('!H')[0]
- obj.tp_port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 10)
+ _len = reader.read("!H")[0]
+ obj.tp_port = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -688,7 +689,7 @@
q.text('}')
class set_tp_src(Action):
- type = const.OFPAT_SET_TP_SRC
+ type = 9
def __init__(self, tp_port=None):
if tp_port != None:
@@ -714,10 +715,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_TP_SRC)
- _len = reader.read('!H')[0]
- obj.tp_port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 9)
+ _len = reader.read("!H")[0]
+ obj.tp_port = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -744,7 +745,7 @@
q.text('}')
class set_vlan_pcp(Action):
- type = const.OFPAT_SET_VLAN_PCP
+ type = 2
def __init__(self, vlan_pcp=None):
if vlan_pcp != None:
@@ -770,10 +771,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_VLAN_PCP)
- _len = reader.read('!H')[0]
- obj.vlan_pcp = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
+ obj.vlan_pcp = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -800,7 +801,7 @@
q.text('}')
class set_vlan_vid(Action):
- type = const.OFPAT_SET_VLAN_VID
+ type = 1
def __init__(self, vlan_vid=None):
if vlan_vid != None:
@@ -826,10 +827,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_VLAN_VID)
- _len = reader.read('!H')[0]
- obj.vlan_vid = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
+ obj.vlan_vid = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -856,7 +857,7 @@
q.text('}')
class strip_vlan(Action):
- type = const.OFPAT_STRIP_VLAN
+ type = 3
def __init__(self):
return
@@ -877,9 +878,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_STRIP_VLAN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 3)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -919,26 +920,26 @@
raise loxi.ProtocolError("unexpected BSN experimenter subtype %#x" % subtype)
parsers = {
- const.OFPAT_ENQUEUE : enqueue.unpack,
const.OFPAT_OUTPUT : output.unpack,
- const.OFPAT_SET_DL_DST : set_dl_dst.unpack,
- const.OFPAT_SET_DL_SRC : set_dl_src.unpack,
- const.OFPAT_SET_NW_DST : set_nw_dst.unpack,
- const.OFPAT_SET_NW_SRC : set_nw_src.unpack,
- const.OFPAT_SET_NW_TOS : set_nw_tos.unpack,
- const.OFPAT_SET_TP_DST : set_tp_dst.unpack,
- const.OFPAT_SET_TP_SRC : set_tp_src.unpack,
- const.OFPAT_SET_VLAN_PCP : set_vlan_pcp.unpack,
const.OFPAT_SET_VLAN_VID : set_vlan_vid.unpack,
+ const.OFPAT_SET_VLAN_PCP : set_vlan_pcp.unpack,
const.OFPAT_STRIP_VLAN : strip_vlan.unpack,
+ const.OFPAT_SET_DL_SRC : set_dl_src.unpack,
+ const.OFPAT_SET_DL_DST : set_dl_dst.unpack,
+ const.OFPAT_SET_NW_SRC : set_nw_src.unpack,
+ const.OFPAT_SET_NW_DST : set_nw_dst.unpack,
+ const.OFPAT_SET_NW_TOS : set_nw_tos.unpack,
+ 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,
}
experimenter_parsers = {
- 0x2320 : {
+ 8992 : {
18: nicira_dec_ttl.unpack,
},
- 0x5c16c7 : {
+ 6035143 : {
1: bsn_mirror.unpack,
2: bsn_set_tunnel_dst.unpack,
},
diff --git a/src/python/loxi/of10/common.py b/src/python/loxi/of10/common.py
index cfee494..616cf75 100644
--- a/src/python/loxi/of10/common.py
+++ b/src/python/loxi/of10/common.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template common.py
# Do not modify
@@ -96,8 +97,8 @@
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.ipv4_addr = reader.read('!L')[0]
- obj.ipv4_netmask = reader.read('!L')[0]
+ obj.ipv4_addr = reader.read("!L")[0]
+ obj.ipv4_netmask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -134,6 +135,100 @@
q.breakable()
q.text('}')
+class bsn_vport_q_in_q(object):
+ type = 0
+
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None):
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if ingress_tpid != None:
+ self.ingress_tpid = ingress_tpid
+ else:
+ self.ingress_tpid = 0
+ if ingress_vlan_id != None:
+ self.ingress_vlan_id = ingress_vlan_id
+ else:
+ self.ingress_vlan_id = 0
+ if egress_tpid != None:
+ self.egress_tpid = egress_tpid
+ else:
+ self.egress_tpid = 0
+ if egress_vlan_id != None:
+ self.egress_vlan_id = egress_vlan_id
+ else:
+ self.egress_vlan_id = 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
+ packed.append(struct.pack("!L", self.port_no))
+ packed.append(struct.pack("!H", self.ingress_tpid))
+ packed.append(struct.pack("!H", self.ingress_vlan_id))
+ packed.append(struct.pack("!H", self.egress_tpid))
+ packed.append(struct.pack("!H", self.egress_vlan_id))
+ length = sum([len(x) for x in packed])
+ packed[1] = struct.pack("!H", length)
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_vport_q_in_q()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.port_no = reader.read("!L")[0]
+ obj.ingress_tpid = reader.read("!H")[0]
+ obj.ingress_vlan_id = reader.read("!H")[0]
+ obj.egress_tpid = reader.read("!H")[0]
+ obj.egress_vlan_id = reader.read("!H")[0]
+ return obj
+
+ def __eq__(self, other):
+ if type(self) != type(other): return False
+ if self.port_no != other.port_no: return False
+ if self.ingress_tpid != other.ingress_tpid: return False
+ if self.ingress_vlan_id != other.ingress_vlan_id: return False
+ if self.egress_tpid != other.egress_tpid: return False
+ if self.egress_vlan_id != other.egress_vlan_id: 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_vport_q_in_q {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("port_no = ");
+ q.text("%#x" % self.port_no)
+ q.text(","); q.breakable()
+ q.text("ingress_tpid = ");
+ q.text("%#x" % self.ingress_tpid)
+ q.text(","); q.breakable()
+ q.text("ingress_vlan_id = ");
+ q.text("%#x" % self.ingress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("egress_tpid = ");
+ q.text("%#x" % self.egress_tpid)
+ q.text(","); q.breakable()
+ q.text("egress_vlan_id = ");
+ q.text("%#x" % self.egress_vlan_id)
+ q.breakable()
+ q.text('}')
+
class flow_stats_entry(object):
def __init__(self, table_id=None, match=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet_count=None, byte_count=None, actions=None):
@@ -198,7 +293,7 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.packet_count))
packed.append(struct.pack("!Q", self.byte_count))
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -210,19 +305,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(1)
obj.match = common.match.unpack(reader)
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.priority = reader.read('!H')[0]
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
reader.skip(6)
- obj.cookie = reader.read('!Q')[0]
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.actions = action.unpack_list(reader)
return obj
@@ -290,11 +385,11 @@
class match_v1(object):
- def __init__(self, wildcards=None, in_port=None, eth_src=None, eth_dst=None, vlan_vid=None, vlan_pcp=None, eth_type=None, ip_dscp=None, ip_proto=None, ipv4_src=None, ipv4_dst=None, tcp_src=None, tcp_dst=None):
+ def __init__(self, wildcards=None, in_port=None, eth_src=None, eth_dst=None, vlan_vid=None, vlan_pcp=None, eth_type=None, ip_dscp=None, ip_proto=None, src_meta_id=None, dst_meta_id=None, ipv4_src=None, ipv4_dst=None, tcp_src=None, tcp_dst=None):
if wildcards != None:
self.wildcards = wildcards
else:
- self.wildcards = const.OFPFW_ALL
+ self.wildcards = util.init_wc_bmap()
if in_port != None:
self.in_port = in_port
else:
@@ -327,6 +422,14 @@
self.ip_proto = ip_proto
else:
self.ip_proto = 0
+ if src_meta_id != None:
+ self.src_meta_id = src_meta_id
+ else:
+ self.src_meta_id = 0
+ if dst_meta_id != None:
+ self.dst_meta_id = dst_meta_id
+ else:
+ self.dst_meta_id = 0
if ipv4_src != None:
self.ipv4_src = ipv4_src
else:
@@ -347,8 +450,8 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.wildcards))
- packed.append(struct.pack("!H", self.in_port))
+ packed.append(util.pack_wc_bmap(self.wildcards))
+ packed.append(util.pack_port_no(self.in_port))
packed.append(struct.pack("!6B", *self.eth_src))
packed.append(struct.pack("!6B", *self.eth_dst))
packed.append(struct.pack("!H", self.vlan_vid))
@@ -357,7 +460,8 @@
packed.append(struct.pack("!H", self.eth_type))
packed.append(struct.pack("!B", self.ip_dscp))
packed.append(struct.pack("!B", self.ip_proto))
- packed.append('\x00' * 2)
+ packed.append(struct.pack("!B", self.src_meta_id))
+ packed.append(struct.pack("!B", self.dst_meta_id))
packed.append(struct.pack("!L", self.ipv4_src))
packed.append(struct.pack("!L", self.ipv4_dst))
packed.append(struct.pack("!H", self.tcp_src))
@@ -371,21 +475,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.wildcards = reader.read('!L')[0]
- obj.in_port = reader.read('!H')[0]
+ obj.wildcards = util.unpack_wc_bmap(reader)
+ obj.in_port = util.unpack_port_no(reader)
obj.eth_src = list(reader.read('!6B'))
obj.eth_dst = list(reader.read('!6B'))
- obj.vlan_vid = reader.read('!H')[0]
- obj.vlan_pcp = reader.read('!B')[0]
+ obj.vlan_vid = reader.read("!H")[0]
+ obj.vlan_pcp = reader.read("!B")[0]
reader.skip(1)
- obj.eth_type = reader.read('!H')[0]
- obj.ip_dscp = reader.read('!B')[0]
- obj.ip_proto = reader.read('!B')[0]
- reader.skip(2)
- obj.ipv4_src = reader.read('!L')[0]
- obj.ipv4_dst = reader.read('!L')[0]
- obj.tcp_src = reader.read('!H')[0]
- obj.tcp_dst = reader.read('!H')[0]
+ obj.eth_type = reader.read("!H")[0]
+ obj.ip_dscp = reader.read("!B")[0]
+ obj.ip_proto = reader.read("!B")[0]
+ obj.src_meta_id = reader.read("!B")[0]
+ obj.dst_meta_id = reader.read("!B")[0]
+ obj.ipv4_src = reader.read("!L")[0]
+ obj.ipv4_dst = reader.read("!L")[0]
+ obj.tcp_src = reader.read("!H")[0]
+ obj.tcp_dst = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -399,6 +504,8 @@
if self.eth_type != other.eth_type: return False
if self.ip_dscp != other.ip_dscp: return False
if self.ip_proto != other.ip_proto: return False
+ if self.src_meta_id != other.src_meta_id: return False
+ if self.dst_meta_id != other.dst_meta_id: return False
if self.ipv4_src != other.ipv4_src: return False
if self.ipv4_dst != other.ipv4_dst: return False
if self.tcp_src != other.tcp_src: return False
@@ -444,6 +551,12 @@
q.text("ip_proto = ");
q.text("%#x" % self.ip_proto)
q.text(","); q.breakable()
+ q.text("src_meta_id = ");
+ q.text("%#x" % self.src_meta_id)
+ q.text(","); q.breakable()
+ q.text("dst_meta_id = ");
+ q.text("%#x" % self.dst_meta_id)
+ q.text(","); q.breakable()
q.text("ipv4_src = ");
q.text(util.pretty_ipv4(self.ipv4_src))
q.text(","); q.breakable()
@@ -476,7 +589,7 @@
packed.append(struct.pack("!L", self.queue_id))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 2)
- packed.append("".join([x.pack() for x in self.properties]))
+ packed.append(util.pack_list(self.properties))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -488,8 +601,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.queue_id = reader.read('!L')[0]
- _len = reader.read('!H')[0]
+ obj.queue_id = reader.read("!L")[0]
+ _len = reader.read("!H")[0]
reader.skip(2)
obj.properties = common.unpack_list_queue_prop(reader)
return obj
@@ -563,7 +676,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!H", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append(struct.pack("!16s", self.name))
packed.append(struct.pack("!L", self.config))
@@ -581,15 +694,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!H')[0]
+ obj.port_no = util.unpack_port_no(reader)
obj.hw_addr = list(reader.read('!6B'))
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.config = reader.read('!L')[0]
- obj.state = reader.read('!L')[0]
- obj.curr = reader.read('!L')[0]
- obj.advertised = reader.read('!L')[0]
- obj.supported = reader.read('!L')[0]
- obj.peer = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.state = reader.read("!L")[0]
+ obj.curr = reader.read("!L")[0]
+ obj.advertised = reader.read("!L")[0]
+ obj.supported = reader.read("!L")[0]
+ obj.peer = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -705,7 +818,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!H", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 6)
packed.append(struct.pack("!Q", self.rx_packets))
packed.append(struct.pack("!Q", self.tx_packets))
@@ -728,20 +841,20 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!H')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(6)
- obj.rx_packets = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.rx_bytes = reader.read('!Q')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.rx_dropped = reader.read('!Q')[0]
- obj.tx_dropped = reader.read('!Q')[0]
- obj.rx_errors = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
- obj.rx_frame_err = reader.read('!Q')[0]
- obj.rx_over_err = reader.read('!Q')[0]
- obj.rx_crc_err = reader.read('!Q')[0]
- obj.collisions = reader.read('!Q')[0]
+ obj.rx_packets = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.rx_bytes = reader.read("!Q")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.rx_dropped = reader.read("!Q")[0]
+ obj.tx_dropped = reader.read("!Q")[0]
+ obj.rx_errors = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
+ obj.rx_frame_err = reader.read("!Q")[0]
+ obj.rx_over_err = reader.read("!Q")[0]
+ obj.rx_crc_err = reader.read("!Q")[0]
+ obj.collisions = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -815,7 +928,7 @@
q.text('}')
class queue_prop_min_rate(object):
- type = const.OFPQT_MIN_RATE
+ type = 1
def __init__(self, rate=None):
if rate != None:
@@ -842,11 +955,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_MIN_RATE)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.rate = reader.read('!H')[0]
+ obj.rate = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -899,7 +1012,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!H", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 2)
packed.append(struct.pack("!L", self.queue_id))
packed.append(struct.pack("!Q", self.tx_bytes))
@@ -914,12 +1027,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!H')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(2)
- obj.queue_id = reader.read('!L')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
+ obj.queue_id = reader.read("!L")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -974,7 +1087,7 @@
if wildcards != None:
self.wildcards = wildcards
else:
- self.wildcards = const.OFPFW_ALL
+ self.wildcards = util.init_wc_bmap()
if max_entries != None:
self.max_entries = max_entries
else:
@@ -998,7 +1111,7 @@
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 3)
packed.append(struct.pack("!32s", self.name))
- packed.append(struct.pack("!L", self.wildcards))
+ packed.append(util.pack_wc_bmap(self.wildcards))
packed.append(struct.pack("!L", self.max_entries))
packed.append(struct.pack("!L", self.active_count))
packed.append(struct.pack("!Q", self.lookup_count))
@@ -1012,14 +1125,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
obj.name = reader.read("!32s")[0].rstrip("\x00")
- obj.wildcards = reader.read('!L')[0]
- obj.max_entries = reader.read('!L')[0]
- obj.active_count = reader.read('!L')[0]
- obj.lookup_count = reader.read('!Q')[0]
- obj.matched_count = reader.read('!Q')[0]
+ obj.wildcards = util.unpack_wc_bmap(reader)
+ obj.max_entries = reader.read("!L")[0]
+ obj.active_count = reader.read("!L")[0]
+ obj.lookup_count = reader.read("!Q")[0]
+ obj.matched_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
diff --git a/src/python/loxi/of10/const.py b/src/python/loxi/of10/const.py
index 3b9a177..0273c7a 100644
--- a/src/python/loxi/of10/const.py
+++ b/src/python/loxi/of10/const.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template const.py
# Do not modify
@@ -8,23 +9,23 @@
OFP_VERSION = 1
# Identifiers from group macro_definitions
-OFP_FLOW_PERMANENT = 0
-OFP_ETH_ALEN = 6
-OFP_MAX_PORT_NAME_LEN = 16
OFP_MAX_TABLE_NAME_LEN = 32
-SERIAL_NUM_LEN = 32
-OFPFW_ICMP_TYPE = 64
-OFP_DEFAULT_MISS_SEND_LEN = 128
-OFPFW_ICMP_CODE = 128
-DESC_STR_LEN = 256
-OFP_DL_TYPE_NOT_ETH_TYPE = 1535
-OFP_DL_TYPE_ETH2_CUTOFF = 1536
+OFP_MAX_PORT_NAME_LEN = 16
OFP_TCP_PORT = 6633
OFP_SSL_PORT = 6633
-OFP_DEFAULT_PRIORITY = 32768
+OFP_ETH_ALEN = 6
+OFP_DEFAULT_MISS_SEND_LEN = 128
OFP_VLAN_NONE = 65535
-OFPQ_MIN_RATE_UNCFG = 65535
+OFPFW_ICMP_TYPE = 64
+OFPFW_ICMP_CODE = 128
+OFP_DL_TYPE_ETH2_CUTOFF = 1536
+OFP_DL_TYPE_NOT_ETH_TYPE = 1535
+OFP_FLOW_PERMANENT = 0
+OFP_DEFAULT_PRIORITY = 32768
+DESC_STR_LEN = 256
+SERIAL_NUM_LEN = 32
OFPQ_ALL = 4294967295
+OFPQ_MIN_RATE_UNCFG = 65535
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
@@ -103,6 +104,13 @@
8: 'OFPBRC_BUFFER_UNKNOWN',
}
+# Identifiers from group ofp_bsn_vport_q_in_q_untagged
+OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
+
+ofp_bsn_vport_q_in_q_untagged_map = {
+ 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
+}
+
# Identifiers from group ofp_capabilities
OFPC_FLOW_STATS = 1
OFPC_TABLE_STATS = 2
@@ -227,6 +235,8 @@
OFPFW_NW_DST_MASK = 1032192
OFPFW_DL_VLAN_PCP = 1048576
OFPFW_NW_TOS = 2097152
+OFPFW_SRC_META_ID = 4194304
+OFPFW_DST_META_ID = 8388608
OFPFW_ALL = 4194303
ofp_flow_wildcards_map = {
@@ -240,6 +250,8 @@
128: 'OFPFW_TP_DST',
1048576: 'OFPFW_DL_VLAN_PCP',
2097152: 'OFPFW_NW_TOS',
+ 4194304: 'OFPFW_SRC_META_ID',
+ 8388608: 'OFPFW_DST_META_ID',
}
# Identifiers from group ofp_hello_failed_code
diff --git a/src/python/loxi/of10/message.py b/src/python/loxi/of10/message.py
index b95b3c4..e01c342 100644
--- a/src/python/loxi/of10/message.py
+++ b/src/python/loxi/of10/message.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template message.py
# Do not modify
@@ -19,9 +20,9 @@
xid = None
class aggregate_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_AGGREGATE
+ version = 1
+ type = 17
+ stats_type = 2
def __init__(self, xid=None, flags=None, packet_count=None, byte_count=None, flow_count=None):
self.xid = xid
@@ -66,18 +67,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_AGGREGATE)
- obj.flags = reader.read('!H')[0]
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
- obj.flow_count = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 2)
+ obj.flags = reader.read("!H")[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
+ obj.flow_count = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -128,9 +129,9 @@
q.text('}')
class aggregate_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_AGGREGATE
+ version = 1
+ type = 16
+ stats_type = 2
def __init__(self, xid=None, flags=None, match=None, table_id=None, out_port=None):
self.xid = xid
@@ -162,7 +163,7 @@
packed.append(self.match.pack())
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 1)
- packed.append(struct.pack("!H", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -175,19 +176,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_AGGREGATE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 2)
+ obj.flags = reader.read("!H")[0]
obj.match = common.match.unpack(reader)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(1)
- obj.out_port = reader.read('!H')[0]
+ obj.out_port = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -237,8 +238,8 @@
q.text('}')
class barrier_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REPLY
+ version = 1
+ type = 19
def __init__(self, xid=None):
self.xid = xid
@@ -261,12 +262,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -300,8 +301,8 @@
q.text('}')
class barrier_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REQUEST
+ version = 1
+ type = 18
def __init__(self, xid=None):
self.xid = xid
@@ -324,12 +325,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -362,10 +363,486 @@
q.breakable()
q.text('}')
+class bsn_bw_clear_data_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 22
+
+ 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_bw_clear_data_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 == 22)
+ 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_bw_clear_data_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_bw_clear_data_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 21
+
+ 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_bw_clear_data_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 == 21)
+ 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_bw_clear_data_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_bw_enable_get_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 20
+
+ 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_bw_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 == 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 == 20)
+ 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_bw_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_bw_enable_get_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 19
+
+ 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_bw_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 == 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 == 19)
+ 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_bw_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_bw_enable_set_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 23
+
+ 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_bw_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 == 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 == 23)
+ 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_bw_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_bw_enable_set_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 18
+
+ 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_bw_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 == 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 == 18)
+ 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_bw_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 = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 10
def __init__(self, xid=None, interfaces=None):
@@ -383,7 +860,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!L", self.experimenter))
packed.append(struct.pack("!L", self.subtype))
- packed.append("".join([x.pack() for x in self.interfaces]))
+ packed.append(util.pack_list(self.interfaces))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -396,15 +873,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 10)
obj.interfaces = loxi.generic_util.unpack_list(reader, common.bsn_interface.unpack)
return obj
@@ -444,9 +921,9 @@
q.text('}')
class bsn_get_interfaces_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 9
def __init__(self, xid=None):
@@ -472,15 +949,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 9)
return obj
@@ -515,9 +992,9 @@
q.text('}')
class bsn_get_ip_mask_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 2
def __init__(self, xid=None, index=None, mask=None):
@@ -554,19 +1031,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 2)
- obj.index = reader.read('!B')[0]
+ obj.index = reader.read("!B")[0]
reader.skip(3)
- obj.mask = reader.read('!L')[0]
+ obj.mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -608,9 +1085,9 @@
q.text('}')
class bsn_get_ip_mask_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 1
def __init__(self, xid=None, index=None):
@@ -642,17 +1119,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 1)
- obj.index = reader.read('!B')[0]
+ obj.index = reader.read("!B")[0]
reader.skip(7)
return obj
@@ -691,9 +1168,9 @@
q.text('}')
class bsn_get_l2_table_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 14
def __init__(self, xid=None, l2_table_enable=None, l2_table_priority=None):
@@ -731,19 +1208,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 14)
- obj.l2_table_enable = reader.read('!B')[0]
+ obj.l2_table_enable = reader.read("!B")[0]
reader.skip(1)
- obj.l2_table_priority = reader.read('!H')[0]
+ obj.l2_table_priority = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -786,9 +1263,9 @@
q.text('}')
class bsn_get_l2_table_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 13
def __init__(self, xid=None):
@@ -814,15 +1291,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 13)
return obj
@@ -857,9 +1334,9 @@
q.text('}')
class bsn_get_mirroring_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 5
def __init__(self, xid=None, report_mirror_ports=None):
@@ -891,17 +1368,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 5)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -940,9 +1417,9 @@
q.text('}')
class bsn_get_mirroring_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 4
def __init__(self, xid=None, report_mirror_ports=None):
@@ -974,17 +1451,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 4)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1023,9 +1500,9 @@
q.text('}')
class bsn_set_ip_mask(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 0
def __init__(self, xid=None, index=None, mask=None):
@@ -1062,19 +1539,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 0)
- obj.index = reader.read('!B')[0]
+ obj.index = reader.read("!B")[0]
reader.skip(3)
- obj.mask = reader.read('!L')[0]
+ obj.mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1115,10 +1592,113 @@
q.breakable()
q.text('}')
-class bsn_set_l2_table(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+class bsn_set_l2_table_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 24
+
+ def __init__(self, xid=None, l2_table_enable=None, l2_table_priority=None, status=None):
+ self.xid = xid
+ if l2_table_enable != None:
+ self.l2_table_enable = l2_table_enable
+ else:
+ self.l2_table_enable = 0
+ if l2_table_priority != None:
+ self.l2_table_priority = l2_table_priority
+ else:
+ self.l2_table_priority = 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("!B", self.l2_table_enable))
+ packed.append('\x00' * 1)
+ packed.append(struct.pack("!H", self.l2_table_priority))
+ 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_set_l2_table_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 == 24)
+ obj.l2_table_enable = reader.read("!B")[0]
+ reader.skip(1)
+ obj.l2_table_priority = reader.read("!H")[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.l2_table_enable != other.l2_table_enable: return False
+ if self.l2_table_priority != other.l2_table_priority: 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_set_l2_table_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("l2_table_enable = ");
+ q.text("%#x" % self.l2_table_enable)
+ q.text(","); q.breakable()
+ q.text("l2_table_priority = ");
+ q.text("%#x" % self.l2_table_priority)
+ q.text(","); q.breakable()
+ q.text("status = ");
+ q.text("%#x" % self.status)
+ q.breakable()
+ q.text('}')
+
+class bsn_set_l2_table_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 12
def __init__(self, xid=None, l2_table_enable=None, l2_table_priority=None):
@@ -1151,24 +1731,24 @@
@staticmethod
def unpack(buf):
if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = bsn_set_l2_table()
+ obj = bsn_set_l2_table_request()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 12)
- obj.l2_table_enable = reader.read('!B')[0]
+ obj.l2_table_enable = reader.read("!B")[0]
reader.skip(1)
- obj.l2_table_priority = reader.read('!H')[0]
+ obj.l2_table_priority = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -1192,7 +1772,7 @@
return loxi.pp.pp(self)
def pretty_print(self, q):
- q.text("bsn_set_l2_table {")
+ q.text("bsn_set_l2_table_request {")
with q.group():
with q.indent(2):
q.breakable()
@@ -1211,9 +1791,9 @@
q.text('}')
class bsn_set_mirroring(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 3
def __init__(self, xid=None, report_mirror_ports=None):
@@ -1245,17 +1825,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 3)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1293,10 +1873,91 @@
q.breakable()
q.text('}')
-class bsn_set_pktin_suppression(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+class bsn_set_pktin_suppression_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 25
+
+ 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_set_pktin_suppression_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 == 25)
+ 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_set_pktin_suppression_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_set_pktin_suppression_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 11
def __init__(self, xid=None, enabled=None, idle_timeout=None, hard_timeout=None, priority=None, cookie=None):
@@ -1343,27 +2004,27 @@
@staticmethod
def unpack(buf):
if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = bsn_set_pktin_suppression()
+ obj = bsn_set_pktin_suppression_request()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 11)
- obj.enabled = reader.read('!B')[0]
+ obj.enabled = reader.read("!B")[0]
reader.skip(1)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.cookie = reader.read('!Q')[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.cookie = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1389,7 +2050,7 @@
return loxi.pp.pp(self)
def pretty_print(self, q):
- q.text("bsn_set_pktin_suppression {")
+ q.text("bsn_set_pktin_suppression_request {")
with q.group():
with q.indent(2):
q.breakable()
@@ -1417,9 +2078,9 @@
q.text('}')
class bsn_shell_command(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 6
def __init__(self, xid=None, service=None, data=None):
@@ -1431,7 +2092,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1455,17 +2116,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 6)
- obj.service = reader.read('!L')[0]
+ obj.service = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1508,9 +2169,9 @@
q.text('}')
class bsn_shell_output(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 7
def __init__(self, xid=None, data=None):
@@ -1518,7 +2179,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1541,15 +2202,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 7)
obj.data = str(reader.read_all())
return obj
@@ -1589,9 +2250,9 @@
q.text('}')
class bsn_shell_status(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x5c16c7
+ version = 1
+ type = 4
+ experimenter = 6035143
subtype = 8
def __init__(self, xid=None, status=None):
@@ -1622,17 +2283,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 8)
- obj.status = reader.read('!L')[0]
+ obj.status = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1669,10 +2330,344 @@
q.breakable()
q.text('}')
+class bsn_virtual_port_create_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 16
+
+ def __init__(self, xid=None, status=None, vport_no=None):
+ self.xid = xid
+ if status != None:
+ self.status = status
+ else:
+ self.status = 0
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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))
+ packed.append(struct.pack("!L", self.vport_no))
+ 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_virtual_port_create_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 == 16)
+ obj.status = reader.read("!L")[0]
+ obj.vport_no = 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
+ if self.vport_no != other.vport_no: 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_virtual_port_create_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.text(","); q.breakable()
+ q.text("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_create_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 15
+
+ def __init__(self, xid=None, vport=None):
+ self.xid = xid
+ if vport != None:
+ self.vport = vport
+ else:
+ self.vport = common.bsn_vport_q_in_q()
+
+ 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(self.vport.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_virtual_port_create_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 == 15)
+ obj.vport = common.bsn_vport_q_in_q.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.vport != other.vport: 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_virtual_port_create_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("vport = ");
+ q.pp(self.vport)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_remove_reply(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 26
+
+ 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_virtual_port_remove_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 == 26)
+ 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_virtual_port_remove_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_virtual_port_remove_request(Message):
+ version = 1
+ type = 4
+ experimenter = 6035143
+ subtype = 17
+
+ def __init__(self, xid=None, vport_no=None):
+ self.xid = xid
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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.vport_no))
+ 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_virtual_port_remove_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 == 17)
+ obj.vport_no = 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.vport_no != other.vport_no: 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_virtual_port_remove_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("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
class desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_DESC
+ version = 1
+ type = 17
+ stats_type = 0
def __init__(self, xid=None, flags=None, mfr_desc=None, hw_desc=None, sw_desc=None, serial_num=None, dp_desc=None):
self.xid = xid
@@ -1726,15 +2721,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 0)
+ obj.flags = reader.read("!H")[0]
obj.mfr_desc = reader.read("!256s")[0].rstrip("\x00")
obj.hw_desc = reader.read("!256s")[0].rstrip("\x00")
obj.sw_desc = reader.read("!256s")[0].rstrip("\x00")
@@ -1797,9 +2792,9 @@
q.text('}')
class desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_DESC
+ version = 1
+ type = 16
+ stats_type = 0
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -1828,15 +2823,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 0)
+ obj.flags = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -1874,15 +2869,15 @@
q.text('}')
class echo_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REPLY
+ version = 1
+ type = 3
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1903,12 +2898,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 3)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1947,15 +2942,15 @@
q.text('}')
class echo_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REQUEST
+ version = 1
+ type = 2
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1976,12 +2971,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 2)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -2020,8 +3015,8 @@
q.text('}')
class error_msg(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ERROR
+ version = 1
+ type = 1
def __init__(self, xid=None, err_type=None, code=None, data=None):
self.xid = xid
@@ -2036,7 +3031,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -2059,14 +3054,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ERROR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.err_type = reader.read('!H')[0]
- obj.code = reader.read('!H')[0]
+ _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
@@ -2113,9 +3108,9 @@
q.text('}')
class experimenter_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_VENDOR
+ version = 1
+ type = 17
+ stats_type = 65535
def __init__(self, xid=None, flags=None, experimenter=None, data=None):
self.xid = xid
@@ -2130,7 +3125,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -2154,16 +3149,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_VENDOR)
- obj.flags = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 65535)
+ obj.flags = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -2210,9 +3205,9 @@
q.text('}')
class experimenter_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_VENDOR
+ version = 1
+ type = 16
+ stats_type = 65535
def __init__(self, xid=None, flags=None, experimenter=None, data=None):
self.xid = xid
@@ -2227,7 +3222,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -2251,16 +3246,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_VENDOR)
- obj.flags = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 65535)
+ obj.flags = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -2307,8 +3302,8 @@
q.text('}')
class features_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REPLY
+ version = 1
+ type = 6
def __init__(self, xid=None, datapath_id=None, n_buffers=None, n_tables=None, capabilities=None, actions=None, ports=None):
self.xid = xid
@@ -2349,7 +3344,7 @@
packed.append('\x00' * 3)
packed.append(struct.pack("!L", self.capabilities))
packed.append(struct.pack("!L", self.actions))
- packed.append("".join([x.pack() for x in self.ports]))
+ packed.append(util.pack_list(self.ports))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2362,18 +3357,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.datapath_id = reader.read('!Q')[0]
- obj.n_buffers = reader.read('!L')[0]
- obj.n_tables = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 6)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.datapath_id = reader.read("!Q")[0]
+ obj.n_buffers = reader.read("!L")[0]
+ obj.n_tables = reader.read("!B")[0]
reader.skip(3)
- obj.capabilities = reader.read('!L')[0]
- obj.actions = reader.read('!L')[0]
+ obj.capabilities = reader.read("!L")[0]
+ obj.actions = reader.read("!L")[0]
obj.ports = loxi.generic_util.unpack_list(reader, common.port_desc.unpack)
return obj
@@ -2432,8 +3427,8 @@
q.text('}')
class features_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REQUEST
+ version = 1
+ type = 5
def __init__(self, xid=None):
self.xid = xid
@@ -2456,12 +3451,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 5)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2495,9 +3490,9 @@
q.text('}')
class flow_add(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_ADD
+ version = 1
+ type = 14
+ _command = 0
def __init__(self, xid=None, match=None, cookie=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, flags=None, actions=None):
self.xid = xid
@@ -2546,14 +3541,14 @@
packed.append(struct.pack("!L", self.xid))
packed.append(self.match.pack())
packed.append(struct.pack("!Q", self.cookie))
- packed.append(struct.pack("!H", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!H", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2566,22 +3561,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.match = common.match.unpack(reader)
- obj.cookie = reader.read('!Q')[0]
- __command = reader.read('!H')[0]
- assert(__command == const.OFPFC_ADD)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!H')[0]
- obj.flags = reader.read('!H')[0]
+ obj.cookie = reader.read("!Q")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 0)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.flags = reader.read("!H")[0]
obj.actions = action.unpack_list(reader)
return obj
@@ -2652,9 +3647,9 @@
q.text('}')
class flow_delete(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE
+ version = 1
+ type = 14
+ _command = 3
def __init__(self, xid=None, match=None, cookie=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, flags=None, actions=None):
self.xid = xid
@@ -2703,14 +3698,14 @@
packed.append(struct.pack("!L", self.xid))
packed.append(self.match.pack())
packed.append(struct.pack("!Q", self.cookie))
- packed.append(struct.pack("!H", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!H", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2723,22 +3718,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.match = common.match.unpack(reader)
- obj.cookie = reader.read('!Q')[0]
- __command = reader.read('!H')[0]
- assert(__command == const.OFPFC_DELETE)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!H')[0]
- obj.flags = reader.read('!H')[0]
+ obj.cookie = reader.read("!Q")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 3)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.flags = reader.read("!H")[0]
obj.actions = action.unpack_list(reader)
return obj
@@ -2809,9 +3804,9 @@
q.text('}')
class flow_delete_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE_STRICT
+ version = 1
+ type = 14
+ _command = 4
def __init__(self, xid=None, match=None, cookie=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, flags=None, actions=None):
self.xid = xid
@@ -2860,14 +3855,14 @@
packed.append(struct.pack("!L", self.xid))
packed.append(self.match.pack())
packed.append(struct.pack("!Q", self.cookie))
- packed.append(struct.pack("!H", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!H", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2880,22 +3875,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.match = common.match.unpack(reader)
- obj.cookie = reader.read('!Q')[0]
- __command = reader.read('!H')[0]
- assert(__command == const.OFPFC_DELETE_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!H')[0]
- obj.flags = reader.read('!H')[0]
+ obj.cookie = reader.read("!Q")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 4)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.flags = reader.read("!H")[0]
obj.actions = action.unpack_list(reader)
return obj
@@ -2966,9 +3961,9 @@
q.text('}')
class flow_modify(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY
+ version = 1
+ type = 14
+ _command = 1
def __init__(self, xid=None, match=None, cookie=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, flags=None, actions=None):
self.xid = xid
@@ -3017,14 +4012,14 @@
packed.append(struct.pack("!L", self.xid))
packed.append(self.match.pack())
packed.append(struct.pack("!Q", self.cookie))
- packed.append(struct.pack("!H", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!H", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3037,22 +4032,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.match = common.match.unpack(reader)
- obj.cookie = reader.read('!Q')[0]
- __command = reader.read('!H')[0]
- assert(__command == const.OFPFC_MODIFY)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!H')[0]
- obj.flags = reader.read('!H')[0]
+ obj.cookie = reader.read("!Q")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 1)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.flags = reader.read("!H")[0]
obj.actions = action.unpack_list(reader)
return obj
@@ -3123,9 +4118,9 @@
q.text('}')
class flow_modify_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY_STRICT
+ version = 1
+ type = 14
+ _command = 2
def __init__(self, xid=None, match=None, cookie=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, flags=None, actions=None):
self.xid = xid
@@ -3174,14 +4169,14 @@
packed.append(struct.pack("!L", self.xid))
packed.append(self.match.pack())
packed.append(struct.pack("!Q", self.cookie))
- packed.append(struct.pack("!H", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!H", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3194,22 +4189,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.match = common.match.unpack(reader)
- obj.cookie = reader.read('!Q')[0]
- __command = reader.read('!H')[0]
- assert(__command == const.OFPFC_MODIFY_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!H')[0]
- obj.flags = reader.read('!H')[0]
+ obj.cookie = reader.read("!Q")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 2)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.flags = reader.read("!H")[0]
obj.actions = action.unpack_list(reader)
return obj
@@ -3280,8 +4275,8 @@
q.text('}')
class flow_removed(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_REMOVED
+ version = 1
+ type = 11
def __init__(self, xid=None, match=None, cookie=None, priority=None, reason=None, duration_sec=None, duration_nsec=None, idle_timeout=None, packet_count=None, byte_count=None):
self.xid = xid
@@ -3351,23 +4346,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_REMOVED)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 11)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.match = common.match.unpack(reader)
- obj.cookie = reader.read('!Q')[0]
- obj.priority = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.reason = reader.read("!B")[0]
reader.skip(1)
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.idle_timeout = reader.read('!H')[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.idle_timeout = reader.read("!H")[0]
reader.skip(2)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -3437,9 +4432,9 @@
q.text('}')
class flow_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_FLOW
+ version = 1
+ type = 17
+ stats_type = 1
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -3460,7 +4455,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3473,15 +4468,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_FLOW)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 1)
+ obj.flags = reader.read("!H")[0]
obj.entries = common.unpack_list_flow_stats_entry(reader)
return obj
@@ -3524,9 +4519,9 @@
q.text('}')
class flow_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_FLOW
+ version = 1
+ type = 16
+ stats_type = 1
def __init__(self, xid=None, flags=None, match=None, table_id=None, out_port=None):
self.xid = xid
@@ -3558,7 +4553,7 @@
packed.append(self.match.pack())
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 1)
- packed.append(struct.pack("!H", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3571,19 +4566,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_FLOW)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 1)
+ obj.flags = reader.read("!H")[0]
obj.match = common.match.unpack(reader)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(1)
- obj.out_port = reader.read('!H')[0]
+ obj.out_port = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -3633,8 +4628,8 @@
q.text('}')
class get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REPLY
+ version = 1
+ type = 8
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -3667,14 +4662,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 8)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3716,8 +4711,8 @@
q.text('}')
class get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REQUEST
+ version = 1
+ type = 7
def __init__(self, xid=None):
self.xid = xid
@@ -3740,12 +4735,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 7)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3779,8 +4774,8 @@
q.text('}')
class hello(Message):
- version = const.OFP_VERSION
- type = const.OFPT_HELLO
+ version = 1
+ type = 0
def __init__(self, xid=None):
self.xid = xid
@@ -3803,12 +4798,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_HELLO)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3842,9 +4837,9 @@
q.text('}')
class nicira_controller_role_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x2320
+ version = 1
+ type = 4
+ experimenter = 8992
subtype = 11
def __init__(self, xid=None, role=None):
@@ -3875,17 +4870,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!L')[0]
+ _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 == 8992)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 11)
- obj.role = reader.read('!L')[0]
+ obj.role = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3923,9 +4918,9 @@
q.text('}')
class nicira_controller_role_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_VENDOR
- experimenter = 0x2320
+ version = 1
+ type = 4
+ experimenter = 8992
subtype = 10
def __init__(self, xid=None, role=None):
@@ -3956,17 +4951,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_VENDOR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!L')[0]
+ _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 == 8992)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 10)
- obj.role = reader.read('!L')[0]
+ obj.role = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -4004,8 +4999,8 @@
q.text('}')
class packet_in(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_IN
+ version = 1
+ type = 10
def __init__(self, xid=None, buffer_id=None, total_len=None, in_port=None, reason=None, data=None):
self.xid = xid
@@ -4028,7 +5023,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -4038,7 +5033,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!L", self.buffer_id))
packed.append(struct.pack("!H", self.total_len))
- packed.append(struct.pack("!H", self.in_port))
+ packed.append(util.pack_port_no(self.in_port))
packed.append(struct.pack("!B", self.reason))
packed.append('\x00' * 1)
packed.append(self.data)
@@ -4054,16 +5049,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_IN)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.total_len = reader.read('!H')[0]
- obj.in_port = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 10)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.total_len = reader.read("!H")[0]
+ obj.in_port = util.unpack_port_no(reader)
+ obj.reason = reader.read("!B")[0]
reader.skip(1)
obj.data = str(reader.read_all())
return obj
@@ -4119,8 +5114,8 @@
q.text('}')
class packet_out(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_OUT
+ version = 1
+ type = 13
def __init__(self, xid=None, buffer_id=None, in_port=None, actions=None, data=None):
self.xid = xid
@@ -4139,7 +5134,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -4148,9 +5143,9 @@
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.buffer_id))
- packed.append(struct.pack("!H", self.in_port))
+ packed.append(util.pack_port_no(self.in_port))
packed.append(struct.pack("!H", 0)) # placeholder for actions_len at index 6
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
packed[6] = struct.pack("!H", len(packed[-1]))
packed.append(self.data)
length = sum([len(x) for x in packed])
@@ -4165,15 +5160,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_OUT)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.in_port = reader.read('!H')[0]
- _actions_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 13)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.in_port = util.unpack_port_no(reader)
+ _actions_len = reader.read("!H")[0]
obj.actions = action.unpack_list(reader.slice(_actions_len))
obj.data = str(reader.read_all())
return obj
@@ -4225,8 +5220,8 @@
q.text('}')
class port_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_MOD
+ version = 1
+ type = 15
def __init__(self, xid=None, port_no=None, hw_addr=None, config=None, mask=None, advertise=None):
self.xid = xid
@@ -4257,7 +5252,7 @@
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.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append(struct.pack("!L", self.config))
packed.append(struct.pack("!L", self.mask))
@@ -4275,17 +5270,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port_no = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 15)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
obj.hw_addr = list(reader.read('!6B'))
- obj.config = reader.read('!L')[0]
- obj.mask = reader.read('!L')[0]
- obj.advertise = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.mask = reader.read("!L")[0]
+ obj.advertise = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -4340,9 +5335,9 @@
q.text('}')
class port_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_PORT
+ version = 1
+ type = 17
+ stats_type = 4
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -4363,7 +5358,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4376,15 +5371,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_PORT)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 4)
+ obj.flags = reader.read("!H")[0]
obj.entries = loxi.generic_util.unpack_list(reader, common.port_stats_entry.unpack)
return obj
@@ -4427,9 +5422,9 @@
q.text('}')
class port_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_PORT
+ version = 1
+ type = 16
+ stats_type = 4
def __init__(self, xid=None, flags=None, port_no=None):
self.xid = xid
@@ -4450,7 +5445,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
- packed.append(struct.pack("!H", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 6)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4464,16 +5459,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_PORT)
- obj.flags = reader.read('!H')[0]
- obj.port_no = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 4)
+ obj.flags = reader.read("!H")[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(6)
return obj
@@ -4516,8 +5511,8 @@
q.text('}')
class port_status(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_STATUS
+ version = 1
+ type = 12
def __init__(self, xid=None, reason=None, desc=None):
self.xid = xid
@@ -4551,13 +5546,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_STATUS)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.reason = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 12)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.reason = reader.read("!B")[0]
reader.skip(7)
obj.desc = common.port_desc.unpack(reader)
return obj
@@ -4601,8 +5596,8 @@
q.text('}')
class queue_get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REPLY
+ version = 1
+ type = 21
def __init__(self, xid=None, port=None, queues=None):
self.xid = xid
@@ -4621,9 +5616,9 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 6)
- packed.append("".join([x.pack() for x in self.queues]))
+ packed.append(util.pack_list(self.queues))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4636,13 +5631,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 21)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(6)
obj.queues = common.unpack_list_packet_queue(reader)
return obj
@@ -4686,8 +5681,8 @@
q.text('}')
class queue_get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REQUEST
+ version = 1
+ type = 20
def __init__(self, xid=None, port=None):
self.xid = xid
@@ -4702,7 +5697,7 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 2)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4716,13 +5711,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 20)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(2)
return obj
@@ -4761,9 +5756,9 @@
q.text('}')
class queue_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_QUEUE
+ version = 1
+ type = 17
+ stats_type = 5
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -4784,7 +5779,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4797,15 +5792,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_QUEUE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 5)
+ obj.flags = reader.read("!H")[0]
obj.entries = loxi.generic_util.unpack_list(reader, common.queue_stats_entry.unpack)
return obj
@@ -4848,9 +5843,9 @@
q.text('}')
class queue_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_QUEUE
+ version = 1
+ type = 16
+ stats_type = 5
def __init__(self, xid=None, flags=None, port_no=None, queue_id=None):
self.xid = xid
@@ -4875,7 +5870,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
- packed.append(struct.pack("!H", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 2)
packed.append(struct.pack("!L", self.queue_id))
length = sum([len(x) for x in packed])
@@ -4890,18 +5885,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_QUEUE)
- obj.flags = reader.read('!H')[0]
- obj.port_no = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 5)
+ obj.flags = reader.read("!H")[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(2)
- obj.queue_id = reader.read('!L')[0]
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -4947,8 +5942,8 @@
q.text('}')
class set_config(Message):
- version = const.OFP_VERSION
- type = const.OFPT_SET_CONFIG
+ version = 1
+ type = 9
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -4981,14 +5976,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_SET_CONFIG)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 9)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -5030,7 +6025,7 @@
q.text('}')
class table_mod(Message):
- version = const.OFP_VERSION
+ version = 1
type = 22
def __init__(self, xid=None, table_id=None, config=None):
@@ -5065,15 +6060,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
assert(_type == 22)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.table_id = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.config = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -5115,9 +6110,9 @@
q.text('}')
class table_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_TABLE
+ version = 1
+ type = 17
+ stats_type = 3
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -5138,7 +6133,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -5151,15 +6146,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_TABLE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 3)
+ obj.flags = reader.read("!H")[0]
obj.entries = loxi.generic_util.unpack_list(reader, common.table_stats_entry.unpack)
return obj
@@ -5202,9 +6197,9 @@
q.text('}')
class table_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_TABLE
+ version = 1
+ type = 16
+ stats_type = 3
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -5233,15 +6228,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_TABLE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 1)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 3)
+ obj.flags = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -5340,29 +6335,29 @@
raise loxi.ProtocolError("unexpected experimenter %#x subtype %#x" % (experimenter, subtype))
parsers = {
- 22 : table_mod.unpack,
- const.OFPT_BARRIER_REPLY : barrier_reply.unpack,
- const.OFPT_BARRIER_REQUEST : barrier_request.unpack,
- const.OFPT_ECHO_REPLY : echo_reply.unpack,
- const.OFPT_ECHO_REQUEST : echo_request.unpack,
- const.OFPT_ERROR : error_msg.unpack,
- const.OFPT_FEATURES_REPLY : features_reply.unpack,
- const.OFPT_FEATURES_REQUEST : features_request.unpack,
- const.OFPT_FLOW_MOD : parse_flow_mod,
- const.OFPT_FLOW_REMOVED : flow_removed.unpack,
- const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
- const.OFPT_GET_CONFIG_REQUEST : get_config_request.unpack,
const.OFPT_HELLO : hello.unpack,
- const.OFPT_PACKET_IN : packet_in.unpack,
- const.OFPT_PACKET_OUT : packet_out.unpack,
- const.OFPT_PORT_MOD : port_mod.unpack,
- const.OFPT_PORT_STATUS : port_status.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REQUEST : queue_get_config_request.unpack,
- const.OFPT_SET_CONFIG : set_config.unpack,
- const.OFPT_STATS_REPLY : parse_stats_reply,
- const.OFPT_STATS_REQUEST : parse_stats_request,
+ const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ECHO_REQUEST : echo_request.unpack,
+ const.OFPT_ECHO_REPLY : echo_reply.unpack,
const.OFPT_VENDOR : parse_vendor,
+ const.OFPT_FEATURES_REQUEST : features_request.unpack,
+ const.OFPT_FEATURES_REPLY : features_reply.unpack,
+ const.OFPT_GET_CONFIG_REQUEST : get_config_request.unpack,
+ const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
+ const.OFPT_SET_CONFIG : set_config.unpack,
+ const.OFPT_PACKET_IN : packet_in.unpack,
+ const.OFPT_FLOW_REMOVED : flow_removed.unpack,
+ const.OFPT_PORT_STATUS : port_status.unpack,
+ const.OFPT_PACKET_OUT : packet_out.unpack,
+ const.OFPT_FLOW_MOD : parse_flow_mod,
+ const.OFPT_PORT_MOD : port_mod.unpack,
+ 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,
+ const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
+ 22 : table_mod.unpack,
}
flow_mod_parsers = {
@@ -5394,11 +6389,17 @@
}
experimenter_parsers = {
- 0x2320 : {
+ 8992 : {
11: nicira_controller_role_reply.unpack,
10: nicira_controller_role_request.unpack,
},
- 0x5c16c7 : {
+ 6035143 : {
+ 22: bsn_bw_clear_data_reply.unpack,
+ 21: bsn_bw_clear_data_request.unpack,
+ 20: bsn_bw_enable_get_reply.unpack,
+ 19: bsn_bw_enable_get_request.unpack,
+ 23: bsn_bw_enable_set_reply.unpack,
+ 18: bsn_bw_enable_set_request.unpack,
10: bsn_get_interfaces_reply.unpack,
9: bsn_get_interfaces_request.unpack,
2: bsn_get_ip_mask_reply.unpack,
@@ -5408,11 +6409,17 @@
5: bsn_get_mirroring_reply.unpack,
4: bsn_get_mirroring_request.unpack,
0: bsn_set_ip_mask.unpack,
- 12: bsn_set_l2_table.unpack,
+ 24: bsn_set_l2_table_reply.unpack,
+ 12: bsn_set_l2_table_request.unpack,
3: bsn_set_mirroring.unpack,
- 11: bsn_set_pktin_suppression.unpack,
+ 25: bsn_set_pktin_suppression_reply.unpack,
+ 11: bsn_set_pktin_suppression_request.unpack,
6: bsn_shell_command.unpack,
7: bsn_shell_output.unpack,
8: bsn_shell_status.unpack,
+ 16: bsn_virtual_port_create_reply.unpack,
+ 15: bsn_virtual_port_create_request.unpack,
+ 26: bsn_virtual_port_remove_reply.unpack,
+ 17: bsn_virtual_port_remove_request.unpack,
},
}
diff --git a/src/python/loxi/of10/util.py b/src/python/loxi/of10/util.py
index 45aa2d0..de54fa8 100644
--- a/src/python/loxi/of10/util.py
+++ b/src/python/loxi/of10/util.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template util.py
# Do not modify
@@ -43,3 +44,36 @@
if v == v2:
return k
return v
+
+def pack_port_no(value):
+ return struct.pack("!H", value)
+
+def unpack_port_no(reader):
+ return reader.read("!H")[0]
+
+def pack_fm_cmd(value):
+ return struct.pack("!H", value)
+
+def unpack_fm_cmd(reader):
+ return reader.read("!H")[0]
+
+def init_wc_bmap():
+ return const.OFPFW_ALL
+
+def pack_wc_bmap(value):
+ return struct.pack("!L", value)
+
+def unpack_wc_bmap(reader):
+ return reader.read("!L")[0]
+
+def init_match_bmap():
+ return const.OFPFW_ALL
+
+def pack_match_bmap(value):
+ return struct.pack("!L", value)
+
+def unpack_match_bmap(reader):
+ return reader.read("!L")[0]
+
+def pack_list(values):
+ return "".join([x.pack() for x in values])
diff --git a/src/python/loxi/of11/__init__.py b/src/python/loxi/of11/__init__.py
index edb9e20..e24e54a 100644
--- a/src/python/loxi/of11/__init__.py
+++ b/src/python/loxi/of11/__init__.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template init.py
# Do not modify
diff --git a/src/python/loxi/of11/action.py b/src/python/loxi/of11/action.py
index 7853607..44a3b70 100644
--- a/src/python/loxi/of11/action.py
+++ b/src/python/loxi/of11/action.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template action.py
# Do not modify
@@ -23,8 +24,8 @@
pass
class bsn_mirror(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 1
def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
@@ -63,16 +64,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 1)
- obj.dest_port = reader.read('!L')[0]
- obj.vlan_tag = reader.read('!L')[0]
- obj.copy_stage = reader.read('!B')[0]
+ obj.dest_port = reader.read("!L")[0]
+ obj.vlan_tag = reader.read("!L")[0]
+ obj.copy_stage = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -107,8 +108,8 @@
q.text('}')
class bsn_set_tunnel_dst(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 2
def __init__(self, dst=None):
@@ -136,14 +137,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 2)
- obj.dst = reader.read('!L')[0]
+ obj.dst = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -169,7 +170,7 @@
q.text('}')
class copy_ttl_in(Action):
- type = const.OFPAT_COPY_TTL_IN
+ type = 12
def __init__(self):
return
@@ -190,9 +191,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_IN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 12)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -216,7 +217,7 @@
q.text('}')
class copy_ttl_out(Action):
- type = const.OFPAT_COPY_TTL_OUT
+ type = 11
def __init__(self):
return
@@ -237,9 +238,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_OUT)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 11)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -263,7 +264,7 @@
q.text('}')
class dec_mpls_ttl(Action):
- type = const.OFPAT_DEC_MPLS_TTL
+ type = 16
def __init__(self):
return
@@ -284,9 +285,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_MPLS_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 16)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -310,7 +311,7 @@
q.text('}')
class dec_nw_ttl(Action):
- type = const.OFPAT_DEC_NW_TTL
+ type = 24
def __init__(self):
return
@@ -331,9 +332,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_NW_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 24)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -357,7 +358,7 @@
q.text('}')
class group(Action):
- type = const.OFPAT_GROUP
+ type = 22
def __init__(self, group_id=None):
if group_id != None:
@@ -382,10 +383,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_GROUP)
- _len = reader.read('!H')[0]
- obj.group_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 22)
+ _len = reader.read("!H")[0]
+ obj.group_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -411,8 +412,8 @@
q.text('}')
class nicira_dec_ttl(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x2320
+ type = 65535
+ experimenter = 8992
subtype = 18
def __init__(self):
@@ -437,12 +438,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 8992)
+ _subtype = reader.read("!H")[0]
assert(_subtype == 18)
reader.skip(2)
reader.skip(4)
@@ -468,7 +469,7 @@
q.text('}')
class output(Action):
- type = const.OFPAT_OUTPUT
+ type = 0
def __init__(self, port=None, max_len=None):
if port != None:
@@ -485,7 +486,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", self.max_len))
packed.append('\x00' * 6)
length = sum([len(x) for x in packed])
@@ -499,11 +500,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_OUTPUT)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!L')[0]
- obj.max_len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
+ obj.max_len = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -534,7 +535,7 @@
q.text('}')
class pop_mpls(Action):
- type = const.OFPAT_POP_MPLS
+ type = 20
def __init__(self, ethertype=None):
if ethertype != None:
@@ -560,10 +561,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 20)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -590,7 +591,7 @@
q.text('}')
class pop_vlan(Action):
- type = const.OFPAT_POP_VLAN
+ type = 18
def __init__(self):
return
@@ -611,9 +612,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_VLAN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 18)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -637,7 +638,7 @@
q.text('}')
class push_mpls(Action):
- type = const.OFPAT_PUSH_MPLS
+ type = 19
def __init__(self, ethertype=None):
if ethertype != None:
@@ -663,10 +664,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 19)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -693,7 +694,7 @@
q.text('}')
class push_vlan(Action):
- type = const.OFPAT_PUSH_VLAN
+ type = 17
def __init__(self, ethertype=None):
if ethertype != None:
@@ -719,10 +720,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_VLAN)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 17)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -749,7 +750,7 @@
q.text('}')
class set_dl_dst(Action):
- type = const.OFPAT_SET_DL_DST
+ type = 4
def __init__(self, dl_addr=None):
if dl_addr != None:
@@ -775,9 +776,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_DL_DST)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 4)
+ _len = reader.read("!H")[0]
obj.dl_addr = list(reader.read('!6B'))
reader.skip(6)
return obj
@@ -805,7 +806,7 @@
q.text('}')
class set_dl_src(Action):
- type = const.OFPAT_SET_DL_SRC
+ type = 3
def __init__(self, dl_addr=None):
if dl_addr != None:
@@ -831,9 +832,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_DL_SRC)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 3)
+ _len = reader.read("!H")[0]
obj.dl_addr = list(reader.read('!6B'))
reader.skip(6)
return obj
@@ -861,7 +862,7 @@
q.text('}')
class set_mpls_label(Action):
- type = const.OFPAT_SET_MPLS_LABEL
+ type = 13
def __init__(self, mpls_label=None):
if mpls_label != None:
@@ -886,10 +887,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_MPLS_LABEL)
- _len = reader.read('!H')[0]
- obj.mpls_label = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 13)
+ _len = reader.read("!H")[0]
+ obj.mpls_label = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -915,7 +916,7 @@
q.text('}')
class set_mpls_tc(Action):
- type = const.OFPAT_SET_MPLS_TC
+ type = 14
def __init__(self, mpls_tc=None):
if mpls_tc != None:
@@ -941,10 +942,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_MPLS_TC)
- _len = reader.read('!H')[0]
- obj.mpls_tc = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 14)
+ _len = reader.read("!H")[0]
+ obj.mpls_tc = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -971,7 +972,7 @@
q.text('}')
class set_mpls_ttl(Action):
- type = const.OFPAT_SET_MPLS_TTL
+ type = 15
def __init__(self, mpls_ttl=None):
if mpls_ttl != None:
@@ -997,10 +998,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_MPLS_TTL)
- _len = reader.read('!H')[0]
- obj.mpls_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 15)
+ _len = reader.read("!H")[0]
+ obj.mpls_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1027,7 +1028,7 @@
q.text('}')
class set_nw_dst(Action):
- type = const.OFPAT_SET_NW_DST
+ type = 6
def __init__(self, nw_addr=None):
if nw_addr != None:
@@ -1052,10 +1053,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_DST)
- _len = reader.read('!H')[0]
- obj.nw_addr = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 6)
+ _len = reader.read("!H")[0]
+ obj.nw_addr = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1081,7 +1082,7 @@
q.text('}')
class set_nw_ecn(Action):
- type = const.OFPAT_SET_NW_ECN
+ type = 8
def __init__(self, nw_ecn=None):
if nw_ecn != None:
@@ -1107,10 +1108,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_ECN)
- _len = reader.read('!H')[0]
- obj.nw_ecn = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 8)
+ _len = reader.read("!H")[0]
+ obj.nw_ecn = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1137,7 +1138,7 @@
q.text('}')
class set_nw_src(Action):
- type = const.OFPAT_SET_NW_SRC
+ type = 5
def __init__(self, nw_addr=None):
if nw_addr != None:
@@ -1162,10 +1163,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_SRC)
- _len = reader.read('!H')[0]
- obj.nw_addr = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 5)
+ _len = reader.read("!H")[0]
+ obj.nw_addr = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1191,7 +1192,7 @@
q.text('}')
class set_nw_tos(Action):
- type = const.OFPAT_SET_NW_TOS
+ type = 7
def __init__(self, nw_tos=None):
if nw_tos != None:
@@ -1217,10 +1218,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_TOS)
- _len = reader.read('!H')[0]
- obj.nw_tos = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 7)
+ _len = reader.read("!H")[0]
+ obj.nw_tos = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1247,7 +1248,7 @@
q.text('}')
class set_nw_ttl(Action):
- type = const.OFPAT_SET_NW_TTL
+ type = 23
def __init__(self, nw_ttl=None):
if nw_ttl != None:
@@ -1273,10 +1274,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_TTL)
- _len = reader.read('!H')[0]
- obj.nw_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 23)
+ _len = reader.read("!H")[0]
+ obj.nw_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1303,7 +1304,7 @@
q.text('}')
class set_queue(Action):
- type = const.OFPAT_SET_QUEUE
+ type = 21
def __init__(self, queue_id=None):
if queue_id != None:
@@ -1328,10 +1329,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_QUEUE)
- _len = reader.read('!H')[0]
- obj.queue_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 21)
+ _len = reader.read("!H")[0]
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1357,7 +1358,7 @@
q.text('}')
class set_tp_dst(Action):
- type = const.OFPAT_SET_TP_DST
+ type = 10
def __init__(self, tp_port=None):
if tp_port != None:
@@ -1383,10 +1384,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_TP_DST)
- _len = reader.read('!H')[0]
- obj.tp_port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 10)
+ _len = reader.read("!H")[0]
+ obj.tp_port = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -1413,7 +1414,7 @@
q.text('}')
class set_tp_src(Action):
- type = const.OFPAT_SET_TP_SRC
+ type = 9
def __init__(self, tp_port=None):
if tp_port != None:
@@ -1439,10 +1440,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_TP_SRC)
- _len = reader.read('!H')[0]
- obj.tp_port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 9)
+ _len = reader.read("!H")[0]
+ obj.tp_port = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -1469,7 +1470,7 @@
q.text('}')
class set_vlan_pcp(Action):
- type = const.OFPAT_SET_VLAN_PCP
+ type = 2
def __init__(self, vlan_pcp=None):
if vlan_pcp != None:
@@ -1495,10 +1496,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_VLAN_PCP)
- _len = reader.read('!H')[0]
- obj.vlan_pcp = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
+ obj.vlan_pcp = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1525,7 +1526,7 @@
q.text('}')
class set_vlan_vid(Action):
- type = const.OFPAT_SET_VLAN_VID
+ type = 1
def __init__(self, vlan_vid=None):
if vlan_vid != None:
@@ -1551,10 +1552,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_VLAN_VID)
- _len = reader.read('!H')[0]
- obj.vlan_vid = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
+ obj.vlan_vid = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -1597,33 +1598,40 @@
raise loxi.ProtocolError("unexpected BSN experimenter subtype %#x" % subtype)
parsers = {
- const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
- const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
- const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
- const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
- const.OFPAT_EXPERIMENTER : parse_experimenter,
- const.OFPAT_GROUP : group.unpack,
const.OFPAT_OUTPUT : output.unpack,
- const.OFPAT_POP_MPLS : pop_mpls.unpack,
- const.OFPAT_POP_VLAN : pop_vlan.unpack,
- const.OFPAT_PUSH_MPLS : push_mpls.unpack,
- const.OFPAT_PUSH_VLAN : push_vlan.unpack,
- const.OFPAT_SET_DL_DST : set_dl_dst.unpack,
+ const.OFPAT_SET_VLAN_VID : set_vlan_vid.unpack,
+ const.OFPAT_SET_VLAN_PCP : set_vlan_pcp.unpack,
const.OFPAT_SET_DL_SRC : set_dl_src.unpack,
+ const.OFPAT_SET_DL_DST : set_dl_dst.unpack,
+ const.OFPAT_SET_NW_SRC : set_nw_src.unpack,
+ const.OFPAT_SET_NW_DST : set_nw_dst.unpack,
+ const.OFPAT_SET_NW_TOS : set_nw_tos.unpack,
+ const.OFPAT_SET_NW_ECN : set_nw_ecn.unpack,
+ const.OFPAT_SET_TP_SRC : set_tp_src.unpack,
+ const.OFPAT_SET_TP_DST : set_tp_dst.unpack,
+ const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
+ const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
const.OFPAT_SET_MPLS_LABEL : set_mpls_label.unpack,
const.OFPAT_SET_MPLS_TC : set_mpls_tc.unpack,
const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
- const.OFPAT_SET_NW_DST : set_nw_dst.unpack,
- const.OFPAT_SET_NW_ECN : set_nw_ecn.unpack,
- const.OFPAT_SET_NW_SRC : set_nw_src.unpack,
- const.OFPAT_SET_NW_TOS : set_nw_tos.unpack,
- const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
+ const.OFPAT_PUSH_VLAN : push_vlan.unpack,
+ const.OFPAT_POP_VLAN : pop_vlan.unpack,
+ const.OFPAT_PUSH_MPLS : push_mpls.unpack,
+ const.OFPAT_POP_MPLS : pop_mpls.unpack,
const.OFPAT_SET_QUEUE : set_queue.unpack,
- const.OFPAT_SET_TP_DST : set_tp_dst.unpack,
- const.OFPAT_SET_TP_SRC : set_tp_src.unpack,
- const.OFPAT_SET_VLAN_PCP : set_vlan_pcp.unpack,
- const.OFPAT_SET_VLAN_VID : set_vlan_vid.unpack,
+ const.OFPAT_GROUP : group.unpack,
+ const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
+ const.OFPAT_EXPERIMENTER : parse_experimenter,
}
experimenter_parsers = {
+ 8992 : {
+ 18: nicira_dec_ttl.unpack,
+ },
+ 6035143 : {
+ 1: bsn_mirror.unpack,
+ 2: bsn_set_tunnel_dst.unpack,
+ },
}
diff --git a/src/python/loxi/of11/common.py b/src/python/loxi/of11/common.py
index 138d451..969b561 100644
--- a/src/python/loxi/of11/common.py
+++ b/src/python/loxi/of11/common.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template common.py
# Do not modify
@@ -97,8 +98,8 @@
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.ipv4_addr = reader.read('!L')[0]
- obj.ipv4_netmask = reader.read('!L')[0]
+ obj.ipv4_addr = reader.read("!L")[0]
+ obj.ipv4_netmask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -135,6 +136,100 @@
q.breakable()
q.text('}')
+class bsn_vport_q_in_q(object):
+ type = 0
+
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None):
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if ingress_tpid != None:
+ self.ingress_tpid = ingress_tpid
+ else:
+ self.ingress_tpid = 0
+ if ingress_vlan_id != None:
+ self.ingress_vlan_id = ingress_vlan_id
+ else:
+ self.ingress_vlan_id = 0
+ if egress_tpid != None:
+ self.egress_tpid = egress_tpid
+ else:
+ self.egress_tpid = 0
+ if egress_vlan_id != None:
+ self.egress_vlan_id = egress_vlan_id
+ else:
+ self.egress_vlan_id = 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
+ packed.append(struct.pack("!L", self.port_no))
+ packed.append(struct.pack("!H", self.ingress_tpid))
+ packed.append(struct.pack("!H", self.ingress_vlan_id))
+ packed.append(struct.pack("!H", self.egress_tpid))
+ packed.append(struct.pack("!H", self.egress_vlan_id))
+ length = sum([len(x) for x in packed])
+ packed[1] = struct.pack("!H", length)
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_vport_q_in_q()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.port_no = reader.read("!L")[0]
+ obj.ingress_tpid = reader.read("!H")[0]
+ obj.ingress_vlan_id = reader.read("!H")[0]
+ obj.egress_tpid = reader.read("!H")[0]
+ obj.egress_vlan_id = reader.read("!H")[0]
+ return obj
+
+ def __eq__(self, other):
+ if type(self) != type(other): return False
+ if self.port_no != other.port_no: return False
+ if self.ingress_tpid != other.ingress_tpid: return False
+ if self.ingress_vlan_id != other.ingress_vlan_id: return False
+ if self.egress_tpid != other.egress_tpid: return False
+ if self.egress_vlan_id != other.egress_vlan_id: 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_vport_q_in_q {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("port_no = ");
+ q.text("%#x" % self.port_no)
+ q.text(","); q.breakable()
+ q.text("ingress_tpid = ");
+ q.text("%#x" % self.ingress_tpid)
+ q.text(","); q.breakable()
+ q.text("ingress_vlan_id = ");
+ q.text("%#x" % self.ingress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("egress_tpid = ");
+ q.text("%#x" % self.egress_tpid)
+ q.text(","); q.breakable()
+ q.text("egress_vlan_id = ");
+ q.text("%#x" % self.egress_vlan_id)
+ q.breakable()
+ q.text('}')
+
class bucket(object):
def __init__(self, weight=None, watch_port=None, watch_group=None, actions=None):
@@ -160,10 +255,10 @@
packed = []
packed.append(struct.pack("!H", 0)) # placeholder for len at index 0
packed.append(struct.pack("!H", self.weight))
- packed.append(struct.pack("!L", self.watch_port))
+ packed.append(util.pack_port_no(self.watch_port))
packed.append(struct.pack("!L", self.watch_group))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -175,10 +270,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _len = reader.read('!H')[0]
- obj.weight = reader.read('!H')[0]
- obj.watch_port = reader.read('!L')[0]
- obj.watch_group = reader.read('!L')[0]
+ _len = reader.read("!H")[0]
+ obj.weight = reader.read("!H")[0]
+ obj.watch_port = util.unpack_port_no(reader)
+ obj.watch_group = reader.read("!L")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -243,8 +338,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -337,7 +432,7 @@
packed.append(struct.pack("!Q", self.packet_count))
packed.append(struct.pack("!Q", self.byte_count))
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -349,18 +444,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(1)
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.priority = reader.read('!H')[0]
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
reader.skip(6)
- obj.cookie = reader.read('!Q')[0]
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
return obj
@@ -450,7 +545,7 @@
packed.append(struct.pack("!B", self.type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
- packed.append("".join([x.pack() for x in self.buckets]))
+ packed.append(util.pack_list(self.buckets))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -462,10 +557,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.type = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.type = reader.read("!B")[0]
reader.skip(1)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
return obj
@@ -533,7 +628,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.packet_count))
packed.append(struct.pack("!Q", self.byte_count))
- packed.append("".join([x.pack() for x in self.bucket_stats]))
+ packed.append(util.pack_list(self.bucket_stats))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -545,13 +640,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
+ _length = reader.read("!H")[0]
reader.skip(2)
- obj.group_id = reader.read('!L')[0]
- obj.ref_count = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
+ obj.ref_count = reader.read("!L")[0]
reader.skip(4)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.bucket_stats = loxi.generic_util.unpack_list(reader, common.bucket_counter.unpack)
return obj
@@ -604,7 +699,7 @@
if wildcards != None:
self.wildcards = wildcards
else:
- self.wildcards = const.OFPFW_ALL
+ self.wildcards = util.init_wc_bmap()
if eth_src != None:
self.eth_src = eth_src
else:
@@ -687,8 +782,8 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append(struct.pack("!L", self.in_port))
- packed.append(struct.pack("!L", self.wildcards))
+ packed.append(util.pack_port_no(self.in_port))
+ packed.append(util.pack_wc_bmap(self.wildcards))
packed.append(struct.pack("!6B", *self.eth_src))
packed.append(struct.pack("!6B", *self.eth_src_mask))
packed.append(struct.pack("!6B", *self.eth_dst))
@@ -721,32 +816,32 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
assert(_type == 0)
- _length = reader.read('!H')[0]
- obj.in_port = reader.read('!L')[0]
- obj.wildcards = reader.read('!L')[0]
+ _length = reader.read("!H")[0]
+ obj.in_port = util.unpack_port_no(reader)
+ obj.wildcards = util.unpack_wc_bmap(reader)
obj.eth_src = list(reader.read('!6B'))
obj.eth_src_mask = list(reader.read('!6B'))
obj.eth_dst = list(reader.read('!6B'))
obj.eth_dst_mask = list(reader.read('!6B'))
- obj.vlan_vid = reader.read('!H')[0]
- obj.vlan_pcp = reader.read('!B')[0]
+ obj.vlan_vid = reader.read("!H")[0]
+ obj.vlan_pcp = reader.read("!B")[0]
reader.skip(1)
- obj.eth_type = reader.read('!H')[0]
- obj.ip_dscp = reader.read('!B')[0]
- obj.ip_proto = reader.read('!B')[0]
- obj.ipv4_src = reader.read('!L')[0]
- obj.ipv4_src_mask = reader.read('!L')[0]
- obj.ipv4_dst = reader.read('!L')[0]
- obj.ipv4_dst_mask = reader.read('!L')[0]
- obj.tcp_src = reader.read('!H')[0]
- obj.tcp_dst = reader.read('!H')[0]
- obj.mpls_label = reader.read('!L')[0]
- obj.mpls_tc = reader.read('!B')[0]
+ obj.eth_type = reader.read("!H")[0]
+ obj.ip_dscp = reader.read("!B")[0]
+ obj.ip_proto = reader.read("!B")[0]
+ obj.ipv4_src = reader.read("!L")[0]
+ obj.ipv4_src_mask = reader.read("!L")[0]
+ obj.ipv4_dst = reader.read("!L")[0]
+ obj.ipv4_dst_mask = reader.read("!L")[0]
+ obj.tcp_src = reader.read("!H")[0]
+ obj.tcp_dst = reader.read("!H")[0]
+ obj.mpls_label = reader.read("!L")[0]
+ obj.mpls_tc = reader.read("!B")[0]
reader.skip(3)
- obj.metadata = reader.read('!Q')[0]
- obj.metadata_mask = reader.read('!Q')[0]
+ obj.metadata = reader.read("!Q")[0]
+ obj.metadata_mask = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -869,7 +964,7 @@
packed.append(struct.pack("!L", self.queue_id))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 2)
- packed.append("".join([x.pack() for x in self.properties]))
+ packed.append(util.pack_list(self.properties))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -881,8 +976,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.queue_id = reader.read('!L')[0]
- _len = reader.read('!H')[0]
+ obj.queue_id = reader.read("!L")[0]
+ _len = reader.read("!H")[0]
reader.skip(2)
obj.properties = common.unpack_list_queue_prop(reader)
return obj
@@ -964,7 +1059,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append('\x00' * 2)
@@ -986,19 +1081,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.config = reader.read('!L')[0]
- obj.state = reader.read('!L')[0]
- obj.curr = reader.read('!L')[0]
- obj.advertised = reader.read('!L')[0]
- obj.supported = reader.read('!L')[0]
- obj.peer = reader.read('!L')[0]
- obj.curr_speed = reader.read('!L')[0]
- obj.max_speed = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.state = reader.read("!L")[0]
+ obj.curr = reader.read("!L")[0]
+ obj.advertised = reader.read("!L")[0]
+ obj.supported = reader.read("!L")[0]
+ obj.peer = reader.read("!L")[0]
+ obj.curr_speed = reader.read("!L")[0]
+ obj.max_speed = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1122,7 +1217,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.rx_packets))
packed.append(struct.pack("!Q", self.tx_packets))
@@ -1145,20 +1240,20 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
- obj.rx_packets = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.rx_bytes = reader.read('!Q')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.rx_dropped = reader.read('!Q')[0]
- obj.tx_dropped = reader.read('!Q')[0]
- obj.rx_errors = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
- obj.rx_frame_err = reader.read('!Q')[0]
- obj.rx_over_err = reader.read('!Q')[0]
- obj.rx_crc_err = reader.read('!Q')[0]
- obj.collisions = reader.read('!Q')[0]
+ obj.rx_packets = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.rx_bytes = reader.read("!Q")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.rx_dropped = reader.read("!Q")[0]
+ obj.tx_dropped = reader.read("!Q")[0]
+ obj.rx_errors = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
+ obj.rx_frame_err = reader.read("!Q")[0]
+ obj.rx_over_err = reader.read("!Q")[0]
+ obj.rx_crc_err = reader.read("!Q")[0]
+ obj.collisions = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1232,7 +1327,7 @@
q.text('}')
class queue_prop_min_rate(object):
- type = const.OFPQT_MIN_RATE
+ type = 1
def __init__(self, rate=None):
if rate != None:
@@ -1259,11 +1354,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_MIN_RATE)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.rate = reader.read('!H')[0]
+ obj.rate = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -1316,7 +1411,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!L", self.queue_id))
packed.append(struct.pack("!Q", self.tx_bytes))
packed.append(struct.pack("!Q", self.tx_packets))
@@ -1330,11 +1425,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
- obj.queue_id = reader.read('!L')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.queue_id = reader.read("!L")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1389,11 +1484,11 @@
if wildcards != None:
self.wildcards = wildcards
else:
- self.wildcards = const.OFPFW_ALL
+ self.wildcards = util.init_wc_bmap()
if match != None:
self.match = match
else:
- self.match = const.OFPFW_ALL
+ self.match = util.init_match_bmap()
if instructions != None:
self.instructions = instructions
else:
@@ -1433,8 +1528,8 @@
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 7)
packed.append(struct.pack("!32s", self.name))
- packed.append(struct.pack("!L", self.wildcards))
- packed.append(struct.pack("!L", self.match))
+ packed.append(util.pack_wc_bmap(self.wildcards))
+ packed.append(util.pack_match_bmap(self.match))
packed.append(struct.pack("!L", self.instructions))
packed.append(struct.pack("!L", self.write_actions))
packed.append(struct.pack("!L", self.apply_actions))
@@ -1452,19 +1547,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(7)
obj.name = reader.read("!32s")[0].rstrip("\x00")
- obj.wildcards = reader.read('!L')[0]
- obj.match = reader.read('!L')[0]
- obj.instructions = reader.read('!L')[0]
- obj.write_actions = reader.read('!L')[0]
- obj.apply_actions = reader.read('!L')[0]
- obj.config = reader.read('!L')[0]
- obj.max_entries = reader.read('!L')[0]
- obj.active_count = reader.read('!L')[0]
- obj.lookup_count = reader.read('!Q')[0]
- obj.matched_count = reader.read('!Q')[0]
+ obj.wildcards = util.unpack_wc_bmap(reader)
+ obj.match = util.unpack_match_bmap(reader)
+ obj.instructions = reader.read("!L")[0]
+ obj.write_actions = reader.read("!L")[0]
+ obj.apply_actions = reader.read("!L")[0]
+ obj.config = reader.read("!L")[0]
+ obj.max_entries = reader.read("!L")[0]
+ obj.active_count = reader.read("!L")[0]
+ obj.lookup_count = reader.read("!Q")[0]
+ obj.matched_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
diff --git a/src/python/loxi/of11/const.py b/src/python/loxi/of11/const.py
index b6cca94..bd0fd11 100644
--- a/src/python/loxi/of11/const.py
+++ b/src/python/loxi/of11/const.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template const.py
# Do not modify
@@ -8,24 +9,24 @@
OFP_VERSION = 2
# Identifiers from group macro_definitions
-OFP_VLAN_NONE = 0
-OFP_FLOW_PERMANENT = 0
-OFP_ETH_ALEN = 6
-OFP_MAX_PORT_NAME_LEN = 16
OFP_MAX_TABLE_NAME_LEN = 32
-SERIAL_NUM_LEN = 32
-OFPFW_ICMP_TYPE = 64
-OFPMT_STANDARD_LENGTH = 88
-OFP_DEFAULT_MISS_SEND_LEN = 128
-OFPFW_ICMP_CODE = 128
-DESC_STR_LEN = 256
-OFP_DL_TYPE_NOT_ETH_TYPE = 1535
-OFP_DL_TYPE_ETH2_CUTOFF = 1536
+OFP_MAX_PORT_NAME_LEN = 16
OFP_TCP_PORT = 6633
OFP_SSL_PORT = 6633
+OFP_ETH_ALEN = 6
+OFP_DEFAULT_MISS_SEND_LEN = 128
+OFPFW_ICMP_TYPE = 64
+OFPFW_ICMP_CODE = 128
+OFP_DL_TYPE_ETH2_CUTOFF = 1536
+OFP_DL_TYPE_NOT_ETH_TYPE = 1535
+OFP_VLAN_NONE = 0
+OFPMT_STANDARD_LENGTH = 88
+OFP_FLOW_PERMANENT = 0
OFP_DEFAULT_PRIORITY = 32768
-OFPQ_MIN_RATE_UNCFG = 65535
+DESC_STR_LEN = 256
+SERIAL_NUM_LEN = 32
OFPQ_ALL = 4294967295
+OFPQ_MIN_RATE_UNCFG = 65535
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
@@ -178,6 +179,13 @@
9: 'OFPBRC_BAD_TABLE_ID',
}
+# Identifiers from group ofp_bsn_vport_q_in_q_untagged
+OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
+
+ofp_bsn_vport_q_in_q_untagged_map = {
+ 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
+}
+
# Identifiers from group ofp_capabilities
OFPC_FLOW_STATS = 1
OFPC_TABLE_STATS = 2
diff --git a/src/python/loxi/of11/instruction.py b/src/python/loxi/of11/instruction.py
index 52ee289..961f3c6 100644
--- a/src/python/loxi/of11/instruction.py
+++ b/src/python/loxi/of11/instruction.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template instruction.py
# Do not modify
@@ -24,7 +25,7 @@
pass
class apply_actions(Instruction):
- type = const.OFPIT_APPLY_ACTIONS
+ type = 4
def __init__(self, actions=None):
if actions != None:
@@ -38,7 +39,7 @@
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -50,9 +51,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_APPLY_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 4)
+ _len = reader.read("!H")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -80,7 +81,7 @@
q.text('}')
class clear_actions(Instruction):
- type = const.OFPIT_CLEAR_ACTIONS
+ type = 5
def __init__(self):
return
@@ -101,9 +102,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_CLEAR_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 5)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -127,7 +128,7 @@
q.text('}')
class experimenter(Instruction):
- type = const.OFPIT_EXPERIMENTER
+ type = 65535
def __init__(self, experimenter=None, data=None):
if experimenter != None:
@@ -137,7 +138,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
return
def pack(self):
@@ -157,10 +158,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -191,7 +192,7 @@
q.text('}')
class goto_table(Instruction):
- type = const.OFPIT_GOTO_TABLE
+ type = 1
def __init__(self, table_id=None):
if table_id != None:
@@ -217,10 +218,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_GOTO_TABLE)
- _len = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -247,7 +248,7 @@
q.text('}')
class write_actions(Instruction):
- type = const.OFPIT_WRITE_ACTIONS
+ type = 3
def __init__(self, actions=None):
if actions != None:
@@ -261,7 +262,7 @@
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -273,9 +274,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_WRITE_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 3)
+ _len = reader.read("!H")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -303,7 +304,7 @@
q.text('}')
class write_metadata(Instruction):
- type = const.OFPIT_WRITE_METADATA
+ type = 2
def __init__(self, metadata=None, metadata_mask=None):
if metadata != None:
@@ -334,12 +335,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_WRITE_METADATA)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.metadata = reader.read('!Q')[0]
- obj.metadata_mask = reader.read('!Q')[0]
+ obj.metadata = reader.read("!Q")[0]
+ obj.metadata_mask = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -370,10 +371,10 @@
parsers = {
+ const.OFPIT_GOTO_TABLE : goto_table.unpack,
+ const.OFPIT_WRITE_METADATA : write_metadata.unpack,
+ const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
const.OFPIT_APPLY_ACTIONS : apply_actions.unpack,
const.OFPIT_CLEAR_ACTIONS : clear_actions.unpack,
const.OFPIT_EXPERIMENTER : experimenter.unpack,
- const.OFPIT_GOTO_TABLE : goto_table.unpack,
- const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
- const.OFPIT_WRITE_METADATA : write_metadata.unpack,
}
diff --git a/src/python/loxi/of11/message.py b/src/python/loxi/of11/message.py
index 8d922b5..12aa4a1 100644
--- a/src/python/loxi/of11/message.py
+++ b/src/python/loxi/of11/message.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template message.py
# Do not modify
@@ -20,9 +21,9 @@
xid = None
class aggregate_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_AGGREGATE
+ version = 2
+ type = 19
+ stats_type = 2
def __init__(self, xid=None, flags=None, packet_count=None, byte_count=None, flow_count=None):
self.xid = xid
@@ -68,19 +69,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_AGGREGATE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 2)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
- obj.flow_count = reader.read('!L')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
+ obj.flow_count = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -131,9 +132,9 @@
q.text('}')
class aggregate_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_AGGREGATE
+ version = 2
+ type = 18
+ stats_type = 2
def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
self.xid = xid
@@ -177,7 +178,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 3)
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.cookie))
@@ -195,23 +196,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_AGGREGATE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 2)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
reader.skip(4)
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -274,8 +275,8 @@
q.text('}')
class barrier_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REPLY
+ version = 2
+ type = 21
def __init__(self, xid=None):
self.xid = xid
@@ -298,12 +299,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 21)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -337,8 +338,8 @@
q.text('}')
class barrier_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REQUEST
+ version = 2
+ type = 20
def __init__(self, xid=None):
self.xid = xid
@@ -361,12 +362,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 20)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -399,10 +400,486 @@
q.breakable()
q.text('}')
+class bsn_bw_clear_data_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 22
+
+ 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_bw_clear_data_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 == 22)
+ 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_bw_clear_data_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_bw_clear_data_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 21
+
+ 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_bw_clear_data_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 == 21)
+ 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_bw_clear_data_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_bw_enable_get_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 20
+
+ 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_bw_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 == 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 == 20)
+ 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_bw_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_bw_enable_get_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 19
+
+ 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_bw_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 == 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 == 19)
+ 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_bw_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_bw_enable_set_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 23
+
+ 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_bw_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 == 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 == 23)
+ 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_bw_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_bw_enable_set_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 18
+
+ 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_bw_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 == 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 == 18)
+ 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_bw_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 = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 2
+ type = 4
+ experimenter = 6035143
subtype = 10
def __init__(self, xid=None, interfaces=None):
@@ -420,7 +897,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!L", self.experimenter))
packed.append(struct.pack("!L", self.subtype))
- packed.append("".join([x.pack() for x in self.interfaces]))
+ packed.append(util.pack_list(self.interfaces))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -433,15 +910,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 10)
obj.interfaces = loxi.generic_util.unpack_list(reader, common.bsn_interface.unpack)
return obj
@@ -481,9 +958,9 @@
q.text('}')
class bsn_get_interfaces_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 2
+ type = 4
+ experimenter = 6035143
subtype = 9
def __init__(self, xid=None):
@@ -509,15 +986,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 9)
return obj
@@ -552,9 +1029,9 @@
q.text('}')
class bsn_get_mirroring_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 2
+ type = 4
+ experimenter = 6035143
subtype = 5
def __init__(self, xid=None, report_mirror_ports=None):
@@ -586,17 +1063,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 5)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -635,9 +1112,9 @@
q.text('}')
class bsn_get_mirroring_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 2
+ type = 4
+ experimenter = 6035143
subtype = 4
def __init__(self, xid=None, report_mirror_ports=None):
@@ -669,17 +1146,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 4)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -718,9 +1195,9 @@
q.text('}')
class bsn_set_mirroring(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 2
+ type = 4
+ experimenter = 6035143
subtype = 3
def __init__(self, xid=None, report_mirror_ports=None):
@@ -752,17 +1229,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 3)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -800,10 +1277,91 @@
q.breakable()
q.text('}')
-class bsn_set_pktin_suppression(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+class bsn_set_pktin_suppression_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 25
+
+ 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_set_pktin_suppression_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 == 25)
+ 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_set_pktin_suppression_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_set_pktin_suppression_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
subtype = 11
def __init__(self, xid=None, enabled=None, idle_timeout=None, hard_timeout=None, priority=None, cookie=None):
@@ -850,27 +1408,27 @@
@staticmethod
def unpack(buf):
if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = bsn_set_pktin_suppression()
+ obj = bsn_set_pktin_suppression_request()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 11)
- obj.enabled = reader.read('!B')[0]
+ obj.enabled = reader.read("!B")[0]
reader.skip(1)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.cookie = reader.read('!Q')[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.cookie = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -896,7 +1454,7 @@
return loxi.pp.pp(self)
def pretty_print(self, q):
- q.text("bsn_set_pktin_suppression {")
+ q.text("bsn_set_pktin_suppression_request {")
with q.group():
with q.indent(2):
q.breakable()
@@ -923,10 +1481,344 @@
q.breakable()
q.text('}')
+class bsn_virtual_port_create_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 16
+
+ def __init__(self, xid=None, status=None, vport_no=None):
+ self.xid = xid
+ if status != None:
+ self.status = status
+ else:
+ self.status = 0
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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))
+ packed.append(struct.pack("!L", self.vport_no))
+ 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_virtual_port_create_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 == 16)
+ obj.status = reader.read("!L")[0]
+ obj.vport_no = 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
+ if self.vport_no != other.vport_no: 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_virtual_port_create_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.text(","); q.breakable()
+ q.text("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_create_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 15
+
+ def __init__(self, xid=None, vport=None):
+ self.xid = xid
+ if vport != None:
+ self.vport = vport
+ else:
+ self.vport = common.bsn_vport_q_in_q()
+
+ 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(self.vport.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_virtual_port_create_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 == 15)
+ obj.vport = common.bsn_vport_q_in_q.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.vport != other.vport: 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_virtual_port_create_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("vport = ");
+ q.pp(self.vport)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_remove_reply(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 26
+
+ 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_virtual_port_remove_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 == 26)
+ 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_virtual_port_remove_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_virtual_port_remove_request(Message):
+ version = 2
+ type = 4
+ experimenter = 6035143
+ subtype = 17
+
+ def __init__(self, xid=None, vport_no=None):
+ self.xid = xid
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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.vport_no))
+ 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_virtual_port_remove_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 == 17)
+ obj.vport_no = 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.vport_no != other.vport_no: 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_virtual_port_remove_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("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
class desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_DESC
+ version = 2
+ type = 19
+ stats_type = 0
def __init__(self, xid=None, flags=None, mfr_desc=None, hw_desc=None, sw_desc=None, serial_num=None, dp_desc=None):
self.xid = xid
@@ -981,15 +1873,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 0)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.mfr_desc = reader.read("!256s")[0].rstrip("\x00")
obj.hw_desc = reader.read("!256s")[0].rstrip("\x00")
@@ -1053,9 +1945,9 @@
q.text('}')
class desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_DESC
+ version = 2
+ type = 18
+ stats_type = 0
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -1085,15 +1977,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 0)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -1132,15 +2024,15 @@
q.text('}')
class echo_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REPLY
+ version = 2
+ type = 3
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1161,12 +2053,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 3)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1205,15 +2097,15 @@
q.text('}')
class echo_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REQUEST
+ version = 2
+ type = 2
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1234,12 +2126,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 2)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1278,8 +2170,8 @@
q.text('}')
class error_msg(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ERROR
+ version = 2
+ type = 1
def __init__(self, xid=None, err_type=None, code=None, data=None):
self.xid = xid
@@ -1294,7 +2186,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1317,14 +2209,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ERROR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.err_type = reader.read('!H')[0]
- obj.code = reader.read('!H')[0]
+ _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
@@ -1371,9 +2263,9 @@
q.text('}')
class experimenter_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_EXPERIMENTER
+ version = 2
+ type = 19
+ stats_type = 65535
def __init__(self, xid=None, flags=None, experimenter=None, data=None):
self.xid = xid
@@ -1388,7 +2280,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1414,17 +2306,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_EXPERIMENTER)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 65535)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.experimenter = reader.read('!L')[0]
+ obj.experimenter = reader.read("!L")[0]
reader.skip(4)
obj.data = str(reader.read_all())
return obj
@@ -1472,9 +2364,9 @@
q.text('}')
class experimenter_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_EXPERIMENTER
+ version = 2
+ type = 18
+ stats_type = 65535
def __init__(self, xid=None, flags=None, experimenter=None, data=None):
self.xid = xid
@@ -1489,7 +2381,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1515,17 +2407,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_EXPERIMENTER)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 65535)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.experimenter = reader.read('!L')[0]
+ obj.experimenter = reader.read("!L")[0]
reader.skip(4)
obj.data = str(reader.read_all())
return obj
@@ -1573,8 +2465,8 @@
q.text('}')
class features_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REPLY
+ version = 2
+ type = 6
def __init__(self, xid=None, datapath_id=None, n_buffers=None, n_tables=None, capabilities=None, reserved=None, ports=None):
self.xid = xid
@@ -1615,7 +2507,7 @@
packed.append('\x00' * 3)
packed.append(struct.pack("!L", self.capabilities))
packed.append(struct.pack("!L", self.reserved))
- packed.append("".join([x.pack() for x in self.ports]))
+ packed.append(util.pack_list(self.ports))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -1628,18 +2520,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.datapath_id = reader.read('!Q')[0]
- obj.n_buffers = reader.read('!L')[0]
- obj.n_tables = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 6)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.datapath_id = reader.read("!Q")[0]
+ obj.n_buffers = reader.read("!L")[0]
+ obj.n_tables = reader.read("!B")[0]
reader.skip(3)
- obj.capabilities = reader.read('!L')[0]
- obj.reserved = reader.read('!L')[0]
+ obj.capabilities = reader.read("!L")[0]
+ obj.reserved = reader.read("!L")[0]
obj.ports = loxi.generic_util.unpack_list(reader, common.port_desc.unpack)
return obj
@@ -1698,8 +2590,8 @@
q.text('}')
class features_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REQUEST
+ version = 2
+ type = 5
def __init__(self, xid=None):
self.xid = xid
@@ -1722,12 +2614,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 5)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1761,9 +2653,9 @@
q.text('}')
class flow_add(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_ADD
+ version = 2
+ type = 14
+ _command = 0
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -1825,17 +2717,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -1848,24 +2740,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_ADD)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 0)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -1950,9 +2842,9 @@
q.text('}')
class flow_delete(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE
+ version = 2
+ type = 14
+ _command = 3
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2014,17 +2906,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2037,24 +2929,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_DELETE)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 3)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2139,9 +3031,9 @@
q.text('}')
class flow_delete_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE_STRICT
+ version = 2
+ type = 14
+ _command = 4
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2203,17 +3095,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2226,24 +3118,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_DELETE_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 4)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2328,9 +3220,9 @@
q.text('}')
class flow_modify(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY
+ version = 2
+ type = 14
+ _command = 1
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2392,17 +3284,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2415,24 +3307,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_MODIFY)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 1)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2517,9 +3409,9 @@
q.text('}')
class flow_modify_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY_STRICT
+ version = 2
+ type = 14
+ _command = 2
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2581,17 +3473,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2604,24 +3496,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_MODIFY_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 2)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2706,8 +3598,8 @@
q.text('}')
class flow_removed(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_REMOVED
+ version = 2
+ type = 11
def __init__(self, xid=None, cookie=None, priority=None, reason=None, table_id=None, duration_sec=None, duration_nsec=None, idle_timeout=None, packet_count=None, byte_count=None, match=None):
self.xid = xid
@@ -2781,22 +3673,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_REMOVED)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.priority = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
- obj.table_id = reader.read('!B')[0]
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.idle_timeout = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 11)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.reason = reader.read("!B")[0]
+ obj.table_id = reader.read("!B")[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.idle_timeout = reader.read("!H")[0]
reader.skip(2)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -2871,9 +3763,9 @@
q.text('}')
class flow_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_FLOW
+ version = 2
+ type = 19
+ stats_type = 1
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -2895,7 +3787,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2908,15 +3800,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_FLOW)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 1)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_flow_stats_entry(reader)
return obj
@@ -2960,9 +3852,9 @@
q.text('}')
class flow_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_FLOW
+ version = 2
+ type = 18
+ stats_type = 1
def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
self.xid = xid
@@ -3006,7 +3898,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 3)
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.cookie))
@@ -3024,23 +3916,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_FLOW)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 1)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
reader.skip(4)
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -3103,8 +3995,8 @@
q.text('}')
class get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REPLY
+ version = 2
+ type = 8
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -3137,14 +4029,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 8)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3186,8 +4078,8 @@
q.text('}')
class get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REQUEST
+ version = 2
+ type = 7
def __init__(self, xid=None):
self.xid = xid
@@ -3210,12 +4102,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 7)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3249,9 +4141,9 @@
q.text('}')
class group_desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_GROUP_DESC
+ version = 2
+ type = 19
+ stats_type = 7
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -3273,7 +4165,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3286,15 +4178,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 7)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_group_desc_stats_entry(reader)
return obj
@@ -3338,9 +4230,9 @@
q.text('}')
class group_desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_GROUP_DESC
+ version = 2
+ type = 18
+ stats_type = 7
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -3370,15 +4262,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 7)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -3417,8 +4309,8 @@
q.text('}')
class group_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GROUP_MOD
+ version = 2
+ type = 15
def __init__(self, xid=None, command=None, group_type=None, group_id=None, buckets=None):
self.xid = xid
@@ -3449,7 +4341,7 @@
packed.append(struct.pack("!B", self.group_type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
- packed.append("".join([x.pack() for x in self.buckets]))
+ packed.append(util.pack_list(self.buckets))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3462,16 +4354,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GROUP_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.command = reader.read('!H')[0]
- obj.group_type = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 15)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.command = reader.read("!H")[0]
+ obj.group_type = reader.read("!B")[0]
reader.skip(1)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
return obj
@@ -3522,9 +4414,9 @@
q.text('}')
class group_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_GROUP
+ version = 2
+ type = 19
+ stats_type = 6
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -3546,7 +4438,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3559,15 +4451,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 6)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_group_stats_entry(reader)
return obj
@@ -3611,9 +4503,9 @@
q.text('}')
class group_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_GROUP
+ version = 2
+ type = 18
+ stats_type = 6
def __init__(self, xid=None, flags=None, group_id=None):
self.xid = xid
@@ -3649,17 +4541,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 6)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -3702,8 +4594,8 @@
q.text('}')
class hello(Message):
- version = const.OFP_VERSION
- type = const.OFPT_HELLO
+ version = 2
+ type = 0
def __init__(self, xid=None):
self.xid = xid
@@ -3726,12 +4618,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_HELLO)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3765,8 +4657,8 @@
q.text('}')
class packet_in(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_IN
+ version = 2
+ type = 10
def __init__(self, xid=None, buffer_id=None, in_port=None, in_phy_port=None, total_len=None, reason=None, table_id=None, data=None):
self.xid = xid
@@ -3797,7 +4689,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -3806,8 +4698,8 @@
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.buffer_id))
- packed.append(struct.pack("!L", self.in_port))
- packed.append(struct.pack("!L", self.in_phy_port))
+ packed.append(util.pack_port_no(self.in_port))
+ packed.append(util.pack_port_no(self.in_phy_port))
packed.append(struct.pack("!H", self.total_len))
packed.append(struct.pack("!B", self.reason))
packed.append(struct.pack("!B", self.table_id))
@@ -3824,18 +4716,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_IN)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.in_port = reader.read('!L')[0]
- obj.in_phy_port = reader.read('!L')[0]
- obj.total_len = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
- obj.table_id = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 10)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.in_port = util.unpack_port_no(reader)
+ obj.in_phy_port = util.unpack_port_no(reader)
+ obj.total_len = reader.read("!H")[0]
+ obj.reason = reader.read("!B")[0]
+ obj.table_id = reader.read("!B")[0]
obj.data = str(reader.read_all())
return obj
@@ -3898,8 +4790,8 @@
q.text('}')
class packet_out(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_OUT
+ version = 2
+ type = 13
def __init__(self, xid=None, buffer_id=None, in_port=None, actions=None, data=None):
self.xid = xid
@@ -3918,7 +4810,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -3927,10 +4819,10 @@
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.buffer_id))
- packed.append(struct.pack("!L", self.in_port))
+ packed.append(util.pack_port_no(self.in_port))
packed.append(struct.pack("!H", 0)) # placeholder for actions_len at index 6
packed.append('\x00' * 6)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
packed[6] = struct.pack("!H", len(packed[-1]))
packed.append(self.data)
length = sum([len(x) for x in packed])
@@ -3945,15 +4837,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_OUT)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.in_port = reader.read('!L')[0]
- _actions_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 13)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.in_port = util.unpack_port_no(reader)
+ _actions_len = reader.read("!H")[0]
reader.skip(6)
obj.actions = action.unpack_list(reader.slice(_actions_len))
obj.data = str(reader.read_all())
@@ -4006,8 +4898,8 @@
q.text('}')
class port_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_MOD
+ version = 2
+ type = 16
def __init__(self, xid=None, port_no=None, hw_addr=None, config=None, mask=None, advertise=None):
self.xid = xid
@@ -4038,7 +4930,7 @@
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.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append('\x00' * 2)
@@ -4058,19 +4950,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port_no = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
- obj.config = reader.read('!L')[0]
- obj.mask = reader.read('!L')[0]
- obj.advertise = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.mask = reader.read("!L")[0]
+ obj.advertise = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -4125,9 +5017,9 @@
q.text('}')
class port_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_PORT
+ version = 2
+ type = 19
+ stats_type = 4
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -4149,7 +5041,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4162,15 +5054,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_PORT)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 4)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.port_stats_entry.unpack)
return obj
@@ -4214,9 +5106,9 @@
q.text('}')
class port_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_PORT
+ version = 2
+ type = 18
+ stats_type = 4
def __init__(self, xid=None, flags=None, port_no=None):
self.xid = xid
@@ -4238,7 +5130,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4252,17 +5144,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_PORT)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 4)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
return obj
@@ -4305,8 +5197,8 @@
q.text('}')
class port_status(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_STATUS
+ version = 2
+ type = 12
def __init__(self, xid=None, reason=None, desc=None):
self.xid = xid
@@ -4340,13 +5232,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_STATUS)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.reason = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 12)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.reason = reader.read("!B")[0]
reader.skip(7)
obj.desc = common.port_desc.unpack(reader)
return obj
@@ -4390,8 +5282,8 @@
q.text('}')
class queue_get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REPLY
+ version = 2
+ type = 23
def __init__(self, xid=None, port=None, queues=None):
self.xid = xid
@@ -4410,9 +5302,9 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.queues]))
+ packed.append(util.pack_list(self.queues))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4425,13 +5317,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 23)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(4)
obj.queues = common.unpack_list_packet_queue(reader)
return obj
@@ -4475,8 +5367,8 @@
q.text('}')
class queue_get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REQUEST
+ version = 2
+ type = 22
def __init__(self, xid=None, port=None):
self.xid = xid
@@ -4491,7 +5383,7 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 4)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4505,13 +5397,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 22)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(4)
return obj
@@ -4550,9 +5442,9 @@
q.text('}')
class queue_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_QUEUE
+ version = 2
+ type = 19
+ stats_type = 5
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -4574,7 +5466,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4587,15 +5479,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_QUEUE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 5)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.queue_stats_entry.unpack)
return obj
@@ -4639,9 +5531,9 @@
q.text('}')
class queue_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_QUEUE
+ version = 2
+ type = 18
+ stats_type = 5
def __init__(self, xid=None, flags=None, port_no=None, queue_id=None):
self.xid = xid
@@ -4667,7 +5559,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!L", self.queue_id))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4681,18 +5573,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_QUEUE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 5)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.port_no = reader.read('!L')[0]
- obj.queue_id = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -4738,8 +5630,8 @@
q.text('}')
class set_config(Message):
- version = const.OFP_VERSION
- type = const.OFPT_SET_CONFIG
+ version = 2
+ type = 9
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -4772,14 +5664,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_SET_CONFIG)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 9)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -4821,8 +5713,8 @@
q.text('}')
class table_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_TABLE_MOD
+ version = 2
+ type = 17
def __init__(self, xid=None, table_id=None, config=None):
self.xid = xid
@@ -4856,15 +5748,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_TABLE_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.table_id = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.config = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -4906,9 +5798,9 @@
q.text('}')
class table_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_TABLE
+ version = 2
+ type = 19
+ stats_type = 3
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -4930,7 +5822,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4943,15 +5835,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_TABLE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 3)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.table_stats_entry.unpack)
return obj
@@ -4995,9 +5887,9 @@
q.text('}')
class table_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_TABLE
+ version = 2
+ type = 18
+ stats_type = 3
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -5027,15 +5919,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_TABLE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 2)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 3)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -5135,30 +6027,30 @@
raise loxi.ProtocolError("unexpected experimenter %#x subtype %#x" % (experimenter, subtype))
parsers = {
- const.OFPT_BARRIER_REPLY : barrier_reply.unpack,
- const.OFPT_BARRIER_REQUEST : barrier_request.unpack,
- const.OFPT_ECHO_REPLY : echo_reply.unpack,
- const.OFPT_ECHO_REQUEST : echo_request.unpack,
- const.OFPT_ERROR : error_msg.unpack,
- const.OFPT_EXPERIMENTER : parse_experimenter,
- const.OFPT_FEATURES_REPLY : features_reply.unpack,
- const.OFPT_FEATURES_REQUEST : features_request.unpack,
- const.OFPT_FLOW_MOD : parse_flow_mod,
- const.OFPT_FLOW_REMOVED : flow_removed.unpack,
- const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
- const.OFPT_GET_CONFIG_REQUEST : get_config_request.unpack,
- const.OFPT_GROUP_MOD : group_mod.unpack,
const.OFPT_HELLO : hello.unpack,
- const.OFPT_PACKET_IN : packet_in.unpack,
- const.OFPT_PACKET_OUT : packet_out.unpack,
- const.OFPT_PORT_MOD : port_mod.unpack,
- const.OFPT_PORT_STATUS : port_status.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REQUEST : queue_get_config_request.unpack,
+ const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ECHO_REQUEST : echo_request.unpack,
+ const.OFPT_ECHO_REPLY : echo_reply.unpack,
+ 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,
+ const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
const.OFPT_SET_CONFIG : set_config.unpack,
- const.OFPT_STATS_REPLY : parse_stats_reply,
- const.OFPT_STATS_REQUEST : parse_stats_request,
+ const.OFPT_PACKET_IN : packet_in.unpack,
+ const.OFPT_FLOW_REMOVED : flow_removed.unpack,
+ const.OFPT_PORT_STATUS : port_status.unpack,
+ const.OFPT_PACKET_OUT : packet_out.unpack,
+ const.OFPT_FLOW_MOD : parse_flow_mod,
+ const.OFPT_GROUP_MOD : group_mod.unpack,
+ const.OFPT_PORT_MOD : port_mod.unpack,
const.OFPT_TABLE_MOD : table_mod.unpack,
+ 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,
+ const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
}
flow_mod_parsers = {
@@ -5194,4 +6086,23 @@
}
experimenter_parsers = {
+ 6035143 : {
+ 22: bsn_bw_clear_data_reply.unpack,
+ 21: bsn_bw_clear_data_request.unpack,
+ 20: bsn_bw_enable_get_reply.unpack,
+ 19: bsn_bw_enable_get_request.unpack,
+ 23: bsn_bw_enable_set_reply.unpack,
+ 18: bsn_bw_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,
+ 3: bsn_set_mirroring.unpack,
+ 25: bsn_set_pktin_suppression_reply.unpack,
+ 11: bsn_set_pktin_suppression_request.unpack,
+ 16: bsn_virtual_port_create_reply.unpack,
+ 15: bsn_virtual_port_create_request.unpack,
+ 26: bsn_virtual_port_remove_reply.unpack,
+ 17: bsn_virtual_port_remove_request.unpack,
+ },
}
diff --git a/src/python/loxi/of11/util.py b/src/python/loxi/of11/util.py
index 45aa2d0..13c927a 100644
--- a/src/python/loxi/of11/util.py
+++ b/src/python/loxi/of11/util.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template util.py
# Do not modify
@@ -43,3 +44,36 @@
if v == v2:
return k
return v
+
+def pack_port_no(value):
+ return struct.pack("!L", value)
+
+def unpack_port_no(reader):
+ return reader.read("!L")[0]
+
+def pack_fm_cmd(value):
+ return struct.pack("!B", value)
+
+def unpack_fm_cmd(reader):
+ return reader.read("!B")[0]
+
+def init_wc_bmap():
+ return const.OFPFW_ALL
+
+def pack_wc_bmap(value):
+ return struct.pack("!L", value)
+
+def unpack_wc_bmap(reader):
+ return reader.read("!L")[0]
+
+def init_match_bmap():
+ return const.OFPFW_ALL
+
+def pack_match_bmap(value):
+ return struct.pack("!L", value)
+
+def unpack_match_bmap(reader):
+ return reader.read("!L")[0]
+
+def pack_list(values):
+ return "".join([x.pack() for x in values])
diff --git a/src/python/loxi/of12/__init__.py b/src/python/loxi/of12/__init__.py
index 5610646..ca8395c 100644
--- a/src/python/loxi/of12/__init__.py
+++ b/src/python/loxi/of12/__init__.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template init.py
# Do not modify
diff --git a/src/python/loxi/of12/action.py b/src/python/loxi/of12/action.py
index 8775b88..f1f9272 100644
--- a/src/python/loxi/of12/action.py
+++ b/src/python/loxi/of12/action.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template action.py
# Do not modify
@@ -23,8 +24,8 @@
pass
class bsn_mirror(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 1
def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
@@ -63,16 +64,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 1)
- obj.dest_port = reader.read('!L')[0]
- obj.vlan_tag = reader.read('!L')[0]
- obj.copy_stage = reader.read('!B')[0]
+ obj.dest_port = reader.read("!L")[0]
+ obj.vlan_tag = reader.read("!L")[0]
+ obj.copy_stage = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -107,8 +108,8 @@
q.text('}')
class bsn_set_tunnel_dst(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 2
def __init__(self, dst=None):
@@ -136,14 +137,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 2)
- obj.dst = reader.read('!L')[0]
+ obj.dst = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -169,7 +170,7 @@
q.text('}')
class copy_ttl_in(Action):
- type = const.OFPAT_COPY_TTL_IN
+ type = 12
def __init__(self):
return
@@ -190,9 +191,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_IN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 12)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -216,7 +217,7 @@
q.text('}')
class copy_ttl_out(Action):
- type = const.OFPAT_COPY_TTL_OUT
+ type = 11
def __init__(self):
return
@@ -237,9 +238,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_OUT)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 11)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -263,7 +264,7 @@
q.text('}')
class dec_mpls_ttl(Action):
- type = const.OFPAT_DEC_MPLS_TTL
+ type = 16
def __init__(self):
return
@@ -284,9 +285,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_MPLS_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 16)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -310,7 +311,7 @@
q.text('}')
class dec_nw_ttl(Action):
- type = const.OFPAT_DEC_NW_TTL
+ type = 24
def __init__(self):
return
@@ -331,9 +332,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_NW_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 24)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -357,7 +358,7 @@
q.text('}')
class group(Action):
- type = const.OFPAT_GROUP
+ type = 22
def __init__(self, group_id=None):
if group_id != None:
@@ -382,10 +383,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_GROUP)
- _len = reader.read('!H')[0]
- obj.group_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 22)
+ _len = reader.read("!H")[0]
+ obj.group_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -411,8 +412,8 @@
q.text('}')
class nicira_dec_ttl(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x2320
+ type = 65535
+ experimenter = 8992
subtype = 18
def __init__(self):
@@ -437,12 +438,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 8992)
+ _subtype = reader.read("!H")[0]
assert(_subtype == 18)
reader.skip(2)
reader.skip(4)
@@ -468,7 +469,7 @@
q.text('}')
class output(Action):
- type = const.OFPAT_OUTPUT
+ type = 0
def __init__(self, port=None, max_len=None):
if port != None:
@@ -485,7 +486,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", self.max_len))
packed.append('\x00' * 6)
length = sum([len(x) for x in packed])
@@ -499,11 +500,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_OUTPUT)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!L')[0]
- obj.max_len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
+ obj.max_len = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -534,7 +535,7 @@
q.text('}')
class pop_mpls(Action):
- type = const.OFPAT_POP_MPLS
+ type = 20
def __init__(self, ethertype=None):
if ethertype != None:
@@ -560,10 +561,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 20)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -590,7 +591,7 @@
q.text('}')
class pop_vlan(Action):
- type = const.OFPAT_POP_VLAN
+ type = 18
def __init__(self):
return
@@ -611,9 +612,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_VLAN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 18)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -637,7 +638,7 @@
q.text('}')
class push_mpls(Action):
- type = const.OFPAT_PUSH_MPLS
+ type = 19
def __init__(self, ethertype=None):
if ethertype != None:
@@ -663,10 +664,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 19)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -693,7 +694,7 @@
q.text('}')
class push_vlan(Action):
- type = const.OFPAT_PUSH_VLAN
+ type = 17
def __init__(self, ethertype=None):
if ethertype != None:
@@ -719,10 +720,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_VLAN)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 17)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -749,13 +750,13 @@
q.text('}')
class set_field(Action):
- type = const.OFPAT_SET_FIELD
+ type = 25
def __init__(self, field=None):
if field != None:
self.field = field
else:
- self.field = ""
+ self.field = ''
return
def pack(self):
@@ -774,9 +775,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_FIELD)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 25)
+ _len = reader.read("!H")[0]
obj.field = str(reader.read_all())
return obj
@@ -803,7 +804,7 @@
q.text('}')
class set_mpls_ttl(Action):
- type = const.OFPAT_SET_MPLS_TTL
+ type = 15
def __init__(self, mpls_ttl=None):
if mpls_ttl != None:
@@ -829,10 +830,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_MPLS_TTL)
- _len = reader.read('!H')[0]
- obj.mpls_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 15)
+ _len = reader.read("!H")[0]
+ obj.mpls_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -859,7 +860,7 @@
q.text('}')
class set_nw_ttl(Action):
- type = const.OFPAT_SET_NW_TTL
+ type = 23
def __init__(self, nw_ttl=None):
if nw_ttl != None:
@@ -885,10 +886,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_TTL)
- _len = reader.read('!H')[0]
- obj.nw_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 23)
+ _len = reader.read("!H")[0]
+ obj.nw_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -915,7 +916,7 @@
q.text('}')
class set_queue(Action):
- type = const.OFPAT_SET_QUEUE
+ type = 21
def __init__(self, queue_id=None):
if queue_id != None:
@@ -940,10 +941,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_QUEUE)
- _len = reader.read('!H')[0]
- obj.queue_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 21)
+ _len = reader.read("!H")[0]
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -985,22 +986,29 @@
raise loxi.ProtocolError("unexpected BSN experimenter subtype %#x" % subtype)
parsers = {
- const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
- const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
- const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
- const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
- const.OFPAT_EXPERIMENTER : parse_experimenter,
- const.OFPAT_GROUP : group.unpack,
const.OFPAT_OUTPUT : output.unpack,
- const.OFPAT_POP_MPLS : pop_mpls.unpack,
+ const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
+ const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
+ const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
+ const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
+ const.OFPAT_PUSH_VLAN : push_vlan.unpack,
const.OFPAT_POP_VLAN : pop_vlan.unpack,
const.OFPAT_PUSH_MPLS : push_mpls.unpack,
- const.OFPAT_PUSH_VLAN : push_vlan.unpack,
- const.OFPAT_SET_FIELD : set_field.unpack,
- const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
- const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_POP_MPLS : pop_mpls.unpack,
const.OFPAT_SET_QUEUE : set_queue.unpack,
+ const.OFPAT_GROUP : group.unpack,
+ const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
+ const.OFPAT_SET_FIELD : set_field.unpack,
+ const.OFPAT_EXPERIMENTER : parse_experimenter,
}
experimenter_parsers = {
+ 8992 : {
+ 18: nicira_dec_ttl.unpack,
+ },
+ 6035143 : {
+ 1: bsn_mirror.unpack,
+ 2: bsn_set_tunnel_dst.unpack,
+ },
}
diff --git a/src/python/loxi/of12/common.py b/src/python/loxi/of12/common.py
index 13cc2f4..f2d2493 100644
--- a/src/python/loxi/of12/common.py
+++ b/src/python/loxi/of12/common.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template common.py
# Do not modify
@@ -98,8 +99,8 @@
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.ipv4_addr = reader.read('!L')[0]
- obj.ipv4_netmask = reader.read('!L')[0]
+ obj.ipv4_addr = reader.read("!L")[0]
+ obj.ipv4_netmask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -136,6 +137,100 @@
q.breakable()
q.text('}')
+class bsn_vport_q_in_q(object):
+ type = 0
+
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None):
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if ingress_tpid != None:
+ self.ingress_tpid = ingress_tpid
+ else:
+ self.ingress_tpid = 0
+ if ingress_vlan_id != None:
+ self.ingress_vlan_id = ingress_vlan_id
+ else:
+ self.ingress_vlan_id = 0
+ if egress_tpid != None:
+ self.egress_tpid = egress_tpid
+ else:
+ self.egress_tpid = 0
+ if egress_vlan_id != None:
+ self.egress_vlan_id = egress_vlan_id
+ else:
+ self.egress_vlan_id = 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
+ packed.append(struct.pack("!L", self.port_no))
+ packed.append(struct.pack("!H", self.ingress_tpid))
+ packed.append(struct.pack("!H", self.ingress_vlan_id))
+ packed.append(struct.pack("!H", self.egress_tpid))
+ packed.append(struct.pack("!H", self.egress_vlan_id))
+ length = sum([len(x) for x in packed])
+ packed[1] = struct.pack("!H", length)
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_vport_q_in_q()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.port_no = reader.read("!L")[0]
+ obj.ingress_tpid = reader.read("!H")[0]
+ obj.ingress_vlan_id = reader.read("!H")[0]
+ obj.egress_tpid = reader.read("!H")[0]
+ obj.egress_vlan_id = reader.read("!H")[0]
+ return obj
+
+ def __eq__(self, other):
+ if type(self) != type(other): return False
+ if self.port_no != other.port_no: return False
+ if self.ingress_tpid != other.ingress_tpid: return False
+ if self.ingress_vlan_id != other.ingress_vlan_id: return False
+ if self.egress_tpid != other.egress_tpid: return False
+ if self.egress_vlan_id != other.egress_vlan_id: 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_vport_q_in_q {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("port_no = ");
+ q.text("%#x" % self.port_no)
+ q.text(","); q.breakable()
+ q.text("ingress_tpid = ");
+ q.text("%#x" % self.ingress_tpid)
+ q.text(","); q.breakable()
+ q.text("ingress_vlan_id = ");
+ q.text("%#x" % self.ingress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("egress_tpid = ");
+ q.text("%#x" % self.egress_tpid)
+ q.text(","); q.breakable()
+ q.text("egress_vlan_id = ");
+ q.text("%#x" % self.egress_vlan_id)
+ q.breakable()
+ q.text('}')
+
class bucket(object):
def __init__(self, weight=None, watch_port=None, watch_group=None, actions=None):
@@ -161,10 +256,10 @@
packed = []
packed.append(struct.pack("!H", 0)) # placeholder for len at index 0
packed.append(struct.pack("!H", self.weight))
- packed.append(struct.pack("!L", self.watch_port))
+ packed.append(util.pack_port_no(self.watch_port))
packed.append(struct.pack("!L", self.watch_group))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -176,10 +271,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _len = reader.read('!H')[0]
- obj.weight = reader.read('!H')[0]
- obj.watch_port = reader.read('!L')[0]
- obj.watch_group = reader.read('!L')[0]
+ _len = reader.read("!H")[0]
+ obj.weight = reader.read("!H")[0]
+ obj.watch_port = util.unpack_port_no(reader)
+ obj.watch_group = reader.read("!L")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -244,8 +339,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -338,7 +433,7 @@
packed.append(struct.pack("!Q", self.packet_count))
packed.append(struct.pack("!Q", self.byte_count))
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -350,18 +445,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(1)
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.priority = reader.read('!H')[0]
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
reader.skip(6)
- obj.cookie = reader.read('!Q')[0]
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
return obj
@@ -451,7 +546,7 @@
packed.append(struct.pack("!B", self.type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
- packed.append("".join([x.pack() for x in self.buckets]))
+ packed.append(util.pack_list(self.buckets))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -463,10 +558,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.type = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.type = reader.read("!B")[0]
reader.skip(1)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
return obj
@@ -534,7 +629,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.packet_count))
packed.append(struct.pack("!Q", self.byte_count))
- packed.append("".join([x.pack() for x in self.bucket_stats]))
+ packed.append(util.pack_list(self.bucket_stats))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -546,13 +641,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
+ _length = reader.read("!H")[0]
reader.skip(2)
- obj.group_id = reader.read('!L')[0]
- obj.ref_count = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
+ obj.ref_count = reader.read("!L")[0]
reader.skip(4)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.bucket_stats = loxi.generic_util.unpack_list(reader, common.bucket_counter.unpack)
return obj
@@ -608,7 +703,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_list]))
+ packed.append(util.pack_list(self.oxm_list))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
packed.append('\x00' * ((length + 7)/8*8 - length))
@@ -621,9 +716,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
assert(_type == 1)
- _length = reader.read('!H')[0]
+ _length = reader.read("!H")[0]
obj.oxm_list = oxm.unpack_list(reader.slice(_length-4))
reader.skip((_length + 7)/8*8 - _length)
return obj
@@ -670,10 +765,10 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.queue_id))
- packed.append(struct.pack("!L", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 2
packed.append('\x00' * 6)
- packed.append("".join([x.pack() for x in self.properties]))
+ packed.append(util.pack_list(self.properties))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -685,9 +780,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.queue_id = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
- _len = reader.read('!H')[0]
+ obj.queue_id = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
+ _len = reader.read("!H")[0]
reader.skip(6)
obj.properties = common.unpack_list_queue_prop(reader)
return obj
@@ -773,7 +868,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append('\x00' * 2)
@@ -795,19 +890,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.config = reader.read('!L')[0]
- obj.state = reader.read('!L')[0]
- obj.curr = reader.read('!L')[0]
- obj.advertised = reader.read('!L')[0]
- obj.supported = reader.read('!L')[0]
- obj.peer = reader.read('!L')[0]
- obj.curr_speed = reader.read('!L')[0]
- obj.max_speed = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.state = reader.read("!L")[0]
+ obj.curr = reader.read("!L")[0]
+ obj.advertised = reader.read("!L")[0]
+ obj.supported = reader.read("!L")[0]
+ obj.peer = reader.read("!L")[0]
+ obj.curr_speed = reader.read("!L")[0]
+ obj.max_speed = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -931,7 +1026,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.rx_packets))
packed.append(struct.pack("!Q", self.tx_packets))
@@ -954,20 +1049,20 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
- obj.rx_packets = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.rx_bytes = reader.read('!Q')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.rx_dropped = reader.read('!Q')[0]
- obj.tx_dropped = reader.read('!Q')[0]
- obj.rx_errors = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
- obj.rx_frame_err = reader.read('!Q')[0]
- obj.rx_over_err = reader.read('!Q')[0]
- obj.rx_crc_err = reader.read('!Q')[0]
- obj.collisions = reader.read('!Q')[0]
+ obj.rx_packets = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.rx_bytes = reader.read("!Q")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.rx_dropped = reader.read("!Q")[0]
+ obj.tx_dropped = reader.read("!Q")[0]
+ obj.rx_errors = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
+ obj.rx_frame_err = reader.read("!Q")[0]
+ obj.rx_over_err = reader.read("!Q")[0]
+ obj.rx_crc_err = reader.read("!Q")[0]
+ obj.collisions = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1041,7 +1136,7 @@
q.text('}')
class queue_prop_experimenter(object):
- type = const.OFPQT_EXPERIMENTER
+ type = 65535
def __init__(self, experimenter=None, data=None):
if experimenter != None:
@@ -1051,7 +1146,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
return
def pack(self):
@@ -1073,11 +1168,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_EXPERIMENTER)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.experimenter = reader.read('!L')[0]
+ obj.experimenter = reader.read("!L")[0]
reader.skip(4)
obj.data = str(reader.read_all())
return obj
@@ -1109,7 +1204,7 @@
q.text('}')
class queue_prop_max_rate(object):
- type = const.OFPQT_MAX_RATE
+ type = 2
def __init__(self, rate=None):
if rate != None:
@@ -1136,11 +1231,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_MAX_RATE)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.rate = reader.read('!H')[0]
+ obj.rate = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -1167,7 +1262,7 @@
q.text('}')
class queue_prop_min_rate(object):
- type = const.OFPQT_MIN_RATE
+ type = 1
def __init__(self, rate=None):
if rate != None:
@@ -1194,11 +1289,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_MIN_RATE)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.rate = reader.read('!H')[0]
+ obj.rate = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -1251,7 +1346,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!L", self.queue_id))
packed.append(struct.pack("!Q", self.tx_bytes))
packed.append(struct.pack("!Q", self.tx_packets))
@@ -1265,11 +1360,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
- obj.queue_id = reader.read('!L')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.queue_id = reader.read("!L")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1324,11 +1419,11 @@
if match != None:
self.match = match
else:
- self.match = 0
+ self.match = util.init_match_bmap()
if wildcards != None:
self.wildcards = wildcards
else:
- self.wildcards = 0
+ self.wildcards = util.init_wc_bmap()
if write_actions != None:
self.write_actions = write_actions
else:
@@ -1384,8 +1479,8 @@
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 7)
packed.append(struct.pack("!32s", self.name))
- packed.append(struct.pack("!Q", self.match))
- packed.append(struct.pack("!Q", self.wildcards))
+ packed.append(util.pack_match_bmap(self.match))
+ packed.append(util.pack_wc_bmap(self.wildcards))
packed.append(struct.pack("!L", self.write_actions))
packed.append(struct.pack("!L", self.apply_actions))
packed.append(struct.pack("!Q", self.write_setfields))
@@ -1407,23 +1502,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(7)
obj.name = reader.read("!32s")[0].rstrip("\x00")
- obj.match = reader.read('!Q')[0]
- obj.wildcards = reader.read('!Q')[0]
- obj.write_actions = reader.read('!L')[0]
- obj.apply_actions = reader.read('!L')[0]
- obj.write_setfields = reader.read('!Q')[0]
- obj.apply_setfields = reader.read('!Q')[0]
- obj.metadata_match = reader.read('!Q')[0]
- obj.metadata_write = reader.read('!Q')[0]
- obj.instructions = reader.read('!L')[0]
- obj.config = reader.read('!L')[0]
- obj.max_entries = reader.read('!L')[0]
- obj.active_count = reader.read('!L')[0]
- obj.lookup_count = reader.read('!Q')[0]
- obj.matched_count = reader.read('!Q')[0]
+ obj.match = util.unpack_match_bmap(reader)
+ obj.wildcards = util.unpack_wc_bmap(reader)
+ obj.write_actions = reader.read("!L")[0]
+ obj.apply_actions = reader.read("!L")[0]
+ obj.write_setfields = reader.read("!Q")[0]
+ obj.apply_setfields = reader.read("!Q")[0]
+ obj.metadata_match = reader.read("!Q")[0]
+ obj.metadata_write = reader.read("!Q")[0]
+ obj.instructions = reader.read("!L")[0]
+ obj.config = reader.read("!L")[0]
+ obj.max_entries = reader.read("!L")[0]
+ obj.active_count = reader.read("!L")[0]
+ obj.lookup_count = reader.read("!Q")[0]
+ obj.matched_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
diff --git a/src/python/loxi/of12/const.py b/src/python/loxi/of12/const.py
index fa9c93c..20f99bb 100644
--- a/src/python/loxi/of12/const.py
+++ b/src/python/loxi/of12/const.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template const.py
# Do not modify
@@ -8,21 +9,21 @@
OFP_VERSION = 3
# Identifiers from group macro_definitions
-OFP_VLAN_NONE = 0
-OFP_FLOW_PERMANENT = 0
-OFP_ETH_ALEN = 6
-OFP_MAX_PORT_NAME_LEN = 16
OFP_MAX_TABLE_NAME_LEN = 32
-SERIAL_NUM_LEN = 32
-OFP_DEFAULT_MISS_SEND_LEN = 128
-DESC_STR_LEN = 256
+OFP_MAX_PORT_NAME_LEN = 16
OFP_TCP_PORT = 6633
OFP_SSL_PORT = 6633
+OFP_ETH_ALEN = 6
+OFP_DEFAULT_MISS_SEND_LEN = 128
+OFP_VLAN_NONE = 0
+OFP_FLOW_PERMANENT = 0
OFP_DEFAULT_PRIORITY = 32768
+OFP_NO_BUFFER = 4294967295
+DESC_STR_LEN = 256
+SERIAL_NUM_LEN = 32
+OFPQ_ALL = 4294967295
OFPQ_MIN_RATE_UNCFG = 65535
OFPQ_MAX_RATE_UNCFG = 65535
-OFPQ_ALL = 4294967295
-OFP_NO_BUFFER = 4294967295
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
@@ -179,6 +180,13 @@
12: 'OFPBRC_BAD_PACKET',
}
+# Identifiers from group ofp_bsn_vport_q_in_q_untagged
+OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
+
+ofp_bsn_vport_q_in_q_untagged_map = {
+ 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
+}
+
# Identifiers from group ofp_capabilities
OFPC_FLOW_STATS = 1
OFPC_TABLE_STATS = 2
diff --git a/src/python/loxi/of12/instruction.py b/src/python/loxi/of12/instruction.py
index 52ee289..961f3c6 100644
--- a/src/python/loxi/of12/instruction.py
+++ b/src/python/loxi/of12/instruction.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template instruction.py
# Do not modify
@@ -24,7 +25,7 @@
pass
class apply_actions(Instruction):
- type = const.OFPIT_APPLY_ACTIONS
+ type = 4
def __init__(self, actions=None):
if actions != None:
@@ -38,7 +39,7 @@
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -50,9 +51,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_APPLY_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 4)
+ _len = reader.read("!H")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -80,7 +81,7 @@
q.text('}')
class clear_actions(Instruction):
- type = const.OFPIT_CLEAR_ACTIONS
+ type = 5
def __init__(self):
return
@@ -101,9 +102,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_CLEAR_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 5)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -127,7 +128,7 @@
q.text('}')
class experimenter(Instruction):
- type = const.OFPIT_EXPERIMENTER
+ type = 65535
def __init__(self, experimenter=None, data=None):
if experimenter != None:
@@ -137,7 +138,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
return
def pack(self):
@@ -157,10 +158,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -191,7 +192,7 @@
q.text('}')
class goto_table(Instruction):
- type = const.OFPIT_GOTO_TABLE
+ type = 1
def __init__(self, table_id=None):
if table_id != None:
@@ -217,10 +218,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_GOTO_TABLE)
- _len = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -247,7 +248,7 @@
q.text('}')
class write_actions(Instruction):
- type = const.OFPIT_WRITE_ACTIONS
+ type = 3
def __init__(self, actions=None):
if actions != None:
@@ -261,7 +262,7 @@
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -273,9 +274,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_WRITE_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 3)
+ _len = reader.read("!H")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -303,7 +304,7 @@
q.text('}')
class write_metadata(Instruction):
- type = const.OFPIT_WRITE_METADATA
+ type = 2
def __init__(self, metadata=None, metadata_mask=None):
if metadata != None:
@@ -334,12 +335,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_WRITE_METADATA)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.metadata = reader.read('!Q')[0]
- obj.metadata_mask = reader.read('!Q')[0]
+ obj.metadata = reader.read("!Q")[0]
+ obj.metadata_mask = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -370,10 +371,10 @@
parsers = {
+ const.OFPIT_GOTO_TABLE : goto_table.unpack,
+ const.OFPIT_WRITE_METADATA : write_metadata.unpack,
+ const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
const.OFPIT_APPLY_ACTIONS : apply_actions.unpack,
const.OFPIT_CLEAR_ACTIONS : clear_actions.unpack,
const.OFPIT_EXPERIMENTER : experimenter.unpack,
- const.OFPIT_GOTO_TABLE : goto_table.unpack,
- const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
- const.OFPIT_WRITE_METADATA : write_metadata.unpack,
}
diff --git a/src/python/loxi/of12/message.py b/src/python/loxi/of12/message.py
index f5b75e4..76424fe 100644
--- a/src/python/loxi/of12/message.py
+++ b/src/python/loxi/of12/message.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template message.py
# Do not modify
@@ -20,9 +21,9 @@
xid = None
class aggregate_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_AGGREGATE
+ version = 3
+ type = 19
+ stats_type = 2
def __init__(self, xid=None, flags=None, packet_count=None, byte_count=None, flow_count=None):
self.xid = xid
@@ -68,19 +69,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_AGGREGATE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 2)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
- obj.flow_count = reader.read('!L')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
+ obj.flow_count = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -131,9 +132,9 @@
q.text('}')
class aggregate_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_AGGREGATE
+ version = 3
+ type = 18
+ stats_type = 2
def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
self.xid = xid
@@ -177,7 +178,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 3)
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.cookie))
@@ -195,23 +196,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_AGGREGATE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 2)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
reader.skip(4)
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -274,8 +275,8 @@
q.text('}')
class barrier_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REPLY
+ version = 3
+ type = 21
def __init__(self, xid=None):
self.xid = xid
@@ -298,12 +299,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 21)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -337,8 +338,8 @@
q.text('}')
class barrier_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REQUEST
+ version = 3
+ type = 20
def __init__(self, xid=None):
self.xid = xid
@@ -361,12 +362,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 20)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -399,10 +400,486 @@
q.breakable()
q.text('}')
+class bsn_bw_clear_data_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 22
+
+ 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_bw_clear_data_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 == 22)
+ 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_bw_clear_data_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_bw_clear_data_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 21
+
+ 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_bw_clear_data_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 == 21)
+ 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_bw_clear_data_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_bw_enable_get_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 20
+
+ 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_bw_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 == 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 == 20)
+ 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_bw_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_bw_enable_get_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 19
+
+ 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_bw_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 == 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 == 19)
+ 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_bw_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_bw_enable_set_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 23
+
+ 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_bw_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 == 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 == 23)
+ 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_bw_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_bw_enable_set_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 18
+
+ 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_bw_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 == 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 == 18)
+ 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_bw_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 = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 3
+ type = 4
+ experimenter = 6035143
subtype = 10
def __init__(self, xid=None, interfaces=None):
@@ -420,7 +897,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!L", self.experimenter))
packed.append(struct.pack("!L", self.subtype))
- packed.append("".join([x.pack() for x in self.interfaces]))
+ packed.append(util.pack_list(self.interfaces))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -433,15 +910,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 10)
obj.interfaces = loxi.generic_util.unpack_list(reader, common.bsn_interface.unpack)
return obj
@@ -481,9 +958,9 @@
q.text('}')
class bsn_get_interfaces_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 3
+ type = 4
+ experimenter = 6035143
subtype = 9
def __init__(self, xid=None):
@@ -509,15 +986,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 9)
return obj
@@ -552,9 +1029,9 @@
q.text('}')
class bsn_get_mirroring_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 3
+ type = 4
+ experimenter = 6035143
subtype = 5
def __init__(self, xid=None, report_mirror_ports=None):
@@ -586,17 +1063,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 5)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -635,9 +1112,9 @@
q.text('}')
class bsn_get_mirroring_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 3
+ type = 4
+ experimenter = 6035143
subtype = 4
def __init__(self, xid=None, report_mirror_ports=None):
@@ -669,17 +1146,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 4)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -718,9 +1195,9 @@
q.text('}')
class bsn_set_mirroring(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 3
+ type = 4
+ experimenter = 6035143
subtype = 3
def __init__(self, xid=None, report_mirror_ports=None):
@@ -752,17 +1229,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 3)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -800,10 +1277,91 @@
q.breakable()
q.text('}')
-class bsn_set_pktin_suppression(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+class bsn_set_pktin_suppression_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 25
+
+ 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_set_pktin_suppression_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 == 25)
+ 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_set_pktin_suppression_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_set_pktin_suppression_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
subtype = 11
def __init__(self, xid=None, enabled=None, idle_timeout=None, hard_timeout=None, priority=None, cookie=None):
@@ -850,27 +1408,27 @@
@staticmethod
def unpack(buf):
if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = bsn_set_pktin_suppression()
+ obj = bsn_set_pktin_suppression_request()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 11)
- obj.enabled = reader.read('!B')[0]
+ obj.enabled = reader.read("!B")[0]
reader.skip(1)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.cookie = reader.read('!Q')[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.cookie = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -896,7 +1454,7 @@
return loxi.pp.pp(self)
def pretty_print(self, q):
- q.text("bsn_set_pktin_suppression {")
+ q.text("bsn_set_pktin_suppression_request {")
with q.group():
with q.indent(2):
q.breakable()
@@ -923,10 +1481,344 @@
q.breakable()
q.text('}')
+class bsn_virtual_port_create_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 16
+
+ def __init__(self, xid=None, status=None, vport_no=None):
+ self.xid = xid
+ if status != None:
+ self.status = status
+ else:
+ self.status = 0
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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))
+ packed.append(struct.pack("!L", self.vport_no))
+ 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_virtual_port_create_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 == 16)
+ obj.status = reader.read("!L")[0]
+ obj.vport_no = 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
+ if self.vport_no != other.vport_no: 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_virtual_port_create_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.text(","); q.breakable()
+ q.text("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_create_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 15
+
+ def __init__(self, xid=None, vport=None):
+ self.xid = xid
+ if vport != None:
+ self.vport = vport
+ else:
+ self.vport = common.bsn_vport_q_in_q()
+
+ 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(self.vport.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_virtual_port_create_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 == 15)
+ obj.vport = common.bsn_vport_q_in_q.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.vport != other.vport: 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_virtual_port_create_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("vport = ");
+ q.pp(self.vport)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_remove_reply(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 26
+
+ 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_virtual_port_remove_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 == 26)
+ 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_virtual_port_remove_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_virtual_port_remove_request(Message):
+ version = 3
+ type = 4
+ experimenter = 6035143
+ subtype = 17
+
+ def __init__(self, xid=None, vport_no=None):
+ self.xid = xid
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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.vport_no))
+ 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_virtual_port_remove_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 == 17)
+ obj.vport_no = 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.vport_no != other.vport_no: 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_virtual_port_remove_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("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
class desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_DESC
+ version = 3
+ type = 19
+ stats_type = 0
def __init__(self, xid=None, flags=None, mfr_desc=None, hw_desc=None, sw_desc=None, serial_num=None, dp_desc=None):
self.xid = xid
@@ -981,15 +1873,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 0)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.mfr_desc = reader.read("!256s")[0].rstrip("\x00")
obj.hw_desc = reader.read("!256s")[0].rstrip("\x00")
@@ -1053,9 +1945,9 @@
q.text('}')
class desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_DESC
+ version = 3
+ type = 18
+ stats_type = 0
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -1085,15 +1977,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 0)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -1132,15 +2024,15 @@
q.text('}')
class echo_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REPLY
+ version = 3
+ type = 3
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1161,12 +2053,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 3)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1205,15 +2097,15 @@
q.text('}')
class echo_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REQUEST
+ version = 3
+ type = 2
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1234,12 +2126,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 2)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1278,8 +2170,8 @@
q.text('}')
class error_msg(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ERROR
+ version = 3
+ type = 1
def __init__(self, xid=None, err_type=None, code=None, data=None):
self.xid = xid
@@ -1294,7 +2186,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1317,14 +2209,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ERROR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.err_type = reader.read('!H')[0]
- obj.code = reader.read('!H')[0]
+ _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]
+ obj.err_type = reader.read("!H")[0]
+ obj.code = reader.read("!H")[0]
obj.data = str(reader.read_all())
return obj
@@ -1371,9 +2263,9 @@
q.text('}')
class experimenter_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_EXPERIMENTER
+ version = 3
+ type = 19
+ stats_type = 65535
def __init__(self, xid=None, flags=None, experimenter=None, subtype=None, data=None):
self.xid = xid
@@ -1392,7 +2284,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1418,18 +2310,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_EXPERIMENTER)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 65535)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.experimenter = reader.read('!L')[0]
- obj.subtype = reader.read('!L')[0]
+ obj.experimenter = reader.read("!L")[0]
+ obj.subtype = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1480,9 +2372,9 @@
q.text('}')
class experimenter_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_EXPERIMENTER
+ version = 3
+ type = 18
+ stats_type = 65535
def __init__(self, xid=None, flags=None, experimenter=None, subtype=None, data=None):
self.xid = xid
@@ -1501,7 +2393,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1527,18 +2419,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_EXPERIMENTER)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 65535)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.experimenter = reader.read('!L')[0]
- obj.subtype = reader.read('!L')[0]
+ obj.experimenter = reader.read("!L")[0]
+ obj.subtype = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1589,8 +2481,8 @@
q.text('}')
class features_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REPLY
+ version = 3
+ type = 6
def __init__(self, xid=None, datapath_id=None, n_buffers=None, n_tables=None, capabilities=None, reserved=None, ports=None):
self.xid = xid
@@ -1631,7 +2523,7 @@
packed.append('\x00' * 3)
packed.append(struct.pack("!L", self.capabilities))
packed.append(struct.pack("!L", self.reserved))
- packed.append("".join([x.pack() for x in self.ports]))
+ packed.append(util.pack_list(self.ports))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -1644,18 +2536,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.datapath_id = reader.read('!Q')[0]
- obj.n_buffers = reader.read('!L')[0]
- obj.n_tables = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 6)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.datapath_id = reader.read("!Q")[0]
+ obj.n_buffers = reader.read("!L")[0]
+ obj.n_tables = reader.read("!B")[0]
reader.skip(3)
- obj.capabilities = reader.read('!L')[0]
- obj.reserved = reader.read('!L')[0]
+ obj.capabilities = reader.read("!L")[0]
+ obj.reserved = reader.read("!L")[0]
obj.ports = loxi.generic_util.unpack_list(reader, common.port_desc.unpack)
return obj
@@ -1714,8 +2606,8 @@
q.text('}')
class features_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REQUEST
+ version = 3
+ type = 5
def __init__(self, xid=None):
self.xid = xid
@@ -1738,12 +2630,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 5)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1777,9 +2669,9 @@
q.text('}')
class flow_add(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_ADD
+ version = 3
+ type = 14
+ _command = 0
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -1841,17 +2733,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -1864,24 +2756,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_ADD)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 0)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -1966,9 +2858,9 @@
q.text('}')
class flow_delete(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE
+ version = 3
+ type = 14
+ _command = 3
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2030,17 +2922,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2053,24 +2945,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_DELETE)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 3)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2155,9 +3047,9 @@
q.text('}')
class flow_delete_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE_STRICT
+ version = 3
+ type = 14
+ _command = 4
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2219,17 +3111,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2242,24 +3134,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_DELETE_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 4)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2344,9 +3236,9 @@
q.text('}')
class flow_modify(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY
+ version = 3
+ type = 14
+ _command = 1
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2408,17 +3300,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2431,24 +3323,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_MODIFY)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 1)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2533,9 +3425,9 @@
q.text('}')
class flow_modify_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY_STRICT
+ version = 3
+ type = 14
+ _command = 2
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2597,17 +3489,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2620,24 +3512,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_MODIFY_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 2)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2722,8 +3614,8 @@
q.text('}')
class flow_removed(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_REMOVED
+ version = 3
+ type = 11
def __init__(self, xid=None, cookie=None, priority=None, reason=None, table_id=None, duration_sec=None, duration_nsec=None, idle_timeout=None, hard_timeout=None, packet_count=None, byte_count=None, match=None):
self.xid = xid
@@ -2801,22 +3693,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_REMOVED)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.priority = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
- obj.table_id = reader.read('!B')[0]
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 11)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.reason = reader.read("!B")[0]
+ obj.table_id = reader.read("!B")[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -2895,9 +3787,9 @@
q.text('}')
class flow_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_FLOW
+ version = 3
+ type = 19
+ stats_type = 1
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -2919,7 +3811,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2932,15 +3824,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_FLOW)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 1)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_flow_stats_entry(reader)
return obj
@@ -2984,9 +3876,9 @@
q.text('}')
class flow_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_FLOW
+ version = 3
+ type = 18
+ stats_type = 1
def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
self.xid = xid
@@ -3030,7 +3922,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 3)
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.cookie))
@@ -3048,23 +3940,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_FLOW)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 1)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
reader.skip(4)
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -3127,8 +4019,8 @@
q.text('}')
class get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REPLY
+ version = 3
+ type = 8
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -3161,14 +4053,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 8)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3210,8 +4102,8 @@
q.text('}')
class get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REQUEST
+ version = 3
+ type = 7
def __init__(self, xid=None):
self.xid = xid
@@ -3234,12 +4126,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 7)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3273,9 +4165,9 @@
q.text('}')
class group_desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_GROUP_DESC
+ version = 3
+ type = 19
+ stats_type = 7
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -3297,7 +4189,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3310,15 +4202,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 7)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_group_desc_stats_entry(reader)
return obj
@@ -3362,9 +4254,9 @@
q.text('}')
class group_desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_GROUP_DESC
+ version = 3
+ type = 18
+ stats_type = 7
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -3394,15 +4286,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP_DESC)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 7)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -3441,9 +4333,9 @@
q.text('}')
class group_features_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_GROUP_FEATURES
+ version = 3
+ type = 19
+ stats_type = 8
def __init__(self, xid=None, flags=None, types=None, capabilities=None, max_groups_all=None, max_groups_select=None, max_groups_indirect=None, max_groups_ff=None, actions_all=None, actions_select=None, actions_indirect=None, actions_ff=None):
self.xid = xid
@@ -3523,26 +4415,26 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP_FEATURES)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 8)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.types = reader.read('!L')[0]
- obj.capabilities = reader.read('!L')[0]
- obj.max_groups_all = reader.read('!L')[0]
- obj.max_groups_select = reader.read('!L')[0]
- obj.max_groups_indirect = reader.read('!L')[0]
- obj.max_groups_ff = reader.read('!L')[0]
- obj.actions_all = reader.read('!L')[0]
- obj.actions_select = reader.read('!L')[0]
- obj.actions_indirect = reader.read('!L')[0]
- obj.actions_ff = reader.read('!L')[0]
+ obj.types = reader.read("!L")[0]
+ obj.capabilities = reader.read("!L")[0]
+ obj.max_groups_all = reader.read("!L")[0]
+ obj.max_groups_select = reader.read("!L")[0]
+ obj.max_groups_indirect = reader.read("!L")[0]
+ obj.max_groups_ff = reader.read("!L")[0]
+ obj.actions_all = reader.read("!L")[0]
+ obj.actions_select = reader.read("!L")[0]
+ obj.actions_indirect = reader.read("!L")[0]
+ obj.actions_ff = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3620,9 +4512,9 @@
q.text('}')
class group_features_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_GROUP_FEATURES
+ version = 3
+ type = 18
+ stats_type = 8
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -3652,15 +4544,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP_FEATURES)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 8)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -3699,8 +4591,8 @@
q.text('}')
class group_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GROUP_MOD
+ version = 3
+ type = 15
def __init__(self, xid=None, command=None, group_type=None, group_id=None, buckets=None):
self.xid = xid
@@ -3731,7 +4623,7 @@
packed.append(struct.pack("!B", self.group_type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
- packed.append("".join([x.pack() for x in self.buckets]))
+ packed.append(util.pack_list(self.buckets))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3744,16 +4636,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GROUP_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.command = reader.read('!H')[0]
- obj.group_type = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 15)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.command = reader.read("!H")[0]
+ obj.group_type = reader.read("!B")[0]
reader.skip(1)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
return obj
@@ -3804,9 +4696,9 @@
q.text('}')
class group_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_GROUP
+ version = 3
+ type = 19
+ stats_type = 6
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -3828,7 +4720,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3841,15 +4733,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 6)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_group_stats_entry(reader)
return obj
@@ -3893,9 +4785,9 @@
q.text('}')
class group_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_GROUP
+ version = 3
+ type = 18
+ stats_type = 6
def __init__(self, xid=None, flags=None, group_id=None):
self.xid = xid
@@ -3931,17 +4823,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_GROUP)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 6)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -3984,8 +4876,8 @@
q.text('}')
class hello(Message):
- version = const.OFP_VERSION
- type = const.OFPT_HELLO
+ version = 3
+ type = 0
def __init__(self, xid=None):
self.xid = xid
@@ -4008,12 +4900,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_HELLO)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -4047,8 +4939,8 @@
q.text('}')
class packet_in(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_IN
+ version = 3
+ type = 10
def __init__(self, xid=None, buffer_id=None, total_len=None, reason=None, table_id=None, match=None, data=None):
self.xid = xid
@@ -4075,7 +4967,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -4102,16 +4994,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_IN)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.total_len = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
- obj.table_id = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 10)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.total_len = reader.read("!H")[0]
+ obj.reason = reader.read("!B")[0]
+ obj.table_id = reader.read("!B")[0]
obj.match = common.match.unpack(reader)
reader.skip(2)
obj.data = str(reader.read_all())
@@ -4172,8 +5064,8 @@
q.text('}')
class packet_out(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_OUT
+ version = 3
+ type = 13
def __init__(self, xid=None, buffer_id=None, in_port=None, actions=None, data=None):
self.xid = xid
@@ -4192,7 +5084,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -4201,10 +5093,10 @@
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.buffer_id))
- packed.append(struct.pack("!L", self.in_port))
+ packed.append(util.pack_port_no(self.in_port))
packed.append(struct.pack("!H", 0)) # placeholder for actions_len at index 6
packed.append('\x00' * 6)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
packed[6] = struct.pack("!H", len(packed[-1]))
packed.append(self.data)
length = sum([len(x) for x in packed])
@@ -4219,15 +5111,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_OUT)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.in_port = reader.read('!L')[0]
- _actions_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 13)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.in_port = util.unpack_port_no(reader)
+ _actions_len = reader.read("!H")[0]
reader.skip(6)
obj.actions = action.unpack_list(reader.slice(_actions_len))
obj.data = str(reader.read_all())
@@ -4280,8 +5172,8 @@
q.text('}')
class port_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_MOD
+ version = 3
+ type = 16
def __init__(self, xid=None, port_no=None, hw_addr=None, config=None, mask=None, advertise=None):
self.xid = xid
@@ -4312,7 +5204,7 @@
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.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append('\x00' * 2)
@@ -4332,19 +5224,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port_no = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
- obj.config = reader.read('!L')[0]
- obj.mask = reader.read('!L')[0]
- obj.advertise = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.mask = reader.read("!L")[0]
+ obj.advertise = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -4399,9 +5291,9 @@
q.text('}')
class port_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_PORT
+ version = 3
+ type = 19
+ stats_type = 4
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -4423,7 +5315,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4436,15 +5328,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_PORT)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 4)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.port_stats_entry.unpack)
return obj
@@ -4488,9 +5380,9 @@
q.text('}')
class port_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_PORT
+ version = 3
+ type = 18
+ stats_type = 4
def __init__(self, xid=None, flags=None, port_no=None):
self.xid = xid
@@ -4512,7 +5404,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4526,17 +5418,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_PORT)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 4)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
return obj
@@ -4579,8 +5471,8 @@
q.text('}')
class port_status(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_STATUS
+ version = 3
+ type = 12
def __init__(self, xid=None, reason=None, desc=None):
self.xid = xid
@@ -4614,13 +5506,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_STATUS)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.reason = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 12)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.reason = reader.read("!B")[0]
reader.skip(7)
obj.desc = common.port_desc.unpack(reader)
return obj
@@ -4664,8 +5556,8 @@
q.text('}')
class queue_get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REPLY
+ version = 3
+ type = 23
def __init__(self, xid=None, port=None, queues=None):
self.xid = xid
@@ -4684,9 +5576,9 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.queues]))
+ packed.append(util.pack_list(self.queues))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4699,13 +5591,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 23)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(4)
obj.queues = common.unpack_list_packet_queue(reader)
return obj
@@ -4749,8 +5641,8 @@
q.text('}')
class queue_get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REQUEST
+ version = 3
+ type = 22
def __init__(self, xid=None, port=None):
self.xid = xid
@@ -4765,7 +5657,7 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 4)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4779,13 +5671,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 22)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(4)
return obj
@@ -4824,9 +5716,9 @@
q.text('}')
class queue_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_QUEUE
+ version = 3
+ type = 19
+ stats_type = 5
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -4848,7 +5740,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4861,15 +5753,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_QUEUE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 5)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.queue_stats_entry.unpack)
return obj
@@ -4913,9 +5805,9 @@
q.text('}')
class queue_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_QUEUE
+ version = 3
+ type = 18
+ stats_type = 5
def __init__(self, xid=None, flags=None, port_no=None, queue_id=None):
self.xid = xid
@@ -4941,7 +5833,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!L", self.queue_id))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -4955,18 +5847,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_QUEUE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 5)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.port_no = reader.read('!L')[0]
- obj.queue_id = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -5012,15 +5904,15 @@
q.text('}')
class role_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ROLE_REPLY
+ version = 3
+ type = 25
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -5041,12 +5933,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ROLE_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 25)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -5085,8 +5977,8 @@
q.text('}')
class role_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ROLE_REQUEST
+ version = 3
+ type = 24
def __init__(self, xid=None, role=None, generation_id=None):
self.xid = xid
@@ -5120,15 +6012,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ROLE_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.role = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 24)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.role = reader.read("!L")[0]
reader.skip(4)
- obj.generation_id = reader.read('!Q')[0]
+ obj.generation_id = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -5170,8 +6062,8 @@
q.text('}')
class set_config(Message):
- version = const.OFP_VERSION
- type = const.OFPT_SET_CONFIG
+ version = 3
+ type = 9
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -5204,14 +6096,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_SET_CONFIG)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 9)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -5253,8 +6145,8 @@
q.text('}')
class table_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_TABLE_MOD
+ version = 3
+ type = 17
def __init__(self, xid=None, table_id=None, config=None):
self.xid = xid
@@ -5288,15 +6180,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_TABLE_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.table_id = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.config = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -5338,9 +6230,9 @@
q.text('}')
class table_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REPLY
- stats_type = const.OFPST_TABLE
+ version = 3
+ type = 19
+ stats_type = 3
def __init__(self, xid=None, flags=None, entries=None):
self.xid = xid
@@ -5362,7 +6254,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -5375,15 +6267,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_TABLE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 3)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.table_stats_entry.unpack)
return obj
@@ -5427,9 +6319,9 @@
q.text('}')
class table_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_STATS_REQUEST
- stats_type = const.OFPST_TABLE
+ version = 3
+ type = 18
+ stats_type = 3
def __init__(self, xid=None, flags=None):
self.xid = xid
@@ -5459,15 +6351,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_STATS_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
- assert(_stats_type == const.OFPST_TABLE)
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 3)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
+ assert(_stats_type == 3)
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -5567,32 +6459,32 @@
raise loxi.ProtocolError("unexpected experimenter %#x subtype %#x" % (experimenter, subtype))
parsers = {
- const.OFPT_BARRIER_REPLY : barrier_reply.unpack,
- const.OFPT_BARRIER_REQUEST : barrier_request.unpack,
- const.OFPT_ECHO_REPLY : echo_reply.unpack,
- const.OFPT_ECHO_REQUEST : echo_request.unpack,
- const.OFPT_ERROR : error_msg.unpack,
- const.OFPT_EXPERIMENTER : parse_experimenter,
- const.OFPT_FEATURES_REPLY : features_reply.unpack,
- const.OFPT_FEATURES_REQUEST : features_request.unpack,
- const.OFPT_FLOW_MOD : parse_flow_mod,
- const.OFPT_FLOW_REMOVED : flow_removed.unpack,
- const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
- const.OFPT_GET_CONFIG_REQUEST : get_config_request.unpack,
- const.OFPT_GROUP_MOD : group_mod.unpack,
const.OFPT_HELLO : hello.unpack,
- const.OFPT_PACKET_IN : packet_in.unpack,
- const.OFPT_PACKET_OUT : packet_out.unpack,
- const.OFPT_PORT_MOD : port_mod.unpack,
- const.OFPT_PORT_STATUS : port_status.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REQUEST : queue_get_config_request.unpack,
- const.OFPT_ROLE_REPLY : role_reply.unpack,
- const.OFPT_ROLE_REQUEST : role_request.unpack,
+ const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ECHO_REQUEST : echo_request.unpack,
+ const.OFPT_ECHO_REPLY : echo_reply.unpack,
+ 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,
+ const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
const.OFPT_SET_CONFIG : set_config.unpack,
- const.OFPT_STATS_REPLY : parse_stats_reply,
- const.OFPT_STATS_REQUEST : parse_stats_request,
+ const.OFPT_PACKET_IN : packet_in.unpack,
+ const.OFPT_FLOW_REMOVED : flow_removed.unpack,
+ const.OFPT_PORT_STATUS : port_status.unpack,
+ const.OFPT_PACKET_OUT : packet_out.unpack,
+ const.OFPT_FLOW_MOD : parse_flow_mod,
+ const.OFPT_GROUP_MOD : group_mod.unpack,
+ const.OFPT_PORT_MOD : port_mod.unpack,
const.OFPT_TABLE_MOD : table_mod.unpack,
+ 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,
+ const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
+ const.OFPT_ROLE_REQUEST : role_request.unpack,
+ const.OFPT_ROLE_REPLY : role_reply.unpack,
}
flow_mod_parsers = {
@@ -5630,4 +6522,23 @@
}
experimenter_parsers = {
+ 6035143 : {
+ 22: bsn_bw_clear_data_reply.unpack,
+ 21: bsn_bw_clear_data_request.unpack,
+ 20: bsn_bw_enable_get_reply.unpack,
+ 19: bsn_bw_enable_get_request.unpack,
+ 23: bsn_bw_enable_set_reply.unpack,
+ 18: bsn_bw_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,
+ 3: bsn_set_mirroring.unpack,
+ 25: bsn_set_pktin_suppression_reply.unpack,
+ 11: bsn_set_pktin_suppression_request.unpack,
+ 16: bsn_virtual_port_create_reply.unpack,
+ 15: bsn_virtual_port_create_request.unpack,
+ 26: bsn_virtual_port_remove_reply.unpack,
+ 17: bsn_virtual_port_remove_request.unpack,
+ },
}
diff --git a/src/python/loxi/of12/oxm.py b/src/python/loxi/of12/oxm.py
index d3bc046..fb1291d 100644
--- a/src/python/loxi/of12/oxm.py
+++ b/src/python/loxi/of12/oxm.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template oxm.py
# Do not modify
@@ -26,7 +27,7 @@
pass
class arp_op(OXM):
- type_len = 0x80002a02
+ type_len = 2147494402
def __init__(self, value=None):
if value != None:
@@ -47,9 +48,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002a02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494402)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -75,7 +76,7 @@
q.text('}')
class arp_op_masked(OXM):
- type_len = 0x80002b04
+ type_len = 2147494660
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -101,10 +102,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002b04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494660)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -134,7 +135,7 @@
q.text('}')
class arp_sha(OXM):
- type_len = 0x80003006
+ type_len = 2147495942
def __init__(self, value=None):
if value != None:
@@ -155,8 +156,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003006)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495942)
obj.value = list(reader.read('!6B'))
return obj
@@ -183,7 +184,7 @@
q.text('}')
class arp_sha_masked(OXM):
- type_len = 0x8000310c
+ type_len = 2147496204
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -209,8 +210,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000310c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496204)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -242,7 +243,7 @@
q.text('}')
class arp_spa(OXM):
- type_len = 0x80002c04
+ type_len = 2147494916
def __init__(self, value=None):
if value != None:
@@ -263,9 +264,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002c04)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494916)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -291,7 +292,7 @@
q.text('}')
class arp_spa_masked(OXM):
- type_len = 0x80002d08
+ type_len = 2147495176
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -317,10 +318,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002d08)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495176)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -350,7 +351,7 @@
q.text('}')
class arp_tha(OXM):
- type_len = 0x80003206
+ type_len = 2147496454
def __init__(self, value=None):
if value != None:
@@ -371,8 +372,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003206)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496454)
obj.value = list(reader.read('!6B'))
return obj
@@ -399,7 +400,7 @@
q.text('}')
class arp_tha_masked(OXM):
- type_len = 0x8000330c
+ type_len = 2147496716
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -425,8 +426,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000330c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496716)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -458,7 +459,7 @@
q.text('}')
class arp_tpa(OXM):
- type_len = 0x80002e04
+ type_len = 2147495428
def __init__(self, value=None):
if value != None:
@@ -479,9 +480,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002e04)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495428)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -507,7 +508,7 @@
q.text('}')
class arp_tpa_masked(OXM):
- type_len = 0x80002f08
+ type_len = 2147495688
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -533,10 +534,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002f08)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495688)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -565,8 +566,116 @@
q.breakable()
q.text('}')
+class dst_meta_id(OXM):
+ type_len = 258561
+
+ def __init__(self, value=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = dst_meta_id()
+ 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 == 258561)
+ obj.value = reader.read("!B")[0]
+ 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("dst_meta_id {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.breakable()
+ q.text('}')
+
+class dst_meta_id_masked(OXM):
+ type_len = 258818
+
+ def __init__(self, value=None, value_mask=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+ if value_mask != None:
+ self.value_mask = value_mask
+ else:
+ self.value_mask = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ packed.append(struct.pack("!B", self.value_mask))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = dst_meta_id_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 == 258818)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
+ 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("dst_meta_id_masked {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.text(","); q.breakable()
+ q.text("value_mask = ");
+ q.text("%#x" % self.value_mask)
+ q.breakable()
+ q.text('}')
+
class eth_dst(OXM):
- type_len = 0x80000606
+ type_len = 2147485190
def __init__(self, value=None):
if value != None:
@@ -587,8 +696,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000606)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485190)
obj.value = list(reader.read('!6B'))
return obj
@@ -615,7 +724,7 @@
q.text('}')
class eth_dst_masked(OXM):
- type_len = 0x8000070c
+ type_len = 2147485452
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -641,8 +750,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000070c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485452)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -674,7 +783,7 @@
q.text('}')
class eth_src(OXM):
- type_len = 0x80000806
+ type_len = 2147485702
def __init__(self, value=None):
if value != None:
@@ -695,8 +804,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000806)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485702)
obj.value = list(reader.read('!6B'))
return obj
@@ -723,7 +832,7 @@
q.text('}')
class eth_src_masked(OXM):
- type_len = 0x8000090c
+ type_len = 2147485964
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -749,8 +858,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000090c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485964)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -782,7 +891,7 @@
q.text('}')
class eth_type(OXM):
- type_len = 0x80000a02
+ type_len = 2147486210
def __init__(self, value=None):
if value != None:
@@ -803,9 +912,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000a02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486210)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -831,7 +940,7 @@
q.text('}')
class eth_type_masked(OXM):
- type_len = 0x80000b04
+ type_len = 2147486468
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -857,10 +966,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000b04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486468)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -890,7 +999,7 @@
q.text('}')
class icmpv4_code(OXM):
- type_len = 0x80002801
+ type_len = 2147493889
def __init__(self, value=None):
if value != None:
@@ -911,9 +1020,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002801)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493889)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -939,7 +1048,7 @@
q.text('}')
class icmpv4_code_masked(OXM):
- type_len = 0x80002902
+ type_len = 2147494146
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -965,10 +1074,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002902)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494146)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -998,7 +1107,7 @@
q.text('}')
class icmpv4_type(OXM):
- type_len = 0x80002601
+ type_len = 2147493377
def __init__(self, value=None):
if value != None:
@@ -1019,9 +1128,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002601)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493377)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1047,7 +1156,7 @@
q.text('}')
class icmpv4_type_masked(OXM):
- type_len = 0x80002702
+ type_len = 2147493634
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1073,10 +1182,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002702)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493634)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1106,7 +1215,7 @@
q.text('}')
class icmpv6_code(OXM):
- type_len = 0x80003c01
+ type_len = 2147499009
def __init__(self, value=None):
if value != None:
@@ -1127,9 +1236,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003c01)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499009)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1155,7 +1264,7 @@
q.text('}')
class icmpv6_code_masked(OXM):
- type_len = 0x80003d02
+ type_len = 2147499266
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1181,10 +1290,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003d02)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499266)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1214,7 +1323,7 @@
q.text('}')
class icmpv6_type(OXM):
- type_len = 0x80003a01
+ type_len = 2147498497
def __init__(self, value=None):
if value != None:
@@ -1235,9 +1344,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003a01)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147498497)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1263,7 +1372,7 @@
q.text('}')
class icmpv6_type_masked(OXM):
- type_len = 0x80003b02
+ type_len = 2147498754
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1289,10 +1398,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003b02)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147498754)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1322,7 +1431,7 @@
q.text('}')
class in_phy_port(OXM):
- type_len = 0x80000204
+ type_len = 2147484164
def __init__(self, value=None):
if value != None:
@@ -1333,7 +1442,7 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
+ packed.append(util.pack_port_no(self.value))
return ''.join(packed)
@staticmethod
@@ -1343,9 +1452,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000204)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484164)
+ obj.value = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1371,7 +1480,7 @@
q.text('}')
class in_phy_port_masked(OXM):
- type_len = 0x80000308
+ type_len = 2147484424
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1386,8 +1495,8 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
- packed.append(struct.pack("!L", self.value_mask))
+ packed.append(util.pack_port_no(self.value))
+ packed.append(util.pack_port_no(self.value_mask))
return ''.join(packed)
@staticmethod
@@ -1397,10 +1506,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000308)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484424)
+ obj.value = util.unpack_port_no(reader)
+ obj.value_mask = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1430,7 +1539,7 @@
q.text('}')
class in_port(OXM):
- type_len = 0x80000004
+ type_len = 2147483652
def __init__(self, value=None):
if value != None:
@@ -1441,7 +1550,7 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
+ packed.append(util.pack_port_no(self.value))
return ''.join(packed)
@staticmethod
@@ -1451,9 +1560,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000004)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147483652)
+ obj.value = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1479,7 +1588,7 @@
q.text('}')
class in_port_masked(OXM):
- type_len = 0x80000108
+ type_len = 2147483912
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1494,8 +1603,8 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
- packed.append(struct.pack("!L", self.value_mask))
+ packed.append(util.pack_port_no(self.value))
+ packed.append(util.pack_port_no(self.value_mask))
return ''.join(packed)
@staticmethod
@@ -1505,10 +1614,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000108)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147483912)
+ obj.value = util.unpack_port_no(reader)
+ obj.value_mask = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1538,7 +1647,7 @@
q.text('}')
class ip_dscp(OXM):
- type_len = 0x80001001
+ type_len = 2147487745
def __init__(self, value=None):
if value != None:
@@ -1559,9 +1668,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001001)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147487745)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1587,7 +1696,7 @@
q.text('}')
class ip_dscp_masked(OXM):
- type_len = 0x80001102
+ type_len = 2147488002
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1613,10 +1722,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001102)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488002)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1646,7 +1755,7 @@
q.text('}')
class ip_ecn(OXM):
- type_len = 0x80001201
+ type_len = 2147488257
def __init__(self, value=None):
if value != None:
@@ -1667,9 +1776,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001201)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488257)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1695,7 +1804,7 @@
q.text('}')
class ip_ecn_masked(OXM):
- type_len = 0x80001302
+ type_len = 2147488514
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1721,10 +1830,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001302)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488514)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1754,7 +1863,7 @@
q.text('}')
class ip_proto(OXM):
- type_len = 0x80001401
+ type_len = 2147488769
def __init__(self, value=None):
if value != None:
@@ -1775,9 +1884,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001401)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488769)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1803,7 +1912,7 @@
q.text('}')
class ip_proto_masked(OXM):
- type_len = 0x80001502
+ type_len = 2147489026
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1829,10 +1938,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001502)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489026)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1862,7 +1971,7 @@
q.text('}')
class ipv4_dst(OXM):
- type_len = 0x80001804
+ type_len = 2147489796
def __init__(self, value=None):
if value != None:
@@ -1883,9 +1992,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001804)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489796)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1911,7 +2020,7 @@
q.text('}')
class ipv4_dst_masked(OXM):
- type_len = 0x80001908
+ type_len = 2147490056
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1937,10 +2046,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001908)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490056)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1970,7 +2079,7 @@
q.text('}')
class ipv4_src(OXM):
- type_len = 0x80001604
+ type_len = 2147489284
def __init__(self, value=None):
if value != None:
@@ -1991,9 +2100,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001604)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489284)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2019,7 +2128,7 @@
q.text('}')
class ipv4_src_masked(OXM):
- type_len = 0x80001708
+ type_len = 2147489544
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2045,10 +2154,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001708)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489544)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2078,7 +2187,7 @@
q.text('}')
class ipv6_dst(OXM):
- type_len = 0x80003610
+ type_len = 2147497488
def __init__(self, value=None):
if value != None:
@@ -2099,8 +2208,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003610)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497488)
obj.value = reader.read('!16s')[0]
return obj
@@ -2127,7 +2236,7 @@
q.text('}')
class ipv6_dst_masked(OXM):
- type_len = 0x80003720
+ type_len = 2147497760
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2153,8 +2262,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003720)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497760)
obj.value = reader.read('!16s')[0]
obj.value_mask = reader.read('!16s')[0]
return obj
@@ -2186,7 +2295,7 @@
q.text('}')
class ipv6_flabel(OXM):
- type_len = 0x80003804
+ type_len = 2147497988
def __init__(self, value=None):
if value != None:
@@ -2207,9 +2316,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003804)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497988)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2235,7 +2344,7 @@
q.text('}')
class ipv6_flabel_masked(OXM):
- type_len = 0x80003908
+ type_len = 2147498248
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2261,10 +2370,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003908)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147498248)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2294,7 +2403,7 @@
q.text('}')
class ipv6_nd_sll(OXM):
- type_len = 0x80004006
+ type_len = 2147500038
def __init__(self, value=None):
if value != None:
@@ -2315,8 +2424,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004006)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500038)
obj.value = list(reader.read('!6B'))
return obj
@@ -2343,7 +2452,7 @@
q.text('}')
class ipv6_nd_sll_masked(OXM):
- type_len = 0x8000410c
+ type_len = 2147500300
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2369,8 +2478,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000410c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500300)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -2402,7 +2511,7 @@
q.text('}')
class ipv6_nd_target(OXM):
- type_len = 0x80003e10
+ type_len = 2147499536
def __init__(self, value=None):
if value != None:
@@ -2423,8 +2532,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003e10)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499536)
obj.value = reader.read('!16s')[0]
return obj
@@ -2451,7 +2560,7 @@
q.text('}')
class ipv6_nd_target_masked(OXM):
- type_len = 0x80003f20
+ type_len = 2147499808
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2477,8 +2586,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003f20)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499808)
obj.value = reader.read('!16s')[0]
obj.value_mask = reader.read('!16s')[0]
return obj
@@ -2510,7 +2619,7 @@
q.text('}')
class ipv6_nd_tll(OXM):
- type_len = 0x80004206
+ type_len = 2147500550
def __init__(self, value=None):
if value != None:
@@ -2531,8 +2640,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004206)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500550)
obj.value = list(reader.read('!6B'))
return obj
@@ -2559,7 +2668,7 @@
q.text('}')
class ipv6_nd_tll_masked(OXM):
- type_len = 0x8000430c
+ type_len = 2147500812
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2585,8 +2694,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000430c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500812)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -2618,7 +2727,7 @@
q.text('}')
class ipv6_src(OXM):
- type_len = 0x80003410
+ type_len = 2147496976
def __init__(self, value=None):
if value != None:
@@ -2639,8 +2748,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003410)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496976)
obj.value = reader.read('!16s')[0]
return obj
@@ -2667,7 +2776,7 @@
q.text('}')
class ipv6_src_masked(OXM):
- type_len = 0x80003520
+ type_len = 2147497248
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2693,8 +2802,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003520)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497248)
obj.value = reader.read('!16s')[0]
obj.value_mask = reader.read('!16s')[0]
return obj
@@ -2726,7 +2835,7 @@
q.text('}')
class metadata(OXM):
- type_len = 0x80000408
+ type_len = 2147484680
def __init__(self, value=None):
if value != None:
@@ -2747,9 +2856,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000408)
- obj.value = reader.read('!Q')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484680)
+ obj.value = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -2775,7 +2884,7 @@
q.text('}')
class metadata_masked(OXM):
- type_len = 0x80000510
+ type_len = 2147484944
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2801,10 +2910,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000510)
- obj.value = reader.read('!Q')[0]
- obj.value_mask = reader.read('!Q')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484944)
+ obj.value = reader.read("!Q")[0]
+ obj.value_mask = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -2834,7 +2943,7 @@
q.text('}')
class mpls_label(OXM):
- type_len = 0x80004404
+ type_len = 2147501060
def __init__(self, value=None):
if value != None:
@@ -2855,9 +2964,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004404)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501060)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2883,7 +2992,7 @@
q.text('}')
class mpls_label_masked(OXM):
- type_len = 0x80004508
+ type_len = 2147501320
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2909,10 +3018,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004508)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501320)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2942,7 +3051,7 @@
q.text('}')
class mpls_tc(OXM):
- type_len = 0x80004601
+ type_len = 2147501569
def __init__(self, value=None):
if value != None:
@@ -2963,9 +3072,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004601)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501569)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -2991,7 +3100,7 @@
q.text('}')
class mpls_tc_masked(OXM):
- type_len = 0x80004702
+ type_len = 2147501826
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3017,10 +3126,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004702)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501826)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -3050,7 +3159,7 @@
q.text('}')
class sctp_dst(OXM):
- type_len = 0x80002402
+ type_len = 2147492866
def __init__(self, value=None):
if value != None:
@@ -3071,9 +3180,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002402)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492866)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3099,7 +3208,7 @@
q.text('}')
class sctp_dst_masked(OXM):
- type_len = 0x80002504
+ type_len = 2147493124
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3125,10 +3234,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002504)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493124)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3158,7 +3267,7 @@
q.text('}')
class sctp_src(OXM):
- type_len = 0x80002202
+ type_len = 2147492354
def __init__(self, value=None):
if value != None:
@@ -3179,9 +3288,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002202)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492354)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3207,7 +3316,7 @@
q.text('}')
class sctp_src_masked(OXM):
- type_len = 0x80002304
+ type_len = 2147492612
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3233,10 +3342,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002304)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492612)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3265,8 +3374,116 @@
q.breakable()
q.text('}')
+class src_meta_id(OXM):
+ type_len = 258049
+
+ def __init__(self, value=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = src_meta_id()
+ 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 == 258049)
+ obj.value = reader.read("!B")[0]
+ 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("src_meta_id {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.breakable()
+ q.text('}')
+
+class src_meta_id_masked(OXM):
+ type_len = 258306
+
+ def __init__(self, value=None, value_mask=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+ if value_mask != None:
+ self.value_mask = value_mask
+ else:
+ self.value_mask = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ packed.append(struct.pack("!B", self.value_mask))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = src_meta_id_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 == 258306)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
+ 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("src_meta_id_masked {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.text(","); q.breakable()
+ q.text("value_mask = ");
+ q.text("%#x" % self.value_mask)
+ q.breakable()
+ q.text('}')
+
class tcp_dst(OXM):
- type_len = 0x80001c02
+ type_len = 2147490818
def __init__(self, value=None):
if value != None:
@@ -3287,9 +3504,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001c02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490818)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3315,7 +3532,7 @@
q.text('}')
class tcp_dst_masked(OXM):
- type_len = 0x80001d04
+ type_len = 2147491076
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3341,10 +3558,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001d04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491076)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3374,7 +3591,7 @@
q.text('}')
class tcp_src(OXM):
- type_len = 0x80001a02
+ type_len = 2147490306
def __init__(self, value=None):
if value != None:
@@ -3395,9 +3612,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001a02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490306)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3423,7 +3640,7 @@
q.text('}')
class tcp_src_masked(OXM):
- type_len = 0x80001b04
+ type_len = 2147490564
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3449,10 +3666,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001b04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490564)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3482,7 +3699,7 @@
q.text('}')
class udp_dst(OXM):
- type_len = 0x80002002
+ type_len = 2147491842
def __init__(self, value=None):
if value != None:
@@ -3503,9 +3720,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002002)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491842)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3531,7 +3748,7 @@
q.text('}')
class udp_dst_masked(OXM):
- type_len = 0x80002104
+ type_len = 2147492100
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3557,10 +3774,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002104)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492100)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3590,7 +3807,7 @@
q.text('}')
class udp_src(OXM):
- type_len = 0x80001e02
+ type_len = 2147491330
def __init__(self, value=None):
if value != None:
@@ -3611,9 +3828,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001e02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491330)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3639,7 +3856,7 @@
q.text('}')
class udp_src_masked(OXM):
- type_len = 0x80001f04
+ type_len = 2147491588
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3665,10 +3882,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001f04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491588)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3698,7 +3915,7 @@
q.text('}')
class vlan_pcp(OXM):
- type_len = 0x80000e01
+ type_len = 2147487233
def __init__(self, value=None):
if value != None:
@@ -3719,9 +3936,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000e01)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147487233)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -3747,7 +3964,7 @@
q.text('}')
class vlan_pcp_masked(OXM):
- type_len = 0x80000f02
+ type_len = 2147487490
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3773,10 +3990,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000f02)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147487490)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -3806,7 +4023,7 @@
q.text('}')
class vlan_vid(OXM):
- type_len = 0x80000c02
+ type_len = 2147486722
def __init__(self, value=None):
if value != None:
@@ -3827,9 +4044,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000c02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486722)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3855,7 +4072,7 @@
q.text('}')
class vlan_vid_masked(OXM):
- type_len = 0x80000d04
+ type_len = 2147486980
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3881,10 +4098,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000d04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486980)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3915,6 +4132,10 @@
parsers = {
+ 258049 : src_meta_id.unpack,
+ 258306 : src_meta_id_masked.unpack,
+ 258561 : dst_meta_id.unpack,
+ 258818 : dst_meta_id_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 d431d4c..56b5729 100644
--- a/src/python/loxi/of12/util.py
+++ b/src/python/loxi/of12/util.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template util.py
# Do not modify
@@ -35,3 +36,36 @@
if v == v2:
return k
return v
+
+def pack_port_no(value):
+ return struct.pack("!L", value)
+
+def unpack_port_no(reader):
+ return reader.read("!L")[0]
+
+def pack_fm_cmd(value):
+ return struct.pack("!B", value)
+
+def unpack_fm_cmd(reader):
+ return reader.read("!B")[0]
+
+def init_wc_bmap():
+ return 0
+
+def pack_wc_bmap(value):
+ return struct.pack("!Q", value)
+
+def unpack_wc_bmap(reader):
+ return reader.read("!Q")[0]
+
+def init_match_bmap():
+ return 0
+
+def pack_match_bmap(value):
+ return struct.pack("!Q", value)
+
+def unpack_match_bmap(reader):
+ return reader.read("!Q")[0]
+
+def pack_list(values):
+ return "".join([x.pack() for x in values])
diff --git a/src/python/loxi/of13/__init__.py b/src/python/loxi/of13/__init__.py
index 48364b1..2099537 100644
--- a/src/python/loxi/of13/__init__.py
+++ b/src/python/loxi/of13/__init__.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template init.py
# Do not modify
diff --git a/src/python/loxi/of13/action.py b/src/python/loxi/of13/action.py
index 2a0629c..645916a 100644
--- a/src/python/loxi/of13/action.py
+++ b/src/python/loxi/of13/action.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template action.py
# Do not modify
@@ -23,8 +24,8 @@
pass
class bsn_mirror(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 1
def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
@@ -63,16 +64,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 1)
- obj.dest_port = reader.read('!L')[0]
- obj.vlan_tag = reader.read('!L')[0]
- obj.copy_stage = reader.read('!B')[0]
+ obj.dest_port = reader.read("!L")[0]
+ obj.vlan_tag = reader.read("!L")[0]
+ obj.copy_stage = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -107,8 +108,8 @@
q.text('}')
class bsn_set_tunnel_dst(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 2
def __init__(self, dst=None):
@@ -136,14 +137,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 2)
- obj.dst = reader.read('!L')[0]
+ obj.dst = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -169,7 +170,7 @@
q.text('}')
class copy_ttl_in(Action):
- type = const.OFPAT_COPY_TTL_IN
+ type = 12
def __init__(self):
return
@@ -190,9 +191,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_IN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 12)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -216,7 +217,7 @@
q.text('}')
class copy_ttl_out(Action):
- type = const.OFPAT_COPY_TTL_OUT
+ type = 11
def __init__(self):
return
@@ -237,9 +238,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_OUT)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 11)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -263,7 +264,7 @@
q.text('}')
class dec_mpls_ttl(Action):
- type = const.OFPAT_DEC_MPLS_TTL
+ type = 16
def __init__(self):
return
@@ -284,9 +285,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_MPLS_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 16)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -310,7 +311,7 @@
q.text('}')
class dec_nw_ttl(Action):
- type = const.OFPAT_DEC_NW_TTL
+ type = 24
def __init__(self):
return
@@ -331,9 +332,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_NW_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 24)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -357,7 +358,7 @@
q.text('}')
class group(Action):
- type = const.OFPAT_GROUP
+ type = 22
def __init__(self, group_id=None):
if group_id != None:
@@ -382,10 +383,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_GROUP)
- _len = reader.read('!H')[0]
- obj.group_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 22)
+ _len = reader.read("!H")[0]
+ obj.group_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -411,8 +412,8 @@
q.text('}')
class nicira_dec_ttl(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x2320
+ type = 65535
+ experimenter = 8992
subtype = 18
def __init__(self):
@@ -437,12 +438,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 8992)
+ _subtype = reader.read("!H")[0]
assert(_subtype == 18)
reader.skip(2)
reader.skip(4)
@@ -468,7 +469,7 @@
q.text('}')
class output(Action):
- type = const.OFPAT_OUTPUT
+ type = 0
def __init__(self, port=None, max_len=None):
if port != None:
@@ -485,7 +486,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", self.max_len))
packed.append('\x00' * 6)
length = sum([len(x) for x in packed])
@@ -499,11 +500,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_OUTPUT)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!L')[0]
- obj.max_len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
+ obj.max_len = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -534,7 +535,7 @@
q.text('}')
class pop_mpls(Action):
- type = const.OFPAT_POP_MPLS
+ type = 20
def __init__(self, ethertype=None):
if ethertype != None:
@@ -560,10 +561,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 20)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -590,7 +591,7 @@
q.text('}')
class pop_pbb(Action):
- type = const.OFPAT_POP_PBB
+ type = 27
def __init__(self):
return
@@ -611,9 +612,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_PBB)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 27)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -637,7 +638,7 @@
q.text('}')
class pop_vlan(Action):
- type = const.OFPAT_POP_VLAN
+ type = 18
def __init__(self):
return
@@ -658,9 +659,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_VLAN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 18)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -684,7 +685,7 @@
q.text('}')
class push_mpls(Action):
- type = const.OFPAT_PUSH_MPLS
+ type = 19
def __init__(self, ethertype=None):
if ethertype != None:
@@ -710,10 +711,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 19)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -740,7 +741,7 @@
q.text('}')
class push_pbb(Action):
- type = const.OFPAT_PUSH_PBB
+ type = 26
def __init__(self, ethertype=None):
if ethertype != None:
@@ -766,10 +767,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_PBB)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 26)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -796,7 +797,7 @@
q.text('}')
class push_vlan(Action):
- type = const.OFPAT_PUSH_VLAN
+ type = 17
def __init__(self, ethertype=None):
if ethertype != None:
@@ -822,10 +823,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_VLAN)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 17)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -852,13 +853,13 @@
q.text('}')
class set_field(Action):
- type = const.OFPAT_SET_FIELD
+ type = 25
def __init__(self, field=None):
if field != None:
self.field = field
else:
- self.field = ""
+ self.field = ''
return
def pack(self):
@@ -877,9 +878,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_FIELD)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 25)
+ _len = reader.read("!H")[0]
obj.field = str(reader.read_all())
return obj
@@ -906,7 +907,7 @@
q.text('}')
class set_mpls_ttl(Action):
- type = const.OFPAT_SET_MPLS_TTL
+ type = 15
def __init__(self, mpls_ttl=None):
if mpls_ttl != None:
@@ -932,10 +933,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_MPLS_TTL)
- _len = reader.read('!H')[0]
- obj.mpls_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 15)
+ _len = reader.read("!H")[0]
+ obj.mpls_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -962,7 +963,7 @@
q.text('}')
class set_nw_ttl(Action):
- type = const.OFPAT_SET_NW_TTL
+ type = 23
def __init__(self, nw_ttl=None):
if nw_ttl != None:
@@ -988,10 +989,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_TTL)
- _len = reader.read('!H')[0]
- obj.nw_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 23)
+ _len = reader.read("!H")[0]
+ obj.nw_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1018,7 +1019,7 @@
q.text('}')
class set_queue(Action):
- type = const.OFPAT_SET_QUEUE
+ type = 21
def __init__(self, queue_id=None):
if queue_id != None:
@@ -1043,10 +1044,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_QUEUE)
- _len = reader.read('!H')[0]
- obj.queue_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 21)
+ _len = reader.read("!H")[0]
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1088,24 +1089,31 @@
raise loxi.ProtocolError("unexpected BSN experimenter subtype %#x" % subtype)
parsers = {
- const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
- const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
- const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
- const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
- const.OFPAT_EXPERIMENTER : parse_experimenter,
- const.OFPAT_GROUP : group.unpack,
const.OFPAT_OUTPUT : output.unpack,
- const.OFPAT_POP_MPLS : pop_mpls.unpack,
- const.OFPAT_POP_PBB : pop_pbb.unpack,
+ const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
+ const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
+ const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
+ const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
+ const.OFPAT_PUSH_VLAN : push_vlan.unpack,
const.OFPAT_POP_VLAN : pop_vlan.unpack,
const.OFPAT_PUSH_MPLS : push_mpls.unpack,
- const.OFPAT_PUSH_PBB : push_pbb.unpack,
- const.OFPAT_PUSH_VLAN : push_vlan.unpack,
- const.OFPAT_SET_FIELD : set_field.unpack,
- const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
- const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_POP_MPLS : pop_mpls.unpack,
const.OFPAT_SET_QUEUE : set_queue.unpack,
+ const.OFPAT_GROUP : group.unpack,
+ const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
+ const.OFPAT_SET_FIELD : set_field.unpack,
+ const.OFPAT_PUSH_PBB : push_pbb.unpack,
+ const.OFPAT_POP_PBB : pop_pbb.unpack,
+ const.OFPAT_EXPERIMENTER : parse_experimenter,
}
experimenter_parsers = {
+ 8992 : {
+ 18: nicira_dec_ttl.unpack,
+ },
+ 6035143 : {
+ 1: bsn_mirror.unpack,
+ 2: bsn_set_tunnel_dst.unpack,
+ },
}
diff --git a/src/python/loxi/of13/common.py b/src/python/loxi/of13/common.py
index 84572eb..e3f9921 100644
--- a/src/python/loxi/of13/common.py
+++ b/src/python/loxi/of13/common.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template common.py
# Do not modify
@@ -59,1100 +60,6 @@
return meter_stats.unpack(reader.slice(length))
return loxi.generic_util.unpack_list(reader, wrapper)
-class action_id_bsn_mirror(object):
-
- def __init__(self, type=None, experimenter=None, subtype=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if subtype != None:
- self.subtype = subtype
- else:
- self.subtype = 0
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(struct.pack("!L", self.subtype))
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_bsn_mirror()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
- obj.subtype = reader.read('!L')[0]
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.type != other.type: return False
- if self.experimenter != other.experimenter: return False
- if self.subtype != other.subtype: 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("action_id_bsn_mirror {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("subtype = ");
- q.text("%#x" % self.subtype)
- q.breakable()
- q.text('}')
-
-class action_id_bsn_set_tunnel_dst(object):
-
- def __init__(self, type=None, experimenter=None, subtype=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if subtype != None:
- self.subtype = subtype
- else:
- self.subtype = 0
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(struct.pack("!L", self.subtype))
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_bsn_set_tunnel_dst()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
- obj.subtype = reader.read('!L')[0]
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.type != other.type: return False
- if self.experimenter != other.experimenter: return False
- if self.subtype != other.subtype: 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("action_id_bsn_set_tunnel_dst {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("subtype = ");
- q.text("%#x" % self.subtype)
- q.breakable()
- q.text('}')
-
-class action_id_copy_ttl_in(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_copy_ttl_in()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_copy_ttl_in {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_copy_ttl_out(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_copy_ttl_out()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_copy_ttl_out {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_dec_mpls_ttl(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_dec_mpls_ttl()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_dec_mpls_ttl {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_dec_nw_ttl(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_dec_nw_ttl()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_dec_nw_ttl {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_experimenter(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_experimenter()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_experimenter {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_group(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_group()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_group {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_nicira_dec_ttl(object):
-
- def __init__(self, type=None, experimenter=None, subtype=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if subtype != None:
- self.subtype = subtype
- else:
- self.subtype = 0
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(struct.pack("!H", self.subtype))
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_nicira_dec_ttl()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
- obj.subtype = reader.read('!H')[0]
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.type != other.type: return False
- if self.experimenter != other.experimenter: return False
- if self.subtype != other.subtype: 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("action_id_nicira_dec_ttl {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("subtype = ");
- q.text("%#x" % self.subtype)
- q.breakable()
- q.text('}')
-
-class action_id_output(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_output()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_output {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_pop_mpls(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_pop_mpls()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_pop_mpls {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_pop_pbb(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_pop_pbb()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_pop_pbb {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_pop_vlan(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_pop_vlan()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_pop_vlan {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_push_mpls(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_push_mpls()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_push_mpls {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_push_pbb(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_push_pbb()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_push_pbb {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_push_vlan(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_push_vlan()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_push_vlan {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_set_field(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_set_field()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_set_field {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_set_mpls_ttl(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_set_mpls_ttl()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_set_mpls_ttl {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_set_nw_ttl(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_set_nw_ttl()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_set_nw_ttl {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
-class action_id_set_queue(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 len at index 1
- packed.append('\x00' * 4)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = action_id_set_queue()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _len = reader.read('!H')[0]
- reader.skip(4)
- 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("action_id_set_queue {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.breakable()
- q.text('}')
-
class bsn_interface(object):
def __init__(self, hw_addr=None, name=None, ipv4_addr=None, ipv4_netmask=None):
@@ -1193,8 +100,8 @@
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.ipv4_addr = reader.read('!L')[0]
- obj.ipv4_netmask = reader.read('!L')[0]
+ obj.ipv4_addr = reader.read("!L")[0]
+ obj.ipv4_netmask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1231,6 +138,100 @@
q.breakable()
q.text('}')
+class bsn_vport_q_in_q(object):
+ type = 0
+
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None):
+ if port_no != None:
+ self.port_no = port_no
+ else:
+ self.port_no = 0
+ if ingress_tpid != None:
+ self.ingress_tpid = ingress_tpid
+ else:
+ self.ingress_tpid = 0
+ if ingress_vlan_id != None:
+ self.ingress_vlan_id = ingress_vlan_id
+ else:
+ self.ingress_vlan_id = 0
+ if egress_tpid != None:
+ self.egress_tpid = egress_tpid
+ else:
+ self.egress_tpid = 0
+ if egress_vlan_id != None:
+ self.egress_vlan_id = egress_vlan_id
+ else:
+ self.egress_vlan_id = 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
+ packed.append(struct.pack("!L", self.port_no))
+ packed.append(struct.pack("!H", self.ingress_tpid))
+ packed.append(struct.pack("!H", self.ingress_vlan_id))
+ packed.append(struct.pack("!H", self.egress_tpid))
+ packed.append(struct.pack("!H", self.egress_vlan_id))
+ length = sum([len(x) for x in packed])
+ packed[1] = struct.pack("!H", length)
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = bsn_vport_q_in_q()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.port_no = reader.read("!L")[0]
+ obj.ingress_tpid = reader.read("!H")[0]
+ obj.ingress_vlan_id = reader.read("!H")[0]
+ obj.egress_tpid = reader.read("!H")[0]
+ obj.egress_vlan_id = reader.read("!H")[0]
+ return obj
+
+ def __eq__(self, other):
+ if type(self) != type(other): return False
+ if self.port_no != other.port_no: return False
+ if self.ingress_tpid != other.ingress_tpid: return False
+ if self.ingress_vlan_id != other.ingress_vlan_id: return False
+ if self.egress_tpid != other.egress_tpid: return False
+ if self.egress_vlan_id != other.egress_vlan_id: 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_vport_q_in_q {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("port_no = ");
+ q.text("%#x" % self.port_no)
+ q.text(","); q.breakable()
+ q.text("ingress_tpid = ");
+ q.text("%#x" % self.ingress_tpid)
+ q.text(","); q.breakable()
+ q.text("ingress_vlan_id = ");
+ q.text("%#x" % self.ingress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("egress_tpid = ");
+ q.text("%#x" % self.egress_tpid)
+ q.text(","); q.breakable()
+ q.text("egress_vlan_id = ");
+ q.text("%#x" % self.egress_vlan_id)
+ q.breakable()
+ q.text('}')
+
class bucket(object):
def __init__(self, weight=None, watch_port=None, watch_group=None, actions=None):
@@ -1256,10 +257,10 @@
packed = []
packed.append(struct.pack("!H", 0)) # placeholder for len at index 0
packed.append(struct.pack("!H", self.weight))
- packed.append(struct.pack("!L", self.watch_port))
+ packed.append(util.pack_port_no(self.watch_port))
packed.append(struct.pack("!L", self.watch_group))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -1271,10 +272,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _len = reader.read('!H')[0]
- obj.weight = reader.read('!H')[0]
- obj.watch_port = reader.read('!L')[0]
- obj.watch_group = reader.read('!L')[0]
+ _len = reader.read("!H")[0]
+ obj.weight = reader.read("!H")[0]
+ obj.watch_port = util.unpack_port_no(reader)
+ obj.watch_group = reader.read("!L")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -1339,8 +340,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1433,7 +434,7 @@
packed.append(struct.pack("!Q", self.packet_count))
packed.append(struct.pack("!Q", self.byte_count))
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -1445,18 +446,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(1)
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.priority = reader.read('!H')[0]
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
reader.skip(6)
- obj.cookie = reader.read('!Q')[0]
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
return obj
@@ -1546,7 +547,7 @@
packed.append(struct.pack("!B", self.type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
- packed.append("".join([x.pack() for x in self.buckets]))
+ packed.append(util.pack_list(self.buckets))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -1558,10 +559,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.type = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.type = reader.read("!B")[0]
reader.skip(1)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
return obj
@@ -1639,7 +640,7 @@
packed.append(struct.pack("!Q", self.byte_count))
packed.append(struct.pack("!L", self.duration_sec))
packed.append(struct.pack("!L", self.duration_nsec))
- packed.append("".join([x.pack() for x in self.bucket_stats]))
+ packed.append(util.pack_list(self.bucket_stats))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -1651,15 +652,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
+ _length = reader.read("!H")[0]
reader.skip(2)
- obj.group_id = reader.read('!L')[0]
- obj.ref_count = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
+ obj.ref_count = reader.read("!L")[0]
reader.skip(4)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
obj.bucket_stats = loxi.generic_util.unpack_list(reader, common.bucket_counter.unpack)
return obj
@@ -1710,7 +711,7 @@
q.text('}')
class hello_elem_versionbitmap(object):
- type = const.OFPHET_VERSIONBITMAP
+ type = 1
def __init__(self, bitmaps=None):
if bitmaps != None:
@@ -1723,7 +724,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.bitmaps]))
+ packed.append(util.pack_list(self.bitmaps))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -1735,9 +736,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPHET_VERSIONBITMAP)
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
obj.bitmaps = loxi.generic_util.unpack_list(reader, common.uint32.unpack)
return obj
@@ -1777,7 +778,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_list]))
+ packed.append(util.pack_list(self.oxm_list))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
packed.append('\x00' * ((length + 7)/8*8 - length))
@@ -1790,9 +791,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
assert(_type == 1)
- _length = reader.read('!H')[0]
+ _length = reader.read("!H")[0]
obj.oxm_list = oxm.unpack_list(reader.slice(_length-4))
reader.skip((_length + 7)/8*8 - _length)
return obj
@@ -1845,8 +846,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.packet_band_count = reader.read('!Q')[0]
- obj.byte_band_count = reader.read('!Q')[0]
+ obj.packet_band_count = reader.read("!Q")[0]
+ obj.byte_band_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1897,7 +898,7 @@
packed.append(struct.pack("!H", 0)) # placeholder for length at index 0
packed.append(struct.pack("!H", self.flags))
packed.append(struct.pack("!L", self.meter_id))
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -1909,9 +910,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.flags = reader.read('!H')[0]
- obj.meter_id = reader.read('!L')[0]
+ _length = reader.read("!H")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.meter_id = reader.read("!L")[0]
obj.entries = meter_band.unpack_list(reader)
return obj
@@ -1987,11 +988,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.max_meter = reader.read('!L')[0]
- obj.band_types = reader.read('!L')[0]
- obj.capabilities = reader.read('!L')[0]
- obj.max_bands = reader.read('!B')[0]
- obj.max_color = reader.read('!B')[0]
+ obj.max_meter = reader.read("!L")[0]
+ obj.band_types = reader.read("!L")[0]
+ obj.capabilities = reader.read("!L")[0]
+ obj.max_bands = reader.read("!B")[0]
+ obj.max_color = reader.read("!B")[0]
reader.skip(2)
return obj
@@ -2076,7 +1077,7 @@
packed.append(struct.pack("!Q", self.byte_in_count))
packed.append(struct.pack("!L", self.duration_sec))
packed.append(struct.pack("!L", self.duration_nsec))
- packed.append("".join([x.pack() for x in self.band_stats]))
+ packed.append(util.pack_list(self.band_stats))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -2088,14 +1089,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.meter_id = reader.read('!L')[0]
- _len = reader.read('!H')[0]
+ obj.meter_id = reader.read("!L")[0]
+ _len = reader.read("!H")[0]
reader.skip(6)
- obj.flow_count = reader.read('!L')[0]
- obj.packet_in_count = reader.read('!Q')[0]
- obj.byte_in_count = reader.read('!Q')[0]
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
+ obj.flow_count = reader.read("!L")[0]
+ obj.packet_in_count = reader.read("!Q")[0]
+ obj.byte_in_count = reader.read("!Q")[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
obj.band_stats = loxi.generic_util.unpack_list(reader, common.meter_band_stats.unpack)
return obj
@@ -2165,10 +1166,10 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.queue_id))
- packed.append(struct.pack("!L", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 2
packed.append('\x00' * 6)
- packed.append("".join([x.pack() for x in self.properties]))
+ packed.append(util.pack_list(self.properties))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2180,9 +1181,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.queue_id = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
- _len = reader.read('!H')[0]
+ obj.queue_id = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
+ _len = reader.read("!H")[0]
reader.skip(6)
obj.properties = common.unpack_list_queue_prop(reader)
return obj
@@ -2268,7 +1269,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append('\x00' * 2)
@@ -2290,19 +1291,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
obj.name = reader.read("!16s")[0].rstrip("\x00")
- obj.config = reader.read('!L')[0]
- obj.state = reader.read('!L')[0]
- obj.curr = reader.read('!L')[0]
- obj.advertised = reader.read('!L')[0]
- obj.supported = reader.read('!L')[0]
- obj.peer = reader.read('!L')[0]
- obj.curr_speed = reader.read('!L')[0]
- obj.max_speed = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.state = reader.read("!L")[0]
+ obj.curr = reader.read("!L")[0]
+ obj.advertised = reader.read("!L")[0]
+ obj.supported = reader.read("!L")[0]
+ obj.peer = reader.read("!L")[0]
+ obj.curr_speed = reader.read("!L")[0]
+ obj.max_speed = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2434,7 +1435,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.rx_packets))
packed.append(struct.pack("!Q", self.tx_packets))
@@ -2459,22 +1460,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
- obj.rx_packets = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.rx_bytes = reader.read('!Q')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.rx_dropped = reader.read('!Q')[0]
- obj.tx_dropped = reader.read('!Q')[0]
- obj.rx_errors = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
- obj.rx_frame_err = reader.read('!Q')[0]
- obj.rx_over_err = reader.read('!Q')[0]
- obj.rx_crc_err = reader.read('!Q')[0]
- obj.collisions = reader.read('!Q')[0]
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
+ obj.rx_packets = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.rx_bytes = reader.read("!Q")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.rx_dropped = reader.read("!Q")[0]
+ obj.tx_dropped = reader.read("!Q")[0]
+ obj.rx_errors = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
+ obj.rx_frame_err = reader.read("!Q")[0]
+ obj.rx_over_err = reader.read("!Q")[0]
+ obj.rx_crc_err = reader.read("!Q")[0]
+ obj.collisions = reader.read("!Q")[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2556,7 +1557,7 @@
q.text('}')
class queue_prop_experimenter(object):
- type = const.OFPQT_EXPERIMENTER
+ type = 65535
def __init__(self, experimenter=None, data=None):
if experimenter != None:
@@ -2566,7 +1567,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
return
def pack(self):
@@ -2588,11 +1589,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_EXPERIMENTER)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.experimenter = reader.read('!L')[0]
+ obj.experimenter = reader.read("!L")[0]
reader.skip(4)
obj.data = str(reader.read_all())
return obj
@@ -2624,7 +1625,7 @@
q.text('}')
class queue_prop_max_rate(object):
- type = const.OFPQT_MAX_RATE
+ type = 2
def __init__(self, rate=None):
if rate != None:
@@ -2651,11 +1652,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_MAX_RATE)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.rate = reader.read('!H')[0]
+ obj.rate = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -2682,7 +1683,7 @@
q.text('}')
class queue_prop_min_rate(object):
- type = const.OFPQT_MIN_RATE
+ type = 1
def __init__(self, rate=None):
if rate != None:
@@ -2709,11 +1710,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPQT_MIN_RATE)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.rate = reader.read('!H')[0]
+ obj.rate = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -2774,7 +1775,7 @@
def pack(self):
packed = []
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!L", self.queue_id))
packed.append(struct.pack("!Q", self.tx_bytes))
packed.append(struct.pack("!Q", self.tx_packets))
@@ -2790,13 +1791,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.port_no = reader.read('!L')[0]
- obj.queue_id = reader.read('!L')[0]
- obj.tx_bytes = reader.read('!Q')[0]
- obj.tx_packets = reader.read('!Q')[0]
- obj.tx_errors = reader.read('!Q')[0]
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.queue_id = reader.read("!L")[0]
+ obj.tx_bytes = reader.read("!Q")[0]
+ obj.tx_packets = reader.read("!Q")[0]
+ obj.tx_errors = reader.read("!Q")[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2846,12 +1847,9 @@
q.text('}')
class table_feature_prop_apply_actions(object):
+ type = 6
- def __init__(self, type=None, action_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, action_ids=None):
if action_ids != None:
self.action_ids = action_ids
else:
@@ -2862,7 +1860,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.action_ids]))
+ packed.append(util.pack_list(self.action_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -2874,14 +1872,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
- obj.action_ids = loxi.unimplemented('unpack list of_list_action_id_t')
+ _type = reader.read("!H")[0]
+ assert(_type == 6)
+ _length = reader.read("!H")[0]
+ obj.action_ids = loxi.unimplemented('unpack list(of_action_id_t)')
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.action_ids != other.action_ids: return False
return True
@@ -2897,21 +1895,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("action_ids = ");
q.pp(self.action_ids)
q.breakable()
q.text('}')
class table_feature_prop_apply_actions_miss(object):
+ type = 7
- def __init__(self, type=None, action_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, action_ids=None):
if action_ids != None:
self.action_ids = action_ids
else:
@@ -2922,7 +1914,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.action_ids]))
+ packed.append(util.pack_list(self.action_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -2934,14 +1926,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
- obj.action_ids = loxi.unimplemented('unpack list of_list_action_id_t')
+ _type = reader.read("!H")[0]
+ assert(_type == 7)
+ _length = reader.read("!H")[0]
+ obj.action_ids = loxi.unimplemented('unpack list(of_action_id_t)')
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.action_ids != other.action_ids: return False
return True
@@ -2957,21 +1949,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("action_ids = ");
q.pp(self.action_ids)
q.breakable()
q.text('}')
class table_feature_prop_apply_setfield(object):
+ type = 14
- def __init__(self, type=None, oxm_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, oxm_ids=None):
if oxm_ids != None:
self.oxm_ids = oxm_ids
else:
@@ -2982,7 +1968,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_ids]))
+ packed.append(util.pack_list(self.oxm_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -2994,14 +1980,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.oxm_ids != other.oxm_ids: return False
return True
@@ -3017,21 +2003,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("oxm_ids = ");
q.pp(self.oxm_ids)
q.breakable()
q.text('}')
class table_feature_prop_apply_setfield_miss(object):
+ type = 15
- def __init__(self, type=None, oxm_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, oxm_ids=None):
if oxm_ids != None:
self.oxm_ids = oxm_ids
else:
@@ -3042,7 +2022,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_ids]))
+ packed.append(util.pack_list(self.oxm_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3054,14 +2034,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 15)
+ _length = reader.read("!H")[0]
obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.oxm_ids != other.oxm_ids: return False
return True
@@ -3077,21 +2057,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("oxm_ids = ");
q.pp(self.oxm_ids)
q.breakable()
q.text('}')
class table_feature_prop_experimenter(object):
+ type = 65535
- def __init__(self, type=None, experimenter=None, subtype=None, experimenter_data=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, experimenter=None, subtype=None, experimenter_data=None):
if experimenter != None:
self.experimenter = experimenter
else:
@@ -3103,7 +2077,7 @@
if experimenter_data != None:
self.experimenter_data = experimenter_data
else:
- self.experimenter_data = ""
+ self.experimenter_data = ''
return
def pack(self):
@@ -3124,16 +2098,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
- obj.subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _length = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
+ obj.subtype = reader.read("!L")[0]
obj.experimenter_data = str(reader.read_all())
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.experimenter != other.experimenter: return False
if self.subtype != other.subtype: return False
if self.experimenter_data != other.experimenter_data: return False
@@ -3151,9 +2125,6 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("experimenter = ");
q.text("%#x" % self.experimenter)
q.text(","); q.breakable()
@@ -3166,12 +2137,9 @@
q.text('}')
class table_feature_prop_instructions(object):
+ type = 0
- def __init__(self, type=None, instruction_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, instruction_ids=None):
if instruction_ids != None:
self.instruction_ids = instruction_ids
else:
@@ -3182,7 +2150,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.instruction_ids]))
+ packed.append(util.pack_list(self.instruction_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3194,14 +2162,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
obj.instruction_ids = instruction.unpack_list(reader)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.instruction_ids != other.instruction_ids: return False
return True
@@ -3217,21 +2185,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("instruction_ids = ");
q.pp(self.instruction_ids)
q.breakable()
q.text('}')
class table_feature_prop_instructions_miss(object):
+ type = 1
- def __init__(self, type=None, instruction_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, instruction_ids=None):
if instruction_ids != None:
self.instruction_ids = instruction_ids
else:
@@ -3242,7 +2204,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.instruction_ids]))
+ packed.append(util.pack_list(self.instruction_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3254,14 +2216,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _length = reader.read("!H")[0]
obj.instruction_ids = instruction.unpack_list(reader)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.instruction_ids != other.instruction_ids: return False
return True
@@ -3277,21 +2239,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("instruction_ids = ");
q.pp(self.instruction_ids)
q.breakable()
q.text('}')
class table_feature_prop_match(object):
+ type = 8
- def __init__(self, type=None, oxm_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, oxm_ids=None):
if oxm_ids != None:
self.oxm_ids = oxm_ids
else:
@@ -3302,7 +2258,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_ids]))
+ packed.append(util.pack_list(self.oxm_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3314,14 +2270,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 8)
+ _length = reader.read("!H")[0]
obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.oxm_ids != other.oxm_ids: return False
return True
@@ -3337,21 +2293,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("oxm_ids = ");
q.pp(self.oxm_ids)
q.breakable()
q.text('}')
class table_feature_prop_next_tables(object):
+ type = 2
- def __init__(self, type=None, next_table_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, next_table_ids=None):
if next_table_ids != None:
self.next_table_ids = next_table_ids
else:
@@ -3362,7 +2312,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.next_table_ids]))
+ packed.append(util.pack_list(self.next_table_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3374,14 +2324,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _length = reader.read("!H")[0]
obj.next_table_ids = loxi.generic_util.unpack_list(reader, common.uint8.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.next_table_ids != other.next_table_ids: return False
return True
@@ -3397,21 +2347,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("next_table_ids = ");
q.pp(self.next_table_ids)
q.breakable()
q.text('}')
class table_feature_prop_next_tables_miss(object):
+ type = 3
- def __init__(self, type=None, next_table_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, next_table_ids=None):
if next_table_ids != None:
self.next_table_ids = next_table_ids
else:
@@ -3422,7 +2366,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.next_table_ids]))
+ packed.append(util.pack_list(self.next_table_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3434,14 +2378,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 3)
+ _length = reader.read("!H")[0]
obj.next_table_ids = loxi.generic_util.unpack_list(reader, common.uint8.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.next_table_ids != other.next_table_ids: return False
return True
@@ -3457,21 +2401,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("next_table_ids = ");
q.pp(self.next_table_ids)
q.breakable()
q.text('}')
class table_feature_prop_wildcards(object):
+ type = 10
- def __init__(self, type=None, oxm_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, oxm_ids=None):
if oxm_ids != None:
self.oxm_ids = oxm_ids
else:
@@ -3482,7 +2420,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_ids]))
+ packed.append(util.pack_list(self.oxm_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3494,14 +2432,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 10)
+ _length = reader.read("!H")[0]
obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.oxm_ids != other.oxm_ids: return False
return True
@@ -3517,21 +2455,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("oxm_ids = ");
q.pp(self.oxm_ids)
q.breakable()
q.text('}')
class table_feature_prop_write_actions(object):
+ type = 4
- def __init__(self, type=None, action_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, action_ids=None):
if action_ids != None:
self.action_ids = action_ids
else:
@@ -3542,7 +2474,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.action_ids]))
+ packed.append(util.pack_list(self.action_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3554,14 +2486,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
- obj.action_ids = loxi.unimplemented('unpack list of_list_action_id_t')
+ _type = reader.read("!H")[0]
+ assert(_type == 4)
+ _length = reader.read("!H")[0]
+ obj.action_ids = loxi.unimplemented('unpack list(of_action_id_t)')
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.action_ids != other.action_ids: return False
return True
@@ -3577,21 +2509,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("action_ids = ");
q.pp(self.action_ids)
q.breakable()
q.text('}')
class table_feature_prop_write_actions_miss(object):
+ type = 5
- def __init__(self, type=None, action_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, action_ids=None):
if action_ids != None:
self.action_ids = action_ids
else:
@@ -3602,7 +2528,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.action_ids]))
+ packed.append(util.pack_list(self.action_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3614,14 +2540,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
- obj.action_ids = loxi.unimplemented('unpack list of_list_action_id_t')
+ _type = reader.read("!H")[0]
+ assert(_type == 5)
+ _length = reader.read("!H")[0]
+ obj.action_ids = loxi.unimplemented('unpack list(of_action_id_t)')
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.action_ids != other.action_ids: return False
return True
@@ -3637,21 +2563,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("action_ids = ");
q.pp(self.action_ids)
q.breakable()
q.text('}')
class table_feature_prop_write_setfield(object):
+ type = 12
- def __init__(self, type=None, oxm_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, oxm_ids=None):
if oxm_ids != None:
self.oxm_ids = oxm_ids
else:
@@ -3662,7 +2582,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_ids]))
+ packed.append(util.pack_list(self.oxm_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3674,14 +2594,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 12)
+ _length = reader.read("!H")[0]
obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.oxm_ids != other.oxm_ids: return False
return True
@@ -3697,21 +2617,15 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("oxm_ids = ");
q.pp(self.oxm_ids)
q.breakable()
q.text('}')
class table_feature_prop_write_setfield_miss(object):
+ type = 13
- def __init__(self, type=None, oxm_ids=None):
- if type != None:
- self.type = type
- else:
- self.type = 0
+ def __init__(self, oxm_ids=None):
if oxm_ids != None:
self.oxm_ids = oxm_ids
else:
@@ -3722,7 +2636,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
- packed.append("".join([x.pack() for x in self.oxm_ids]))
+ packed.append(util.pack_list(self.oxm_ids))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -3734,14 +2648,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.type = reader.read('!H')[0]
- _length = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 13)
+ _length = reader.read("!H")[0]
obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack)
return obj
def __eq__(self, other):
if type(self) != type(other): return False
- if self.type != other.type: return False
if self.oxm_ids != other.oxm_ids: return False
return True
@@ -3757,9 +2671,6 @@
with q.group():
with q.indent(2):
q.breakable()
- q.text("type = ");
- q.text("%#x" % self.type)
- q.text(","); q.breakable()
q.text("oxm_ids = ");
q.pp(self.oxm_ids)
q.breakable()
@@ -3808,7 +2719,7 @@
packed.append(struct.pack("!Q", self.metadata_write))
packed.append(struct.pack("!L", self.config))
packed.append(struct.pack("!L", self.max_entries))
- packed.append("".join([x.pack() for x in self.properties]))
+ packed.append(util.pack_list(self.properties))
length = sum([len(x) for x in packed])
packed[0] = struct.pack("!H", length)
return ''.join(packed)
@@ -3820,15 +2731,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _length = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _length = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(5)
obj.name = reader.read("!32s")[0].rstrip("\x00")
- obj.metadata_match = reader.read('!Q')[0]
- obj.metadata_write = reader.read('!Q')[0]
- obj.config = reader.read('!L')[0]
- obj.max_entries = reader.read('!L')[0]
- obj.properties = loxi.unimplemented('unpack list of_list_table_feature_prop_t')
+ obj.metadata_match = reader.read("!Q")[0]
+ obj.metadata_write = reader.read("!Q")[0]
+ obj.config = reader.read("!L")[0]
+ obj.max_entries = reader.read("!L")[0]
+ obj.properties = loxi.unimplemented('unpack list(of_table_feature_prop_t)')
return obj
def __eq__(self, other):
@@ -3914,11 +2825,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.active_count = reader.read('!L')[0]
- obj.lookup_count = reader.read('!Q')[0]
- obj.matched_count = reader.read('!Q')[0]
+ obj.active_count = reader.read("!L")[0]
+ obj.lookup_count = reader.read("!Q")[0]
+ obj.matched_count = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -3976,7 +2887,7 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.value = reader.read('!L')[0]
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -4022,7 +2933,7 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- obj.value = reader.read('!B')[0]
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
diff --git a/src/python/loxi/of13/const.py b/src/python/loxi/of13/const.py
index c04b1db..e2545f1 100644
--- a/src/python/loxi/of13/const.py
+++ b/src/python/loxi/of13/const.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template const.py
# Do not modify
@@ -8,21 +9,21 @@
OFP_VERSION = 4
# Identifiers from group macro_definitions
-OFP_VLAN_NONE = 0
-OFP_FLOW_PERMANENT = 0
-OFP_ETH_ALEN = 6
-OFP_MAX_PORT_NAME_LEN = 16
OFP_MAX_TABLE_NAME_LEN = 32
-SERIAL_NUM_LEN = 32
-OFP_DEFAULT_MISS_SEND_LEN = 128
-DESC_STR_LEN = 256
+OFP_MAX_PORT_NAME_LEN = 16
OFP_TCP_PORT = 6633
OFP_SSL_PORT = 6633
+OFP_ETH_ALEN = 6
+OFP_DEFAULT_MISS_SEND_LEN = 128
+OFP_VLAN_NONE = 0
+OFP_FLOW_PERMANENT = 0
OFP_DEFAULT_PRIORITY = 32768
-OFPQ_MIN_RATE_UNCFG = 65535
-OFPQ_MAX_RATE_UNCFG = 65535
-OFPQ_ALL = 4294967295
OFP_NO_BUFFER = 4294967295
+DESC_STR_LEN = 256
+SERIAL_NUM_LEN = 32
+OFPQ_ALL = 4294967295
+OFPQ_MAX_RATE_UNCFG = 65535
+OFPQ_MIN_RATE_UNCFG = 65535
# Identifiers from group ofp_action_type
OFPAT_OUTPUT = 0
@@ -185,6 +186,13 @@
13: 'OFPBRC_MULTIPART_BUFFER_OVERFLOW',
}
+# Identifiers from group ofp_bsn_vport_q_in_q_untagged
+OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 65535
+
+ofp_bsn_vport_q_in_q_untagged_map = {
+ 65535: 'OF_BSN_VPORT_Q_IN_Q_UNTAGGED',
+}
+
# Identifiers from group ofp_capabilities
OFPC_FLOW_STATS = 1
OFPC_TABLE_STATS = 2
diff --git a/src/python/loxi/of13/instruction.py b/src/python/loxi/of13/instruction.py
index 08b5124..5b825d0 100644
--- a/src/python/loxi/of13/instruction.py
+++ b/src/python/loxi/of13/instruction.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template instruction.py
# Do not modify
@@ -24,7 +25,7 @@
pass
class apply_actions(Instruction):
- type = const.OFPIT_APPLY_ACTIONS
+ type = 4
def __init__(self, actions=None):
if actions != None:
@@ -38,7 +39,7 @@
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -50,9 +51,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_APPLY_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 4)
+ _len = reader.read("!H")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -80,7 +81,7 @@
q.text('}')
class clear_actions(Instruction):
- type = const.OFPIT_CLEAR_ACTIONS
+ type = 5
def __init__(self):
return
@@ -101,9 +102,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_CLEAR_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 5)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -127,7 +128,7 @@
q.text('}')
class experimenter(Instruction):
- type = const.OFPIT_EXPERIMENTER
+ type = 65535
def __init__(self, experimenter=None, data=None):
if experimenter != None:
@@ -137,7 +138,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
return
def pack(self):
@@ -157,10 +158,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- obj.experimenter = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ obj.experimenter = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -191,7 +192,7 @@
q.text('}')
class goto_table(Instruction):
- type = const.OFPIT_GOTO_TABLE
+ type = 1
def __init__(self, table_id=None):
if table_id != None:
@@ -217,10 +218,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_GOTO_TABLE)
- _len = reader.read('!H')[0]
- obj.table_id = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -247,7 +248,7 @@
q.text('}')
class meter(Instruction):
- type = const.OFPIT_METER
+ type = 6
def __init__(self, meter_id=None):
if meter_id != None:
@@ -272,10 +273,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_METER)
- _len = reader.read('!H')[0]
- obj.meter_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 6)
+ _len = reader.read("!H")[0]
+ obj.meter_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -301,7 +302,7 @@
q.text('}')
class write_actions(Instruction):
- type = const.OFPIT_WRITE_ACTIONS
+ type = 3
def __init__(self, actions=None):
if actions != None:
@@ -315,7 +316,7 @@
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -327,9 +328,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_WRITE_ACTIONS)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 3)
+ _len = reader.read("!H")[0]
reader.skip(4)
obj.actions = action.unpack_list(reader)
return obj
@@ -357,7 +358,7 @@
q.text('}')
class write_metadata(Instruction):
- type = const.OFPIT_WRITE_METADATA
+ type = 2
def __init__(self, metadata=None, metadata_mask=None):
if metadata != None:
@@ -388,12 +389,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPIT_WRITE_METADATA)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
reader.skip(4)
- obj.metadata = reader.read('!Q')[0]
- obj.metadata_mask = reader.read('!Q')[0]
+ obj.metadata = reader.read("!Q")[0]
+ obj.metadata_mask = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -424,11 +425,11 @@
parsers = {
+ const.OFPIT_GOTO_TABLE : goto_table.unpack,
+ const.OFPIT_WRITE_METADATA : write_metadata.unpack,
+ const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
const.OFPIT_APPLY_ACTIONS : apply_actions.unpack,
const.OFPIT_CLEAR_ACTIONS : clear_actions.unpack,
- const.OFPIT_EXPERIMENTER : experimenter.unpack,
- const.OFPIT_GOTO_TABLE : goto_table.unpack,
const.OFPIT_METER : meter.unpack,
- const.OFPIT_WRITE_ACTIONS : write_actions.unpack,
- const.OFPIT_WRITE_METADATA : write_metadata.unpack,
+ const.OFPIT_EXPERIMENTER : experimenter.unpack,
}
diff --git a/src/python/loxi/of13/message.py b/src/python/loxi/of13/message.py
index 46376d1..543442b 100644
--- a/src/python/loxi/of13/message.py
+++ b/src/python/loxi/of13/message.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template message.py
# Do not modify
@@ -21,8 +22,8 @@
xid = None
class aggregate_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 2
def __init__(self, xid=None, flags=None, packet_count=None, byte_count=None, flow_count=None):
@@ -69,19 +70,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 2)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
- obj.flow_count = reader.read('!L')[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
+ obj.flow_count = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -132,8 +133,8 @@
q.text('}')
class aggregate_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 2
def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
@@ -178,7 +179,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 3)
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.cookie))
@@ -196,23 +197,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 2)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
reader.skip(4)
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -275,8 +276,8 @@
q.text('}')
class async_get_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_ASYNC_REPLY
+ version = 4
+ type = 27
def __init__(self, xid=None, packet_in_mask_equal_master=None, packet_in_mask_slave=None, port_status_mask_equal_master=None, port_status_mask_slave=None, flow_removed_mask_equal_master=None, flow_removed_mask_slave=None):
self.xid = xid
@@ -329,18 +330,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_ASYNC_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.packet_in_mask_equal_master = reader.read('!L')[0]
- obj.packet_in_mask_slave = reader.read('!L')[0]
- obj.port_status_mask_equal_master = reader.read('!L')[0]
- obj.port_status_mask_slave = reader.read('!L')[0]
- obj.flow_removed_mask_equal_master = reader.read('!L')[0]
- obj.flow_removed_mask_slave = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 27)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.packet_in_mask_equal_master = reader.read("!L")[0]
+ obj.packet_in_mask_slave = reader.read("!L")[0]
+ obj.port_status_mask_equal_master = reader.read("!L")[0]
+ obj.port_status_mask_slave = reader.read("!L")[0]
+ obj.flow_removed_mask_equal_master = reader.read("!L")[0]
+ obj.flow_removed_mask_slave = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -398,8 +399,8 @@
q.text('}')
class async_get_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_ASYNC_REQUEST
+ version = 4
+ type = 26
def __init__(self, xid=None, packet_in_mask_equal_master=None, packet_in_mask_slave=None, port_status_mask_equal_master=None, port_status_mask_slave=None, flow_removed_mask_equal_master=None, flow_removed_mask_slave=None):
self.xid = xid
@@ -452,18 +453,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_ASYNC_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.packet_in_mask_equal_master = reader.read('!L')[0]
- obj.packet_in_mask_slave = reader.read('!L')[0]
- obj.port_status_mask_equal_master = reader.read('!L')[0]
- obj.port_status_mask_slave = reader.read('!L')[0]
- obj.flow_removed_mask_equal_master = reader.read('!L')[0]
- obj.flow_removed_mask_slave = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 26)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.packet_in_mask_equal_master = reader.read("!L")[0]
+ obj.packet_in_mask_slave = reader.read("!L")[0]
+ obj.port_status_mask_equal_master = reader.read("!L")[0]
+ obj.port_status_mask_slave = reader.read("!L")[0]
+ obj.flow_removed_mask_equal_master = reader.read("!L")[0]
+ obj.flow_removed_mask_slave = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -521,8 +522,8 @@
q.text('}')
class async_set(Message):
- version = const.OFP_VERSION
- type = const.OFPT_SET_ASYNC
+ version = 4
+ type = 28
def __init__(self, xid=None, packet_in_mask_equal_master=None, packet_in_mask_slave=None, port_status_mask_equal_master=None, port_status_mask_slave=None, flow_removed_mask_equal_master=None, flow_removed_mask_slave=None):
self.xid = xid
@@ -575,18 +576,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_SET_ASYNC)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.packet_in_mask_equal_master = reader.read('!L')[0]
- obj.packet_in_mask_slave = reader.read('!L')[0]
- obj.port_status_mask_equal_master = reader.read('!L')[0]
- obj.port_status_mask_slave = reader.read('!L')[0]
- obj.flow_removed_mask_equal_master = reader.read('!L')[0]
- obj.flow_removed_mask_slave = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 28)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.packet_in_mask_equal_master = reader.read("!L")[0]
+ obj.packet_in_mask_slave = reader.read("!L")[0]
+ obj.port_status_mask_equal_master = reader.read("!L")[0]
+ obj.port_status_mask_slave = reader.read("!L")[0]
+ obj.flow_removed_mask_equal_master = reader.read("!L")[0]
+ obj.flow_removed_mask_slave = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -644,8 +645,8 @@
q.text('}')
class barrier_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REPLY
+ version = 4
+ type = 21
def __init__(self, xid=None):
self.xid = xid
@@ -668,12 +669,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 21)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -707,8 +708,8 @@
q.text('}')
class barrier_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_BARRIER_REQUEST
+ version = 4
+ type = 20
def __init__(self, xid=None):
self.xid = xid
@@ -731,12 +732,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_BARRIER_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 20)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -769,10 +770,486 @@
q.breakable()
q.text('}')
+class bsn_bw_clear_data_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 22
+
+ 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_bw_clear_data_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 == 22)
+ 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_bw_clear_data_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_bw_clear_data_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 21
+
+ 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_bw_clear_data_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 == 21)
+ 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_bw_clear_data_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_bw_enable_get_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 20
+
+ 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_bw_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 == 20)
+ 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_bw_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_bw_enable_get_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 19
+
+ 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_bw_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 == 19)
+ 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_bw_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_bw_enable_set_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 23
+
+ 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_bw_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 == 23)
+ 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_bw_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_bw_enable_set_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 18
+
+ 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_bw_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 == 18)
+ 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_bw_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 = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 4
+ type = 4
+ experimenter = 6035143
subtype = 10
def __init__(self, xid=None, interfaces=None):
@@ -790,7 +1267,7 @@
packed.append(struct.pack("!L", self.xid))
packed.append(struct.pack("!L", self.experimenter))
packed.append(struct.pack("!L", self.subtype))
- packed.append("".join([x.pack() for x in self.interfaces]))
+ packed.append(util.pack_list(self.interfaces))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -803,15 +1280,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 10)
obj.interfaces = loxi.generic_util.unpack_list(reader, common.bsn_interface.unpack)
return obj
@@ -851,9 +1328,9 @@
q.text('}')
class bsn_get_interfaces_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 4
+ type = 4
+ experimenter = 6035143
subtype = 9
def __init__(self, xid=None):
@@ -879,15 +1356,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 9)
return obj
@@ -922,9 +1399,9 @@
q.text('}')
class bsn_get_mirroring_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 4
+ type = 4
+ experimenter = 6035143
subtype = 5
def __init__(self, xid=None, report_mirror_ports=None):
@@ -956,17 +1433,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 5)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1005,9 +1482,9 @@
q.text('}')
class bsn_get_mirroring_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 4
+ type = 4
+ experimenter = 6035143
subtype = 4
def __init__(self, xid=None, report_mirror_ports=None):
@@ -1039,17 +1516,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 4)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1088,9 +1565,9 @@
q.text('}')
class bsn_set_mirroring(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+ version = 4
+ type = 4
+ experimenter = 6035143
subtype = 3
def __init__(self, xid=None, report_mirror_ports=None):
@@ -1122,17 +1599,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 3)
- obj.report_mirror_ports = reader.read('!B')[0]
+ obj.report_mirror_ports = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1170,10 +1647,91 @@
q.breakable()
q.text('}')
-class bsn_set_pktin_suppression(Message):
- version = const.OFP_VERSION
- type = const.OFPT_EXPERIMENTER
- experimenter = 0x5c16c7
+class bsn_set_pktin_suppression_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 25
+
+ 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_set_pktin_suppression_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 == 25)
+ 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_set_pktin_suppression_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_set_pktin_suppression_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
subtype = 11
def __init__(self, xid=None, enabled=None, idle_timeout=None, hard_timeout=None, priority=None, cookie=None):
@@ -1220,27 +1778,27 @@
@staticmethod
def unpack(buf):
if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = bsn_set_pktin_suppression()
+ obj = bsn_set_pktin_suppression_request()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_EXPERIMENTER)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _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 == 11)
- obj.enabled = reader.read('!B')[0]
+ obj.enabled = reader.read("!B")[0]
reader.skip(1)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.cookie = reader.read('!Q')[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.cookie = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -1266,7 +1824,7 @@
return loxi.pp.pp(self)
def pretty_print(self, q):
- q.text("bsn_set_pktin_suppression {")
+ q.text("bsn_set_pktin_suppression_request {")
with q.group():
with q.indent(2):
q.breakable()
@@ -1293,9 +1851,343 @@
q.breakable()
q.text('}')
+class bsn_virtual_port_create_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 16
+
+ def __init__(self, xid=None, status=None, vport_no=None):
+ self.xid = xid
+ if status != None:
+ self.status = status
+ else:
+ self.status = 0
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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))
+ packed.append(struct.pack("!L", self.vport_no))
+ 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_virtual_port_create_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 == 16)
+ obj.status = reader.read("!L")[0]
+ obj.vport_no = 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
+ if self.vport_no != other.vport_no: 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_virtual_port_create_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.text(","); q.breakable()
+ q.text("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_create_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 15
+
+ def __init__(self, xid=None, vport=None):
+ self.xid = xid
+ if vport != None:
+ self.vport = vport
+ else:
+ self.vport = common.bsn_vport_q_in_q()
+
+ 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(self.vport.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_virtual_port_create_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 == 15)
+ obj.vport = common.bsn_vport_q_in_q.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.vport != other.vport: 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_virtual_port_create_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("vport = ");
+ q.pp(self.vport)
+ q.breakable()
+ q.text('}')
+
+class bsn_virtual_port_remove_reply(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 26
+
+ 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_virtual_port_remove_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 == 26)
+ 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_virtual_port_remove_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_virtual_port_remove_request(Message):
+ version = 4
+ type = 4
+ experimenter = 6035143
+ subtype = 17
+
+ def __init__(self, xid=None, vport_no=None):
+ self.xid = xid
+ if vport_no != None:
+ self.vport_no = vport_no
+ else:
+ self.vport_no = 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.vport_no))
+ 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_virtual_port_remove_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 == 17)
+ obj.vport_no = 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.vport_no != other.vport_no: 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_virtual_port_remove_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("vport_no = ");
+ q.text("%#x" % self.vport_no)
+ q.breakable()
+ q.text('}')
+
class desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 0
def __init__(self, xid=None, flags=None, mfr_desc=None, hw_desc=None, sw_desc=None, serial_num=None, dp_desc=None):
@@ -1351,15 +2243,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 0)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.mfr_desc = reader.read("!256s")[0].rstrip("\x00")
obj.hw_desc = reader.read("!256s")[0].rstrip("\x00")
@@ -1423,8 +2315,8 @@
q.text('}')
class desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 0
def __init__(self, xid=None, flags=None):
@@ -1455,15 +2347,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 0)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -1502,15 +2394,15 @@
q.text('}')
class echo_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REPLY
+ version = 4
+ type = 3
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1531,12 +2423,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 3)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1575,15 +2467,15 @@
q.text('}')
class echo_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ECHO_REQUEST
+ version = 4
+ type = 2
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1604,12 +2496,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ECHO_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 2)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -1648,8 +2540,8 @@
q.text('}')
class error_msg(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ERROR
+ version = 4
+ type = 1
def __init__(self, xid=None, err_type=None, code=None, data=None):
self.xid = xid
@@ -1664,7 +2556,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -1687,14 +2579,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ERROR)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.err_type = reader.read('!H')[0]
- obj.code = reader.read('!H')[0]
+ _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]
+ obj.err_type = reader.read("!H")[0]
+ obj.code = reader.read("!H")[0]
obj.data = str(reader.read_all())
return obj
@@ -1741,8 +2633,8 @@
q.text('}')
class features_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REPLY
+ version = 4
+ type = 6
def __init__(self, xid=None, datapath_id=None, n_buffers=None, n_tables=None, auxiliary_id=None, capabilities=None, reserved=None):
self.xid = xid
@@ -1796,19 +2688,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.datapath_id = reader.read('!Q')[0]
- obj.n_buffers = reader.read('!L')[0]
- obj.n_tables = reader.read('!B')[0]
- obj.auxiliary_id = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 6)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.datapath_id = reader.read("!Q")[0]
+ obj.n_buffers = reader.read("!L")[0]
+ obj.n_tables = reader.read("!B")[0]
+ obj.auxiliary_id = reader.read("!B")[0]
reader.skip(2)
- obj.capabilities = reader.read('!L')[0]
- obj.reserved = reader.read('!L')[0]
+ obj.capabilities = reader.read("!L")[0]
+ obj.reserved = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1866,8 +2758,8 @@
q.text('}')
class features_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FEATURES_REQUEST
+ version = 4
+ type = 5
def __init__(self, xid=None):
self.xid = xid
@@ -1890,12 +2782,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FEATURES_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 5)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1929,9 +2821,9 @@
q.text('}')
class flow_add(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_ADD
+ version = 4
+ type = 14
+ _command = 0
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -1993,17 +2885,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2016,24 +2908,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_ADD)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 0)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2118,9 +3010,9 @@
q.text('}')
class flow_delete(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE
+ version = 4
+ type = 14
+ _command = 3
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2182,17 +3074,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2205,24 +3097,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_DELETE)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 3)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2307,9 +3199,9 @@
q.text('}')
class flow_delete_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_DELETE_STRICT
+ version = 4
+ type = 14
+ _command = 4
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2371,17 +3263,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2394,24 +3286,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_DELETE_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 4)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2496,9 +3388,9 @@
q.text('}')
class flow_modify(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY
+ version = 4
+ type = 14
+ _command = 1
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2560,17 +3452,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2583,24 +3475,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_MODIFY)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 1)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2685,9 +3577,9 @@
q.text('}')
class flow_modify_strict(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_MOD
- _command = const.OFPFC_MODIFY_STRICT
+ version = 4
+ type = 14
+ _command = 2
def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None):
self.xid = xid
@@ -2749,17 +3641,17 @@
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.cookie_mask))
packed.append(struct.pack("!B", self.table_id))
- packed.append(struct.pack("!B", self._command))
+ packed.append(util.pack_fm_cmd(self._command))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!L", self.buffer_id))
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 2)
packed.append(self.match.pack())
- packed.append("".join([x.pack() for x in self.instructions]))
+ packed.append(util.pack_list(self.instructions))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -2772,24 +3664,24 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
- obj.table_id = reader.read('!B')[0]
- __command = reader.read('!B')[0]
- assert(__command == const.OFPFC_MODIFY_STRICT)
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.priority = reader.read('!H')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 14)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
+ obj.table_id = reader.read("!B")[0]
+ __command = util.unpack_fm_cmd(reader)
+ assert(__command == 2)
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(2)
obj.match = common.match.unpack(reader)
obj.instructions = instruction.unpack_list(reader)
@@ -2874,8 +3766,8 @@
q.text('}')
class flow_removed(Message):
- version = const.OFP_VERSION
- type = const.OFPT_FLOW_REMOVED
+ version = 4
+ type = 11
def __init__(self, xid=None, cookie=None, priority=None, reason=None, table_id=None, duration_sec=None, duration_nsec=None, idle_timeout=None, hard_timeout=None, packet_count=None, byte_count=None, match=None):
self.xid = xid
@@ -2953,22 +3845,22 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_FLOW_REMOVED)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.cookie = reader.read('!Q')[0]
- obj.priority = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
- obj.table_id = reader.read('!B')[0]
- obj.duration_sec = reader.read('!L')[0]
- obj.duration_nsec = reader.read('!L')[0]
- obj.idle_timeout = reader.read('!H')[0]
- obj.hard_timeout = reader.read('!H')[0]
- obj.packet_count = reader.read('!Q')[0]
- obj.byte_count = reader.read('!Q')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 11)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.priority = reader.read("!H")[0]
+ obj.reason = reader.read("!B")[0]
+ obj.table_id = reader.read("!B")[0]
+ obj.duration_sec = reader.read("!L")[0]
+ obj.duration_nsec = reader.read("!L")[0]
+ obj.idle_timeout = reader.read("!H")[0]
+ obj.hard_timeout = reader.read("!H")[0]
+ obj.packet_count = reader.read("!Q")[0]
+ obj.byte_count = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -3047,8 +3939,8 @@
q.text('}')
class flow_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 1
def __init__(self, xid=None, flags=None, entries=None):
@@ -3071,7 +3963,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3084,15 +3976,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 1)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_flow_stats_entry(reader)
return obj
@@ -3136,8 +4028,8 @@
q.text('}')
class flow_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 1
def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None):
@@ -3182,7 +4074,7 @@
packed.append('\x00' * 4)
packed.append(struct.pack("!B", self.table_id))
packed.append('\x00' * 3)
- packed.append(struct.pack("!L", self.out_port))
+ packed.append(util.pack_port_no(self.out_port))
packed.append(struct.pack("!L", self.out_group))
packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.cookie))
@@ -3200,23 +4092,23 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 1)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.table_id = reader.read('!B')[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.out_port = reader.read('!L')[0]
- obj.out_group = reader.read('!L')[0]
+ obj.out_port = util.unpack_port_no(reader)
+ obj.out_group = reader.read("!L")[0]
reader.skip(4)
- obj.cookie = reader.read('!Q')[0]
- obj.cookie_mask = reader.read('!Q')[0]
+ obj.cookie = reader.read("!Q")[0]
+ obj.cookie_mask = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
return obj
@@ -3279,8 +4171,8 @@
q.text('}')
class get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REPLY
+ version = 4
+ type = 8
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -3313,14 +4205,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 8)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3362,8 +4254,8 @@
q.text('}')
class get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GET_CONFIG_REQUEST
+ version = 4
+ type = 7
def __init__(self, xid=None):
self.xid = xid
@@ -3386,12 +4278,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 7)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3425,8 +4317,8 @@
q.text('}')
class group_desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 7
def __init__(self, xid=None, flags=None, entries=None):
@@ -3449,7 +4341,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3462,15 +4354,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 7)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_group_desc_stats_entry(reader)
return obj
@@ -3514,8 +4406,8 @@
q.text('}')
class group_desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 7
def __init__(self, xid=None, flags=None):
@@ -3546,15 +4438,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 7)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -3593,8 +4485,8 @@
q.text('}')
class group_features_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 8
def __init__(self, xid=None, flags=None, types=None, capabilities=None, max_groups_all=None, max_groups_select=None, max_groups_indirect=None, max_groups_ff=None, actions_all=None, actions_select=None, actions_indirect=None, actions_ff=None):
@@ -3675,26 +4567,26 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 8)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.types = reader.read('!L')[0]
- obj.capabilities = reader.read('!L')[0]
- obj.max_groups_all = reader.read('!L')[0]
- obj.max_groups_select = reader.read('!L')[0]
- obj.max_groups_indirect = reader.read('!L')[0]
- obj.max_groups_ff = reader.read('!L')[0]
- obj.actions_all = reader.read('!L')[0]
- obj.actions_select = reader.read('!L')[0]
- obj.actions_indirect = reader.read('!L')[0]
- obj.actions_ff = reader.read('!L')[0]
+ obj.types = reader.read("!L")[0]
+ obj.capabilities = reader.read("!L")[0]
+ obj.max_groups_all = reader.read("!L")[0]
+ obj.max_groups_select = reader.read("!L")[0]
+ obj.max_groups_indirect = reader.read("!L")[0]
+ obj.max_groups_ff = reader.read("!L")[0]
+ obj.actions_all = reader.read("!L")[0]
+ obj.actions_select = reader.read("!L")[0]
+ obj.actions_indirect = reader.read("!L")[0]
+ obj.actions_ff = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -3772,8 +4664,8 @@
q.text('}')
class group_features_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 8
def __init__(self, xid=None, flags=None):
@@ -3804,15 +4696,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 8)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -3851,8 +4743,8 @@
q.text('}')
class group_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_GROUP_MOD
+ version = 4
+ type = 15
def __init__(self, xid=None, command=None, group_type=None, group_id=None, buckets=None):
self.xid = xid
@@ -3883,7 +4775,7 @@
packed.append(struct.pack("!B", self.group_type))
packed.append('\x00' * 1)
packed.append(struct.pack("!L", self.group_id))
- packed.append("".join([x.pack() for x in self.buckets]))
+ packed.append(util.pack_list(self.buckets))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3896,16 +4788,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_GROUP_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.command = reader.read('!H')[0]
- obj.group_type = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 15)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.command = reader.read("!H")[0]
+ obj.group_type = reader.read("!B")[0]
reader.skip(1)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
obj.buckets = common.unpack_list_bucket(reader)
return obj
@@ -3956,8 +4848,8 @@
q.text('}')
class group_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 6
def __init__(self, xid=None, flags=None, entries=None):
@@ -3980,7 +4872,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -3993,15 +4885,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 6)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_group_stats_entry(reader)
return obj
@@ -4045,8 +4937,8 @@
q.text('}')
class group_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 6
def __init__(self, xid=None, flags=None, group_id=None):
@@ -4083,17 +4975,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 6)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.group_id = reader.read('!L')[0]
+ obj.group_id = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -4136,8 +5028,8 @@
q.text('}')
class hello(Message):
- version = const.OFP_VERSION
- type = const.OFPT_HELLO
+ version = 4
+ type = 0
def __init__(self, xid=None, elements=None):
self.xid = xid
@@ -4152,7 +5044,7 @@
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("".join([x.pack() for x in self.elements]))
+ packed.append(util.pack_list(self.elements))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4165,12 +5057,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_HELLO)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 0)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.elements = common.unpack_list_hello_elem(reader)
return obj
@@ -4209,8 +5101,8 @@
q.text('}')
class meter_config_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 10
def __init__(self, xid=None, flags=None, entries=None):
@@ -4233,7 +5125,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4246,15 +5138,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 10)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = meter_band.unpack_list(reader)
return obj
@@ -4298,8 +5190,8 @@
q.text('}')
class meter_config_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 10
def __init__(self, xid=None, flags=None, meter_id=None):
@@ -4336,17 +5228,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 10)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.meter_id = reader.read('!L')[0]
+ obj.meter_id = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -4389,8 +5281,8 @@
q.text('}')
class meter_features_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 11
def __init__(self, xid=None, flags=None, features=None):
@@ -4426,15 +5318,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 11)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.features = common.meter_features.unpack(reader)
return obj
@@ -4478,8 +5370,8 @@
q.text('}')
class meter_features_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 11
def __init__(self, xid=None, flags=None):
@@ -4510,15 +5402,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 11)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -4557,8 +5449,8 @@
q.text('}')
class meter_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_METER_MOD
+ version = 4
+ type = 29
def __init__(self, xid=None, command=None, flags=None, meter_id=None, meters=None):
self.xid = xid
@@ -4588,7 +5480,7 @@
packed.append(struct.pack("!H", self.command))
packed.append(struct.pack("!H", self.flags))
packed.append(struct.pack("!L", self.meter_id))
- packed.append("".join([x.pack() for x in self.meters]))
+ packed.append(util.pack_list(self.meters))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4601,15 +5493,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_METER_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.command = reader.read('!H')[0]
- obj.flags = reader.read('!H')[0]
- obj.meter_id = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 29)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.command = reader.read("!H")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.meter_id = reader.read("!L")[0]
obj.meters = meter_band.unpack_list(reader)
return obj
@@ -4660,8 +5552,8 @@
q.text('}')
class meter_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 9
def __init__(self, xid=None, flags=None, entries=None):
@@ -4684,7 +5576,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -4697,15 +5589,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 9)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = common.unpack_list_meter_stats(reader)
return obj
@@ -4749,8 +5641,8 @@
q.text('}')
class meter_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 9
def __init__(self, xid=None, flags=None, meter_id=None):
@@ -4787,17 +5679,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 9)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.meter_id = reader.read('!L')[0]
+ obj.meter_id = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -4840,8 +5732,8 @@
q.text('}')
class packet_in(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_IN
+ version = 4
+ type = 10
def __init__(self, xid=None, buffer_id=None, total_len=None, reason=None, table_id=None, cookie=None, match=None, data=None):
self.xid = xid
@@ -4872,7 +5764,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -4900,17 +5792,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_IN)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.total_len = reader.read('!H')[0]
- obj.reason = reader.read('!B')[0]
- obj.table_id = reader.read('!B')[0]
- obj.cookie = reader.read('!Q')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 10)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.total_len = reader.read("!H")[0]
+ obj.reason = reader.read("!B")[0]
+ obj.table_id = reader.read("!B")[0]
+ obj.cookie = reader.read("!Q")[0]
obj.match = common.match.unpack(reader)
reader.skip(2)
obj.data = str(reader.read_all())
@@ -4975,8 +5867,8 @@
q.text('}')
class packet_out(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PACKET_OUT
+ version = 4
+ type = 13
def __init__(self, xid=None, buffer_id=None, in_port=None, actions=None, data=None):
self.xid = xid
@@ -4995,7 +5887,7 @@
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -5004,10 +5896,10 @@
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.buffer_id))
- packed.append(struct.pack("!L", self.in_port))
+ packed.append(util.pack_port_no(self.in_port))
packed.append(struct.pack("!H", 0)) # placeholder for actions_len at index 6
packed.append('\x00' * 6)
- packed.append("".join([x.pack() for x in self.actions]))
+ packed.append(util.pack_list(self.actions))
packed[6] = struct.pack("!H", len(packed[-1]))
packed.append(self.data)
length = sum([len(x) for x in packed])
@@ -5022,15 +5914,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PACKET_OUT)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.buffer_id = reader.read('!L')[0]
- obj.in_port = reader.read('!L')[0]
- _actions_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 13)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.buffer_id = reader.read("!L")[0]
+ obj.in_port = util.unpack_port_no(reader)
+ _actions_len = reader.read("!H")[0]
reader.skip(6)
obj.actions = action.unpack_list(reader.slice(_actions_len))
obj.data = str(reader.read_all())
@@ -5083,8 +5975,8 @@
q.text('}')
class port_desc_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 13
def __init__(self, xid=None, flags=None, entries=None):
@@ -5107,7 +5999,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -5120,15 +6012,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 13)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.port_desc.unpack)
return obj
@@ -5172,8 +6064,8 @@
q.text('}')
class port_desc_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 13
def __init__(self, xid=None, flags=None):
@@ -5204,15 +6096,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 13)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -5251,8 +6143,8 @@
q.text('}')
class port_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_MOD
+ version = 4
+ type = 16
def __init__(self, xid=None, port_no=None, hw_addr=None, config=None, mask=None, advertise=None):
self.xid = xid
@@ -5283,7 +6175,7 @@
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.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
packed.append(struct.pack("!6B", *self.hw_addr))
packed.append('\x00' * 2)
@@ -5303,19 +6195,19 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port_no = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 16)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
obj.hw_addr = list(reader.read('!6B'))
reader.skip(2)
- obj.config = reader.read('!L')[0]
- obj.mask = reader.read('!L')[0]
- obj.advertise = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
+ obj.mask = reader.read("!L")[0]
+ obj.advertise = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -5370,8 +6262,8 @@
q.text('}')
class port_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 4
def __init__(self, xid=None, flags=None, entries=None):
@@ -5394,7 +6286,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -5407,15 +6299,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 4)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.port_stats_entry.unpack)
return obj
@@ -5459,8 +6351,8 @@
q.text('}')
class port_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 4
def __init__(self, xid=None, flags=None, port_no=None):
@@ -5483,7 +6375,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append('\x00' * 4)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -5497,17 +6389,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 4)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.port_no = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
reader.skip(4)
return obj
@@ -5550,8 +6442,8 @@
q.text('}')
class port_status(Message):
- version = const.OFP_VERSION
- type = const.OFPT_PORT_STATUS
+ version = 4
+ type = 12
def __init__(self, xid=None, reason=None, desc=None):
self.xid = xid
@@ -5585,13 +6477,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_PORT_STATUS)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.reason = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 12)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.reason = reader.read("!B")[0]
reader.skip(7)
obj.desc = common.port_desc.unpack(reader)
return obj
@@ -5635,8 +6527,8 @@
q.text('}')
class queue_get_config_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REPLY
+ version = 4
+ type = 23
def __init__(self, xid=None, port=None, queues=None):
self.xid = xid
@@ -5655,9 +6547,9 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.queues]))
+ packed.append(util.pack_list(self.queues))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -5670,13 +6562,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 23)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(4)
obj.queues = common.unpack_list_packet_queue(reader)
return obj
@@ -5720,8 +6612,8 @@
q.text('}')
class queue_get_config_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_QUEUE_GET_CONFIG_REQUEST
+ version = 4
+ type = 22
def __init__(self, xid=None, port=None):
self.xid = xid
@@ -5736,7 +6628,7 @@
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.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 4)
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -5750,13 +6642,13 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_QUEUE_GET_CONFIG_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.port = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 22)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(4)
return obj
@@ -5795,8 +6687,8 @@
q.text('}')
class queue_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 5
def __init__(self, xid=None, flags=None, entries=None):
@@ -5819,7 +6711,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -5832,15 +6724,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 5)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.queue_stats_entry.unpack)
return obj
@@ -5884,8 +6776,8 @@
q.text('}')
class queue_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 5
def __init__(self, xid=None, flags=None, port_no=None, queue_id=None):
@@ -5912,7 +6804,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.port_no))
+ packed.append(util.pack_port_no(self.port_no))
packed.append(struct.pack("!L", self.queue_id))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
@@ -5926,18 +6818,18 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 5)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.port_no = reader.read('!L')[0]
- obj.queue_id = reader.read('!L')[0]
+ obj.port_no = util.unpack_port_no(reader)
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -5983,15 +6875,15 @@
q.text('}')
class role_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ROLE_REPLY
+ version = 4
+ type = 25
def __init__(self, xid=None, data=None):
self.xid = xid
if data != None:
self.data = data
else:
- self.data = ""
+ self.data = ''
def pack(self):
packed = []
@@ -6012,12 +6904,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ROLE_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 25)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
obj.data = str(reader.read_all())
return obj
@@ -6056,8 +6948,8 @@
q.text('}')
class role_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_ROLE_REQUEST
+ version = 4
+ type = 24
def __init__(self, xid=None, role=None, generation_id=None):
self.xid = xid
@@ -6091,15 +6983,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_ROLE_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.role = reader.read('!L')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 24)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.role = reader.read("!L")[0]
reader.skip(4)
- obj.generation_id = reader.read('!Q')[0]
+ obj.generation_id = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -6141,8 +7033,8 @@
q.text('}')
class set_config(Message):
- version = const.OFP_VERSION
- type = const.OFPT_SET_CONFIG
+ version = 4
+ type = 9
def __init__(self, xid=None, flags=None, miss_send_len=None):
self.xid = xid
@@ -6175,14 +7067,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_SET_CONFIG)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.flags = reader.read('!H')[0]
- obj.miss_send_len = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 9)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.flags = reader.read("!H")[0]
+ obj.miss_send_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -6224,8 +7116,8 @@
q.text('}')
class table_features_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 12
def __init__(self, xid=None, flags=None, entries=None):
@@ -6248,7 +7140,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -6261,17 +7153,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 12)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.entries = loxi.unimplemented('unpack list of_list_table_features_t')
+ obj.entries = loxi.unimplemented('unpack list(of_table_features_t)')
return obj
def __eq__(self, other):
@@ -6313,8 +7205,8 @@
q.text('}')
class table_features_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 12
def __init__(self, xid=None, flags=None, entries=None):
@@ -6337,7 +7229,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -6350,17 +7242,17 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 12)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
- obj.entries = loxi.unimplemented('unpack list of_list_table_features_t')
+ obj.entries = loxi.unimplemented('unpack list(of_table_features_t)')
return obj
def __eq__(self, other):
@@ -6402,8 +7294,8 @@
q.text('}')
class table_mod(Message):
- version = const.OFP_VERSION
- type = const.OFPT_TABLE_MOD
+ version = 4
+ type = 17
def __init__(self, xid=None, table_id=None, config=None):
self.xid = xid
@@ -6437,15 +7329,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_TABLE_MOD)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- obj.table_id = reader.read('!B')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 17)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ obj.table_id = reader.read("!B")[0]
reader.skip(3)
- obj.config = reader.read('!L')[0]
+ obj.config = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -6487,8 +7379,8 @@
q.text('}')
class table_stats_reply(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REPLY
+ version = 4
+ type = 19
stats_type = 3
def __init__(self, xid=None, flags=None, entries=None):
@@ -6511,7 +7403,7 @@
packed.append(struct.pack("!H", self.stats_type))
packed.append(struct.pack("!H", self.flags))
packed.append('\x00' * 4)
- packed.append("".join([x.pack() for x in self.entries]))
+ packed.append(util.pack_list(self.entries))
length = sum([len(x) for x in packed])
packed[2] = struct.pack("!H", length)
return ''.join(packed)
@@ -6524,15 +7416,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REPLY)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 19)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 3)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
obj.entries = loxi.generic_util.unpack_list(reader, common.table_stats_entry.unpack)
return obj
@@ -6576,8 +7468,8 @@
q.text('}')
class table_stats_request(Message):
- version = const.OFP_VERSION
- type = const.OFPT_MULTIPART_REQUEST
+ version = 4
+ type = 18
stats_type = 3
def __init__(self, xid=None, flags=None):
@@ -6608,15 +7500,15 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _version = reader.read('!B')[0]
- assert(_version == const.OFP_VERSION)
- _type = reader.read('!B')[0]
- assert(_type == const.OFPT_MULTIPART_REQUEST)
- _length = reader.read('!H')[0]
- obj.xid = reader.read('!L')[0]
- _stats_type = reader.read('!H')[0]
+ _version = reader.read("!B")[0]
+ assert(_version == 4)
+ _type = reader.read("!B")[0]
+ assert(_type == 18)
+ _length = reader.read("!H")[0]
+ obj.xid = reader.read("!L")[0]
+ _stats_type = reader.read("!H")[0]
assert(_stats_type == 3)
- obj.flags = reader.read('!H')[0]
+ obj.flags = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -6716,36 +7608,36 @@
raise loxi.ProtocolError("unexpected experimenter %#x subtype %#x" % (experimenter, subtype))
parsers = {
- const.OFPT_BARRIER_REPLY : barrier_reply.unpack,
- const.OFPT_BARRIER_REQUEST : barrier_request.unpack,
- const.OFPT_ECHO_REPLY : echo_reply.unpack,
- const.OFPT_ECHO_REQUEST : echo_request.unpack,
- const.OFPT_ERROR : error_msg.unpack,
- const.OFPT_EXPERIMENTER : parse_experimenter,
- const.OFPT_FEATURES_REPLY : features_reply.unpack,
- const.OFPT_FEATURES_REQUEST : features_request.unpack,
- const.OFPT_FLOW_MOD : parse_flow_mod,
- const.OFPT_FLOW_REMOVED : flow_removed.unpack,
- const.OFPT_GET_ASYNC_REPLY : async_get_reply.unpack,
- const.OFPT_GET_ASYNC_REQUEST : async_get_request.unpack,
- const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
- const.OFPT_GET_CONFIG_REQUEST : get_config_request.unpack,
- const.OFPT_GROUP_MOD : group_mod.unpack,
const.OFPT_HELLO : hello.unpack,
- const.OFPT_METER_MOD : meter_mod.unpack,
- const.OFPT_MULTIPART_REPLY : parse_multipart_reply,
- const.OFPT_MULTIPART_REQUEST : parse_multipart_request,
- const.OFPT_PACKET_IN : packet_in.unpack,
- const.OFPT_PACKET_OUT : packet_out.unpack,
- const.OFPT_PORT_MOD : port_mod.unpack,
- const.OFPT_PORT_STATUS : port_status.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
- const.OFPT_QUEUE_GET_CONFIG_REQUEST : queue_get_config_request.unpack,
- const.OFPT_ROLE_REPLY : role_reply.unpack,
- const.OFPT_ROLE_REQUEST : role_request.unpack,
- const.OFPT_SET_ASYNC : async_set.unpack,
+ const.OFPT_ERROR : error_msg.unpack,
+ const.OFPT_ECHO_REQUEST : echo_request.unpack,
+ const.OFPT_ECHO_REPLY : echo_reply.unpack,
+ 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,
+ const.OFPT_GET_CONFIG_REPLY : get_config_reply.unpack,
const.OFPT_SET_CONFIG : set_config.unpack,
+ const.OFPT_PACKET_IN : packet_in.unpack,
+ const.OFPT_FLOW_REMOVED : flow_removed.unpack,
+ const.OFPT_PORT_STATUS : port_status.unpack,
+ const.OFPT_PACKET_OUT : packet_out.unpack,
+ const.OFPT_FLOW_MOD : parse_flow_mod,
+ 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_BARRIER_REQUEST : barrier_request.unpack,
+ const.OFPT_BARRIER_REPLY : barrier_reply.unpack,
+ const.OFPT_QUEUE_GET_CONFIG_REQUEST : queue_get_config_request.unpack,
+ const.OFPT_QUEUE_GET_CONFIG_REPLY : queue_get_config_reply.unpack,
+ const.OFPT_ROLE_REQUEST : role_request.unpack,
+ const.OFPT_ROLE_REPLY : role_reply.unpack,
+ const.OFPT_GET_ASYNC_REQUEST : async_get_request.unpack,
+ const.OFPT_GET_ASYNC_REPLY : async_get_reply.unpack,
+ const.OFPT_SET_ASYNC : async_set.unpack,
+ const.OFPT_METER_MOD : meter_mod.unpack,
}
flow_mod_parsers = {
@@ -6759,4 +7651,23 @@
# TODO OF 1.3 multipart messages
experimenter_parsers = {
+ 6035143 : {
+ 22: bsn_bw_clear_data_reply.unpack,
+ 21: bsn_bw_clear_data_request.unpack,
+ 20: bsn_bw_enable_get_reply.unpack,
+ 19: bsn_bw_enable_get_request.unpack,
+ 23: bsn_bw_enable_set_reply.unpack,
+ 18: bsn_bw_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,
+ 3: bsn_set_mirroring.unpack,
+ 25: bsn_set_pktin_suppression_reply.unpack,
+ 11: bsn_set_pktin_suppression_request.unpack,
+ 16: bsn_virtual_port_create_reply.unpack,
+ 15: bsn_virtual_port_create_request.unpack,
+ 26: bsn_virtual_port_remove_reply.unpack,
+ 17: bsn_virtual_port_remove_request.unpack,
+ },
}
diff --git a/src/python/loxi/of13/meter_band.py b/src/python/loxi/of13/meter_band.py
index 814442a..5573beb 100644
--- a/src/python/loxi/of13/meter_band.py
+++ b/src/python/loxi/of13/meter_band.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template meter_band.py
# Do not modify
@@ -23,7 +24,7 @@
pass
class drop(MeterBand):
- type = const.OFPMBT_DROP
+ type = 1
def __init__(self, rate=None, burst_size=None):
if rate != None:
@@ -54,11 +55,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPMBT_DROP)
- _len = reader.read('!H')[0]
- obj.rate = reader.read('!L')[0]
- obj.burst_size = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
+ obj.rate = reader.read("!L")[0]
+ obj.burst_size = reader.read("!L")[0]
reader.skip(4)
return obj
@@ -89,7 +90,7 @@
q.text('}')
class dscp_remark(MeterBand):
- type = const.OFPMBT_DSCP_REMARK
+ type = 2
def __init__(self, rate=None, burst_size=None, prec_level=None):
if rate != None:
@@ -125,12 +126,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPMBT_DSCP_REMARK)
- _len = reader.read('!H')[0]
- obj.rate = reader.read('!L')[0]
- obj.burst_size = reader.read('!L')[0]
- obj.prec_level = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
+ obj.rate = reader.read("!L")[0]
+ obj.burst_size = reader.read("!L")[0]
+ obj.prec_level = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -165,7 +166,7 @@
q.text('}')
class experimenter(MeterBand):
- type = const.OFPMBT_EXPERIMENTER
+ type = 65535
def __init__(self, rate=None, burst_size=None, experimenter=None):
if rate != None:
@@ -200,12 +201,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPMBT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- obj.rate = reader.read('!L')[0]
- obj.burst_size = reader.read('!L')[0]
- obj.experimenter = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ obj.rate = reader.read("!L")[0]
+ obj.burst_size = reader.read("!L")[0]
+ obj.experimenter = reader.read("!L")[0]
return obj
def __eq__(self, other):
diff --git a/src/python/loxi/of13/oxm.py b/src/python/loxi/of13/oxm.py
index d3bc046..fb1291d 100644
--- a/src/python/loxi/of13/oxm.py
+++ b/src/python/loxi/of13/oxm.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template oxm.py
# Do not modify
@@ -26,7 +27,7 @@
pass
class arp_op(OXM):
- type_len = 0x80002a02
+ type_len = 2147494402
def __init__(self, value=None):
if value != None:
@@ -47,9 +48,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002a02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494402)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -75,7 +76,7 @@
q.text('}')
class arp_op_masked(OXM):
- type_len = 0x80002b04
+ type_len = 2147494660
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -101,10 +102,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002b04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494660)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -134,7 +135,7 @@
q.text('}')
class arp_sha(OXM):
- type_len = 0x80003006
+ type_len = 2147495942
def __init__(self, value=None):
if value != None:
@@ -155,8 +156,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003006)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495942)
obj.value = list(reader.read('!6B'))
return obj
@@ -183,7 +184,7 @@
q.text('}')
class arp_sha_masked(OXM):
- type_len = 0x8000310c
+ type_len = 2147496204
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -209,8 +210,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000310c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496204)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -242,7 +243,7 @@
q.text('}')
class arp_spa(OXM):
- type_len = 0x80002c04
+ type_len = 2147494916
def __init__(self, value=None):
if value != None:
@@ -263,9 +264,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002c04)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494916)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -291,7 +292,7 @@
q.text('}')
class arp_spa_masked(OXM):
- type_len = 0x80002d08
+ type_len = 2147495176
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -317,10 +318,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002d08)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495176)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -350,7 +351,7 @@
q.text('}')
class arp_tha(OXM):
- type_len = 0x80003206
+ type_len = 2147496454
def __init__(self, value=None):
if value != None:
@@ -371,8 +372,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003206)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496454)
obj.value = list(reader.read('!6B'))
return obj
@@ -399,7 +400,7 @@
q.text('}')
class arp_tha_masked(OXM):
- type_len = 0x8000330c
+ type_len = 2147496716
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -425,8 +426,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000330c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496716)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -458,7 +459,7 @@
q.text('}')
class arp_tpa(OXM):
- type_len = 0x80002e04
+ type_len = 2147495428
def __init__(self, value=None):
if value != None:
@@ -479,9 +480,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002e04)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495428)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -507,7 +508,7 @@
q.text('}')
class arp_tpa_masked(OXM):
- type_len = 0x80002f08
+ type_len = 2147495688
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -533,10 +534,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002f08)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147495688)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -565,8 +566,116 @@
q.breakable()
q.text('}')
+class dst_meta_id(OXM):
+ type_len = 258561
+
+ def __init__(self, value=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = dst_meta_id()
+ 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 == 258561)
+ obj.value = reader.read("!B")[0]
+ 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("dst_meta_id {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.breakable()
+ q.text('}')
+
+class dst_meta_id_masked(OXM):
+ type_len = 258818
+
+ def __init__(self, value=None, value_mask=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+ if value_mask != None:
+ self.value_mask = value_mask
+ else:
+ self.value_mask = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ packed.append(struct.pack("!B", self.value_mask))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = dst_meta_id_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 == 258818)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
+ 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("dst_meta_id_masked {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.text(","); q.breakable()
+ q.text("value_mask = ");
+ q.text("%#x" % self.value_mask)
+ q.breakable()
+ q.text('}')
+
class eth_dst(OXM):
- type_len = 0x80000606
+ type_len = 2147485190
def __init__(self, value=None):
if value != None:
@@ -587,8 +696,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000606)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485190)
obj.value = list(reader.read('!6B'))
return obj
@@ -615,7 +724,7 @@
q.text('}')
class eth_dst_masked(OXM):
- type_len = 0x8000070c
+ type_len = 2147485452
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -641,8 +750,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000070c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485452)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -674,7 +783,7 @@
q.text('}')
class eth_src(OXM):
- type_len = 0x80000806
+ type_len = 2147485702
def __init__(self, value=None):
if value != None:
@@ -695,8 +804,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000806)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485702)
obj.value = list(reader.read('!6B'))
return obj
@@ -723,7 +832,7 @@
q.text('}')
class eth_src_masked(OXM):
- type_len = 0x8000090c
+ type_len = 2147485964
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -749,8 +858,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000090c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147485964)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -782,7 +891,7 @@
q.text('}')
class eth_type(OXM):
- type_len = 0x80000a02
+ type_len = 2147486210
def __init__(self, value=None):
if value != None:
@@ -803,9 +912,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000a02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486210)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -831,7 +940,7 @@
q.text('}')
class eth_type_masked(OXM):
- type_len = 0x80000b04
+ type_len = 2147486468
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -857,10 +966,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000b04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486468)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -890,7 +999,7 @@
q.text('}')
class icmpv4_code(OXM):
- type_len = 0x80002801
+ type_len = 2147493889
def __init__(self, value=None):
if value != None:
@@ -911,9 +1020,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002801)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493889)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -939,7 +1048,7 @@
q.text('}')
class icmpv4_code_masked(OXM):
- type_len = 0x80002902
+ type_len = 2147494146
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -965,10 +1074,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002902)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147494146)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -998,7 +1107,7 @@
q.text('}')
class icmpv4_type(OXM):
- type_len = 0x80002601
+ type_len = 2147493377
def __init__(self, value=None):
if value != None:
@@ -1019,9 +1128,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002601)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493377)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1047,7 +1156,7 @@
q.text('}')
class icmpv4_type_masked(OXM):
- type_len = 0x80002702
+ type_len = 2147493634
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1073,10 +1182,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002702)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493634)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1106,7 +1215,7 @@
q.text('}')
class icmpv6_code(OXM):
- type_len = 0x80003c01
+ type_len = 2147499009
def __init__(self, value=None):
if value != None:
@@ -1127,9 +1236,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003c01)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499009)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1155,7 +1264,7 @@
q.text('}')
class icmpv6_code_masked(OXM):
- type_len = 0x80003d02
+ type_len = 2147499266
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1181,10 +1290,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003d02)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499266)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1214,7 +1323,7 @@
q.text('}')
class icmpv6_type(OXM):
- type_len = 0x80003a01
+ type_len = 2147498497
def __init__(self, value=None):
if value != None:
@@ -1235,9 +1344,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003a01)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147498497)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1263,7 +1372,7 @@
q.text('}')
class icmpv6_type_masked(OXM):
- type_len = 0x80003b02
+ type_len = 2147498754
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1289,10 +1398,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003b02)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147498754)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1322,7 +1431,7 @@
q.text('}')
class in_phy_port(OXM):
- type_len = 0x80000204
+ type_len = 2147484164
def __init__(self, value=None):
if value != None:
@@ -1333,7 +1442,7 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
+ packed.append(util.pack_port_no(self.value))
return ''.join(packed)
@staticmethod
@@ -1343,9 +1452,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000204)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484164)
+ obj.value = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1371,7 +1480,7 @@
q.text('}')
class in_phy_port_masked(OXM):
- type_len = 0x80000308
+ type_len = 2147484424
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1386,8 +1495,8 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
- packed.append(struct.pack("!L", self.value_mask))
+ packed.append(util.pack_port_no(self.value))
+ packed.append(util.pack_port_no(self.value_mask))
return ''.join(packed)
@staticmethod
@@ -1397,10 +1506,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000308)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484424)
+ obj.value = util.unpack_port_no(reader)
+ obj.value_mask = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1430,7 +1539,7 @@
q.text('}')
class in_port(OXM):
- type_len = 0x80000004
+ type_len = 2147483652
def __init__(self, value=None):
if value != None:
@@ -1441,7 +1550,7 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
+ packed.append(util.pack_port_no(self.value))
return ''.join(packed)
@staticmethod
@@ -1451,9 +1560,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000004)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147483652)
+ obj.value = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1479,7 +1588,7 @@
q.text('}')
class in_port_masked(OXM):
- type_len = 0x80000108
+ type_len = 2147483912
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1494,8 +1603,8 @@
def pack(self):
packed = []
packed.append(struct.pack("!L", self.type_len))
- packed.append(struct.pack("!L", self.value))
- packed.append(struct.pack("!L", self.value_mask))
+ packed.append(util.pack_port_no(self.value))
+ packed.append(util.pack_port_no(self.value_mask))
return ''.join(packed)
@staticmethod
@@ -1505,10 +1614,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000108)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147483912)
+ obj.value = util.unpack_port_no(reader)
+ obj.value_mask = util.unpack_port_no(reader)
return obj
def __eq__(self, other):
@@ -1538,7 +1647,7 @@
q.text('}')
class ip_dscp(OXM):
- type_len = 0x80001001
+ type_len = 2147487745
def __init__(self, value=None):
if value != None:
@@ -1559,9 +1668,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001001)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147487745)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1587,7 +1696,7 @@
q.text('}')
class ip_dscp_masked(OXM):
- type_len = 0x80001102
+ type_len = 2147488002
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1613,10 +1722,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001102)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488002)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1646,7 +1755,7 @@
q.text('}')
class ip_ecn(OXM):
- type_len = 0x80001201
+ type_len = 2147488257
def __init__(self, value=None):
if value != None:
@@ -1667,9 +1776,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001201)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488257)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1695,7 +1804,7 @@
q.text('}')
class ip_ecn_masked(OXM):
- type_len = 0x80001302
+ type_len = 2147488514
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1721,10 +1830,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001302)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488514)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1754,7 +1863,7 @@
q.text('}')
class ip_proto(OXM):
- type_len = 0x80001401
+ type_len = 2147488769
def __init__(self, value=None):
if value != None:
@@ -1775,9 +1884,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001401)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147488769)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1803,7 +1912,7 @@
q.text('}')
class ip_proto_masked(OXM):
- type_len = 0x80001502
+ type_len = 2147489026
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1829,10 +1938,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001502)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489026)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -1862,7 +1971,7 @@
q.text('}')
class ipv4_dst(OXM):
- type_len = 0x80001804
+ type_len = 2147489796
def __init__(self, value=None):
if value != None:
@@ -1883,9 +1992,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001804)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489796)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1911,7 +2020,7 @@
q.text('}')
class ipv4_dst_masked(OXM):
- type_len = 0x80001908
+ type_len = 2147490056
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -1937,10 +2046,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001908)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490056)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1970,7 +2079,7 @@
q.text('}')
class ipv4_src(OXM):
- type_len = 0x80001604
+ type_len = 2147489284
def __init__(self, value=None):
if value != None:
@@ -1991,9 +2100,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001604)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489284)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2019,7 +2128,7 @@
q.text('}')
class ipv4_src_masked(OXM):
- type_len = 0x80001708
+ type_len = 2147489544
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2045,10 +2154,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001708)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147489544)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2078,7 +2187,7 @@
q.text('}')
class ipv6_dst(OXM):
- type_len = 0x80003610
+ type_len = 2147497488
def __init__(self, value=None):
if value != None:
@@ -2099,8 +2208,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003610)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497488)
obj.value = reader.read('!16s')[0]
return obj
@@ -2127,7 +2236,7 @@
q.text('}')
class ipv6_dst_masked(OXM):
- type_len = 0x80003720
+ type_len = 2147497760
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2153,8 +2262,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003720)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497760)
obj.value = reader.read('!16s')[0]
obj.value_mask = reader.read('!16s')[0]
return obj
@@ -2186,7 +2295,7 @@
q.text('}')
class ipv6_flabel(OXM):
- type_len = 0x80003804
+ type_len = 2147497988
def __init__(self, value=None):
if value != None:
@@ -2207,9 +2316,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003804)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497988)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2235,7 +2344,7 @@
q.text('}')
class ipv6_flabel_masked(OXM):
- type_len = 0x80003908
+ type_len = 2147498248
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2261,10 +2370,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003908)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147498248)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2294,7 +2403,7 @@
q.text('}')
class ipv6_nd_sll(OXM):
- type_len = 0x80004006
+ type_len = 2147500038
def __init__(self, value=None):
if value != None:
@@ -2315,8 +2424,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004006)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500038)
obj.value = list(reader.read('!6B'))
return obj
@@ -2343,7 +2452,7 @@
q.text('}')
class ipv6_nd_sll_masked(OXM):
- type_len = 0x8000410c
+ type_len = 2147500300
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2369,8 +2478,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000410c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500300)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -2402,7 +2511,7 @@
q.text('}')
class ipv6_nd_target(OXM):
- type_len = 0x80003e10
+ type_len = 2147499536
def __init__(self, value=None):
if value != None:
@@ -2423,8 +2532,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003e10)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499536)
obj.value = reader.read('!16s')[0]
return obj
@@ -2451,7 +2560,7 @@
q.text('}')
class ipv6_nd_target_masked(OXM):
- type_len = 0x80003f20
+ type_len = 2147499808
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2477,8 +2586,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003f20)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147499808)
obj.value = reader.read('!16s')[0]
obj.value_mask = reader.read('!16s')[0]
return obj
@@ -2510,7 +2619,7 @@
q.text('}')
class ipv6_nd_tll(OXM):
- type_len = 0x80004206
+ type_len = 2147500550
def __init__(self, value=None):
if value != None:
@@ -2531,8 +2640,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004206)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500550)
obj.value = list(reader.read('!6B'))
return obj
@@ -2559,7 +2668,7 @@
q.text('}')
class ipv6_nd_tll_masked(OXM):
- type_len = 0x8000430c
+ type_len = 2147500812
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2585,8 +2694,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x8000430c)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147500812)
obj.value = list(reader.read('!6B'))
obj.value_mask = list(reader.read('!6B'))
return obj
@@ -2618,7 +2727,7 @@
q.text('}')
class ipv6_src(OXM):
- type_len = 0x80003410
+ type_len = 2147496976
def __init__(self, value=None):
if value != None:
@@ -2639,8 +2748,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003410)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147496976)
obj.value = reader.read('!16s')[0]
return obj
@@ -2667,7 +2776,7 @@
q.text('}')
class ipv6_src_masked(OXM):
- type_len = 0x80003520
+ type_len = 2147497248
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2693,8 +2802,8 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80003520)
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147497248)
obj.value = reader.read('!16s')[0]
obj.value_mask = reader.read('!16s')[0]
return obj
@@ -2726,7 +2835,7 @@
q.text('}')
class metadata(OXM):
- type_len = 0x80000408
+ type_len = 2147484680
def __init__(self, value=None):
if value != None:
@@ -2747,9 +2856,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000408)
- obj.value = reader.read('!Q')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484680)
+ obj.value = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -2775,7 +2884,7 @@
q.text('}')
class metadata_masked(OXM):
- type_len = 0x80000510
+ type_len = 2147484944
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2801,10 +2910,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000510)
- obj.value = reader.read('!Q')[0]
- obj.value_mask = reader.read('!Q')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147484944)
+ obj.value = reader.read("!Q")[0]
+ obj.value_mask = reader.read("!Q")[0]
return obj
def __eq__(self, other):
@@ -2834,7 +2943,7 @@
q.text('}')
class mpls_label(OXM):
- type_len = 0x80004404
+ type_len = 2147501060
def __init__(self, value=None):
if value != None:
@@ -2855,9 +2964,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004404)
- obj.value = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501060)
+ obj.value = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2883,7 +2992,7 @@
q.text('}')
class mpls_label_masked(OXM):
- type_len = 0x80004508
+ type_len = 2147501320
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -2909,10 +3018,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004508)
- obj.value = reader.read('!L')[0]
- obj.value_mask = reader.read('!L')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501320)
+ obj.value = reader.read("!L")[0]
+ obj.value_mask = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -2942,7 +3051,7 @@
q.text('}')
class mpls_tc(OXM):
- type_len = 0x80004601
+ type_len = 2147501569
def __init__(self, value=None):
if value != None:
@@ -2963,9 +3072,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004601)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501569)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -2991,7 +3100,7 @@
q.text('}')
class mpls_tc_masked(OXM):
- type_len = 0x80004702
+ type_len = 2147501826
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3017,10 +3126,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80004702)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147501826)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -3050,7 +3159,7 @@
q.text('}')
class sctp_dst(OXM):
- type_len = 0x80002402
+ type_len = 2147492866
def __init__(self, value=None):
if value != None:
@@ -3071,9 +3180,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002402)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492866)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3099,7 +3208,7 @@
q.text('}')
class sctp_dst_masked(OXM):
- type_len = 0x80002504
+ type_len = 2147493124
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3125,10 +3234,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002504)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147493124)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3158,7 +3267,7 @@
q.text('}')
class sctp_src(OXM):
- type_len = 0x80002202
+ type_len = 2147492354
def __init__(self, value=None):
if value != None:
@@ -3179,9 +3288,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002202)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492354)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3207,7 +3316,7 @@
q.text('}')
class sctp_src_masked(OXM):
- type_len = 0x80002304
+ type_len = 2147492612
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3233,10 +3342,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002304)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492612)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3265,8 +3374,116 @@
q.breakable()
q.text('}')
+class src_meta_id(OXM):
+ type_len = 258049
+
+ def __init__(self, value=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = src_meta_id()
+ 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 == 258049)
+ obj.value = reader.read("!B")[0]
+ 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("src_meta_id {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.breakable()
+ q.text('}')
+
+class src_meta_id_masked(OXM):
+ type_len = 258306
+
+ def __init__(self, value=None, value_mask=None):
+ if value != None:
+ self.value = value
+ else:
+ self.value = 0
+ if value_mask != None:
+ self.value_mask = value_mask
+ else:
+ self.value_mask = 0
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!L", self.type_len))
+ packed.append(struct.pack("!B", self.value))
+ packed.append(struct.pack("!B", self.value_mask))
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = src_meta_id_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 == 258306)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
+ 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("src_meta_id_masked {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("value = ");
+ q.text("%#x" % self.value)
+ q.text(","); q.breakable()
+ q.text("value_mask = ");
+ q.text("%#x" % self.value_mask)
+ q.breakable()
+ q.text('}')
+
class tcp_dst(OXM):
- type_len = 0x80001c02
+ type_len = 2147490818
def __init__(self, value=None):
if value != None:
@@ -3287,9 +3504,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001c02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490818)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3315,7 +3532,7 @@
q.text('}')
class tcp_dst_masked(OXM):
- type_len = 0x80001d04
+ type_len = 2147491076
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3341,10 +3558,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001d04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491076)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3374,7 +3591,7 @@
q.text('}')
class tcp_src(OXM):
- type_len = 0x80001a02
+ type_len = 2147490306
def __init__(self, value=None):
if value != None:
@@ -3395,9 +3612,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001a02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490306)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3423,7 +3640,7 @@
q.text('}')
class tcp_src_masked(OXM):
- type_len = 0x80001b04
+ type_len = 2147490564
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3449,10 +3666,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001b04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147490564)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3482,7 +3699,7 @@
q.text('}')
class udp_dst(OXM):
- type_len = 0x80002002
+ type_len = 2147491842
def __init__(self, value=None):
if value != None:
@@ -3503,9 +3720,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002002)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491842)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3531,7 +3748,7 @@
q.text('}')
class udp_dst_masked(OXM):
- type_len = 0x80002104
+ type_len = 2147492100
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3557,10 +3774,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80002104)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147492100)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3590,7 +3807,7 @@
q.text('}')
class udp_src(OXM):
- type_len = 0x80001e02
+ type_len = 2147491330
def __init__(self, value=None):
if value != None:
@@ -3611,9 +3828,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001e02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491330)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3639,7 +3856,7 @@
q.text('}')
class udp_src_masked(OXM):
- type_len = 0x80001f04
+ type_len = 2147491588
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3665,10 +3882,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80001f04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147491588)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3698,7 +3915,7 @@
q.text('}')
class vlan_pcp(OXM):
- type_len = 0x80000e01
+ type_len = 2147487233
def __init__(self, value=None):
if value != None:
@@ -3719,9 +3936,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000e01)
- obj.value = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147487233)
+ obj.value = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -3747,7 +3964,7 @@
q.text('}')
class vlan_pcp_masked(OXM):
- type_len = 0x80000f02
+ type_len = 2147487490
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3773,10 +3990,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000f02)
- obj.value = reader.read('!B')[0]
- obj.value_mask = reader.read('!B')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147487490)
+ obj.value = reader.read("!B")[0]
+ obj.value_mask = reader.read("!B")[0]
return obj
def __eq__(self, other):
@@ -3806,7 +4023,7 @@
q.text('}')
class vlan_vid(OXM):
- type_len = 0x80000c02
+ type_len = 2147486722
def __init__(self, value=None):
if value != None:
@@ -3827,9 +4044,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000c02)
- obj.value = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486722)
+ obj.value = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3855,7 +4072,7 @@
q.text('}')
class vlan_vid_masked(OXM):
- type_len = 0x80000d04
+ type_len = 2147486980
def __init__(self, value=None, value_mask=None):
if value != None:
@@ -3881,10 +4098,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type_len = reader.read('!L')[0]
- assert(_type_len == 0x80000d04)
- obj.value = reader.read('!H')[0]
- obj.value_mask = reader.read('!H')[0]
+ _type_len = reader.read("!L")[0]
+ assert(_type_len == 2147486980)
+ obj.value = reader.read("!H")[0]
+ obj.value_mask = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -3915,6 +4132,10 @@
parsers = {
+ 258049 : src_meta_id.unpack,
+ 258306 : src_meta_id_masked.unpack,
+ 258561 : dst_meta_id.unpack,
+ 258818 : dst_meta_id_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 d431d4c..56b5729 100644
--- a/src/python/loxi/of13/util.py
+++ b/src/python/loxi/of13/util.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template util.py
# Do not modify
@@ -35,3 +36,36 @@
if v == v2:
return k
return v
+
+def pack_port_no(value):
+ return struct.pack("!L", value)
+
+def unpack_port_no(reader):
+ return reader.read("!L")[0]
+
+def pack_fm_cmd(value):
+ return struct.pack("!B", value)
+
+def unpack_fm_cmd(reader):
+ return reader.read("!B")[0]
+
+def init_wc_bmap():
+ return 0
+
+def pack_wc_bmap(value):
+ return struct.pack("!Q", value)
+
+def unpack_wc_bmap(reader):
+ return reader.read("!Q")[0]
+
+def init_match_bmap():
+ return 0
+
+def pack_match_bmap(value):
+ return struct.pack("!Q", value)
+
+def unpack_match_bmap(reader):
+ return reader.read("!Q")[0]
+
+def pack_list(values):
+ return "".join([x.pack() for x in values])
diff --git a/tests/FuncUtils.py b/tests/FuncUtils.py
index 1aefae1..abf40f5 100644
--- a/tests/FuncUtils.py
+++ b/tests/FuncUtils.py
@@ -278,6 +278,18 @@
match_send_flowadd(self, match, priority, of_ports[1])
return (pkt_match, match)
+def match_arp_opcode(self,of_ports,priority=None):
+ #Generate Match_Arp_Opcode
+
+ #Create a simple arp packet and generate match on arp opcode
+ pkt_match = simple_arp_packet(arp_op=1)
+ match = parse.packet_to_flow_match(pkt_match)
+ self.assertTrue(match is not None, "Could not generate flow match from pkt")
+
+ match.wildcards = ofp.OFPFW_ALL^ofp.OFPFW_DL_TYPE^ofp.OFPFW_NW_PROTO
+ match_send_flowadd(self, match, priority, of_ports[1])
+ return (pkt_match, match)
+
def match_arp_sender(self,of_ports,priority=None):
#Generate Match_Arp_Sender
diff --git a/tests/flow_matches.py b/tests/flow_matches.py
index 2216899..71e36b8 100644
--- a/tests/flow_matches.py
+++ b/tests/flow_matches.py
@@ -650,6 +650,42 @@
self.dataplane.send(of_ports[0], str(pkt2))
verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
+class ArpOpcode(base_tests.SimpleDataPlane):
+
+ """"Verify match on single Header Field -- Arp Protocol"""
+
+ def runTest(self):
+
+ logging.info("Running Arp Protocol test")
+
+ of_ports = config["port_map"].keys()
+ of_ports.sort()
+ self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+
+ #Clear Switch State
+ delete_all_flows(self.controller)
+
+ egress_port=of_ports[1]
+ no_ports=set(of_ports).difference([egress_port])
+ yes_ports = of_ports[1]
+
+ logging.info("Inserting a flow with match on Arp Protocol Opcode")
+ logging.info("Sending matching and non-matching arp packets")
+ logging.info("Verifying only matching packets implements the action specified in the flow")
+
+ #Create a flow matching on ARP Opcode
+ (pkt,match) = match_arp_opcode(self,of_ports)
+
+ #Send Packet matching the flow
+ self.dataplane.send(of_ports[0], str(pkt))
+
+ #Verify packet implements the action specified in the flow
+ receive_pkt_check(self.dataplane,pkt,[yes_ports],no_ports,self)
+
+ #Create a non-matching packet , verify packet_in get generated
+ pkt2 = simple_arp_packet(arp_op=2)
+ self.dataplane.send(of_ports[0], str(pkt2))
+ verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
class ArpSenderIP(base_tests.SimpleDataPlane):