Merge into master from pull request #69:
Support for specifying interface name while creating virtual port. (https://github.com/floodlight/oftest/pull/69)
diff --git a/src/python/loxi/of10/common.py b/src/python/loxi/of10/common.py
index 28b079a..efc8b85 100644
--- a/src/python/loxi/of10/common.py
+++ b/src/python/loxi/of10/common.py
@@ -138,7 +138,7 @@
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):
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None, if_name=None):
if port_no != None:
self.port_no = port_no
else:
@@ -159,6 +159,10 @@
self.egress_vlan_id = egress_vlan_id
else:
self.egress_vlan_id = 0
+ if if_name != None:
+ self.if_name = if_name
+ else:
+ self.if_name = ""
return
def pack(self):
@@ -170,6 +174,7 @@
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))
+ packed.append(struct.pack("!16s", self.if_name))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -189,6 +194,7 @@
obj.ingress_vlan_id = reader.read("!H")[0]
obj.egress_tpid = reader.read("!H")[0]
obj.egress_vlan_id = reader.read("!H")[0]
+ obj.if_name = reader.read("!16s")[0].rstrip("\x00")
return obj
def __eq__(self, other):
@@ -198,6 +204,7 @@
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
+ if self.if_name != other.if_name: return False
return True
def __ne__(self, other):
@@ -226,6 +233,9 @@
q.text(","); q.breakable()
q.text("egress_vlan_id = ");
q.text("%#x" % self.egress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("if_name = ");
+ q.pp(self.if_name)
q.breakable()
q.text('}')
diff --git a/src/python/loxi/of10/message.py b/src/python/loxi/of10/message.py
index 6e6649e..c232a1d 100644
--- a/src/python/loxi/of10/message.py
+++ b/src/python/loxi/of10/message.py
@@ -3107,200 +3107,6 @@
q.breakable()
q.text('}')
-class experimenter_stats_reply(Message):
- version = 1
- type = 17
- stats_type = 65535
-
- def __init__(self, xid=None, flags=None, experimenter=None, data=None):
- self.xid = xid
- if flags != None:
- self.flags = flags
- else:
- self.flags = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!B", self.version))
- packed.append(struct.pack("!B", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
- packed.append(struct.pack("!L", self.xid))
- packed.append(struct.pack("!H", self.stats_type))
- packed.append(struct.pack("!H", self.flags))
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[2] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = experimenter_stats_reply()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _version = reader.read("!B")[0]
- assert(_version == 1)
- _type = reader.read("!B")[0]
- assert(_type == 17)
- _length = reader.read("!H")[0]
- obj.xid = reader.read("!L")[0]
- _stats_type = reader.read("!H")[0]
- assert(_stats_type == 65535)
- obj.flags = reader.read("!H")[0]
- obj.experimenter = reader.read("!L")[0]
- obj.data = str(reader.read_all())
- return obj
-
- 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.flags != other.flags: return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: return False
- return True
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def __str__(self):
- return self.show()
-
- def show(self):
- import loxi.pp
- return loxi.pp.pp(self)
-
- def pretty_print(self, q):
- q.text("experimenter_stats_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("flags = ");
- q.text("%#x" % self.flags)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
-class experimenter_stats_request(Message):
- version = 1
- type = 16
- stats_type = 65535
-
- def __init__(self, xid=None, flags=None, experimenter=None, data=None):
- self.xid = xid
- if flags != None:
- self.flags = flags
- else:
- self.flags = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!B", self.version))
- packed.append(struct.pack("!B", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
- packed.append(struct.pack("!L", self.xid))
- packed.append(struct.pack("!H", self.stats_type))
- packed.append(struct.pack("!H", self.flags))
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[2] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = experimenter_stats_request()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _version = reader.read("!B")[0]
- assert(_version == 1)
- _type = reader.read("!B")[0]
- assert(_type == 16)
- _length = reader.read("!H")[0]
- obj.xid = reader.read("!L")[0]
- _stats_type = reader.read("!H")[0]
- assert(_stats_type == 65535)
- obj.flags = reader.read("!H")[0]
- obj.experimenter = reader.read("!L")[0]
- obj.data = str(reader.read_all())
- return obj
-
- 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.flags != other.flags: return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: return False
- return True
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def __str__(self):
- return self.show()
-
- def show(self):
- import loxi.pp
- return loxi.pp.pp(self)
-
- def pretty_print(self, q):
- q.text("experimenter_stats_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("flags = ");
- q.text("%#x" % self.flags)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class features_reply(Message):
version = 1
type = 6
@@ -6376,7 +6182,6 @@
const.OFPST_TABLE : table_stats_reply.unpack,
const.OFPST_PORT : port_stats_reply.unpack,
const.OFPST_QUEUE : queue_stats_reply.unpack,
- const.OFPST_VENDOR : experimenter_stats_reply.unpack,
}
stats_request_parsers = {
@@ -6386,7 +6191,6 @@
const.OFPST_TABLE : table_stats_request.unpack,
const.OFPST_PORT : port_stats_request.unpack,
const.OFPST_QUEUE : queue_stats_request.unpack,
- const.OFPST_VENDOR : experimenter_stats_request.unpack,
}
experimenter_parsers = {
diff --git a/src/python/loxi/of11/common.py b/src/python/loxi/of11/common.py
index 969b561..6b0e296 100644
--- a/src/python/loxi/of11/common.py
+++ b/src/python/loxi/of11/common.py
@@ -139,7 +139,7 @@
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):
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None, if_name=None):
if port_no != None:
self.port_no = port_no
else:
@@ -160,6 +160,10 @@
self.egress_vlan_id = egress_vlan_id
else:
self.egress_vlan_id = 0
+ if if_name != None:
+ self.if_name = if_name
+ else:
+ self.if_name = ""
return
def pack(self):
@@ -171,6 +175,7 @@
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))
+ packed.append(struct.pack("!16s", self.if_name))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -190,6 +195,7 @@
obj.ingress_vlan_id = reader.read("!H")[0]
obj.egress_tpid = reader.read("!H")[0]
obj.egress_vlan_id = reader.read("!H")[0]
+ obj.if_name = reader.read("!16s")[0].rstrip("\x00")
return obj
def __eq__(self, other):
@@ -199,6 +205,7 @@
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
+ if self.if_name != other.if_name: return False
return True
def __ne__(self, other):
@@ -227,6 +234,9 @@
q.text(","); q.breakable()
q.text("egress_vlan_id = ");
q.text("%#x" % self.egress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("if_name = ");
+ q.pp(self.if_name)
q.breakable()
q.text('}')
diff --git a/src/python/loxi/of11/instruction.py b/src/python/loxi/of11/instruction.py
index 961f3c6..2f7f1bf 100644
--- a/src/python/loxi/of11/instruction.py
+++ b/src/python/loxi/of11/instruction.py
@@ -127,70 +127,6 @@
q.breakable()
q.text('}')
-class experimenter(Instruction):
- type = 65535
-
- def __init__(self, experimenter=None, data=None):
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = experimenter()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _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
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: 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("experimenter {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class goto_table(Instruction):
type = 1
@@ -376,5 +312,4 @@
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,
}
diff --git a/src/python/loxi/of11/message.py b/src/python/loxi/of11/message.py
index 091e70c..1d32ee6 100644
--- a/src/python/loxi/of11/message.py
+++ b/src/python/loxi/of11/message.py
@@ -2262,208 +2262,6 @@
q.breakable()
q.text('}')
-class experimenter_stats_reply(Message):
- version = 2
- type = 19
- stats_type = 65535
-
- def __init__(self, xid=None, flags=None, experimenter=None, data=None):
- self.xid = xid
- if flags != None:
- self.flags = flags
- else:
- self.flags = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!B", self.version))
- packed.append(struct.pack("!B", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
- packed.append(struct.pack("!L", self.xid))
- packed.append(struct.pack("!H", self.stats_type))
- packed.append(struct.pack("!H", self.flags))
- packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.experimenter))
- packed.append('\x00' * 4)
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[2] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = experimenter_stats_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 == 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]
- reader.skip(4)
- obj.data = str(reader.read_all())
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.version != other.version: return False
- if self.type != other.type: return False
- if self.xid != other.xid: return False
- if self.flags != other.flags: return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: return False
- return True
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def __str__(self):
- return self.show()
-
- def show(self):
- import loxi.pp
- return loxi.pp.pp(self)
-
- def pretty_print(self, q):
- q.text("experimenter_stats_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("flags = ");
- q.text("%#x" % self.flags)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
-class experimenter_stats_request(Message):
- version = 2
- type = 18
- stats_type = 65535
-
- def __init__(self, xid=None, flags=None, experimenter=None, data=None):
- self.xid = xid
- if flags != None:
- self.flags = flags
- else:
- self.flags = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!B", self.version))
- packed.append(struct.pack("!B", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
- packed.append(struct.pack("!L", self.xid))
- packed.append(struct.pack("!H", self.stats_type))
- packed.append(struct.pack("!H", self.flags))
- packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.experimenter))
- packed.append('\x00' * 4)
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[2] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = experimenter_stats_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 == 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]
- reader.skip(4)
- obj.data = str(reader.read_all())
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.version != other.version: return False
- if self.type != other.type: return False
- if self.xid != other.xid: return False
- if self.flags != other.flags: return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: return False
- return True
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def __str__(self):
- return self.show()
-
- def show(self):
- import loxi.pp
- return loxi.pp.pp(self)
-
- def pretty_print(self, q):
- q.text("experimenter_stats_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("flags = ");
- q.text("%#x" % self.flags)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class features_reply(Message):
version = 2
type = 6
@@ -6069,7 +5867,6 @@
const.OFPST_TABLE : table_stats_reply.unpack,
const.OFPST_PORT : port_stats_reply.unpack,
const.OFPST_QUEUE : queue_stats_reply.unpack,
- const.OFPST_EXPERIMENTER : experimenter_stats_reply.unpack,
const.OFPST_GROUP : group_stats_reply.unpack,
const.OFPST_GROUP_DESC : group_desc_stats_reply.unpack,
}
@@ -6081,7 +5878,6 @@
const.OFPST_TABLE : table_stats_request.unpack,
const.OFPST_PORT : port_stats_request.unpack,
const.OFPST_QUEUE : queue_stats_request.unpack,
- const.OFPST_EXPERIMENTER : experimenter_stats_request.unpack,
const.OFPST_GROUP : group_stats_request.unpack,
const.OFPST_GROUP_DESC : group_desc_stats_request.unpack,
}
diff --git a/src/python/loxi/of12/common.py b/src/python/loxi/of12/common.py
index 698fe7a..dee40f1 100644
--- a/src/python/loxi/of12/common.py
+++ b/src/python/loxi/of12/common.py
@@ -140,7 +140,7 @@
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):
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None, if_name=None):
if port_no != None:
self.port_no = port_no
else:
@@ -161,6 +161,10 @@
self.egress_vlan_id = egress_vlan_id
else:
self.egress_vlan_id = 0
+ if if_name != None:
+ self.if_name = if_name
+ else:
+ self.if_name = ""
return
def pack(self):
@@ -172,6 +176,7 @@
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))
+ packed.append(struct.pack("!16s", self.if_name))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -191,6 +196,7 @@
obj.ingress_vlan_id = reader.read("!H")[0]
obj.egress_tpid = reader.read("!H")[0]
obj.egress_vlan_id = reader.read("!H")[0]
+ obj.if_name = reader.read("!16s")[0].rstrip("\x00")
return obj
def __eq__(self, other):
@@ -200,6 +206,7 @@
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
+ if self.if_name != other.if_name: return False
return True
def __ne__(self, other):
@@ -228,6 +235,9 @@
q.text(","); q.breakable()
q.text("egress_vlan_id = ");
q.text("%#x" % self.egress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("if_name = ");
+ q.pp(self.if_name)
q.breakable()
q.text('}')
@@ -1135,74 +1145,6 @@
q.breakable()
q.text('}')
-class queue_prop_experimenter(object):
- type = 65535
-
- def __init__(self, experimenter=None, data=None):
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.experimenter))
- packed.append('\x00' * 4)
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = queue_prop_experimenter()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _type = reader.read("!H")[0]
- assert(_type == 65535)
- _len = reader.read("!H")[0]
- reader.skip(4)
- obj.experimenter = reader.read("!L")[0]
- reader.skip(4)
- obj.data = str(reader.read_all())
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: 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("queue_prop_experimenter {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class queue_prop_max_rate(object):
type = 2
diff --git a/src/python/loxi/of12/instruction.py b/src/python/loxi/of12/instruction.py
index 961f3c6..2f7f1bf 100644
--- a/src/python/loxi/of12/instruction.py
+++ b/src/python/loxi/of12/instruction.py
@@ -127,70 +127,6 @@
q.breakable()
q.text('}')
-class experimenter(Instruction):
- type = 65535
-
- def __init__(self, experimenter=None, data=None):
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = experimenter()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _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
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: 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("experimenter {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class goto_table(Instruction):
type = 1
@@ -376,5 +312,4 @@
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,
}
diff --git a/src/python/loxi/of12/message.py b/src/python/loxi/of12/message.py
index ed1f04f..c595918 100644
--- a/src/python/loxi/of12/message.py
+++ b/src/python/loxi/of12/message.py
@@ -2262,224 +2262,6 @@
q.breakable()
q.text('}')
-class experimenter_stats_reply(Message):
- version = 3
- type = 19
- stats_type = 65535
-
- def __init__(self, xid=None, flags=None, experimenter=None, subtype=None, data=None):
- self.xid = xid
- if flags != None:
- self.flags = flags
- else:
- self.flags = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if subtype != None:
- self.subtype = subtype
- else:
- self.subtype = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!B", self.version))
- packed.append(struct.pack("!B", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
- packed.append(struct.pack("!L", self.xid))
- packed.append(struct.pack("!H", self.stats_type))
- packed.append(struct.pack("!H", self.flags))
- packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(struct.pack("!L", self.subtype))
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[2] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = experimenter_stats_reply()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _version = reader.read("!B")[0]
- assert(_version == 3)
- _type = reader.read("!B")[0]
- assert(_type == 19)
- _length = reader.read("!H")[0]
- obj.xid = reader.read("!L")[0]
- _stats_type = reader.read("!H")[0]
- assert(_stats_type == 65535)
- obj.flags = reader.read("!H")[0]
- reader.skip(4)
- obj.experimenter = reader.read("!L")[0]
- obj.subtype = reader.read("!L")[0]
- obj.data = str(reader.read_all())
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.version != other.version: return False
- if self.type != other.type: return False
- if self.xid != other.xid: return False
- if self.flags != other.flags: return False
- if self.experimenter != other.experimenter: return False
- if self.subtype != other.subtype: return False
- if self.data != other.data: return False
- return True
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def __str__(self):
- return self.show()
-
- def show(self):
- import loxi.pp
- return loxi.pp.pp(self)
-
- def pretty_print(self, q):
- q.text("experimenter_stats_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("flags = ");
- q.text("%#x" % self.flags)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("subtype = ");
- q.text("%#x" % self.subtype)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
-class experimenter_stats_request(Message):
- version = 3
- type = 18
- stats_type = 65535
-
- def __init__(self, xid=None, flags=None, experimenter=None, subtype=None, data=None):
- self.xid = xid
- if flags != None:
- self.flags = flags
- else:
- self.flags = 0
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if subtype != None:
- self.subtype = subtype
- else:
- self.subtype = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!B", self.version))
- packed.append(struct.pack("!B", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for length at index 2
- packed.append(struct.pack("!L", self.xid))
- packed.append(struct.pack("!H", self.stats_type))
- packed.append(struct.pack("!H", self.flags))
- packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(struct.pack("!L", self.subtype))
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[2] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- if len(buf) < 8: raise loxi.ProtocolError("buffer too short to contain an OpenFlow message")
- obj = experimenter_stats_request()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _version = reader.read("!B")[0]
- assert(_version == 3)
- _type = reader.read("!B")[0]
- assert(_type == 18)
- _length = reader.read("!H")[0]
- obj.xid = reader.read("!L")[0]
- _stats_type = reader.read("!H")[0]
- assert(_stats_type == 65535)
- obj.flags = reader.read("!H")[0]
- reader.skip(4)
- obj.experimenter = reader.read("!L")[0]
- obj.subtype = reader.read("!L")[0]
- obj.data = str(reader.read_all())
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.version != other.version: return False
- if self.type != other.type: return False
- if self.xid != other.xid: return False
- if self.flags != other.flags: return False
- if self.experimenter != other.experimenter: return False
- if self.subtype != other.subtype: return False
- if self.data != other.data: return False
- return True
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def __str__(self):
- return self.show()
-
- def show(self):
- import loxi.pp
- return loxi.pp.pp(self)
-
- def pretty_print(self, q):
- q.text("experimenter_stats_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("flags = ");
- q.text("%#x" % self.flags)
- q.text(","); q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("subtype = ");
- q.text("%#x" % self.subtype)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class features_reply(Message):
version = 3
type = 6
@@ -6503,7 +6285,6 @@
const.OFPST_TABLE : table_stats_reply.unpack,
const.OFPST_PORT : port_stats_reply.unpack,
const.OFPST_QUEUE : queue_stats_reply.unpack,
- const.OFPST_EXPERIMENTER : experimenter_stats_reply.unpack,
const.OFPST_GROUP : group_stats_reply.unpack,
const.OFPST_GROUP_DESC : group_desc_stats_reply.unpack,
const.OFPST_GROUP_FEATURES : group_features_stats_reply.unpack,
@@ -6516,7 +6297,6 @@
const.OFPST_TABLE : table_stats_request.unpack,
const.OFPST_PORT : port_stats_request.unpack,
const.OFPST_QUEUE : queue_stats_request.unpack,
- const.OFPST_EXPERIMENTER : experimenter_stats_request.unpack,
const.OFPST_GROUP : group_stats_request.unpack,
const.OFPST_GROUP_DESC : group_desc_stats_request.unpack,
const.OFPST_GROUP_FEATURES : group_features_stats_request.unpack,
diff --git a/src/python/loxi/of13/common.py b/src/python/loxi/of13/common.py
index 952aeba..820caad 100644
--- a/src/python/loxi/of13/common.py
+++ b/src/python/loxi/of13/common.py
@@ -60,6 +60,58 @@
return meter_stats.unpack(reader.slice(length))
return loxi.generic_util.unpack_list(reader, wrapper)
+class action_id(object):
+
+ def __init__(self, type=None):
+ if type != None:
+ self.type = type
+ else:
+ self.type = 0
+ return
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!H", self.type))
+ packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
+ packed.append('\x00' * 4)
+ length = sum([len(x) for x in packed])
+ packed[1] = struct.pack("!H", length)
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = action_id()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ obj.type = reader.read("!H")[0]
+ _len = reader.read("!H")[0]
+ reader.skip(4)
+ return obj
+
+ def __eq__(self, other):
+ if type(self) != type(other): return False
+ if self.type != other.type: return False
+ return True
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+ def show(self):
+ import loxi.pp
+ return loxi.pp.pp(self)
+
+ def pretty_print(self, q):
+ q.text("action_id {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("type = ");
+ q.text("%#x" % self.type)
+ q.breakable()
+ q.text('}')
+
class bsn_interface(object):
def __init__(self, hw_addr=None, name=None, ipv4_addr=None, ipv4_netmask=None):
@@ -141,7 +193,7 @@
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):
+ def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None, if_name=None):
if port_no != None:
self.port_no = port_no
else:
@@ -162,6 +214,10 @@
self.egress_vlan_id = egress_vlan_id
else:
self.egress_vlan_id = 0
+ if if_name != None:
+ self.if_name = if_name
+ else:
+ self.if_name = ""
return
def pack(self):
@@ -173,6 +229,7 @@
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))
+ packed.append(struct.pack("!16s", self.if_name))
length = sum([len(x) for x in packed])
packed[1] = struct.pack("!H", length)
return ''.join(packed)
@@ -192,6 +249,7 @@
obj.ingress_vlan_id = reader.read("!H")[0]
obj.egress_tpid = reader.read("!H")[0]
obj.egress_vlan_id = reader.read("!H")[0]
+ obj.if_name = reader.read("!16s")[0].rstrip("\x00")
return obj
def __eq__(self, other):
@@ -201,6 +259,7 @@
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
+ if self.if_name != other.if_name: return False
return True
def __ne__(self, other):
@@ -229,6 +288,9 @@
q.text(","); q.breakable()
q.text("egress_vlan_id = ");
q.text("%#x" % self.egress_vlan_id)
+ q.text(","); q.breakable()
+ q.text("if_name = ");
+ q.pp(self.if_name)
q.breakable()
q.text('}')
@@ -372,7 +434,7 @@
class flow_stats_entry(object):
- def __init__(self, table_id=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet_count=None, byte_count=None, match=None, instructions=None):
+ def __init__(self, table_id=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, flags=None, cookie=None, packet_count=None, byte_count=None, match=None, instructions=None):
if table_id != None:
self.table_id = table_id
else:
@@ -397,6 +459,10 @@
self.hard_timeout = hard_timeout
else:
self.hard_timeout = 0
+ if flags != None:
+ self.flags = flags
+ else:
+ self.flags = 0
if cookie != None:
self.cookie = cookie
else:
@@ -429,7 +495,8 @@
packed.append(struct.pack("!H", self.priority))
packed.append(struct.pack("!H", self.idle_timeout))
packed.append(struct.pack("!H", self.hard_timeout))
- packed.append('\x00' * 6)
+ packed.append(struct.pack("!H", self.flags))
+ packed.append('\x00' * 4)
packed.append(struct.pack("!Q", self.cookie))
packed.append(struct.pack("!Q", self.packet_count))
packed.append(struct.pack("!Q", self.byte_count))
@@ -454,7 +521,8 @@
obj.priority = reader.read("!H")[0]
obj.idle_timeout = reader.read("!H")[0]
obj.hard_timeout = reader.read("!H")[0]
- reader.skip(6)
+ obj.flags = reader.read("!H")[0]
+ reader.skip(4)
obj.cookie = reader.read("!Q")[0]
obj.packet_count = reader.read("!Q")[0]
obj.byte_count = reader.read("!Q")[0]
@@ -470,6 +538,7 @@
if self.priority != other.priority: return False
if self.idle_timeout != other.idle_timeout: return False
if self.hard_timeout != other.hard_timeout: return False
+ if self.flags != other.flags: return False
if self.cookie != other.cookie: return False
if self.packet_count != other.packet_count: return False
if self.byte_count != other.byte_count: return False
@@ -507,6 +576,9 @@
q.text("hard_timeout = ");
q.text("%#x" % self.hard_timeout)
q.text(","); q.breakable()
+ q.text("flags = ");
+ q.text("%#x" % self.flags)
+ q.text(","); q.breakable()
q.text("cookie = ");
q.text("%#x" % self.cookie)
q.text(","); q.breakable()
@@ -1556,74 +1628,6 @@
q.breakable()
q.text('}')
-class queue_prop_experimenter(object):
- type = 65535
-
- def __init__(self, experimenter=None, data=None):
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append('\x00' * 4)
- packed.append(struct.pack("!L", self.experimenter))
- packed.append('\x00' * 4)
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = queue_prop_experimenter()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _type = reader.read("!H")[0]
- assert(_type == 65535)
- _len = reader.read("!H")[0]
- reader.skip(4)
- obj.experimenter = reader.read("!L")[0]
- reader.skip(4)
- obj.data = str(reader.read_all())
- return obj
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: 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("queue_prop_experimenter {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class queue_prop_max_rate(object):
type = 2
@@ -1846,6 +1850,56 @@
q.breakable()
q.text('}')
+class table_feature_prop(object):
+
+ def __init__(self, type=None):
+ if type != None:
+ self.type = type
+ else:
+ self.type = 0
+ return
+
+ def pack(self):
+ packed = []
+ packed.append(struct.pack("!H", self.type))
+ packed.append(struct.pack("!H", 0)) # placeholder for length at index 1
+ length = sum([len(x) for x in packed])
+ packed[1] = struct.pack("!H", length)
+ return ''.join(packed)
+
+ @staticmethod
+ def unpack(buf):
+ obj = table_feature_prop()
+ if type(buf) == loxi.generic_util.OFReader:
+ reader = buf
+ else:
+ reader = loxi.generic_util.OFReader(buf)
+ obj.type = reader.read("!H")[0]
+ _length = reader.read("!H")[0]
+ return obj
+
+ def __eq__(self, other):
+ if type(self) != type(other): return False
+ if self.type != other.type: return False
+ return True
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+ def show(self):
+ import loxi.pp
+ return loxi.pp.pp(self)
+
+ def pretty_print(self, q):
+ q.text("table_feature_prop {")
+ with q.group():
+ with q.indent(2):
+ q.breakable()
+ q.text("type = ");
+ q.text("%#x" % self.type)
+ q.breakable()
+ q.text('}')
+
class table_feature_prop_apply_actions(object):
type = 6
diff --git a/src/python/loxi/of13/instruction.py b/src/python/loxi/of13/instruction.py
index 5b825d0..de508c7 100644
--- a/src/python/loxi/of13/instruction.py
+++ b/src/python/loxi/of13/instruction.py
@@ -127,70 +127,6 @@
q.breakable()
q.text('}')
-class experimenter(Instruction):
- type = 65535
-
- def __init__(self, experimenter=None, data=None):
- if experimenter != None:
- self.experimenter = experimenter
- else:
- self.experimenter = 0
- if data != None:
- self.data = data
- else:
- self.data = ''
- return
-
- def pack(self):
- packed = []
- packed.append(struct.pack("!H", self.type))
- packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
- packed.append(struct.pack("!L", self.experimenter))
- packed.append(self.data)
- length = sum([len(x) for x in packed])
- packed[1] = struct.pack("!H", length)
- return ''.join(packed)
-
- @staticmethod
- def unpack(buf):
- obj = experimenter()
- if type(buf) == loxi.generic_util.OFReader:
- reader = buf
- else:
- reader = loxi.generic_util.OFReader(buf)
- _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
-
- def __eq__(self, other):
- if type(self) != type(other): return False
- if self.experimenter != other.experimenter: return False
- if self.data != other.data: 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("experimenter {")
- with q.group():
- with q.indent(2):
- q.breakable()
- q.text("experimenter = ");
- q.text("%#x" % self.experimenter)
- q.text(","); q.breakable()
- q.text("data = ");
- q.pp(self.data)
- q.breakable()
- q.text('}')
-
class goto_table(Instruction):
type = 1
@@ -431,5 +367,4 @@
const.OFPIT_APPLY_ACTIONS : apply_actions.unpack,
const.OFPIT_CLEAR_ACTIONS : clear_actions.unpack,
const.OFPIT_METER : meter.unpack,
- const.OFPIT_EXPERIMENTER : experimenter.unpack,
}