Search in sources :

Example 46 with Topology

use of org.onosproject.net.topology.Topology in project trellis-control by opennetworkinglab.

the class McastUtils method getPaths.

/**
 * Gets path from src to dst computed using the custom link weigher.
 *
 * @param src source device ID
 * @param dst destination device ID
 * @param linksToEnforce links to be enforced
 * @return list of paths from src to dst
 */
List<Path> getPaths(DeviceId src, DeviceId dst, Set<Link> linksToEnforce) {
    final Topology currentTopology = topologyService.currentTopology();
    final LinkWeigher linkWeigher = new SRLinkWeigher(srManager, src, linksToEnforce);
    List<Path> allPaths = Lists.newArrayList(topologyService.getPaths(currentTopology, src, dst, linkWeigher));
    log.trace("{} path(s) found from {} to {}", allPaths.size(), src, dst);
    return allPaths;
}
Also used : Path(org.onosproject.net.Path) SRLinkWeigher(org.onosproject.segmentrouting.SRLinkWeigher) LinkWeigher(org.onosproject.net.topology.LinkWeigher) Topology(org.onosproject.net.topology.Topology) SRLinkWeigher(org.onosproject.segmentrouting.SRLinkWeigher)

Aggregations

Topology (org.onosproject.net.topology.Topology)46 TopologyService (org.onosproject.net.topology.TopologyService)30 Test (org.junit.Test)29 VirtualNetwork (org.onosproject.incubator.net.virtual.VirtualNetwork)23 VirtualDevice (org.onosproject.incubator.net.virtual.VirtualDevice)12 TopologyCluster (org.onosproject.net.topology.TopologyCluster)11 DisjointPath (org.onosproject.net.DisjointPath)9 Path (org.onosproject.net.Path)9 ConnectPoint (org.onosproject.net.ConnectPoint)8 GET (javax.ws.rs.GET)7 Produces (javax.ws.rs.Produces)7 Link (org.onosproject.net.Link)7 Path (javax.ws.rs.Path)6 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)5 VirtualLink (org.onosproject.incubator.net.virtual.VirtualLink)5 DeviceId (org.onosproject.net.DeviceId)5 LinkWeigher (org.onosproject.net.topology.LinkWeigher)5 Event (org.onosproject.event.Event)3 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)2 ClusterEvent (org.onosproject.cluster.ClusterEvent)2