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/DefaultTrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
index fbe240a..623ece1 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
@@ -401,6 +401,11 @@
         }
 
         @Override
+        public Builder pushVlan(EthType ethType) {
+            return add(Instructions.pushVlan(ethType));
+        }
+
+        @Override
         public Builder transition(Integer tableId) {
             return add(Instructions.transition(tableId));
         }
diff --git a/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
index d0de8e4..1ccceea 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
@@ -291,6 +291,13 @@
         Builder pushVlan();
 
         /**
+         * Pushes a new VLAN tag using the supplied Ethernet type.
+         *
+         * @return a treatment builder
+         */
+        Builder pushVlan(EthType ethType);
+
+        /**
          * Any instructions preceded by this method call will be deferred.
          * @return a treatment builder
          */
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