Enhanced topo viewer sample GUI to allow path selection from any node (host or device). Fixed path service implementaiton.
diff --git a/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java b/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java
index 41cd045..07a57e9e 100644
--- a/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java
+++ b/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java
@@ -23,8 +23,8 @@
*/
public DefaultEdgeLink(ProviderId providerId, ConnectPoint hostPoint,
HostLocation hostLocation, boolean isIngress) {
- super(providerId, isIngress ? hostLocation : hostPoint,
- isIngress ? hostPoint : hostLocation, Type.EDGE);
+ super(providerId, isIngress ? hostPoint : hostLocation,
+ isIngress ? hostLocation : hostPoint, Type.EDGE);
checkArgument(hostPoint.elementId() instanceof HostId,
"Host point does not refer to a host ID");
this.hostId = (HostId) hostPoint.elementId();
diff --git a/core/api/src/main/java/org/onlab/onos/net/HostId.java b/core/api/src/main/java/org/onlab/onos/net/HostId.java
index 170e2a2..c6ba53f 100644
--- a/core/api/src/main/java/org/onlab/onos/net/HostId.java
+++ b/core/api/src/main/java/org/onlab/onos/net/HostId.java
@@ -44,7 +44,7 @@
*/
public static HostId hostId(MACAddress mac, VLANID vlanId) {
// FIXME: use more efficient means of encoding
- return hostId("nic" + ":" + mac + "/" + vlanId);
+ return hostId("nic" + ":" + mac + "-" + vlanId);
}
/**
diff --git a/core/api/src/main/java/org/onlab/onos/net/path/PathService.java b/core/api/src/main/java/org/onlab/onos/net/path/PathService.java
index c1d664b..efbd484 100644
--- a/core/api/src/main/java/org/onlab/onos/net/path/PathService.java
+++ b/core/api/src/main/java/org/onlab/onos/net/path/PathService.java
@@ -1,7 +1,6 @@
package org.onlab.onos.net.path;
-import org.onlab.onos.net.DeviceId;
-import org.onlab.onos.net.HostId;
+import org.onlab.onos.net.ElementId;
import org.onlab.onos.net.Path;
import org.onlab.onos.net.topology.LinkWeight;
@@ -15,44 +14,23 @@
/**
* Returns the set of all shortest paths, precomputed in terms of hop-count,
- * between the specified source and destination devices.
+ * between the specified source and destination elements.
*
- * @param src source device
- * @param dst destination device
- * @return set of all shortest paths between the two devices
+ * @param src source element
+ * @param dst destination element
+ * @return set of all shortest paths between the two elements
*/
- Set<Path> getPaths(DeviceId src, DeviceId dst);
+ Set<Path> getPaths(ElementId src, ElementId dst);
/**
* Returns the set of all shortest paths, computed using the supplied
- * edge-weight entity, between the specified source and destination devices.
+ * edge-weight entity, between the specified source and destination
+ * network elements.
*
- * @param src source device
- * @param dst destination device
- * @return set of all shortest paths between the two devices
+ * @param src source element
+ * @param dst destination element
+ * @return set of all shortest paths between the two element
*/
- Set<Path> getPaths(DeviceId src, DeviceId dst,
- LinkWeight weight);
-
-
- /**
- * Returns the set of all shortest paths, precomputed in terms of hop-count,
- * between the specified source and destination end-stations.
- *
- * @param src source device
- * @param dst destination device
- * @return set of all shortest paths between the two end-stations hosts
- */
- Set<Path> getPaths(HostId src, HostId dst);
-
- /**
- * Returns the set of all shortest paths, computed using the supplied
- * edge-weight entity, between the specified source and end-stations.
- *
- * @param src source host
- * @param dst destination host
- * @return set of all shortest paths between the two end-station hosts
- */
- Set<Path> getPaths(HostId src, HostId dst, LinkWeight weight);
+ Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight);
}
diff --git a/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java b/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java
index 368ff16..a19f969 100644
--- a/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java
+++ b/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java
@@ -47,8 +47,8 @@
public void basics() {
HostLocation hostLocation = new HostLocation(DID1, P1, 123L);
EdgeLink link = new DefaultEdgeLink(PID, cp(HID1, P0), hostLocation, false);
- assertEquals("incorrect src", cp(HID1, P0), link.src());
- assertEquals("incorrect dst", hostLocation, link.dst());
+ assertEquals("incorrect src", cp(HID1, P0), link.dst());
+ assertEquals("incorrect dst", hostLocation, link.src());
assertEquals("incorrect type", Link.Type.EDGE, link.type());
assertEquals("incorrect hostId", HID1, link.hostId());
assertEquals("incorrect connect point", hostLocation, link.hostLocation());
diff --git a/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java b/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java
index fefc499..d79f616 100644
--- a/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java
+++ b/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java
@@ -22,7 +22,7 @@
@Test
public void basics() {
new EqualsTester()
- .addEqualityGroup(hostId("nic:00:11:00:00:00:01/11"),
+ .addEqualityGroup(hostId("nic:00:11:00:00:00:01-11"),
hostId(MAC1, VLAN1))
.addEqualityGroup(hostId(MAC2, VLAN2))
.testEquals();