Signed-off-by: Simon Horman <[email protected]>
---
 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 6120633..b4e0382 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -1014,6 +1014,15 @@ class 
OFPRolePropExperimenter(OFPPropCommonExperimenter4ByteData):
     pass
 
 
+class OFPBundleProp(OFPPropBase):
+    _TYPES = {}
+
+
[email protected]_type(ofproto.OFPRPT_EXPERIMENTER)
+class OFPBundlePropExperimenter(OFPPropCommonExperimenter4ByteData):
+    pass
+
+
 class OFPMatchField(StringifyMixin):
     _FIELDS_HEADERS = {}
 
@@ -5756,3 +5765,58 @@ class OFPSetAsync(MsgBase):
                       self.packet_in_mask[0], self.packet_in_mask[1],
                       self.port_status_mask[0], self.port_status_mask[1],
                       self.flow_removed_mask[0], self.flow_removed_mask[1])
+
+
+@_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


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to