Signed-off-by: Simon Horman <[email protected]>

---
v2 - v3
* No change
---
 ryu/ofproto/ofproto_v1_4_parser.py | 50 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/ryu/ofproto/ofproto_v1_4_parser.py 
b/ryu/ofproto/ofproto_v1_4_parser.py
index 7cc78e7..f3b0aee 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -3598,6 +3598,56 @@ class OFPFlowMonitorRequest(OFPFlowMonitorRequestBase):
                                                     table_id, command, match)
 
 
[email protected]_stats_type()
+@_set_stats_type(ofproto.OFPMP_FLOW_MONITOR, OFPFlowUpdateHeader)
+@_set_msg_type(ofproto.OFPT_MULTIPART_REPLY)
+class OFPFlowMonitorReply(OFPMultipartReply):
+    """
+    Flow monitor reply message
+
+    The switch responds with this message to a flow monitor request.
+
+    ================ ======================================================
+    Attribute        Description
+    ================ ======================================================
+    body             List of list of the following class instance.
+                     OFPFlowMonitorFull
+                     OFPFlowMonitorAbbrev
+                     OFPFlowMonitorPaused
+    ================ ======================================================
+
+    Example::
+
+        @set_ev_cls(ofp_event.EventOFPFlowMonitorReply, MAIN_DISPATCHER)
+        def flow_monitor_reply_handler(self, ev):
+            msg = ev.msg
+            dp = msg.datapath
+            ofp = dp.ofproto
+            flow_updates = []
+
+            for update in msg.body:
+                update_str = 'length=%d event=%d' %
+                             (update.length, update.event)
+                if (update.event == ofp.OFPFME_INITIAL or
+                    update.event == ofp.OFPFME_ADDED or
+                    update.event == ofp.OFPFME_REMOVED or
+                    update.event == ofp.OFPFME_MODIFIED):
+                    update_str += 'table_id=%d reason=%d idle_timeout=%d '
+                                  'hard_timeout=%d priority=%d cookie=%d '
+                                  'match=%d instructions=%s' %
+                                  (stat.table_id, stat.reason,
+                                   stat.idle_timeout, stat.hard_timeout,
+                                   stat.priority, stat.cookie,
+                                   stat.match, stat.instructions)
+                elif update.event == ofp.OFPFME_ABBREV:
+                    update_str += 'xid=%d' % (stat.xid)
+                flow_updates.append(update_str)
+            self.logger.debug('FlowUpdates: %s', flow_updates)
+    """
+    def __init__(self, datapath, type_=None, **kwargs):
+        super(OFPFlowMonitorReply, self).__init__(datapath, **kwargs)
+
+
 class OFPExperimenterMultipart(ofproto_parser.namedtuple(
                                'OFPExperimenterMultipart',
                                ('experimenter', 'exp_type', 'data'))):
-- 
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

Reply via email to