Introduced new field FlowPathType to the Flow Path.
The initial set of valid values are:
FP_TYPE_SHORTEST_PATH, // Shortest path flow
FP_TYPE_EXPLICIT_PATH // Flow path with explicit flow entries
For now, the type field is not used (explicitly) yet.
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 a56dbff..7892483 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
@@ -3,7 +3,6 @@
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;
@@ -13,6 +12,7 @@
public class FlowPath implements Comparable<FlowPath> {
private FlowId flowId; // The Flow ID
private CallerId installerId; // The Caller ID of the path installer
+ private FlowPathType flowPathType; // The Flow Path type
private FlowPathFlags flowPathFlags; // The Flow Path flags
private DataPath dataPath; // The data path
private FlowEntryMatch flowEntryMatch; // Common Flow Entry Match for all
@@ -24,6 +24,7 @@
* Default constructor.
*/
public FlowPath() {
+ flowPathType = FlowPathType.FP_TYPE_UNKNOWN;
flowPathFlags = new FlowPathFlags();
dataPath = new DataPath();
flowEntryActions = new FlowEntryActions();
@@ -36,6 +37,7 @@
dataPath = new DataPath();
this.setFlowId(new FlowId(flowObj.getFlowId()));
this.setInstallerId(new CallerId(flowObj.getInstallerId()));
+ this.setFlowPathType(FlowPathType.valueOf(flowObj.getFlowPathType()));
this.setFlowPathFlags(new FlowPathFlags(flowObj.getFlowPathFlags()));
this.dataPath().srcPort().setDpid(new Dpid(flowObj.getSrcSwitch()));
this.dataPath().srcPort().setPort(new Port(flowObj.getSrcPort()));
@@ -221,6 +223,24 @@
}
/**
+ * Get the flow path type.
+ *
+ * @return the flow path type.
+ */
+ @JsonProperty("flowPathType")
+ public FlowPathType flowPathType() { return flowPathType; }
+
+ /**
+ * Set the flow path type.
+ *
+ * @param flowPathType the flow path type to set.
+ */
+ @JsonProperty("flowPathType")
+ public void setFlowPathType(FlowPathType flowPathType) {
+ this.flowPathType = flowPathType;
+ }
+
+ /**
* Get the flow path flags.
*
* @return the flow path flags.
@@ -300,8 +320,8 @@
* Convert the flow path to a string.
*
* The string has the following form:
- * [flowId=XXX installerId=XXX flowPathFlags=XXX dataPath=XXX
- * flowEntryMatch=XXX flowEntryActions=XXX]
+ * [flowId=XXX installerId=XXX flowPathType = XXX flowPathFlags=XXX
+ * dataPath=XXX flowEntryMatch=XXX flowEntryActions=XXX]
*
* @return the flow path as a string.
*/
@@ -309,6 +329,7 @@
public String toString() {
String ret = "[flowId=" + this.flowId.toString();
ret += " installerId=" + this.installerId.toString();
+ ret += " flowPathType=" + this.flowPathType;
ret += " flowPathFlags=" + this.flowPathFlags.toString();
if (dataPath != null)
ret += " dataPath=" + this.dataPath.toString();