Ejemplo n.º 1
0
 def port_delete_handler(self, ev):
     """
     Handler for host leaving the network. Passes host port to the controller.
     :param ev: 
     :return: 
     """
     HandoverController.port_delete_handler(ev.port)
Ejemplo n.º 2
0
 def switch_leave_handler(self, ev):
     """
     Handler for switch leaving the network. Passes switch to the controller.
     :param ev: 
     :return: 
     """
     HandoverController.remove_switch(ev.switch)
Ejemplo n.º 3
0
 def host_add_handler(self, ev):
     """
     Handler for host joining the network. Passes host port to the controller.
     :param ev: 
     :return: 
     """
     HandoverController.host_add_handler(ev.host)
Ejemplo n.º 4
0
 def switch_enter_handler(self, ev):
     """
     Handler for switch joining the network. Passes switch to the controller.
     :param ev: 
     :return: 
     """
     HandoverController.add_switch(ev.switch)
Ejemplo n.º 5
0
 def flow_removed_handler(self, ev):
     """
     OpenFlow FlowRemoved event handler. Passes event message to the controller.
     :param ev: 
     :return: 
     """
     HandoverController.flow_removed_handler(ev.msg)
Ejemplo n.º 6
0
 def switch_feature_handler(self, ev):
     """
     Handler for switches that come online. Used for registering default flow mods.
     :param ev: 
     :return: 
     """
     HandoverController.switch_features_handler(ev.msg.datapath)
Ejemplo n.º 7
0
 def packet_in_handler(self, ev):
     """
     OpenFlow PacketIn event handler. Passes event message to the controller.
     :param ev: 
     :return: 
     """
     msg = ev.msg
     HandoverController.packet_in_handler(msg)
Ejemplo n.º 8
0
    def __init__(self, *args, **kwargs):
        super(HandoverApi, self).__init__(*args, **kwargs)
        self.logger.addHandler(
            logging.handlers.WatchedFileHandler('/ctrl.log'))
        HandoverController.set_logger(self.logger)

        wsgi = kwargs['wsgi']
        self.waiters = {}
        self.data = {}
        wsgi.registory['HandoverController'] = self.data
        wsgi.register(HandoverController, self.data)