>>> +    @handler.set_ev_cls(ofp_event.EventOFPPortStatus, 
>>> handler.MAIN_DISPATCHER)
>>> +    def port_status_handler(self, ev):
>>> +        msg = ev.msg
>>> +        reason = msg.reason
>>> +        dpid = msg.datapath.id
>>> +        port_no = msg.desc.port_no
>>> +        ofproto = msg.datapath.ofproto
>>> +
>>> +        if reason == ofproto.OFPPR_ADD:
>>> +            LOG.debug('port was added.' +
>>> +                      '(datapath id = %s, port number = %s)',
>>> +                      dpid, port_no)
>>> +            self._add_port(dpid, port_no)
>>> +            self.send_event_to_observers(EventDPPortAdd(dpid, port_no))
>>> +
>>> +        elif reason == ofproto.OFPPR_DELETE:
>>> +            LOG.debug('port was deleted.' +
>>> +                      '(datapath id = %s, port number = %s)',
>>> +                      dpid, port_no)
>>> +            self._del_port(dpid, port_no)
>>> +            self.send_event_to_observers(EventDPPortDelete(dpid, port_no))
>>> +
>>> +        else:
>>> +            assert reason == ofproto.OFPPR_MODIFY
>>> +            LOG.debug('port was modified.' +
>>> +                      '(datapath id = %s, port number = %s)',
>>> +                      dpid, port_no)
>>> +            self.send_event_to_observers(EventDPPortModify(dpid, port_no))
>>
>> Doesn't this track port state like link up/down.
>>
> OK, I'll try to track modify state.
> Has OFPPR_MODIFY some parameters?
> In dpset.py, PortState.add and PortState.modify are same code.
>
I have understood that PortState, in dpset.py, has all property of port.
I'll use PortState class.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to