* Add FlowPathFlags to the FlowPath header.
* Implement DISCARD_FIRST_HOP_ENTRY and KEEP_ONLY_FIRST_HOP_ENTRY flags:
- DISCARD_FIRST_HOP_ENTRY : After computing the shortest-path, the
first-hop entry is discarded
- KEEP_ONLY_FIRST_HOP_ENTRY : After computing the shortest-path,
only the the first hop entry is kept, and the rest are discarded.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
index 4a8fc7b..2f4d421 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
@@ -5,6 +5,7 @@
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
+import net.onrc.onos.ofcontroller.util.FlowPathFlags;
import org.codehaus.jackson.annotate.JsonProperty;
@@ -14,6 +15,7 @@
public class FlowPath implements Comparable<FlowPath> {
private FlowId flowId; // The Flow ID
private CallerId installerId; // The Caller ID of the path installer
+ private FlowPathFlags flowPathFlags; // The Flow Path flags
private DataPath dataPath; // The data path
private FlowEntryMatch flowEntryMatch; // Common Flow Entry Match for all
// Flow Entries
@@ -22,6 +24,7 @@
* Default constructor.
*/
public FlowPath() {
+ flowPathFlags = new FlowPathFlags();
dataPath = new DataPath();
}
@@ -32,6 +35,7 @@
dataPath = new DataPath();
this.setFlowId(new FlowId(flowObj.getFlowId()));
this.setInstallerId(new CallerId(flowObj.getInstallerId()));
+ this.setFlowPathFlags(new FlowPathFlags(flowObj.getFlowPathFlags()));
this.dataPath().srcPort().setDpid(new Dpid(flowObj.getSrcSwitch()));
this.dataPath().srcPort().setPort(new Port(flowObj.getSrcPort()));
this.dataPath().dstPort().setDpid(new Dpid(flowObj.getDstSwitch()));
@@ -190,6 +194,24 @@
}
/**
+ * Get the flow path flags.
+ *
+ * @return the flow path flags.
+ */
+ @JsonProperty("flowPathFlags")
+ public FlowPathFlags flowPathFlags() { return flowPathFlags; }
+
+ /**
+ * Set the flow path flags.
+ *
+ * @param flowPathFlags the flow path flags to set.
+ */
+ @JsonProperty("flowPathFlags")
+ public void setFlowPathFlags(FlowPathFlags flowPathFlags) {
+ this.flowPathFlags = flowPathFlags;
+ }
+
+ /**
* Get the flow path's data path.
*
* @return the flow path's data path.
@@ -230,7 +252,7 @@
* Convert the flow path to a string.
*
* The string has the following form:
- * [flowId=XXX installerId=XXX dataPath=XXX]
+ * [flowId=XXX installerId=XXX flowPathFlags=XXX dataPath=XXX]
*
* @return the flow path as a string.
*/
@@ -238,6 +260,7 @@
public String toString() {
String ret = "[flowId=" + this.flowId.toString();
ret += " installerId=" + this.installerId.toString();
+ ret += " flowPathFlags=" + this.flowPathFlags.toString();
if (dataPath != null)
ret += " dataPath=" + this.dataPath.toString();
if (flowEntryMatch != null)