diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2014-03-18 09:53:37 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-03-25 21:38:35 +0900 |
commit | af7220ac34c7129b2869e989f28bd1bcde1eee5c (patch) | |
tree | 24e2dee2a0e6abeef06035cd439d7d9dcdb0d3a6 | |
parent | 80ff7368fe274812e432d92521464d697f66b178 (diff) |
ofctl_rest: use multistage @set_ev_cls
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/app/ofctl_rest.py | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/ryu/app/ofctl_rest.py b/ryu/app/ofctl_rest.py index 9fbce30d..edef9a75 100644 --- a/ryu/app/ofctl_rest.py +++ b/ryu/app/ofctl_rest.py @@ -498,6 +498,16 @@ class RestStatsApi(app_manager.RyuApp): controller=StatsController, action='send_experimenter', conditions=dict(method=['POST'])) + @set_ev_cls([ofp_event.EventOFPStatsReply, + ofp_event.EventOFPDescStatsReply, + ofp_event.EventOFPFlowStatsReply, + ofp_event.EventOFPPortStatsReply, + ofp_event.EventOFPMeterStatsReply, + ofp_event.EventOFPMeterFeaturesStatsReply, + ofp_event.EventOFPMeterConfigStatsReply, + ofp_event.EventOFPGroupStatsReply, + ofp_event.EventOFPGroupFeaturesStatsReply, + ofp_event.EventOFPGroupDescStatsReply], MAIN_DISPATCHER) def stats_reply_handler(self, ev): msg = ev.msg dp = msg.datapath @@ -521,44 +531,3 @@ class RestStatsApi(app_manager.RyuApp): return del self.waiters[dp.id][msg.xid] lock.set() - - @set_ev_cls(ofp_event.EventOFPStatsReply, MAIN_DISPATCHER) - def any_stats_reply_handler(self, ev): - # for OpenFlow 1.2 - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPDescStatsReply, MAIN_DISPATCHER) - def desc_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPFlowStatsReply, MAIN_DISPATCHER) - def flow_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPPortStatsReply, MAIN_DISPATCHER) - def port_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPMeterStatsReply, MAIN_DISPATCHER) - def meter_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPMeterFeaturesStatsReply, MAIN_DISPATCHER) - def meter_features_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPMeterConfigStatsReply, MAIN_DISPATCHER) - def meter_config_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPGroupStatsReply, MAIN_DISPATCHER) - def group_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPGroupFeaturesStatsReply, MAIN_DISPATCHER) - def group_features_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) - - @set_ev_cls(ofp_event.EventOFPGroupDescStatsReply, MAIN_DISPATCHER) - def group_desc_stats_reply_handler(self, ev): - self.stats_reply_handler(ev) |