def del_route_flows(self, mappings): if mappings: ofctl([ 'del-flows {sw} -O {of_ver} in_port={in_port}'.format( sw=self.name, of_ver=self.of_ver, **flow) for flow in mappings ])
def add_route_flows(self, mappings): if mappings: ofctl([ 'add-flow {sw} -O {of_ver} in_port={in_port},actions=output={out_port}' .format(sw=self.name, of_ver=self.of_ver, **flow) for flow in mappings ])
def mod_port_state(self, ports, port_state): if ports and port_state: ofctl([ "mod-port {sw} -O {of_ver} {port} {port_state}".format( sw=self.name, of_ver=self.of_ver, port=str(port), port_state=port_state) for port in ports ])
def dump_flows(self): return ofctl([ "dump-flows {sw} -O {of_ver}".format(sw=self.name, of_ver=self.of_ver) ])[0]