Fixing a couple of bugs in default entries for corsa pipeline.
Also fixing flowRule table-awareness with changes reflected in flow identification (hashing)
and the karaf CLI.
Change-Id: I2fac83db8e0b54b802fb765ef9d82033f7478b99
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
index 441f9a0..c8105c9 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
@@ -180,11 +180,11 @@
* @see java.lang.Object#equals(java.lang.Object)
*/
public int hashCode() {
- return Objects.hash(deviceId, selector, priority);
+ return Objects.hash(deviceId, selector, priority, type);
}
public int hash() {
- return Objects.hash(deviceId, selector, treatment);
+ return Objects.hash(deviceId, selector, treatment, type);
}
@Override
@@ -202,7 +202,8 @@
DefaultFlowRule that = (DefaultFlowRule) obj;
return Objects.equals(deviceId, that.deviceId) &&
Objects.equals(priority, that.priority) &&
- Objects.equals(selector, that.selector);
+ Objects.equals(selector, that.selector) &&
+ Objects.equals(type, that.type);
}
return false;
@@ -216,6 +217,7 @@
.add("priority", priority)
.add("selector", selector.criteria())
.add("treatment", treatment == null ? "N/A" : treatment.instructions())
+ .add("table type", type)
.add("created", created)
.toString();
}
diff --git a/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java b/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
index 462875a..53aff49 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
@@ -33,7 +33,8 @@
* For single table switch, Default is used.
*/
public static enum Type {
- /* Default type - used in flow rule for single table switch */
+ /* Default type - used in flow rule for single table switch
+ * NOTE: this setting should not be used as Table 0 in a multi-table pipeline*/
DEFAULT,
/* Used in flow entry for IP table */
IP,
@@ -48,11 +49,14 @@
/* VLAN table */
VLAN,
- /* L2 table */
+ /* Ethtype table */
ETHER,
/* Class of Service table */
COS,
+
+ /* Table 0 in a multi-table pipeline */
+ FIRST,
}
//TODO: build cookie value