Hi all,

I’m working in a app that gives me the topology of the network. I’ve been 
reading about how to use events and I wrote a very simple app, based on 
simple_switch.py with few additional lines:

from ryu.topology import switches, event
from ryu.controller import dpset
from ryu.base import app_manager
from ryu.controller import mac_to_port
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_0
from ryu.lib.mac import haddr_to_bin
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet


class SimpleSwitch(app_manager.RyuApp):
    OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION]
    __CONTEXTS = {'switches': switches.Switches, 'dpset': dpset.DPSet }


    @set_ev_cls(event.EventLinkAdd, MAIN_DISPATCHER)
    def switch_enter_handler(self, ev):
        print("Swtich  added")


The other lines of code are exactly the same as in simple_switch.py.

My problem is it seems that EventLinkAdd isn’t happening.

I’m working with a very simple custom topology with 1 switch and 2 hosts.

I run my app with the following command:

 sudo PYTHONPATH=. ./bin/ryu-manager --verbose ryu/app/my_simple_switch.py


Can anyone help me?

I’ve looking for info, and I don’t find anything that helps me.

Thanks!!!
Regards, 

Julián
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to