Try to use ModMplsHeaderInstruction and ModVlanHeaderInstruction
Change-Id: I0b486907ef718a6dfa3e92696397fe5a7e851aed
diff --git a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
index b0fbf5b..aaf37e2 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
@@ -333,7 +333,7 @@
* @return a L2 modification.
*/
public static Instruction pushMpls() {
- return new L2ModificationInstruction.PushHeaderInstructions(
+ return new L2ModificationInstruction.ModMplsHeaderInstruction(
L2ModificationInstruction.L2SubType.MPLS_PUSH,
EthType.EtherType.MPLS_UNICAST.ethType());
}
@@ -344,7 +344,7 @@
* @return a L2 modification.
*/
public static Instruction popMpls() {
- return new L2ModificationInstruction.PushHeaderInstructions(
+ return new L2ModificationInstruction.ModMplsHeaderInstruction(
L2ModificationInstruction.L2SubType.MPLS_POP,
EthType.EtherType.MPLS_UNICAST.ethType());
}
@@ -357,7 +357,7 @@
*/
public static Instruction popMpls(EthType etherType) {
checkNotNull(etherType, "Ethernet type cannot be null");
- return new L2ModificationInstruction.PushHeaderInstructions(
+ return new L2ModificationInstruction.ModMplsHeaderInstruction(
L2ModificationInstruction.L2SubType.MPLS_POP, etherType);
}
@@ -367,7 +367,7 @@
* @return a L2 modification
*/
public static Instruction popVlan() {
- return new L2ModificationInstruction.PopVlanInstruction(
+ return new L2ModificationInstruction.ModVlanHeaderInstruction(
L2ModificationInstruction.L2SubType.VLAN_POP);
}
@@ -377,7 +377,7 @@
* @return a L2 modification
*/
public static Instruction pushVlan() {
- return new L2ModificationInstruction.PushHeaderInstructions(
+ return new L2ModificationInstruction.ModVlanHeaderInstruction(
L2ModificationInstruction.L2SubType.VLAN_PUSH,
EthType.EtherType.VLAN.ethType());
}
diff --git a/core/api/src/test/java/org/onosproject/net/flow/instructions/InstructionsTest.java b/core/api/src/test/java/org/onosproject/net/flow/instructions/InstructionsTest.java
index 65b43cb..fd5c9ef 100644
--- a/core/api/src/test/java/org/onosproject/net/flow/instructions/InstructionsTest.java
+++ b/core/api/src/test/java/org/onosproject/net/flow/instructions/InstructionsTest.java
@@ -15,8 +15,7 @@
*/
package org.onosproject.net.flow.instructions;
-import java.util.List;
-
+import com.google.common.testing.EqualsTester;
import org.junit.Test;
import org.onlab.packet.EthType;
import org.onlab.packet.IpAddress;
@@ -34,7 +33,7 @@
import org.onosproject.net.PortNumber;
import org.onosproject.net.meter.MeterId;
-import com.google.common.testing.EqualsTester;
+import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
@@ -106,11 +105,10 @@
assertThatClassIsImmutable(L2ModificationInstruction.ModEtherInstruction.class);
assertThatClassIsImmutable(L2ModificationInstruction.ModVlanIdInstruction.class);
assertThatClassIsImmutable(L2ModificationInstruction.ModVlanPcpInstruction.class);
- assertThatClassIsImmutable(L2ModificationInstruction.PopVlanInstruction.class);
assertThatClassIsImmutable(L3ModificationInstruction.ModIPInstruction.class);
assertThatClassIsImmutable(L3ModificationInstruction.ModIPv6FlowLabelInstruction.class);
assertThatClassIsImmutable(L2ModificationInstruction.ModMplsLabelInstruction.class);
- assertThatClassIsImmutable(L2ModificationInstruction.PushHeaderInstructions.class);
+ assertThatClassIsImmutable(L2ModificationInstruction.ModMplsHeaderInstruction.class);
assertThatClassIsImmutable(L2ModificationInstruction.ModMplsBosInstruction.class);
assertThatClassIsImmutable(L2ModificationInstruction.ModMplsTtlInstruction.class);
assertThatClassIsImmutable(L2ModificationInstruction.ModTunnelIdInstruction.class);
@@ -970,13 +968,13 @@
extensionInstruction2);
}
- // PushHeaderInstructions
+ // ModMplsHeaderInstructions
private final EthType ethType1 = new EthType(1);
private final EthType ethType2 = new EthType(2);
- private final Instruction pushHeaderInstruction1 = Instructions.popMpls(ethType1);
- private final Instruction sameAsPushHeaderInstruction1 = Instructions.popMpls(ethType1);
- private final Instruction pushHeaderInstruction2 = Instructions.popMpls(ethType2);
+ private final Instruction modMplsHeaderInstruction1 = Instructions.popMpls(ethType1);
+ private final Instruction sameAsModMplsHeaderInstruction1 = Instructions.popMpls(ethType1);
+ private final Instruction modMplsHeaderInstruction2 = Instructions.popMpls(ethType2);
/**
* Test the pushMpls method.
@@ -984,10 +982,10 @@
@Test
public void testPushMplsMethod() {
final Instruction instruction = Instructions.pushMpls();
- final L2ModificationInstruction.PushHeaderInstructions pushHeaderInstruction =
+ final L2ModificationInstruction.ModMplsHeaderInstruction pushHeaderInstruction =
checkAndConvert(instruction,
Instruction.Type.L2MODIFICATION,
- L2ModificationInstruction.PushHeaderInstructions.class);
+ L2ModificationInstruction.ModMplsHeaderInstruction.class);
assertThat(pushHeaderInstruction.ethernetType().toString(),
is(EthType.EtherType.MPLS_MULTICAST.toString()));
assertThat(pushHeaderInstruction.subtype(),
@@ -1000,10 +998,10 @@
@Test
public void testPopMplsMethod() {
final Instruction instruction = Instructions.popMpls();
- final L2ModificationInstruction.PushHeaderInstructions pushHeaderInstruction =
+ final L2ModificationInstruction.ModMplsHeaderInstruction pushHeaderInstruction =
checkAndConvert(instruction,
Instruction.Type.L2MODIFICATION,
- L2ModificationInstruction.PushHeaderInstructions.class);
+ L2ModificationInstruction.ModMplsHeaderInstruction.class);
assertThat(pushHeaderInstruction.ethernetType().toString(),
is(EthType.EtherType.MPLS_MULTICAST.toString()));
assertThat(pushHeaderInstruction.subtype(),
@@ -1016,10 +1014,10 @@
@Test
public void testPopMplsEthertypeMethod() {
final Instruction instruction = Instructions.popMpls(new EthType(1));
- final L2ModificationInstruction.PushHeaderInstructions pushHeaderInstruction =
+ final L2ModificationInstruction.ModMplsHeaderInstruction pushHeaderInstruction =
checkAndConvert(instruction,
Instruction.Type.L2MODIFICATION,
- L2ModificationInstruction.PushHeaderInstructions.class);
+ L2ModificationInstruction.ModMplsHeaderInstruction.class);
assertThat(pushHeaderInstruction.ethernetType().toShort(), is((short) 1));
assertThat(pushHeaderInstruction.subtype(),
is(L2ModificationInstruction.L2SubType.MPLS_POP));
@@ -1031,10 +1029,10 @@
@Test
public void testPushVlanMethod() {
final Instruction instruction = Instructions.pushVlan();
- final L2ModificationInstruction.PushHeaderInstructions pushHeaderInstruction =
+ final L2ModificationInstruction.ModVlanHeaderInstruction pushHeaderInstruction =
checkAndConvert(instruction,
Instruction.Type.L2MODIFICATION,
- L2ModificationInstruction.PushHeaderInstructions.class);
+ L2ModificationInstruction.ModVlanHeaderInstruction.class);
assertThat(pushHeaderInstruction.ethernetType().toString(),
is(EthType.EtherType.VLAN.toString()));
assertThat(pushHeaderInstruction.subtype(),
@@ -1043,14 +1041,14 @@
/**
* Tests the equals(), hashCode() and toString() methods of the
- * PushHeaderInstructions class.
+ * ModMplsHeaderInstructions class.
*/
@Test
- public void testPushHeaderInstructionsEquals() {
- checkEqualsAndToString(pushHeaderInstruction1,
- sameAsPushHeaderInstruction1,
- pushHeaderInstruction2);
+ public void testModMplsHeaderInstructionsEquals() {
+ checkEqualsAndToString(modMplsHeaderInstruction1,
+ sameAsModMplsHeaderInstruction1,
+ modMplsHeaderInstruction2);
}
// ModMplsTtlInstruction
@@ -1074,7 +1072,7 @@
/**
* Tests the equals(), hashCode() and toString() methods of the
- * PushHeaderInstructions class.
+ * ModMplsTtlInstructions class.
*/
@Test
@@ -1107,7 +1105,7 @@
/**
* Tests the equals(), hashCode() and toString() methods of the
- * PushHeaderInstructions class.
+ * ModMplsBosInstructions class.
*/
@Test
@@ -1117,10 +1115,10 @@
modMplsBosInstruction2);
}
- // PopVlanInstruction
+ // ModVlanHeaderInstruction
- private final Instruction popVlanInstruction1 = Instructions.popVlan();
- private final Instruction sameAsPopVlanInstruction1 = Instructions.popVlan();
+ private final Instruction modVlanHeaderInstruction1 = Instructions.popVlan();
+ private final Instruction sameAsModVlanHeaderInstruction1 = Instructions.popVlan();
/**
* Test the popVlan method.
@@ -1128,23 +1126,23 @@
@Test
public void testPopVlanMethod() {
final Instruction instruction = Instructions.popVlan();
- final L2ModificationInstruction.PopVlanInstruction popVlanInstruction =
+ final L2ModificationInstruction.ModVlanHeaderInstruction popVlanInstruction =
checkAndConvert(instruction,
Instruction.Type.L2MODIFICATION,
- L2ModificationInstruction.PopVlanInstruction.class);
+ L2ModificationInstruction.ModVlanHeaderInstruction.class);
assertThat(popVlanInstruction.subtype(),
is(L2ModificationInstruction.L2SubType.VLAN_POP));
}
/**
* Tests the equals(), hashCode() and toString() methods of the
- * PushHeaderInstructions class.
+ * ModVlanHeaderInstructions class.
*/
@Test
- public void testPopVlanInstructionsEquals() {
+ public void testModVlanHeaderInstructionsEquals() {
new EqualsTester()
- .addEqualityGroup(popVlanInstruction1, sameAsPopVlanInstruction1)
+ .addEqualityGroup(modVlanHeaderInstruction1, sameAsModVlanHeaderInstruction1)
.testEquals();
}
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
index 3d1ed2f..d04acf5 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
@@ -142,9 +142,8 @@
result.put(InstructionCodec.MPLS_LABEL, modMplsLabelInstruction.label().toInt());
break;
case MPLS_PUSH:
- final L2ModificationInstruction.PushHeaderInstructions pushHeaderInstructions =
- (L2ModificationInstruction.PushHeaderInstructions) l2Instruction;
-
+ final L2ModificationInstruction.ModMplsHeaderInstruction pushHeaderInstructions =
+ (L2ModificationInstruction.ModMplsHeaderInstruction) l2Instruction;
result.put(InstructionCodec.ETHERNET_TYPE,
pushHeaderInstructions.ethernetType().toShort());
break;
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java
index 2625db2..6b507e1 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/FlowRuleCodecTest.java
@@ -425,14 +425,14 @@
instruction = getInstruction(Instruction.Type.L2MODIFICATION,
L2ModificationInstruction.L2SubType.MPLS_PUSH.name());
assertThat(instruction.type(), is(Instruction.Type.L2MODIFICATION));
- assertThat(((L2ModificationInstruction.PushHeaderInstructions) instruction)
+ assertThat(((L2ModificationInstruction.ModMplsHeaderInstruction) instruction)
.ethernetType().toShort(),
is(Ethernet.MPLS_UNICAST));
instruction = getInstruction(Instruction.Type.L2MODIFICATION,
L2ModificationInstruction.L2SubType.MPLS_POP.name());
assertThat(instruction.type(), is(Instruction.Type.L2MODIFICATION));
- assertThat(((L2ModificationInstruction.PushHeaderInstructions) instruction)
+ assertThat(((L2ModificationInstruction.ModMplsHeaderInstruction) instruction)
.ethernetType().toShort(),
is(Ethernet.MPLS_UNICAST));
@@ -444,12 +444,12 @@
instruction = getInstruction(Instruction.Type.L2MODIFICATION,
L2ModificationInstruction.L2SubType.VLAN_POP.name());
assertThat(instruction.type(), is(Instruction.Type.L2MODIFICATION));
- assertThat(instruction, instanceOf(L2ModificationInstruction.PopVlanInstruction.class));
+ assertThat(instruction, instanceOf(L2ModificationInstruction.ModVlanHeaderInstruction.class));
instruction = getInstruction(Instruction.Type.L2MODIFICATION,
L2ModificationInstruction.L2SubType.VLAN_PUSH.name());
assertThat(instruction.type(), is(Instruction.Type.L2MODIFICATION));
- assertThat(instruction, instanceOf(L2ModificationInstruction.PushHeaderInstructions.class));
+ assertThat(instruction, instanceOf(L2ModificationInstruction.ModVlanHeaderInstruction.class));
instruction = getInstruction(Instruction.Type.L2MODIFICATION,
L2ModificationInstruction.L2SubType.TUNNEL_ID.name());
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
index 1168a5b..c42d83a 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
@@ -15,10 +15,7 @@
*/
package org.onosproject.codec.impl;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.onosproject.codec.impl.InstructionJsonMatcher.matchesInstruction;
-
+import com.fasterxml.jackson.databind.node.ObjectNode;
import org.junit.Before;
import org.junit.Test;
import org.onlab.packet.Ip4Address;
@@ -40,7 +37,9 @@
import org.onosproject.net.flow.instructions.L2ModificationInstruction;
import org.onosproject.net.flow.instructions.L3ModificationInstruction;
-import com.fasterxml.jackson.databind.node.ObjectNode;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.onosproject.codec.impl.InstructionJsonMatcher.matchesInstruction;
/**
* Unit tests for Instruction codec.
@@ -60,12 +59,12 @@
}
/**
- * Tests the encoding of push header instructions.
+ * Tests the encoding of push mpls header instructions.
*/
@Test
public void pushHeaderInstructionsTest() {
- final L2ModificationInstruction.PushHeaderInstructions instruction =
- (L2ModificationInstruction.PushHeaderInstructions) Instructions.pushMpls();
+ final L2ModificationInstruction.ModMplsHeaderInstruction instruction =
+ (L2ModificationInstruction.ModMplsHeaderInstruction) Instructions.pushMpls();
final ObjectNode instructionJson = instructionCodec.encode(instruction, context);
assertThat(instructionJson, matchesInstruction(instruction));
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java b/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java
index d501522..51a9759 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/InstructionJsonMatcher.java
@@ -29,10 +29,10 @@
import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModOchSignalInstruction;
import org.onosproject.net.flow.instructions.L1ModificationInstruction.ModOduSignalIdInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModEtherInstruction;
+import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModMplsHeaderInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModMplsLabelInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanIdInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction;
-import org.onosproject.net.flow.instructions.L2ModificationInstruction.PushHeaderInstructions;
import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInstruction;
import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction;
@@ -54,10 +54,10 @@
* @param description Description object used for recording errors
* @return true if contents match, false otherwise
*/
- private boolean matchPushHeaderInstruction(JsonNode instructionJson,
- Description description) {
- PushHeaderInstructions instructionToMatch =
- (PushHeaderInstructions) instruction;
+ private boolean matchModMplsHeaderInstruction(JsonNode instructionJson,
+ Description description) {
+ ModMplsHeaderInstruction instructionToMatch =
+ (ModMplsHeaderInstruction) instruction;
final String jsonSubtype = instructionJson.get("subtype").textValue();
if (!instructionToMatch.subtype().name().equals(jsonSubtype)) {
description.appendText("subtype was " + jsonSubtype);
@@ -84,6 +84,8 @@
return true;
}
+ // TODO: need to add matchModVlanHeaderInstruction
+
/**
* Matches the contents of an output instruction.
*
@@ -513,8 +515,8 @@
return false;
}
- if (instruction instanceof PushHeaderInstructions) {
- return matchPushHeaderInstruction(jsonInstruction, description);
+ if (instruction instanceof ModMplsHeaderInstruction) {
+ return matchModMplsHeaderInstruction(jsonInstruction, description);
} else if (instruction instanceof OutputInstruction) {
return matchOutputInstruction(jsonInstruction, description);
} else if (instruction instanceof GroupInstruction) {
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathCompiler.java
index 4e38e34..3f8bba4 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathCompiler.java
@@ -15,16 +15,8 @@
*/
package org.onosproject.net.intent.impl.compiler;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Sets;
import org.onlab.packet.EthType;
import org.onlab.packet.Ethernet;
import org.onlab.packet.MplsLabel;
@@ -52,8 +44,15 @@
import org.onosproject.net.resource.Resources;
import org.slf4j.Logger;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Sets;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
import static org.onosproject.net.LinkKey.linkKey;
@@ -214,10 +213,11 @@
instruction -> instruction instanceof L2ModificationInstruction.ModVlanIdInstruction)
.map(x -> (L2ModificationInstruction.ModVlanIdInstruction) x).findAny();
- Optional<L2ModificationInstruction.PopVlanInstruction> popVlanInstruction = intent.treatment()
+ Optional<L2ModificationInstruction.ModVlanHeaderInstruction> popVlanInstruction = intent.treatment()
.allInstructions().stream().filter(
- instruction -> instruction instanceof L2ModificationInstruction.PopVlanInstruction)
- .map(x -> (L2ModificationInstruction.PopVlanInstruction) x).findAny();
+ instruction -> instruction instanceof
+ L2ModificationInstruction.ModVlanHeaderInstruction)
+ .map(x -> (L2ModificationInstruction.ModVlanHeaderInstruction) x).findAny();
if (!modVlanIdInstruction.isPresent() && !popVlanInstruction.isPresent()) {
if (vlanCriterion.isPresent()) {
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java
index 4e5a602..ae7859c 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java
@@ -317,7 +317,7 @@
.collect(Collectors.toSet()), hasSize(1));
assertThat(vlanMod.iterator().next().vlanId(), is(egressVlan));
assertThat(rule3.treatment().allInstructions().stream()
- .filter(treat -> treat instanceof L2ModificationInstruction.PopVlanInstruction)
+ .filter(treat -> treat instanceof L2ModificationInstruction.ModVlanHeaderInstruction)
.collect(Collectors.toSet()), hasSize(0));
sut.deactivate();
@@ -350,7 +350,7 @@
.filter(treat -> treat instanceof L2ModificationInstruction.ModVlanIdInstruction)
.collect(Collectors.toSet()), hasSize(0));
assertThat(trafficTreatment.allInstructions().stream()
- .filter(treat -> treat instanceof L2ModificationInstruction.PopVlanInstruction)
+ .filter(treat -> treat instanceof L2ModificationInstruction.ModVlanHeaderInstruction)
.collect(Collectors.toSet()), hasSize(1));
}
@@ -436,7 +436,7 @@
.filter(treat -> treat instanceof L2ModificationInstruction.ModMplsLabelInstruction)
.collect(Collectors.toSet()), hasSize(0));
assertThat(trafficTreatment.allInstructions().stream()
- .filter(treat -> treat instanceof L2ModificationInstruction.PushHeaderInstructions)
+ .filter(treat -> treat instanceof L2ModificationInstruction.ModMplsHeaderInstruction)
.collect(Collectors.toSet()), hasSize(1));
}
diff --git a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
index 22e0aad..79461b7 100644
--- a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
+++ b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
@@ -189,6 +189,10 @@
import org.onosproject.net.intent.constraint.WaypointConstraint;
import org.onosproject.net.link.DefaultLinkDescription;
import org.onosproject.net.meter.MeterId;
+import org.onosproject.net.packet.DefaultOutboundPacket;
+import org.onosproject.net.packet.DefaultPacketRequest;
+import org.onosproject.net.packet.PacketPriority;
+import org.onosproject.net.provider.ProviderId;
import org.onosproject.net.resource.ContinuousResource;
import org.onosproject.net.resource.ContinuousResourceId;
import org.onosproject.net.resource.DiscreteResource;
@@ -196,10 +200,6 @@
import org.onosproject.net.resource.DiscreteResourceId;
import org.onosproject.net.resource.ResourceAllocation;
import org.onosproject.net.resource.ResourceConsumerId;
-import org.onosproject.net.packet.DefaultOutboundPacket;
-import org.onosproject.net.packet.DefaultPacketRequest;
-import org.onosproject.net.packet.PacketPriority;
-import org.onosproject.net.provider.ProviderId;
import org.onosproject.security.Permission;
import org.onosproject.store.Timestamp;
import org.onosproject.store.primitives.MapUpdate;
@@ -399,9 +399,11 @@
L2ModificationInstruction.L2SubType.class,
L2ModificationInstruction.ModEtherInstruction.class,
L2ModificationInstruction.PushHeaderInstructions.class,
+ L2ModificationInstruction.PopVlanInstruction.class,
+ L2ModificationInstruction.ModMplsHeaderInstruction.class,
L2ModificationInstruction.ModVlanIdInstruction.class,
L2ModificationInstruction.ModVlanPcpInstruction.class,
- L2ModificationInstruction.PopVlanInstruction.class,
+ L2ModificationInstruction.ModVlanHeaderInstruction.class,
L2ModificationInstruction.ModMplsLabelInstruction.class,
L2ModificationInstruction.ModMplsBosInstruction.class,
L2ModificationInstruction.ModMplsTtlInstruction.class,
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
index cafa7df..cd96472 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
@@ -40,11 +40,12 @@
import org.onosproject.net.flow.instructions.L2ModificationInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModEtherInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModMplsBosInstruction;
+import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModMplsHeaderInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModMplsLabelInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModTunnelIdInstruction;
+import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanHeaderInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanIdInstruction;
import org.onosproject.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction;
-import org.onosproject.net.flow.instructions.L2ModificationInstruction.PushHeaderInstructions;
import org.onosproject.net.flow.instructions.L3ModificationInstruction;
import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpEthInstruction;
import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModArpIPInstruction;
@@ -394,13 +395,13 @@
oxm = factory().oxms().vlanPcp(VlanPcp.of(vlanPcp.vlanPcp()));
break;
case MPLS_PUSH:
- PushHeaderInstructions pushHeaderInstructions =
- (PushHeaderInstructions) l2m;
+ ModMplsHeaderInstruction pushHeaderInstructions =
+ (ModMplsHeaderInstruction) l2m;
return factory().actions().pushMpls(EthType.of(pushHeaderInstructions
.ethernetType().toShort()));
case MPLS_POP:
- PushHeaderInstructions popHeaderInstructions =
- (PushHeaderInstructions) l2m;
+ ModMplsHeaderInstruction popHeaderInstructions =
+ (ModMplsHeaderInstruction) l2m;
return factory().actions().popMpls(EthType.of(popHeaderInstructions
.ethernetType().toShort()));
case MPLS_LABEL:
@@ -419,7 +420,7 @@
case VLAN_POP:
return factory().actions().popVlan();
case VLAN_PUSH:
- PushHeaderInstructions pushVlanInstruction = (PushHeaderInstructions) l2m;
+ ModVlanHeaderInstruction pushVlanInstruction = (ModVlanHeaderInstruction) l2m;
return factory().actions().pushVlan(
EthType.of(pushVlanInstruction.ethernetType().toShort()));
case TUNNEL_ID:
diff --git a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java
index ce2df5f..d473e66 100644
--- a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java
+++ b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/GroupModBuilder.java
@@ -15,14 +15,6 @@
*/
package org.onosproject.provider.of.group.impl;
-import static org.slf4j.LoggerFactory.getLogger;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Optional;
-
import org.onlab.packet.Ip4Address;
import org.onlab.packet.Ip6Address;
import org.onosproject.core.GroupId;
@@ -67,6 +59,14 @@
import org.projectfloodlight.openflow.types.VlanPcp;
import org.slf4j.Logger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Optional;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
/*
* Builder for GroupMod.
*/
@@ -319,18 +319,18 @@
case VLAN_POP:
return factory.actions().popVlan();
case VLAN_PUSH:
- L2ModificationInstruction.PushHeaderInstructions pushVlanInstruction
- = (L2ModificationInstruction.PushHeaderInstructions) l2m;
+ L2ModificationInstruction.ModVlanHeaderInstruction pushVlanInstruction
+ = (L2ModificationInstruction.ModVlanHeaderInstruction) l2m;
return factory.actions().pushVlan(
EthType.of(pushVlanInstruction.ethernetType().toShort()));
case MPLS_PUSH:
- L2ModificationInstruction.PushHeaderInstructions pushHeaderInstructions =
- (L2ModificationInstruction.PushHeaderInstructions) l2m;
+ L2ModificationInstruction.ModMplsHeaderInstruction pushHeaderInstructions =
+ (L2ModificationInstruction.ModMplsHeaderInstruction) l2m;
return factory.actions().pushMpls(EthType.of(pushHeaderInstructions
.ethernetType().toShort()));
case MPLS_POP:
- L2ModificationInstruction.PushHeaderInstructions popHeaderInstructions =
- (L2ModificationInstruction.PushHeaderInstructions) l2m;
+ L2ModificationInstruction.ModMplsHeaderInstruction popHeaderInstructions =
+ (L2ModificationInstruction.ModMplsHeaderInstruction) l2m;
return factory.actions().popMpls(EthType.of(popHeaderInstructions
.ethernetType().toShort()));
case MPLS_LABEL: