Hi,

I'm a new for ryu controller.
I am trying to understand the code of simple_switch_13.py.
But I have some problems about this simple file,

1) I cannot understand the decorator how to work, just like the follow code:

@set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)def
_switch_features_handler(self, ev):
    datapath = ev.msg.datapath
    ....



2)  Why the function is represented register an event?  How does it work?

def _set_ev_cls_dec111(handler):

        if 'callers' not in dir(handler):

            handler.callers = {}

        for e in _listify(ev_cls):

            handler.callers[e] = _Caller(_listify(dispatchers),
e.__module__)

        return handler

    return _set_ev_cls_dec


Could you please kindly tell me above two question?
Could you please use some simple instances to explain the question?

Thank you very much for your kindly help.


-- 
Sincerely,

Andy Shen
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to