changes from loxigen e8e6401509
diff --git a/src/python/loxi/of13/action.py b/src/python/loxi/of13/action.py
index 2a0629c..645916a 100644
--- a/src/python/loxi/of13/action.py
+++ b/src/python/loxi/of13/action.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template action.py
# Do not modify
@@ -23,8 +24,8 @@
pass
class bsn_mirror(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 1
def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
@@ -63,16 +64,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 1)
- obj.dest_port = reader.read('!L')[0]
- obj.vlan_tag = reader.read('!L')[0]
- obj.copy_stage = reader.read('!B')[0]
+ obj.dest_port = reader.read("!L")[0]
+ obj.vlan_tag = reader.read("!L")[0]
+ obj.copy_stage = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -107,8 +108,8 @@
q.text('}')
class bsn_set_tunnel_dst(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 2
def __init__(self, dst=None):
@@ -136,14 +137,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 2)
- obj.dst = reader.read('!L')[0]
+ obj.dst = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -169,7 +170,7 @@
q.text('}')
class copy_ttl_in(Action):
- type = const.OFPAT_COPY_TTL_IN
+ type = 12
def __init__(self):
return
@@ -190,9 +191,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_IN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 12)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -216,7 +217,7 @@
q.text('}')
class copy_ttl_out(Action):
- type = const.OFPAT_COPY_TTL_OUT
+ type = 11
def __init__(self):
return
@@ -237,9 +238,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_COPY_TTL_OUT)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 11)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -263,7 +264,7 @@
q.text('}')
class dec_mpls_ttl(Action):
- type = const.OFPAT_DEC_MPLS_TTL
+ type = 16
def __init__(self):
return
@@ -284,9 +285,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_MPLS_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 16)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -310,7 +311,7 @@
q.text('}')
class dec_nw_ttl(Action):
- type = const.OFPAT_DEC_NW_TTL
+ type = 24
def __init__(self):
return
@@ -331,9 +332,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_DEC_NW_TTL)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 24)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -357,7 +358,7 @@
q.text('}')
class group(Action):
- type = const.OFPAT_GROUP
+ type = 22
def __init__(self, group_id=None):
if group_id != None:
@@ -382,10 +383,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_GROUP)
- _len = reader.read('!H')[0]
- obj.group_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 22)
+ _len = reader.read("!H")[0]
+ obj.group_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -411,8 +412,8 @@
q.text('}')
class nicira_dec_ttl(Action):
- type = const.OFPAT_EXPERIMENTER
- experimenter = 0x2320
+ type = 65535
+ experimenter = 8992
subtype = 18
def __init__(self):
@@ -437,12 +438,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_EXPERIMENTER)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 8992)
+ _subtype = reader.read("!H")[0]
assert(_subtype == 18)
reader.skip(2)
reader.skip(4)
@@ -468,7 +469,7 @@
q.text('}')
class output(Action):
- type = const.OFPAT_OUTPUT
+ type = 0
def __init__(self, port=None, max_len=None):
if port != None:
@@ -485,7 +486,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", self.max_len))
packed.append('\x00' * 6)
length = sum([len(x) for x in packed])
@@ -499,11 +500,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_OUTPUT)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!L')[0]
- obj.max_len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
+ obj.max_len = reader.read("!H")[0]
reader.skip(6)
return obj
@@ -534,7 +535,7 @@
q.text('}')
class pop_mpls(Action):
- type = const.OFPAT_POP_MPLS
+ type = 20
def __init__(self, ethertype=None):
if ethertype != None:
@@ -560,10 +561,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 20)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -590,7 +591,7 @@
q.text('}')
class pop_pbb(Action):
- type = const.OFPAT_POP_PBB
+ type = 27
def __init__(self):
return
@@ -611,9 +612,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_PBB)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 27)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -637,7 +638,7 @@
q.text('}')
class pop_vlan(Action):
- type = const.OFPAT_POP_VLAN
+ type = 18
def __init__(self):
return
@@ -658,9 +659,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_POP_VLAN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 18)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -684,7 +685,7 @@
q.text('}')
class push_mpls(Action):
- type = const.OFPAT_PUSH_MPLS
+ type = 19
def __init__(self, ethertype=None):
if ethertype != None:
@@ -710,10 +711,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_MPLS)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 19)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -740,7 +741,7 @@
q.text('}')
class push_pbb(Action):
- type = const.OFPAT_PUSH_PBB
+ type = 26
def __init__(self, ethertype=None):
if ethertype != None:
@@ -766,10 +767,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_PBB)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 26)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -796,7 +797,7 @@
q.text('}')
class push_vlan(Action):
- type = const.OFPAT_PUSH_VLAN
+ type = 17
def __init__(self, ethertype=None):
if ethertype != None:
@@ -822,10 +823,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_PUSH_VLAN)
- _len = reader.read('!H')[0]
- obj.ethertype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 17)
+ _len = reader.read("!H")[0]
+ obj.ethertype = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -852,13 +853,13 @@
q.text('}')
class set_field(Action):
- type = const.OFPAT_SET_FIELD
+ type = 25
def __init__(self, field=None):
if field != None:
self.field = field
else:
- self.field = ""
+ self.field = ''
return
def pack(self):
@@ -877,9 +878,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_FIELD)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 25)
+ _len = reader.read("!H")[0]
obj.field = str(reader.read_all())
return obj
@@ -906,7 +907,7 @@
q.text('}')
class set_mpls_ttl(Action):
- type = const.OFPAT_SET_MPLS_TTL
+ type = 15
def __init__(self, mpls_ttl=None):
if mpls_ttl != None:
@@ -932,10 +933,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_MPLS_TTL)
- _len = reader.read('!H')[0]
- obj.mpls_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 15)
+ _len = reader.read("!H")[0]
+ obj.mpls_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -962,7 +963,7 @@
q.text('}')
class set_nw_ttl(Action):
- type = const.OFPAT_SET_NW_TTL
+ type = 23
def __init__(self, nw_ttl=None):
if nw_ttl != None:
@@ -988,10 +989,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_TTL)
- _len = reader.read('!H')[0]
- obj.nw_ttl = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 23)
+ _len = reader.read("!H")[0]
+ obj.nw_ttl = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -1018,7 +1019,7 @@
q.text('}')
class set_queue(Action):
- type = const.OFPAT_SET_QUEUE
+ type = 21
def __init__(self, queue_id=None):
if queue_id != None:
@@ -1043,10 +1044,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_QUEUE)
- _len = reader.read('!H')[0]
- obj.queue_id = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 21)
+ _len = reader.read("!H")[0]
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -1088,24 +1089,31 @@
raise loxi.ProtocolError("unexpected BSN experimenter subtype %#x" % subtype)
parsers = {
- const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
- const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
- const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
- const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
- const.OFPAT_EXPERIMENTER : parse_experimenter,
- const.OFPAT_GROUP : group.unpack,
const.OFPAT_OUTPUT : output.unpack,
- const.OFPAT_POP_MPLS : pop_mpls.unpack,
- const.OFPAT_POP_PBB : pop_pbb.unpack,
+ const.OFPAT_COPY_TTL_OUT : copy_ttl_out.unpack,
+ const.OFPAT_COPY_TTL_IN : copy_ttl_in.unpack,
+ const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
+ const.OFPAT_DEC_MPLS_TTL : dec_mpls_ttl.unpack,
+ const.OFPAT_PUSH_VLAN : push_vlan.unpack,
const.OFPAT_POP_VLAN : pop_vlan.unpack,
const.OFPAT_PUSH_MPLS : push_mpls.unpack,
- const.OFPAT_PUSH_PBB : push_pbb.unpack,
- const.OFPAT_PUSH_VLAN : push_vlan.unpack,
- const.OFPAT_SET_FIELD : set_field.unpack,
- const.OFPAT_SET_MPLS_TTL : set_mpls_ttl.unpack,
- const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_POP_MPLS : pop_mpls.unpack,
const.OFPAT_SET_QUEUE : set_queue.unpack,
+ const.OFPAT_GROUP : group.unpack,
+ const.OFPAT_SET_NW_TTL : set_nw_ttl.unpack,
+ const.OFPAT_DEC_NW_TTL : dec_nw_ttl.unpack,
+ const.OFPAT_SET_FIELD : set_field.unpack,
+ const.OFPAT_PUSH_PBB : push_pbb.unpack,
+ const.OFPAT_POP_PBB : pop_pbb.unpack,
+ const.OFPAT_EXPERIMENTER : parse_experimenter,
}
experimenter_parsers = {
+ 8992 : {
+ 18: nicira_dec_ttl.unpack,
+ },
+ 6035143 : {
+ 1: bsn_mirror.unpack,
+ 2: bsn_set_tunnel_dst.unpack,
+ },
}