diff options
-rw-r--r-- | doc/source/ryu_app_api.rst | 14 | ||||
-rw-r--r-- | ryu/controller/ofp_event.py | 26 |
2 files changed, 31 insertions, 9 deletions
diff --git a/doc/source/ryu_app_api.rst b/doc/source/ryu_app_api.rst index 06276e50..323b4a9d 100644 --- a/doc/source/ryu_app_api.rst +++ b/doc/source/ryu_app_api.rst @@ -198,16 +198,12 @@ The base class for synchronous request reply for RyuApp.send_reply. ryu.controller.ofp_event.EventOFPStateChange ============================================ -An event class for negotiation phase change notification. -An instance of this class is sent to observer after changing -the negotiation phase. -An instance has at least the following attributes. +.. autoclass:: ryu.controller.ofp_event.EventOFPStateChange -========= ==================================================================== -Attribute Description -========= ==================================================================== -datapath ryu.controller.controller.Datapath instance of the switch -========= ==================================================================== +ryu.controller.ofp_event.EventOFPPortStateChange +================================================ + +.. autoclass:: ryu.controller.ofp_event.EventOFPPortStateChange ryu.controller.dpset.EventDP ============================ diff --git a/ryu/controller/ofp_event.py b/ryu/controller/ofp_event.py index aa2b6c1c..8c990aae 100644 --- a/ryu/controller/ofp_event.py +++ b/ryu/controller/ofp_event.py @@ -81,12 +81,38 @@ for ofp_mods in ofproto.get_ofp_modules().values(): class EventOFPStateChange(event.EventBase): + """ + An event class for negotiation phase change notification. + An instance of this class is sent to observer after changing + the negotiation phase. + An instance has at least the following attributes. + + ========= ================================================================= + Attribute Description + ========= ================================================================= + datapath ryu.controller.controller.Datapath instance of the switch + ========= ================================================================= + """ def __init__(self, dp): super(EventOFPStateChange, self).__init__() self.datapath = dp class EventOFPPortStateChange(event.EventBase): + """ + An event class to notify the port state changes of Dtatapath instance. + This event performs like EventOFPPortStatus, but Ryu will + send this event after updating ``ports`` dict of Datapath instances. + An instance has at least the following attributes. + + ========= ================================================================= + Attribute Description + ========= ================================================================= + datapath ryu.controller.controller.Datapath instance of the switch + reason one of OFPPR_* + port_no Port number which state was changed + ========= ================================================================= + """ def __init__(self, dp, reason, port_no): super(EventOFPPortStateChange, self).__init__() self.datapath = dp |