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>
This commit is contained in:
IWASE Yusuke 2016-05-17 10:52:11 +09:00 committed by FUJITA Tomonori
parent 9774eb60af
commit 3cccf23238
2 changed files with 31 additions and 9 deletions

View File

@ -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
============================

View File

@ -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