mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-24 18:11:24 +01:00
dpset: support OF1.3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Tested-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
This commit is contained in:
parent
7f6bb8c18c
commit
0bec11600b
@ -163,7 +163,9 @@ class DPSet(app_manager.RyuApp):
|
||||
def switch_features_handler(self, ev):
|
||||
msg = ev.msg
|
||||
datapath = msg.datapath
|
||||
datapath.ports = msg.ports
|
||||
# ofp_handler.py does the following so we could remove...
|
||||
if datapath.ofproto.OFP_VERSION < 0x04:
|
||||
datapath.ports = msg.ports
|
||||
|
||||
@set_ev_cls(ofp_event.EventOFPPortStatus, handler.MAIN_DISPATCHER)
|
||||
def port_status_handler(self, ev):
|
||||
|
||||
@ -191,6 +191,8 @@ class OFPHandler(ryu.base.app_manager.RyuApp):
|
||||
# while.
|
||||
if datapath.ofproto.OFP_VERSION < 0x04:
|
||||
datapath.ports = msg.ports
|
||||
else:
|
||||
datapath.ports = {}
|
||||
|
||||
ofproto = datapath.ofproto
|
||||
ofproto_parser = datapath.ofproto_parser
|
||||
@ -200,6 +202,23 @@ class OFPHandler(ryu.base.app_manager.RyuApp):
|
||||
)
|
||||
datapath.send_msg(set_config)
|
||||
|
||||
if datapath.ofproto.OFP_VERSION < 0x04:
|
||||
self.logger.debug('move onto main mode')
|
||||
ev.msg.datapath.set_state(MAIN_DISPATCHER)
|
||||
else:
|
||||
port_desc = datapath.ofproto_parser.OFPPortDescStatsRequest(
|
||||
datapath, 0)
|
||||
datapath.send_msg(port_desc)
|
||||
|
||||
@set_ev_handler(ofp_event.EventOFPPortDescStatsReply, CONFIG_DISPATCHER)
|
||||
def multipart_reply_handler(self, ev):
|
||||
msg = ev.msg
|
||||
datapath = msg.datapath
|
||||
for port in msg.body:
|
||||
datapath.ports[port.port_no] = port
|
||||
|
||||
if msg.flags & datapath.ofproto.OFPMPF_REPLY_MORE:
|
||||
return
|
||||
self.logger.debug('move onto main mode')
|
||||
ev.msg.datapath.set_state(MAIN_DISPATCHER)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user