Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/DefaultTrafficSelector.java b/core/api/src/main/java/org/onlab/onos/net/flow/DefaultTrafficSelector.java
index 960eb02..352f604 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/DefaultTrafficSelector.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/DefaultTrafficSelector.java
@@ -188,7 +188,7 @@
}
@Override
- public Builder matchOpticalSignalType(Byte signalType) {
+ public Builder matchOpticalSignalType(Short signalType) {
return add(Criteria.matchOpticalSignalType(signalType));
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/TrafficSelector.java b/core/api/src/main/java/org/onlab/onos/net/flow/TrafficSelector.java
index aaf0ece..dd8e2ae 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/TrafficSelector.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/TrafficSelector.java
@@ -147,7 +147,7 @@
* @param signalType
* @return a selection builder
*/
- public Builder matchOpticalSignalType(Byte signalType);
+ public Builder matchOpticalSignalType(Short signalType);
/**
* Builds an immutable traffic selector.
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
index aba5680..a1ac5f8 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
@@ -161,11 +161,11 @@
/**
* Creates a match on lambda field using the specified value.
*
- * @param lambda
+ * @param sigType
* @return match criterion
*/
- public static Criterion matchOpticalSignalType(Byte lambda) {
- return new OpticalSignalTypeCriterion(lambda, Type.OCH_SIGTYPE);
+ public static Criterion matchOpticalSignalType(Short sigType) {
+ return new OpticalSignalTypeCriterion(sigType, Type.OCH_SIGTYPE);
}
@@ -587,10 +587,10 @@
public static final class OpticalSignalTypeCriterion implements Criterion {
- private final byte signalType;
+ private final Short signalType;
private final Type type;
- public OpticalSignalTypeCriterion(byte signalType, Type type) {
+ public OpticalSignalTypeCriterion(Short signalType, Type type) {
this.signalType = signalType;
this.type = type;
}
@@ -600,7 +600,7 @@
return this.type;
}
- public Byte signalType() {
+ public Short signalType() {
return this.signalType;
}
diff --git a/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java b/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java
index 5faae4d..27b5387 100644
--- a/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java
+++ b/core/net/src/main/java/org/onlab/onos/net/intent/impl/OpticalPathIntentInstaller.java
@@ -79,6 +79,7 @@
private ApplicationId appId;
//final short WAVELENGTH = 80;
+ static final short SIGNAL_TYPE = (short) 1;
@Activate
public void activate() {
@@ -151,7 +152,9 @@
prev = link.dst();
selectorBuilder.matchInport(link.dst().port());
+ selectorBuilder.matchOpticalSignalType(SIGNAL_TYPE); //todo
selectorBuilder.matchLambda((short) la.toInt());
+
}
// build the last T port rule
diff --git a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java
index 02ec827..e5131df 100644
--- a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java
+++ b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java
@@ -289,7 +289,10 @@
case OCH_SIGID:
builder.matchLambda(match.get(MatchField.OCH_SIGID).getChannelNumber());
break;
- case OCH_SIGTYPE_BASIC:
+ case OCH_SIGTYPE:
+ builder.matchOpticalSignalType(match.get(MatchField
+ .OCH_SIGTYPE).getValue());
+ break;
case ARP_OP:
case ARP_SHA:
case ARP_SPA:
diff --git a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
index b191784..0caf06b 100644
--- a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
+++ b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
@@ -19,6 +19,7 @@
import org.onlab.onos.net.flow.FlowRule;
import org.onlab.onos.net.flow.TrafficSelector;
+import org.onlab.onos.net.flow.criteria.Criteria;
import org.onlab.onos.net.flow.criteria.Criteria.EthCriterion;
import org.onlab.onos.net.flow.criteria.Criteria.EthTypeCriterion;
import org.onlab.onos.net.flow.criteria.Criteria.IPCriterion;
@@ -46,6 +47,7 @@
import org.projectfloodlight.openflow.types.OFPort;
import org.projectfloodlight.openflow.types.OFVlanVidMatch;
import org.projectfloodlight.openflow.types.TransportPort;
+import org.projectfloodlight.openflow.types.U8;
import org.projectfloodlight.openflow.types.VlanPcp;
import org.projectfloodlight.openflow.types.VlanVid;
import org.slf4j.Logger;
@@ -197,6 +199,12 @@
mBuilder.setExact(MatchField.OCH_SIGID,
new CircuitSignalID((byte) 1, (byte) 2, lc.lambda(), (short) 1));
break;
+ case OCH_SIGTYPE:
+ Criteria.OpticalSignalTypeCriterion sc =
+ (Criteria.OpticalSignalTypeCriterion) c;
+ mBuilder.setExact(MatchField.OCH_SIGTYPE,
+ U8.of(sc.signalType()));
+ break;
case ARP_OP:
case ARP_SHA:
case ARP_SPA: