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/core/INetMapTopologyObjects.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
index 7b38fef..dadda71 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
@@ -199,6 +199,13 @@
@Property("installer_id")
public void setInstallerId(String installerId);
+ @JsonProperty("flowPathType")
+ @Property("flow_path_type")
+ public String getFlowPathType();
+
+ @Property("flow_path_type")
+ public void setFlowPathType(String flowPathType);
+
@JsonProperty("flowPathFlags")
@Property("flow_path_flags")
public Long getFlowPathFlags();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
index 3178b60..74cfcbe 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
@@ -80,6 +80,7 @@
//
// Set the Flow attributes:
// - flowPath.installerId()
+ // - flowPath.flowPathType()
// - flowPath.flowPathFlags()
// - flowPath.dataPath().srcPort()
// - flowPath.dataPath().dstPort()
@@ -97,6 +98,7 @@
// - flowPath.flowEntryActions()
//
flowObj.setInstallerId(flowPath.installerId().toString());
+ flowObj.setFlowPathType(flowPath.flowPathType().toString());
flowObj.setFlowPathFlags(flowPath.flowPathFlags().flags());
flowObj.setSrcSwitch(flowPath.dataPath().srcPort().dpid().toString());
flowObj.setSrcPort(flowPath.dataPath().srcPort().port().value());
@@ -751,6 +753,7 @@
//
String flowIdStr = flowObj.getFlowId();
String installerIdStr = flowObj.getInstallerId();
+ String flowPathType = flowObj.getFlowPathType();
Long flowPathFlags = flowObj.getFlowPathFlags();
String srcSwitchStr = flowObj.getSrcSwitch();
Short srcPortShort = flowObj.getSrcPort();
@@ -759,6 +762,7 @@
if ((flowIdStr == null) ||
(installerIdStr == null) ||
+ (flowPathType == null) ||
(flowPathFlags == null) ||
(srcSwitchStr == null) ||
(srcPortShort == null) ||
@@ -771,6 +775,7 @@
FlowPath flowPath = new FlowPath();
flowPath.setFlowId(new FlowId(flowIdStr));
flowPath.setInstallerId(new CallerId(installerIdStr));
+ flowPath.setFlowPathType(FlowPathType.valueOf(flowPathType));
flowPath.setFlowPathFlags(new FlowPathFlags(flowPathFlags));
flowPath.dataPath().srcPort().setDpid(new Dpid(srcSwitchStr));
flowPath.dataPath().srcPort().setPort(new Port(srcPortShort));
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 44607a9..cd1c994 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -295,10 +295,12 @@
Short srcPortShort = flowPathObj.getSrcPort();
String dstDpidStr = flowPathObj.getDstSwitch();
Short dstPortShort = flowPathObj.getDstPort();
+ String flowPathTypeStr = flowPathObj.getFlowPathType();
Long flowPathFlagsLong = flowPathObj.getFlowPathFlags();
if ((srcPortShort == null) ||
(dstDpidStr == null) ||
(dstPortShort == null) ||
+ (flowPathTypeStr == null) ||
(flowPathFlagsLong == null)) {
continue;
}
@@ -308,6 +310,7 @@
Port dstPort = new Port(dstPortShort);
SwitchPort srcSwitchPort = new SwitchPort(srcDpid, srcPort);
SwitchPort dstSwitchPort = new SwitchPort(dstDpid, dstPort);
+ FlowPathType flowPathType = FlowPathType.valueOf(flowPathTypeStr);
FlowPathFlags flowPathFlags = new FlowPathFlags(flowPathFlagsLong);
counterMyFlowPaths++;
@@ -713,6 +716,7 @@
FlowPath computedFlowPath = new FlowPath();
computedFlowPath.setFlowId(new FlowId(flowPath.flowId().value()));
computedFlowPath.setInstallerId(new CallerId(flowPath.installerId().value()));
+ computedFlowPath.setFlowPathType(flowPath.flowPathType());
computedFlowPath.setFlowPathFlags(new FlowPathFlags(flowPath.flowPathFlags().flags()));
computedFlowPath.setDataPath(dataPath);
computedFlowPath.setFlowEntryMatch(new FlowEntryMatch(flowPath.flowEntryMatch()));
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();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathType.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathType.java
new file mode 100644
index 0000000..87f2d98
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathType.java
@@ -0,0 +1,10 @@
+package net.onrc.onos.ofcontroller.util;
+
+/**
+ * The Flow Path types.
+ */
+public enum FlowPathType {
+ FP_TYPE_UNKNOWN, // Initialization value: state unknown
+ FP_TYPE_SHORTEST_PATH, // Shortest path flow
+ FP_TYPE_EXPLICIT_PATH // Flow path with explicit flow entries
+}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java b/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java
index 507cb99..45a43bf 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java
@@ -113,6 +113,7 @@
kryo.register(FlowId.class);
kryo.register(FlowPath.class);
kryo.register(FlowPathFlags.class);
+ kryo.register(FlowPathType.class);
kryo.register(IPv4.class);
kryo.register(IPv4Net.class);
kryo.register(IPv6.class);