Hi Vinay,
You can use EventSwitchEnter and EventSwitchLeave.
(Note that this API is supported only by OpenFlow 1.0 and 1.3)
----------
from ryu.base import app_manager
from ryu.controller.handler import set_ev_cls
from ryu.topology import switches
from ryu.topology.event import EventSwitchEnter, EventSwitchLeave
class SwitchEventApp(app_manager.RyuApp):
_CONTEXTS = {
'switches': switches.Switches,
}
@set_ev_cls(EventSwitchEnter)
def _ev_switch_enter_handler(self, ev):
print('enter: %s' % ev)
@set_ev_cls(EventSwitchLeave)
def _ev_switch_leave_handler(self, ev):
print('leave: %s' % ev)
----------
Regards,
Satoshi
2014-02-12 12:27 GMT+09:00 vinay pai <[email protected]>:
> Hi All,
>
> I am traditionally a POX user and am more familiar with the APIs used
> there. I have recently started using Ryu and am finding difficulty in
> finding the appropriate APIs. In POX there is an API which is called when a
> switch connects to the controller. It is _handle_ConnectionUp(). I am
> searching for an equivalent event in Ryu. Should I be
> using ryu.controller.handler.set_ev_cls(ev_cls, dispatchers=None) which the
> negotiation phase as ryu.controller.handler.MAIN_DISPATCHER? or am I
> missing a straight forward API.
>
> Apologies if the question has a very straight forward answer that I might
> be missing out.
>
> Regards,
>
> Vinay Pai B.H.
>
> --
> Vinay Pai B.H.
> Grad Student - Computer Science
> Viterbi School of Engineering
> University of Southern California
> Los Angeles, CA, USA
>
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience. Start now.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
>
--
Satoshi Kobayashi <[email protected]>
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel