diff options
author | Yusuke Iwase <iwase.yusuke0@gmail.com> | 2014-12-05 09:31:00 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-05 10:00:56 +0900 |
commit | 9ecfa8f3be7c52196db00cb47d8f4169174f023f (patch) | |
tree | 4f26d1eab792299c92b049ca9d4150742274f84b | |
parent | 311fe904d2bd6f95ce65f3dd853913130f57d056 (diff) |
ofctl_v1_3: Fix to parse capabilities field in OPFMeterFeatures
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/lib/ofctl_v1_3.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py index bc21a7f5..485a3b4e 100644 --- a/ryu/lib/ofctl_v1_3.py +++ b/ryu/lib/ofctl_v1_3.py @@ -553,6 +553,11 @@ def get_meter_features(dp, waiters): type_convert = {ofp.OFPMBT_DROP: 'DROP', ofp.OFPMBT_DSCP_REMARK: 'DSCP_REMARK'} + capa_convert = {ofp.OFPMF_KBPS: 'KBPS', + ofp.OFPMF_PKTPS: 'PKTPS', + ofp.OFPMF_BURST: 'BURST', + ofp.OFPMF_STATS: 'STATS'} + stats = dp.ofproto_parser.OFPMeterFeaturesStatsRequest(dp, 0) msgs = [] send_stats_request(dp, stats, waiters, msgs) @@ -564,9 +569,13 @@ def get_meter_features(dp, waiters): for k, v in type_convert.items(): if (1 << k) & feature.band_types: band_types.append(v) + capabilities = [] + for k, v in capa_convert.items(): + if k & feature.capabilities: + capabilities.append(v) f = {'max_meter': feature.max_meter, 'band_types': band_types, - 'capabilities': feature.capabilities, + 'capabilities': capabilities, 'max_bands': feature.max_bands, 'max_color': feature.max_color} features.append(f) |