I don't know if you understood my question all i need to do is to load simple_switch_13.py in my module directly from the Python code...i used AppManager methods but it doesn't start as i launch from the shell i want to load the module simple_switch_13 when i check something in my other module that we can call mymodule what you said i've yet done to bring all dpids...this is my code to run simple_switch_13.py but i got even assertion error app_mgr=AppManager.get_instance() From ryu.app import wsgi app_mgr.load_apps(['ryu.app.simple_switch_13']) contexts=app_mgr.create_contexts() services=[] services.extend(app_mgr.instantiate_apps(**contexts)) we=wsgi.start_service(app_mgr) If wsgi: services.append(hub.spawn(we)) It loads simple_switch_13 and instantiate it correctly but got in assertion error i think maybe for double OFPHandler instance...so i want to start simple_switch_13 manually from the Python code this is my goal so can you help me doing this?
> Il giorno 13/set/2016, alle ore 03:19, Iwase Yusuke <iwase.yusu...@gmail.com> > ha scritto: > > Hi, > > How about skipping the ofp event processing for the specific dpid > at the top of each event handler? > > e.g.) If dpid is registered, do switch_features_handler, otherwise skip. > $ git diff > diff --git a/ryu/app/simple_switch_13.py b/ryu/app/simple_switch_13.py > index 3e7c598..c8a9291 100644 > --- a/ryu/app/simple_switch_13.py > +++ b/ryu/app/simple_switch_13.py > @@ -30,8 +30,12 @@ class SimpleSwitch13(app_manager.RyuApp): > super(SimpleSwitch13, self).__init__(*args, **kwargs) > self.mac_to_port = {} > + self.registered_dpids = [1, 2, 3] # specify the range of dpid > + > @set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER) > def switch_features_handler(self, ev): > + if ev.msg.datapath.id not in self.registered_dpids: > + return > datapath = ev.msg.datapath > ofproto = datapath.ofproto > parser = datapath.ofproto_parser > > >> On 2016年09月06日 18:47, Francesco Murador wrote: >> Hi i have a question...i need to start stplib when i check a thing how can i >> start it? Not at the begin of my program with _CONTEXTS...i have to check if >> some values in a switch are out of range if they aren't i need to start the >> spanning tree because all i want is to block a dpid but if i don't block a >> dpid i have a topology with loops so normal simple_switch will not work so i >> had to run the stplib >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Ryu-devel mailing list >> Ryu-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/ryu-devel >> ------------------------------------------------------------------------------ _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel