Signed-off-by: Simon Horman <[email protected]>
---
v3
* Rebase
v2
* First post
---
ryu/ofproto/ofproto_v1_4_parser.py | 64 ++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py
b/ryu/ofproto/ofproto_v1_4_parser.py
index 1edc9b1..186684a 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -991,6 +991,15 @@ class
OFPRolePropExperimenter(OFPPropCommonExperimenter4ByteData):
pass
+class OFPBundleProp(OFPPropBase):
+ _TYPES = {}
+
+
[email protected]_type(ofproto.OFPRPT_EXPERIMENTER)
+class OFPBundlePropExperimenter(OFPPropCommonExperimenter4ByteData):
+ pass
+
+
class OFPMatchField(StringifyMixin):
_FIELDS_HEADERS = {}
@@ -5786,3 +5795,58 @@ class OFPSetAsync(MsgBase):
bin_props += p.serialize()
self.buf += bin_props
+
+
+@_set_msg_type(ofproto.OFPT_BUNDLE_CONTROL)
+class OFPBundleCtrlMsg(MsgBase):
+ """
+ Bundle control message
+
+ The controller uses this message to create, destroy and commit bundles
+
+ ================ ======================================================
+ Attribute Description
+ ================ ======================================================
+ bundle_id Id of the bundle
+ type One of the following values.
+ OFPBCT_OPEN_REQUEST
+ OFPBCT_OPEN_REPLY
+ OFPBCT_CLOSE_REQUEST
+ OFPBCT_CLOSE_REPLY
+ OFPBCT_COMMIT_REQUEST
+ OFPBCT_COMMIT_REPLY
+ OFPBCT_DISCARD_REQUEST
+ OFPBCT_DISCARD_REPLY
+ flags Bitmap of the following flags.
+ OFPBF_ATOMIC
+ OFPBF_ORDERED
+ properties List of ``OFPBundleProp`` subclass instance
+ ================ ======================================================
+
+ Example::
+
+ def send_bundle_control(self, datapath):
+ ofp = datapath.ofproto
+ ofp_parser = datapath.ofproto_parser
+
+ req = ofp_parser.OFPBundleCtrlMsg(datapath, 7,
+ ofp.OFPBCT_OPEN_REQUEST,
+ [ofp.OFPBF_ATOMIC], [])
+ datapath.send_msg(req)
+ """
+ def __init__(self, datapath, bundle_id, type_, flags, properties):
+ super(OFPBundleCtrlMsg, self).__init__(datapath)
+ self.bundle_id = bundle_id
+ self.type = type_
+ self.flags = flags
+ self.properties = properties
+
+ def _serialize_body(self):
+ bin_props = bytearray()
+ for p in self.properties:
+ bin_props += p.serialize()
+
+ msg_pack_into(ofproto.OFP_BUNDLE_CTRL_MSG_PACK_STR,
+ self.buf, ofproto.OFP_HEADER_SIZE, self.bundle_id,
+ self.type, self.flags)
+ self.buf += bin_props
--
1.8.5.2
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel