Showing
6 changed files
with
23 additions
and
9 deletions
| ... | @@ -188,7 +188,7 @@ public final class DefaultTrafficSelector implements TrafficSelector { | ... | @@ -188,7 +188,7 @@ public final class DefaultTrafficSelector implements TrafficSelector { |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | @Override | 190 | @Override |
| 191 | - public Builder matchOpticalSignalType(Byte signalType) { | 191 | + public Builder matchOpticalSignalType(Short signalType) { |
| 192 | return add(Criteria.matchOpticalSignalType(signalType)); | 192 | return add(Criteria.matchOpticalSignalType(signalType)); |
| 193 | 193 | ||
| 194 | } | 194 | } | ... | ... |
| ... | @@ -147,7 +147,7 @@ public interface TrafficSelector { | ... | @@ -147,7 +147,7 @@ public interface TrafficSelector { |
| 147 | * @param signalType | 147 | * @param signalType |
| 148 | * @return a selection builder | 148 | * @return a selection builder |
| 149 | */ | 149 | */ |
| 150 | - public Builder matchOpticalSignalType(Byte signalType); | 150 | + public Builder matchOpticalSignalType(Short signalType); |
| 151 | 151 | ||
| 152 | /** | 152 | /** |
| 153 | * Builds an immutable traffic selector. | 153 | * Builds an immutable traffic selector. | ... | ... |
| ... | @@ -161,11 +161,11 @@ public final class Criteria { | ... | @@ -161,11 +161,11 @@ public final class Criteria { |
| 161 | /** | 161 | /** |
| 162 | * Creates a match on lambda field using the specified value. | 162 | * Creates a match on lambda field using the specified value. |
| 163 | * | 163 | * |
| 164 | - * @param lambda | 164 | + * @param sigType |
| 165 | * @return match criterion | 165 | * @return match criterion |
| 166 | */ | 166 | */ |
| 167 | - public static Criterion matchOpticalSignalType(Byte lambda) { | 167 | + public static Criterion matchOpticalSignalType(Short sigType) { |
| 168 | - return new OpticalSignalTypeCriterion(lambda, Type.OCH_SIGTYPE); | 168 | + return new OpticalSignalTypeCriterion(sigType, Type.OCH_SIGTYPE); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | 171 | ||
| ... | @@ -587,10 +587,10 @@ public final class Criteria { | ... | @@ -587,10 +587,10 @@ public final class Criteria { |
| 587 | 587 | ||
| 588 | public static final class OpticalSignalTypeCriterion implements Criterion { | 588 | public static final class OpticalSignalTypeCriterion implements Criterion { |
| 589 | 589 | ||
| 590 | - private final byte signalType; | 590 | + private final Short signalType; |
| 591 | private final Type type; | 591 | private final Type type; |
| 592 | 592 | ||
| 593 | - public OpticalSignalTypeCriterion(byte signalType, Type type) { | 593 | + public OpticalSignalTypeCriterion(Short signalType, Type type) { |
| 594 | this.signalType = signalType; | 594 | this.signalType = signalType; |
| 595 | this.type = type; | 595 | this.type = type; |
| 596 | } | 596 | } |
| ... | @@ -600,7 +600,7 @@ public final class Criteria { | ... | @@ -600,7 +600,7 @@ public final class Criteria { |
| 600 | return this.type; | 600 | return this.type; |
| 601 | } | 601 | } |
| 602 | 602 | ||
| 603 | - public Byte signalType() { | 603 | + public Short signalType() { |
| 604 | return this.signalType; | 604 | return this.signalType; |
| 605 | } | 605 | } |
| 606 | 606 | ... | ... |
| ... | @@ -79,6 +79,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -79,6 +79,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
| 79 | private ApplicationId appId; | 79 | private ApplicationId appId; |
| 80 | 80 | ||
| 81 | //final short WAVELENGTH = 80; | 81 | //final short WAVELENGTH = 80; |
| 82 | + static final short SIGNAL_TYPE = (short) 1; | ||
| 82 | 83 | ||
| 83 | @Activate | 84 | @Activate |
| 84 | public void activate() { | 85 | public void activate() { |
| ... | @@ -151,7 +152,9 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -151,7 +152,9 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
| 151 | 152 | ||
| 152 | prev = link.dst(); | 153 | prev = link.dst(); |
| 153 | selectorBuilder.matchInport(link.dst().port()); | 154 | selectorBuilder.matchInport(link.dst().port()); |
| 155 | + selectorBuilder.matchOpticalSignalType(SIGNAL_TYPE); //todo | ||
| 154 | selectorBuilder.matchLambda((short) la.toInt()); | 156 | selectorBuilder.matchLambda((short) la.toInt()); |
| 157 | + | ||
| 155 | } | 158 | } |
| 156 | 159 | ||
| 157 | // build the last T port rule | 160 | // build the last T port rule | ... | ... |
| ... | @@ -289,7 +289,10 @@ public class FlowEntryBuilder { | ... | @@ -289,7 +289,10 @@ public class FlowEntryBuilder { |
| 289 | case OCH_SIGID: | 289 | case OCH_SIGID: |
| 290 | builder.matchLambda(match.get(MatchField.OCH_SIGID).getChannelNumber()); | 290 | builder.matchLambda(match.get(MatchField.OCH_SIGID).getChannelNumber()); |
| 291 | break; | 291 | break; |
| 292 | - case OCH_SIGTYPE_BASIC: | 292 | + case OCH_SIGTYPE: |
| 293 | + builder.matchOpticalSignalType(match.get(MatchField | ||
| 294 | + .OCH_SIGTYPE).getValue()); | ||
| 295 | + break; | ||
| 293 | case ARP_OP: | 296 | case ARP_OP: |
| 294 | case ARP_SHA: | 297 | case ARP_SHA: |
| 295 | case ARP_SPA: | 298 | case ARP_SPA: | ... | ... |
| ... | @@ -19,6 +19,7 @@ import static org.slf4j.LoggerFactory.getLogger; | ... | @@ -19,6 +19,7 @@ import static org.slf4j.LoggerFactory.getLogger; |
| 19 | 19 | ||
| 20 | import org.onlab.onos.net.flow.FlowRule; | 20 | import org.onlab.onos.net.flow.FlowRule; |
| 21 | import org.onlab.onos.net.flow.TrafficSelector; | 21 | import org.onlab.onos.net.flow.TrafficSelector; |
| 22 | +import org.onlab.onos.net.flow.criteria.Criteria; | ||
| 22 | import org.onlab.onos.net.flow.criteria.Criteria.EthCriterion; | 23 | import org.onlab.onos.net.flow.criteria.Criteria.EthCriterion; |
| 23 | import org.onlab.onos.net.flow.criteria.Criteria.EthTypeCriterion; | 24 | import org.onlab.onos.net.flow.criteria.Criteria.EthTypeCriterion; |
| 24 | import org.onlab.onos.net.flow.criteria.Criteria.IPCriterion; | 25 | import org.onlab.onos.net.flow.criteria.Criteria.IPCriterion; |
| ... | @@ -46,6 +47,7 @@ import org.projectfloodlight.openflow.types.Masked; | ... | @@ -46,6 +47,7 @@ import org.projectfloodlight.openflow.types.Masked; |
| 46 | import org.projectfloodlight.openflow.types.OFPort; | 47 | import org.projectfloodlight.openflow.types.OFPort; |
| 47 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; | 48 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; |
| 48 | import org.projectfloodlight.openflow.types.TransportPort; | 49 | import org.projectfloodlight.openflow.types.TransportPort; |
| 50 | +import org.projectfloodlight.openflow.types.U8; | ||
| 49 | import org.projectfloodlight.openflow.types.VlanPcp; | 51 | import org.projectfloodlight.openflow.types.VlanPcp; |
| 50 | import org.projectfloodlight.openflow.types.VlanVid; | 52 | import org.projectfloodlight.openflow.types.VlanVid; |
| 51 | import org.slf4j.Logger; | 53 | import org.slf4j.Logger; |
| ... | @@ -195,6 +197,12 @@ public abstract class FlowModBuilder { | ... | @@ -195,6 +197,12 @@ public abstract class FlowModBuilder { |
| 195 | mBuilder.setExact(MatchField.OCH_SIGID, | 197 | mBuilder.setExact(MatchField.OCH_SIGID, |
| 196 | new CircuitSignalID((byte) 1, (byte) 2, lc.lambda(), (short) 1)); | 198 | new CircuitSignalID((byte) 1, (byte) 2, lc.lambda(), (short) 1)); |
| 197 | break; | 199 | break; |
| 200 | + case OCH_SIGTYPE: | ||
| 201 | + Criteria.OpticalSignalTypeCriterion sc = | ||
| 202 | + (Criteria.OpticalSignalTypeCriterion) c; | ||
| 203 | + mBuilder.setExact(MatchField.OCH_SIGTYPE, | ||
| 204 | + U8.of(sc.signalType())); | ||
| 205 | + break; | ||
| 198 | case ARP_OP: | 206 | case ARP_OP: |
| 199 | case ARP_SHA: | 207 | case ARP_SHA: |
| 200 | case ARP_SPA: | 208 | case ARP_SPA: | ... | ... |
-
Please register or login to post a comment