summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKiyonari Harigae <lakshmi@cloudysunny14.org>2014-05-07 12:04:49 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-05-09 23:57:17 +0900
commit882c28820f8f477f6f3156aa21c767faf26a6ffc (patch)
tree3f7bfa13b2122f1a0e8e584f75d0d71576d613da
parent73674f4631b65ec43197040ce7184d1364863907 (diff)
Added queue stats request
Here is added queue status request to ofctl. Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/ofctl_v1_2.py22
-rw-r--r--ryu/lib/ofctl_v1_3.py22
2 files changed, 44 insertions, 0 deletions
diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index ea24fe9e..76e55206 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
@@ -504,6 +504,28 @@ def get_desc_stats(dp, waiters):
return desc
+def get_queue_stats(dp, waiters):
+ ofp = dp.ofproto
+ stats = dp.ofproto_parser.OFPQueueStatsRequest(dp, 0, ofp.OFPP_ANY,
+ ofp.OFPQ_ALL)
+ msgs = []
+ send_stats_request(dp, stats, waiters, msgs)
+
+ s = []
+ for msg in msgs:
+ stats = msg.body
+ for stat in stats:
+ s.append({'duration_nsec': stat.duration_nsec,
+ 'duration_sec': stat.duration_sec,
+ 'port_no': stat.port_no,
+ 'queue_id': stat.queue_id,
+ 'tx_bytes': stat.tx_bytes,
+ 'tx_errors': stat.tx_errors,
+ 'tx_packets': stat.tx_packets})
+ desc = {str(dp.id): s}
+ return desc
+
+
def get_flow_stats(dp, waiters):
table_id = dp.ofproto.OFPTT_ALL
out_port = dp.ofproto.OFPP_ANY
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 63356cd8..d97da8a8 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
@@ -554,6 +554,28 @@ def get_desc_stats(dp, waiters):
return desc
+def get_queue_stats(dp, waiters):
+ ofp = dp.ofproto
+ stats = dp.ofproto_parser.OFPQueueStatsRequest(dp, 0, ofp.OFPP_ANY,
+ ofp.OFPQ_ALL)
+ msgs = []
+ send_stats_request(dp, stats, waiters, msgs)
+
+ s = []
+ for msg in msgs:
+ stats = msg.body
+ for stat in stats:
+ s.append({'duration_nsec': stat.duration_nsec,
+ 'duration_sec': stat.duration_sec,
+ 'port_no': stat.port_no,
+ 'queue_id': stat.queue_id,
+ 'tx_bytes': stat.tx_bytes,
+ 'tx_errors': stat.tx_errors,
+ 'tx_packets': stat.tx_packets})
+ desc = {str(dp.id): s}
+ return desc
+
+
def get_flow_stats(dp, waiters):
table_id = dp.ofproto.OFPTT_ALL
flags = 0