import ryu.app.ofctl.api as api
def ofdpaTableStatsRequest(datapath):
parser = datapath.ofproto_parser
return parser.OFPTableStatsRequest(datapath)
def getFlows(self):
"""
Obtain a list of Flows loaded on the switch
`
:return: A list of Flow Entires
"""
msg = ofdpaTableStatsRequest(self.datapath)
reply = api.send_msg(self.ryuapp, msg,
reply_cls=self.parser.OFPTableStatsReply,
reply_multi=True)
// the flow entries you are looking for will be in the reply
1 回答
使用 OFPTableStatsRequest 对象 . 它将返回包含所有已安装流的列表 .
请注意,还有一个 OFPGroupStatsRequest 对组执行相同的操作 .
一个未经测试的示例,它依赖于实例变量 datapath .
如果这对您有用,请告诉我