Sketched out packet service and related abstractions.
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/ClusterLinksCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/ClusterLinksCommand.java
index 5285418..246c39e 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/ClusterLinksCommand.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/ClusterLinksCommand.java
@@ -16,7 +16,7 @@
public class ClusterLinksCommand extends ClustersListCommand {
@Argument(index = 0, name = "id", description = "Cluster ID",
- required = false, multiValued = false)
+ required = true, multiValued = false)
String id = null;
@Override
@@ -30,5 +30,4 @@
return null;
}
-
}
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/LinksListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/LinksListCommand.java
index 6c3952d..e62fb05 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/LinksListCommand.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/LinksListCommand.java
@@ -33,10 +33,10 @@
}
/**
- * Returns a formated string representing the gien link.
+ * Returns a formatted string representing the given link.
*
* @param link infrastructure link
- * @return formated link string
+ * @return formatted link string
*/
public static String linkString(Link link) {
return String.format(FMT, link.src().deviceId(), link.src().port(),
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/PathListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/PathListCommand.java
new file mode 100644
index 0000000..114d837
--- /dev/null
+++ b/cli/src/main/java/org/onlab/onos/cli/net/PathListCommand.java
@@ -0,0 +1,43 @@
+package org.onlab.onos.cli.net;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onlab.onos.net.Path;
+
+import java.util.Set;
+
+import static org.onlab.onos.net.DeviceId.deviceId;
+
+/**
+ * Lists all shortest-paths paths between the specified source and
+ * destination devices.
+ */
+@Command(scope = "onos", name = "paths",
+ description = "Lists all shortest-paths paths between the specified source and destination devices")
+public class PathListCommand extends TopologyCommand {
+
+ private static final String FMT = "src=%s/%s, dst=%s/%s, type=%s";
+
+ @Argument(index = 0, name = "src", description = "Source device ID",
+ required = true, multiValued = false)
+ String src = null;
+
+ @Argument(index = 0, name = "dst", description = "Destination device ID",
+ required = true, multiValued = false)
+ String dst = null;
+
+ @Override
+ protected Object doExecute() throws Exception {
+ init();
+ Set<Path> paths = service.getPaths(topology, deviceId(src), deviceId(dst));
+ for (Path path : paths) {
+ print(pathString(path));
+ }
+ return null;
+ }
+
+ private String pathString(Path path) {
+ return path.toString();
+ }
+
+}
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/TopologyCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/TopologyCommand.java
index a390025..6c141ae 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/TopologyCommand.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/TopologyCommand.java
@@ -12,6 +12,7 @@
description = "Lists summary of the current topology")
public class TopologyCommand extends AbstractShellCommand {
+ // TODO: format the time-stamp
private static final String FMT =
"time=%s, devices=%d, links=%d, clusters=%d, paths=%d";