---
ryu/ofproto/ofproto_v1_4.py | 5 +++-
ryu/ofproto/ofproto_v1_4_parser.py | 60 ++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/ryu/ofproto/ofproto_v1_4.py b/ryu/ofproto/ofproto_v1_4.py
index 200e9b0..838521f 100644
--- a/ryu/ofproto/ofproto_v1_4.py
+++ b/ryu/ofproto/ofproto_v1_4.py
@@ -1457,7 +1457,10 @@ assert (calcsize(OFP_BUNDLE_CTRL_MSG_PACK_STR) +
OFP_HEADER_SIZE ==
OFP_BUNDLE_CTRL_MSG_SIZE)
# struct ofp_bundle_add_msg
-OFP_BUNDLE_ADD_MSG_PACK_STR = '!IHH' + _OFP_HEADER_PACK_STR
+_OFP_BUNDLE_ADD_MSG_0_PACK_STR = 'I2xH'
+OFP_BUNDLE_ADD_MSG_0_PACK_STR = '!' + _OFP_BUNDLE_ADD_MSG_0_PACK_STR
+OFP_BUNDLE_ADD_MSG_PACK_STR = (OFP_BUNDLE_ADD_MSG_0_PACK_STR +
+ _OFP_HEADER_PACK_STR)
OFP_BUNDLE_ADD_MSG_SIZE = 24
assert (calcsize(OFP_BUNDLE_ADD_MSG_PACK_STR) + OFP_HEADER_SIZE ==
OFP_BUNDLE_ADD_MSG_SIZE)
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py
b/ryu/ofproto/ofproto_v1_4_parser.py
index 2d4581a..1b7a61c 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -5856,3 +5856,63 @@ class OFPBundleCtrlMsg(MsgBase):
self.buf, ofproto.OFP_HEADER_SIZE, self.bundle_id,
self.type, self.flags)
self.buf += bin_props
+
+
+@_set_msg_type(ofproto.OFPT_BUNDLE_ADD_MESSAGE)
+class OFPBundleAddMsg(MsgBase):
+ """
+ Bundle control message
+
+ The controller uses this message to create, destroy and commit bundles
+
+ ================ ======================================================
+ Attribute Description
+ ================ ======================================================
+ bundle_id Id of the bundle
+ flags Bitmap of the following flags.
+ OFPBF_ATOMIC
+ OFPBF_ORDERED
+ message ``MsgBase`` subclass instance
+ properties List of ``OFPBundleProp`` subclass instance
+ ================ ======================================================
+
+ Example::
+
+ def send_bundle_add_message(self, datapath):
+ ofp = datapath.ofproto
+ ofp_parser = datapath.ofproto_parser
+
+ msg = ofp_parser.OFPRoleRequest(datapath, ofp.OFPCR_ROLE_EQUAL, 0)
+
+ req = ofp_parser.OFPBundleAddMsg(datapath, 7, [ofp.OFPBF_ATOMIC],
+ msg, [])
+ datapath.send_msg(req)
+ """
+ def __init__(self, datapath, bundle_id, flags, message, properties):
+ super(OFPBundleAddMsg, self).__init__(datapath)
+ self.bundle_id = bundle_id
+ self.flags = flags
+ self.message = message
+ self.properties = properties
+
+ def _serialize_body(self):
+ # Message
+ tail_buf = self.message.serialize()
+ tail_buf = self.message.buf
+
+ # Pad
+ message_len = len(tail_buf)
+ pad_len = utils.round_up(message_len, 8) - message_len
+ ofproto_parser.msg_pack_into("%dx" % pad_len, tail_buf, message_len)
+
+ # Properties
+ for p in self.properties:
+ tail_buf += p.serialize()
+
+ # Head
+ msg_pack_into(ofproto.OFP_BUNDLE_ADD_MSG_0_PACK_STR,
+ self.buf, ofproto.OFP_HEADER_SIZE, self.bundle_id,
+ self.flags)
+
+ # Finish
+ self.buf += tail_buf
--
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