summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-03-19 15:37:42 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-03-21 20:43:11 +0900
commit37f59926ae2e63cf48778fc34a55fad236d2b481 (patch)
treec725ae3feb76ddb9aa0311721e630402f4ae5395
parent9128082fae23e55412afcdd42aaf776241970efc (diff)
Add request forward message support
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_4_parser.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py
index 087c4d2b..230ac9e0 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -4481,6 +4481,54 @@ class OFPTableStatus(MsgBase):
return msg
+@_set_msg_type(ofproto.OFPT_REQUESTFORWARD)
+class OFPRequestForward(MsgInMsgBase):
+ """
+ Forwarded request message
+
+ The swtich forwards request messages from one controller to other
+ controllers.
+
+ ================ ======================================================
+ Attribute Description
+ ================ ======================================================
+ request ``OFPGroupMod`` or ``OFPMeterMod`` instance
+ ================ ======================================================
+
+ Example::
+
+ def send_bundle_add_message(self, datapath):
+ ofp = datapath.ofproto
+ ofp_parser = datapath.ofproto_parser
+
+ port = 1
+ max_len = 2000
+ actions = [ofp_parser.OFPActionOutput(port, max_len)]
+
+ weight = 100
+ watch_port = 0
+ watch_group = 0
+ buckets = [ofp_parser.OFPBucket(weight, watch_port, watch_group,
+ actions)]
+
+ group_id = 1
+ msg = ofp_parser.OFPGroupMod(datapath, ofp.OFPGC_ADD,
+ ofp.OFPGT_SELECT, group_id, buckets)
+
+ req = ofp_parser.OFPRequestForward(datapath, msg)
+ datapath.send_msg(req)
+ """
+ def __init__(self, datapath, request):
+ super(OFPRequestForward, self).__init__(datapath)
+ assert(isinstance(request, OFPGroupMod) or
+ isinstance(request, OFPMeterMod))
+ self.request = request
+
+ def _serialize_body(self):
+ tail_buf = self.request.serialize()
+ self.buf += self.request.buf
+
+
@_set_msg_type(ofproto.OFPT_PACKET_OUT)
class OFPPacketOut(MsgBase):
"""