summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSriram Natarajan <natarajan.sriram@gmail.com>2014-09-17 17:06:25 -0700
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-09-18 14:45:18 +0900
commit9bcce6010f81630d68663ef81f807e1fdf078636 (patch)
tree6a1443b8c6662af288b9a18bd91dfc6329197b3d
parent72556a68b45beeb4793ae8903f90d57cf7e63e99 (diff)
of: Add missing fields in OpenFlow statistics messages
update statistics structure to reflect OpenFlow specification. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/ofctl_v1_2.py7
-rw-r--r--ryu/lib/ofctl_v1_3.py16
2 files changed, 15 insertions, 8 deletions
diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index dec8c7e2..da300f77 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
@@ -577,9 +577,7 @@ def get_queue_stats(dp, waiters):
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,
+ s.append({'port_no': stat.port_no,
'queue_id': stat.queue_id,
'tx_bytes': stat.tx_bytes,
'tx_errors': stat.tx_errors,
@@ -617,7 +615,8 @@ def get_flow_stats(dp, waiters, flow={}):
'duration_sec': stats.duration_sec,
'duration_nsec': stats.duration_nsec,
'packet_count': stats.packet_count,
- 'table_id': stats.table_id}
+ 'table_id': stats.table_id,
+ 'length': stats.length}
flows.append(s)
flows = {str(dp.id): flows}
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 23692162..b60c4cc0 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
@@ -648,7 +648,9 @@ def get_flow_stats(dp, waiters, flow={}):
'duration_sec': stats.duration_sec,
'duration_nsec': stats.duration_nsec,
'packet_count': stats.packet_count,
- 'table_id': stats.table_id}
+ 'table_id': stats.table_id,
+ 'length': stats.length,
+ 'flags': stats.flags}
flows.append(s)
flows = {str(dp.id): flows}
@@ -676,7 +678,9 @@ def get_port_stats(dp, waiters):
'rx_frame_err': stats.rx_frame_err,
'rx_over_err': stats.rx_over_err,
'rx_crc_err': stats.rx_crc_err,
- 'collisions': stats.collisions}
+ 'collisions': stats.collisions,
+ 'duration_sec': stats.duration_sec,
+ 'duration_nsec': stats.duration_nsec}
ports.append(s)
ports = {str(dp.id): ports}
return ports
@@ -701,6 +705,8 @@ def get_meter_stats(dp, waiters):
'flow_count': stats.flow_count,
'packet_in_count': stats.packet_in_count,
'byte_in_count': stats.byte_in_count,
+ 'duration_sec': stats.duration_sec,
+ 'duration_nsec': stats.duration_nsec,
'band_stats': bands}
meters.append(s)
meters = {str(dp.id): meters}
@@ -726,7 +732,8 @@ def get_meter_features(dp, waiters):
band_types.append(v)
f = {'max_meter': feature.max_meter,
'band_types': band_types,
- 'max_band': feature.max_band,
+ 'capabilities': feature.capabilities,
+ 'max_bands': feature.max_bands,
'max_color': feature.max_color}
features.append(f)
features = {str(dp.id): features}
@@ -787,7 +794,8 @@ def get_group_stats(dp, waiters):
c = {'packet_count': bucket_stat.packet_count,
'byte_count': bucket_stat.byte_count}
bucket_stats.append(c)
- g = {'group_id': stats.group_id,
+ g = {'length': stats.length,
+ 'group_id': stats.group_id,
'ref_count': stats.ref_count,
'packet_count': stats.packet_count,
'byte_count': stats.byte_count,