changes from loxigen e8e6401509
diff --git a/src/python/loxi/of10/action.py b/src/python/loxi/of10/action.py
index 8fe2997..2de9ac9 100644
--- a/src/python/loxi/of10/action.py
+++ b/src/python/loxi/of10/action.py
@@ -1,6 +1,7 @@
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from template action.py
# Do not modify
@@ -23,8 +24,8 @@
pass
class bsn_mirror(Action):
- type = const.OFPAT_VENDOR
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 1
def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
@@ -63,16 +64,16 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_VENDOR)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 1)
- obj.dest_port = reader.read('!L')[0]
- obj.vlan_tag = reader.read('!L')[0]
- obj.copy_stage = reader.read('!B')[0]
+ obj.dest_port = reader.read("!L")[0]
+ obj.vlan_tag = reader.read("!L")[0]
+ obj.copy_stage = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -107,8 +108,8 @@
q.text('}')
class bsn_set_tunnel_dst(Action):
- type = const.OFPAT_VENDOR
- experimenter = 0x5c16c7
+ type = 65535
+ experimenter = 6035143
subtype = 2
def __init__(self, dst=None):
@@ -136,14 +137,14 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_VENDOR)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x5c16c7)
- _subtype = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 6035143)
+ _subtype = reader.read("!L")[0]
assert(_subtype == 2)
- obj.dst = reader.read('!L')[0]
+ obj.dst = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -169,7 +170,7 @@
q.text('}')
class enqueue(Action):
- type = const.OFPAT_ENQUEUE
+ type = 11
def __init__(self, port=None, queue_id=None):
if port != None:
@@ -186,7 +187,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!H", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append('\x00' * 6)
packed.append(struct.pack("!L", self.queue_id))
length = sum([len(x) for x in packed])
@@ -200,12 +201,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_ENQUEUE)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 11)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
reader.skip(6)
- obj.queue_id = reader.read('!L')[0]
+ obj.queue_id = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -235,8 +236,8 @@
q.text('}')
class nicira_dec_ttl(Action):
- type = const.OFPAT_VENDOR
- experimenter = 0x2320
+ type = 65535
+ experimenter = 8992
subtype = 18
def __init__(self):
@@ -261,12 +262,12 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_VENDOR)
- _len = reader.read('!H')[0]
- _experimenter = reader.read('!L')[0]
- assert(_experimenter == 0x2320)
- _subtype = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 65535)
+ _len = reader.read("!H")[0]
+ _experimenter = reader.read("!L")[0]
+ assert(_experimenter == 8992)
+ _subtype = reader.read("!H")[0]
assert(_subtype == 18)
reader.skip(2)
reader.skip(4)
@@ -292,7 +293,7 @@
q.text('}')
class output(Action):
- type = const.OFPAT_OUTPUT
+ type = 0
def __init__(self, port=None, max_len=None):
if port != None:
@@ -309,7 +310,7 @@
packed = []
packed.append(struct.pack("!H", self.type))
packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!H", self.port))
+ packed.append(util.pack_port_no(self.port))
packed.append(struct.pack("!H", self.max_len))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
@@ -322,11 +323,11 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_OUTPUT)
- _len = reader.read('!H')[0]
- obj.port = reader.read('!H')[0]
- obj.max_len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 0)
+ _len = reader.read("!H")[0]
+ obj.port = util.unpack_port_no(reader)
+ obj.max_len = reader.read("!H")[0]
return obj
def __eq__(self, other):
@@ -356,7 +357,7 @@
q.text('}')
class set_dl_dst(Action):
- type = const.OFPAT_SET_DL_DST
+ type = 5
def __init__(self, dl_addr=None):
if dl_addr != None:
@@ -382,9 +383,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_DL_DST)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 5)
+ _len = reader.read("!H")[0]
obj.dl_addr = list(reader.read('!6B'))
reader.skip(6)
return obj
@@ -412,7 +413,7 @@
q.text('}')
class set_dl_src(Action):
- type = const.OFPAT_SET_DL_SRC
+ type = 4
def __init__(self, dl_addr=None):
if dl_addr != None:
@@ -438,9 +439,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_DL_SRC)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 4)
+ _len = reader.read("!H")[0]
obj.dl_addr = list(reader.read('!6B'))
reader.skip(6)
return obj
@@ -468,7 +469,7 @@
q.text('}')
class set_nw_dst(Action):
- type = const.OFPAT_SET_NW_DST
+ type = 7
def __init__(self, nw_addr=None):
if nw_addr != None:
@@ -493,10 +494,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_DST)
- _len = reader.read('!H')[0]
- obj.nw_addr = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 7)
+ _len = reader.read("!H")[0]
+ obj.nw_addr = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -522,7 +523,7 @@
q.text('}')
class set_nw_src(Action):
- type = const.OFPAT_SET_NW_SRC
+ type = 6
def __init__(self, nw_addr=None):
if nw_addr != None:
@@ -547,10 +548,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_SRC)
- _len = reader.read('!H')[0]
- obj.nw_addr = reader.read('!L')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 6)
+ _len = reader.read("!H")[0]
+ obj.nw_addr = reader.read("!L")[0]
return obj
def __eq__(self, other):
@@ -576,7 +577,7 @@
q.text('}')
class set_nw_tos(Action):
- type = const.OFPAT_SET_NW_TOS
+ type = 8
def __init__(self, nw_tos=None):
if nw_tos != None:
@@ -602,10 +603,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_NW_TOS)
- _len = reader.read('!H')[0]
- obj.nw_tos = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 8)
+ _len = reader.read("!H")[0]
+ obj.nw_tos = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -632,7 +633,7 @@
q.text('}')
class set_tp_dst(Action):
- type = const.OFPAT_SET_TP_DST
+ type = 10
def __init__(self, tp_port=None):
if tp_port != None:
@@ -658,10 +659,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_TP_DST)
- _len = reader.read('!H')[0]
- obj.tp_port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 10)
+ _len = reader.read("!H")[0]
+ obj.tp_port = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -688,7 +689,7 @@
q.text('}')
class set_tp_src(Action):
- type = const.OFPAT_SET_TP_SRC
+ type = 9
def __init__(self, tp_port=None):
if tp_port != None:
@@ -714,10 +715,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_TP_SRC)
- _len = reader.read('!H')[0]
- obj.tp_port = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 9)
+ _len = reader.read("!H")[0]
+ obj.tp_port = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -744,7 +745,7 @@
q.text('}')
class set_vlan_pcp(Action):
- type = const.OFPAT_SET_VLAN_PCP
+ type = 2
def __init__(self, vlan_pcp=None):
if vlan_pcp != None:
@@ -770,10 +771,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_VLAN_PCP)
- _len = reader.read('!H')[0]
- obj.vlan_pcp = reader.read('!B')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 2)
+ _len = reader.read("!H")[0]
+ obj.vlan_pcp = reader.read("!B")[0]
reader.skip(3)
return obj
@@ -800,7 +801,7 @@
q.text('}')
class set_vlan_vid(Action):
- type = const.OFPAT_SET_VLAN_VID
+ type = 1
def __init__(self, vlan_vid=None):
if vlan_vid != None:
@@ -826,10 +827,10 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_SET_VLAN_VID)
- _len = reader.read('!H')[0]
- obj.vlan_vid = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 1)
+ _len = reader.read("!H")[0]
+ obj.vlan_vid = reader.read("!H")[0]
reader.skip(2)
return obj
@@ -856,7 +857,7 @@
q.text('}')
class strip_vlan(Action):
- type = const.OFPAT_STRIP_VLAN
+ type = 3
def __init__(self):
return
@@ -877,9 +878,9 @@
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
- _type = reader.read('!H')[0]
- assert(_type == const.OFPAT_STRIP_VLAN)
- _len = reader.read('!H')[0]
+ _type = reader.read("!H")[0]
+ assert(_type == 3)
+ _len = reader.read("!H")[0]
reader.skip(4)
return obj
@@ -919,26 +920,26 @@
raise loxi.ProtocolError("unexpected BSN experimenter subtype %#x" % subtype)
parsers = {
- const.OFPAT_ENQUEUE : enqueue.unpack,
const.OFPAT_OUTPUT : output.unpack,
- const.OFPAT_SET_DL_DST : set_dl_dst.unpack,
- const.OFPAT_SET_DL_SRC : set_dl_src.unpack,
- const.OFPAT_SET_NW_DST : set_nw_dst.unpack,
- const.OFPAT_SET_NW_SRC : set_nw_src.unpack,
- const.OFPAT_SET_NW_TOS : set_nw_tos.unpack,
- const.OFPAT_SET_TP_DST : set_tp_dst.unpack,
- const.OFPAT_SET_TP_SRC : set_tp_src.unpack,
- const.OFPAT_SET_VLAN_PCP : set_vlan_pcp.unpack,
const.OFPAT_SET_VLAN_VID : set_vlan_vid.unpack,
+ const.OFPAT_SET_VLAN_PCP : set_vlan_pcp.unpack,
const.OFPAT_STRIP_VLAN : strip_vlan.unpack,
+ const.OFPAT_SET_DL_SRC : set_dl_src.unpack,
+ const.OFPAT_SET_DL_DST : set_dl_dst.unpack,
+ const.OFPAT_SET_NW_SRC : set_nw_src.unpack,
+ const.OFPAT_SET_NW_DST : set_nw_dst.unpack,
+ const.OFPAT_SET_NW_TOS : set_nw_tos.unpack,
+ const.OFPAT_SET_TP_SRC : set_tp_src.unpack,
+ const.OFPAT_SET_TP_DST : set_tp_dst.unpack,
+ const.OFPAT_ENQUEUE : enqueue.unpack,
const.OFPAT_VENDOR : parse_vendor,
}
experimenter_parsers = {
- 0x2320 : {
+ 8992 : {
18: nicira_dec_ttl.unpack,
},
- 0x5c16c7 : {
+ 6035143 : {
1: bsn_mirror.unpack,
2: bsn_set_tunnel_dst.unpack,
},