Add MPLS encapsulation behaviour ONOS-3467
- MPLS encapsulation using constraint
- New MPLS encapsulation test
- Fix VLAN encapsulation test
Change-Id: I94670bcd51a95a0272f786681e51d6785a56c4f5
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
index 039a1f5..7222f0f 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
@@ -15,10 +15,7 @@
*/
package org.onosproject.net.intent.impl.compiler;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
+import com.google.common.collect.ImmutableList;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
@@ -42,10 +39,13 @@
import org.onosproject.net.resource.link.LinkResourceAllocations;
import org.slf4j.Logger;
-import com.google.common.collect.ImmutableList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
import static org.slf4j.LoggerFactory.getLogger;
+
@Component(immediate = true)
public class PathIntentCompiler
extends PathCompiler<FlowRule>
@@ -84,6 +84,7 @@
List<DeviceId> devices = new LinkedList<>();
compile(this, intent, rules, devices);
+
return ImmutableList.of(new FlowRuleIntent(appId, null, rules, intent.resources()));
}
@@ -97,12 +98,14 @@
return resourceService;
}
+
@Override
public void createFlow(TrafficSelector originalSelector, TrafficTreatment originalTreatment,
ConnectPoint ingress, ConnectPoint egress,
int priority, boolean applyTreatment,
List<FlowRule> rules,
List<DeviceId> devices) {
+
TrafficSelector selector = DefaultTrafficSelector.builder(originalSelector)
.matchInPort(ingress.port())
.build();
@@ -123,5 +126,6 @@
.fromApp(appId)
.makePermanent()
.build());
+
}
}