2013/2/26 oshiba <[email protected]>:
> Hi all,
>
> I would like to proceed some works when switch disconnected.
> But I don't found handler for switch disconnected.
> Please tell me handler of this and how to use it.
>
> Note:
> I found DEAD_DISPATCHER, but I cannot found event name of this.
> And I use Ryu with verbose mode, but display event of change dispather when
> we disconnect switch.
>
> Best Regards,

Hi,

Ryu app can handle datapath join/leave event with the following code:


--
from ryu.base import app_manager
from ryu.controller import dpset
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_0
from ryu.ofproto import ofproto_v1_2


class TestDPSet(app_manager.RyuApp):
    OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION,
                    ofproto_v1_2.OFP_VERSION]

    _CONTEXTS = {
        'dpset': dpset.DPSet,
    }

    def __init__(self, *args, **kwargs):
        super(TestDPSet, self).__init__(*args, **kwargs)
        self.dpset = kwargs['dpset']

    @set_ev_cls(dpset.EventDP, dpset.DPSET_EV_DISPATCHER)
    def handler_datapath(self, ev):
        if ev.enter:
            print 'datapath join'
        else:
            print 'datapath leave'

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to