summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-05-17 10:52:11 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-18 15:59:22 +0900
commit3cccf23238dd073adb47f7c2742c66f6bdba2f73 (patch)
treef6cabb700af3c48956960a0d2e363b83bd541ded
parent9774eb60af62df660ed34cd7262d50506f250f57 (diff)
doc: Add description for EventOFPPortStateChange
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--doc/source/ryu_app_api.rst14
-rw-r--r--ryu/controller/ofp_event.py26
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