changes from loxigen e8e6401509
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])