Skip to content

Instantly share code, notes, and snippets.

@yasuhito
Last active December 9, 2015 08:32
Show Gist options
  • Save yasuhito/343cd1549da7693a9dd9 to your computer and use it in GitHub Desktop.
Save yasuhito/343cd1549da7693a9dd9 to your computer and use it in GitHub Desktop.
class RoutingSwitch < Trema::Controller
# ...
def start_topology
TopologyController.new { |topo| topo.add_observer @path_manager }.start
end
end
class PathManager < Trema::Controller
# ...
def delete_link(port_a, port_b, _topology)
@graph.delete_link port_a, port_b
Path.select { |each| each.link?(port_a, port_b) }.each(&:destroy)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment