Implement OFActionEnqueue (OpenFlow 1.0 only)
Realize the QUEUE Treatment using OpenFlow 1.0 Enqueue action.
The ConnectivityIntentCommand's --setQueue parameter is extended by a notion of
<port>/<queue> to support the difference from OpenFlow 1.3 Set-Queue, which is
not bound to a port.
Change-Id: I28cf70a7c004a1a3a14361e5186cfe42f09f1356
diff --git a/cli/src/main/java/org/onosproject/cli/net/ConnectivityIntentCommand.java b/cli/src/main/java/org/onosproject/cli/net/ConnectivityIntentCommand.java
index 62cf042..a33af76 100644
--- a/cli/src/main/java/org/onosproject/cli/net/ConnectivityIntentCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/ConnectivityIntentCommand.java
@@ -33,6 +33,7 @@
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.Link;
+import org.onosproject.net.PortNumber;
import org.onosproject.net.flow.DefaultTrafficSelector;
import org.onosproject.net.flow.DefaultTrafficTreatment;
import org.onosproject.net.flow.TrafficSelector;
@@ -166,7 +167,8 @@
required = false, multiValued = false)
private String pushVlan = null;
- @Option(name = "--setQueue", description = "Set Queue ID",
+ @Option(name = "--setQueue", description = "Set Queue ID (for OpenFlow 1.0, " +
+ "also the port has to be specified, i.e., <port>/<queue>",
required = false, multiValued = false)
private String setQueue = null;
@@ -332,7 +334,15 @@
emptyTreatment = false;
}
if (!isNullOrEmpty(setQueue)) {
- treatmentBuilder.setQueue(Long.parseLong(setQueue));
+ // OpenFlow 1.0 notation (for ENQUEUE): <port>/<queue>
+ if (setQueue.contains("/")) {
+ String[] queueConfig = setQueue.split("/");
+ PortNumber port = PortNumber.portNumber(Long.parseLong(queueConfig[0]));
+ long queueId = Long.parseLong(queueConfig[1]);
+ treatmentBuilder.setQueue(queueId, port);
+ } else {
+ treatmentBuilder.setQueue(Long.parseLong(setQueue));
+ }
emptyTreatment = false;
}