Adding support for VLAN_PUSH with EtherType (incl. Q-in-Q)
- Allowing VLAN_PUSH Instruction to use ethernetType (incl. using REST API)
- Adding QINQ (0x88a8) Ethernet type
- Updating InstructionCodec decoders/encoders
- Updating TrafficTreatment/FlowEntryBuilder
Change-Id: I723cc936a8a49c39da9abe65ba9e5b1bdc1392bf
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 aaf37e2..01d2c1e 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
@@ -383,6 +383,18 @@
}
/**
+ * Creates a push VLAN header instruction using the supplied Ethernet type.
+ *
+ * @param ethType the Ethernet type to use
+ * @return a L2 modification
+ */
+ public static Instruction pushVlan(EthType ethType) {
+ return new L2ModificationInstruction.ModVlanHeaderInstruction(
+ L2ModificationInstruction.L2SubType.VLAN_PUSH,
+ ethType);
+ }
+
+ /**
* Sends the packet to the table id.
*
* @param tableId flow rule table id