+ def _set_flow_entry_dpctl(self, node, switch_inport_nr, switch_outport_nr, match_input, cmd):
+ match = 'in_port=%s' % switch_inport_nr
+ # add additional match entries from the argument
+ #match_input = kwargs.get('match')
+ # logging.info('match input:{0}'.format(match_input))
+ if match_input:
+ s = ','
+ match = s.join([match, match_input])
+
+ if cmd == 'add-flow':
+ action = 'action=%s' % switch_outport_nr
+ s = ','
+ ofcmd = s.join([match, action])
+ elif cmd == 'del-flows':
+ ofcmd = match
+ else:
+ ofcmd = ''
+
+ node.dpctl(cmd, ofcmd)
+ logging.info("add flow in switch: {0} in_port: {1} out_port: {2}".format(node.name, switch_inport_nr,
+ switch_outport_nr))
+