Hi guys, i am new to Ryu and I am trying to add my own flow table to the
simple switch python file but I am getting errors. Below is the code I used
@set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
def switch_features_handler(self, ev):
datapath = ev.msg.datapath
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
# install the table-miss flow entry.
match = parser.OFPMatch()
actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,)]
self.add_flow(datapath, 0, match, actions)
def add_flow(self, datapath, in_port, dst, src, actions):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
match = datapath.ofproto_parser.OFPMatch(
in_port=1,
dl_dst=haddr_to_bin(dst), dl_src=haddr_to_bin(src))
actions = [parser.OFPActionOutput(2)]
match = datapath.ofproto_parser.OFPMatch(
in_port=2,
dl_dst=haddr_to_bin(dst), dl_src=haddr_to_bin(src))
actions = [parser.OFPActionOutput(1)]
mod = datapath.ofproto_parser.OFPFlowMod(
datapath=datapath, match=match, cookie=0,
command=ofproto.OFPFC_ADD, idle_timeout=0, hard_timeout=0,
priority=ofproto.OFP_DEFAULT_PRIORITY,
flags=ofproto.OFPFF_SEND_FLOW_REM, actions=actions)
datapath.send_msg(mod)
But when I run the code I get the error:
self.add_flow(datapath, 0, match, actions)
TypeError: add_flow() takes exactly 6 arguments (5 given)
Please I need help in resolving the issue or maybe a better way to go about
it. Thanks
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel