#NEWLINE# @ set_ev_cls ( [ ofp_event . EventOFPFlowStatsReply , ofp_event . EventOFPMeterConfigStatsReply , ofp_event . EventOFPTableStatsReply , ofp_event . EventOFPPortStatsReply , ofp_event . EventOFPGroupDescStatsReply ] , handler . MAIN_DISPATCHER ) #NEWLINE# def stats_reply_handler( self , ev ) : #NEWLINE# #INDENT# ofp = ev . msg . datapath . ofproto #NEWLINE# event_states = { #NEWLINE# #INDENT# ofp_event . EventOFPFlowStatsReply : [ STATE_FLOW_EXIST_CHK , STATE_THROUGHPUT_FLOW_EXIST_CHK , STATE_GET_THROUGHPUT ] , #NEWLINE# ofp_event . EventOFPTableStatsReply : [ STATE_GET_MATCH_COUNT , STATE_FLOW_UNMATCH_CHK ] , #NEWLINE# ofp_event . EventOFPPortStatsReply : [ STATE_TARGET_PKT_COUNT , STATE_TESTER_PKT_COUNT ] , #NEWLINE# #UNINDENT# } #NEWLINE# if ( ofp . OFP_VERSION >= ofproto_v1_2 . OFP_VERSION ) : #NEWLINE# #INDENT# event_states [ ofp_event . EventOFPGroupDescStatsReply ] = [ STATE_GROUP_EXIST_CHK ] #NEWLINE# #UNINDENT# if ( ofp . OFP_VERSION >= ofproto_v1_3 . OFP_VERSION ) : #NEWLINE# #INDENT# event_states [ ofp_event . EventOFPMeterConfigStatsReply ] = [ STATE_METER_EXIST_CHK ] #NEWLINE# #UNINDENT# if ( self . state in event_states [ ev . __class__ ] ) : #NEWLINE# #INDENT# if ( self . waiter and ( ev . msg . xid in self . send_msg_xids ) ) : #NEWLINE# #INDENT# self . rcv_msgs . append ( ev . msg ) #NEWLINE# if ( not ev . msg . flags ) : #NEWLINE# #INDENT# self . waiter . set ( ) #NEWLINE# hub . sleep ( 0 )