#NEWLINE# @ handler . set_ev_cls ( vrrp_event . EventVRRPConfigRequest ) #NEWLINE# def config_request_handler( self , ev ) : #NEWLINE# #INDENT# config = ev . config #NEWLINE# interface = ev . interface #NEWLINE# name = self . _instance_name ( monitor , config . vrid , config . is_ipv6 ) #NEWLINE# if ( name in self . _instances ) : #NEWLINE# #INDENT# rep = vrrp_event . EventVRRPConfigReply ( None , interface , config ) #NEWLINE# self . reply_to_request ( ev , rep ) #NEWLINE# return #NEWLINE# #UNINDENT# statistics = VRRPStatistics ( name , config . resource_id , config . statistics_interval ) #NEWLINE# monitor = vrrp_monitor . VRRPInterfaceMonitor . factory ( interface , config , name , statistics , * self . _args , ** self . _kwargs ) #NEWLINE# router = vrrp_router . VRRPRouter . factory ( name , monitor . name , interface , config , statistics , * self . _args , ** self . _kwargs ) #NEWLINE# self . register_observer ( vrrp_event . EventVRRPShutdownRequest , router . name ) #NEWLINE# router . register_observer ( vrrp_event . EventVRRPStateChanged , monitor . name ) #NEWLINE# router . register_observer ( vrrp_event . EventVRRPTransmitRequest , monitor . name ) #NEWLINE# monitor . register_observer ( vrrp_event . EventVRRPReceived , router . name ) #NEWLINE# instance = VRRPInstance ( name , monitor . name , config , interface ) #NEWLINE# self . _instances [ name ] = instance #NEWLINE# monitor . start ( ) #NEWLINE# router . start ( ) #NEWLINE# rep = vrrp_event . EventVRRPConfigReply ( instance . name , interface , config ) #NEWLINE# self . reply_to_request ( ev , rep )