Extensions added as per new OVS NSH patch

Change-Id: Iae1d9db03dea20120d9c689ea25d262104e937e4
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 72827a1..f9f5728 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -811,23 +811,53 @@
         'of_oxm_reg7' : { 'value' : u32obj },
         'of_oxm_reg7_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
 
-        'of_oxm_nsh_spi' : { 'value' : u32obj },
-        'of_oxm_nsh_spi_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+        'of_oxm_nsp' : { 'value' : u32obj },
+        'of_oxm_nsp_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
 
-        'of_oxm_nsh_si' : { 'value' : u8obj },
-        'of_oxm_nsh_si_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
+        'of_oxm_nsi' : { 'value' : u8obj },
+        'of_oxm_nsi_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
 
-        'of_oxm_nsh_ch1' : { 'value' : u32obj },
-        'of_oxm_nsh_ch1_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+        'of_oxm_nsh_c1' : { 'value' : u32obj },
+        'of_oxm_nsh_c1_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
 
-        'of_oxm_nsh_ch2' : { 'value' : u32obj },
-        'of_oxm_nsh_ch2_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+        'of_oxm_nsh_c2' : { 'value' : u32obj },
+        'of_oxm_nsh_c2_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
 
-        'of_oxm_nsh_ch3' : { 'value' : u32obj },
-        'of_oxm_nsh_ch3_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+        'of_oxm_nsh_c3' : { 'value' : u32obj },
+        'of_oxm_nsh_c3_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
 
-        'of_oxm_nsh_ch4' : { 'value' : u32obj },
-        'of_oxm_nsh_ch4_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+        'of_oxm_nsh_c4' : { 'value' : u32obj },
+        'of_oxm_nsh_c4_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+        
+        'of_oxm_nsh_mdtype' : { 'value' : u8obj },
+        'of_oxm_nsh_mdtype_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
+
+        'of_oxm_nsh_np' : { 'value' : u8obj },
+        'of_oxm_nsh_np_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
+
+        'of_oxm_encap_eth_src' : { 'value' : mac_addr },
+        'of_oxm_encap_eth_src_masked' : { 'value' : mac_addr, 'value_mask' : mac_addr },
+
+        'of_oxm_encap_eth_dst' : { 'value' : mac_addr },
+        'of_oxm_encap_eth_dst_masked' : { 'value' : mac_addr, 'value_mask' : mac_addr },
+
+        'of_oxm_encap_eth_type' : { 'value' : u16obj },
+        'of_oxm_encap_eth_type_masked' : { 'value' : u16obj, 'value_mask' : u16obj },
+
+        'of_oxm_tun_flags' : { 'value' : u16obj },
+        'of_oxm_tun_flags_masked' : { 'value' : u16obj, 'value_mask' : u16obj },
+
+        'of_oxm_tun_gbp_id' : { 'value' : u16obj },
+        'of_oxm_tun_gbp_id_masked' : { 'value' : u16obj, 'value_mask' : u16obj },
+
+        'of_oxm_tun_gbp_flags' : { 'value' : u8obj },
+        'of_oxm_tun_gbp_flags_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
+
+        'of_oxm_tun_gpe_np' : { 'value' : u8obj },
+        'of_oxm_tun_gpe_np_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
+
+        'of_oxm_tun_gpe_flags' : { 'value' : u8obj },
+        'of_oxm_tun_gpe_flags_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
 }
 
 
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java
index ba645ea..eeb734f 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java
@@ -336,23 +336,53 @@
     public final static MatchField<U32> REG7 =
             new MatchField<U32>("reg7", MatchFields.REG7);
 
-    public final static MatchField<U32> NSH_SPI =
-            new MatchField<U32>("set_nsp", MatchFields.NSH_SPI);
+    public final static MatchField<U32> NSP =
+            new MatchField<U32>("nsp", MatchFields.NSP);
 
-    public final static MatchField<U8> NSH_SI =
-            new MatchField<U8>("set_nsi", MatchFields.NSH_SI);
+    public final static MatchField<U8> NSI =
+            new MatchField<U8>("nsi", MatchFields.NSI);
 
-    public final static MatchField<U32> NSH_CH1 =
-            new MatchField<U32>("set_nshc1", MatchFields.NSH_CH1);
+    public final static MatchField<U32> NSH_C1 =
+            new MatchField<U32>("nshc1", MatchFields.NSH_C1);
 
-    public final static MatchField<U32> NSH_CH2 =
-            new MatchField<U32>("set_nshc2", MatchFields.NSH_CH2);
+    public final static MatchField<U32> NSH_C2 =
+            new MatchField<U32>("nshc2", MatchFields.NSH_C2);
 
-    public final static MatchField<U32> NSH_CH3 =
-            new MatchField<U32>("set_nshc3", MatchFields.NSH_CH3);
+    public final static MatchField<U32> NSH_C3 =
+            new MatchField<U32>("nshc3", MatchFields.NSH_C3);
 
-    public final static MatchField<U32> NSH_CH4 =
-            new MatchField<U32>("set_nshc4", MatchFields.NSH_CH4);
+    public final static MatchField<U32> NSH_C4 =
+            new MatchField<U32>("nshc4", MatchFields.NSH_C4);
+
+    public final static MatchField<U8> NSH_MDTYPE =
+            new MatchField<U8>("nsh_mdtype", MatchFields.NSH_MDTYPE);
+
+    public final static MatchField<U8> NSH_NP =
+            new MatchField<U8>("nsh_np", MatchFields.NSH_NP);
+
+    public final static MatchField<MacAddress> ENCAP_ETH_SRC =
+            new MatchField<MacAddress>("encap_eth_src", MatchFields.ENCAP_ETH_SRC);
+
+    public final static MatchField<MacAddress> ENCAP_ETH_DST =
+            new MatchField<MacAddress>("encap_eth_dst", MatchFields.ENCAP_ETH_DST);
+
+    public final static MatchField<U16> ENCAP_ETH_TYPE =
+            new MatchField<U16>("encap_eth_type", MatchFields.ENCAP_ETH_TYPE);
+
+    public final static MatchField<U16> TUN_FLAGS =
+            new MatchField<U16>("tun_flags", MatchFields.TUN_FLAGS);
+
+    public final static MatchField<U16> TUN_GBP_ID =
+            new MatchField<U16>("tun_gbp_id", MatchFields.TUN_GBP_ID);
+
+    public final static MatchField<U8> TUN_GBP_FLAGS =
+            new MatchField<U8>("tun_gbp_flags", MatchFields.TUN_GBP_FLAGS);
+
+    public final static MatchField<U8> TUN_GPE_NP =
+            new MatchField<U8>("tun_gpe_np", MatchFields.TUN_GPE_NP);
+
+    public final static MatchField<U8> TUN_GPE_FLAGS =
+            new MatchField<U8>("tun_gpe_flags", MatchFields.TUN_GPE_NP);
 
     public String getName() {
         return name;
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java
index 0e88a1e..7d1b09e 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java
@@ -87,10 +87,20 @@
     REG5,
     REG6,
     REG7,
-    NSH_SPI,
-    NSH_SI,
-    NSH_CH1,
-    NSH_CH2,
-    NSH_CH3,
-    NSH_CH4,
+    NSP,
+    NSI,
+    NSH_C1,
+    NSH_C2,
+    NSH_C3,
+    NSH_C4,
+    NSH_MDTYPE,
+    NSH_NP,
+    ENCAP_ETH_SRC,
+    ENCAP_ETH_DST,
+    ENCAP_ETH_TYPE,
+    TUN_FLAGS,
+    TUN_GBP_ID,
+    TUN_GBP_FLAGS,
+    TUN_GPE_NP,
+    TUN_GPE_FLAGS,
 }
diff --git a/openflow_input/nicira_set_nsh b/openflow_input/nicira_set_nsh
index 04bee49..ec29cc2 100644
--- a/openflow_input/nicira_set_nsh
+++ b/openflow_input/nicira_set_nsh
@@ -27,56 +27,20 @@
 
 #version any
 
-struct of_action_nicira_set_nsp : of_action_nicira {
+struct of_action_nicira_push_nsh : of_action_nicira {
     uint16_t type == 65535;
     uint16_t len;
     uint32_t experimenter == 0x2320;
-    uint16_t subtype == 32;
+    uint16_t subtype == 38;
     pad(2);
-    uint32_t nsp;
+    pad(4);
 };
 
-struct of_action_nicira_set_nsi : of_action_nicira {
+struct of_action_nicira_pop_nsh : of_action_nicira {
     uint16_t type == 65535;
     uint16_t len;
     uint32_t experimenter == 0x2320;
-    uint16_t subtype == 33;
-    uint8_t nsi;
-    pad(5);
-};
-
-struct of_action_nicira_set_nshc1 : of_action_nicira {
-    uint16_t type == 65535;
-    uint16_t len;
-    uint32_t experimenter == 0x2320;
-    uint16_t subtype == 34;
+    uint16_t subtype == 39;
     pad(2);
-    uint32_t nshc1;
-};
-
-struct of_action_nicira_set_nshc2 : of_action_nicira {
-    uint16_t type == 65535;
-    uint16_t len;
-    uint32_t experimenter == 0x2320;
-    uint16_t subtype == 35;
-    pad(2);
-    uint32_t nshc2;
-};
-
-struct of_action_nicira_set_nshc3 : of_action_nicira {
-    uint16_t type == 65535;
-    uint16_t len;
-    uint32_t experimenter == 0x2320;
-    uint16_t subtype == 36;
-    pad(2);
-    uint32_t nshc3;
-};
-
-struct of_action_nicira_set_nshc4 : of_action_nicira {
-    uint16_t type == 65535;
-    uint16_t len;
-    uint32_t experimenter == 0x2320;
-    uint16_t subtype == 37;
-    pad(2);
-    uint32_t nshc4;
+    pad(4);
 };
diff --git a/openflow_input/oxm_nicira_nsh b/openflow_input/oxm_nicira_nsh
index eb32b4d..2ab12e8 100644
--- a/openflow_input/oxm_nicira_nsh
+++ b/openflow_input/oxm_nicira_nsh
@@ -29,75 +29,141 @@
 #version 4
 #version 5
 
-// Nicira extension for nsh_spi (37)
-struct of_oxm_nsh_spi : of_oxm {
-    uint32_t type_len == 0x00014a04;
+// Nicira extension for nsp (113)
+struct of_oxm_nsp : of_oxm {
+    uint32_t type_len == 0x0001e204;
     uint32_t value;
 };
 
-struct of_oxm_nsh_spi_masked : of_oxm {
-    uint32_t type_len == 0x00014b08;
+struct of_oxm_nsp_masked : of_oxm {
+    uint32_t type_len == 0x0001e308;
     uint32_t value;
     uint32_t value_mask;
 };
 
-// Nicira extension for nsh_si (38)
-struct of_oxm_nsh_si : of_oxm {
-    uint32_t type_len == 0x00014c04;
+// Nicira extension for nsi (114)
+struct of_oxm_nsi : of_oxm {
+    uint32_t type_len == 0x0001e401;
     uint8_t value;
 };
 
-struct of_oxm_nsh_si_masked : of_oxm {
-    uint32_t type_len == 0x00014d08;
+struct of_oxm_nsi_masked : of_oxm {
+    uint32_t type_len == 0x0001e502;
     uint8_t value;
     uint8_t value_mask;
 };
 
-// Nicira extension for nsh_ch1 (39)
-struct of_oxm_nsh_ch1 : of_oxm {
-    uint32_t type_len == 0x00014e04;
+// Nicira extension for nsh_c1 (115)
+struct of_oxm_nsh_c1 : of_oxm {
+    uint32_t type_len == 0x0001e604;
     uint32_t value;
 };
 
-struct of_oxm_nsh_ch1_masked : of_oxm {
-    uint32_t type_len == 0x00014f08;
+struct of_oxm_nsh_c1_masked : of_oxm {
+    uint32_t type_len == 0x0001e708;
     uint32_t value;
     uint32_t value_mask;
 };
 
-// Nicira extension for nsh_ch2 (40)
-struct of_oxm_nsh_ch2 : of_oxm {
-    uint32_t type_len == 0x00015004;
+// Nicira extension for nsh_c2 (116)
+struct of_oxm_nsh_c2 : of_oxm {
+    uint32_t type_len == 0x0001e804;
     uint32_t value;
 };
 
-struct of_oxm_nsh_ch2_masked : of_oxm {
-    uint32_t type_len == 0x00015108;
+struct of_oxm_nsh_c2_masked : of_oxm {
+    uint32_t type_len == 0x0001e908;
     uint32_t value;
     uint32_t value_mask;
 };
 
 
-// Nicira extension for nsh_ch3 (41)
-struct of_oxm_nsh_ch3 : of_oxm {
-    uint32_t type_len == 0x00015204;
+// Nicira extension for nsh_c3 (117)
+struct of_oxm_nsh_c3 : of_oxm {
+    uint32_t type_len == 0x0001ea04;
     uint32_t value;
 };
 
-struct of_oxm_nsh_ch3_masked : of_oxm {
-    uint32_t type_len == 0x00015308;
+struct of_oxm_nsh_c3_masked : of_oxm {
+    uint32_t type_len == 0x0001eb08;
     uint32_t value;
     uint32_t value_mask;
 };
 
-// Nicira extension for nsh_ch4 (42)
-struct of_oxm_nsh_ch4 : of_oxm {
-    uint32_t type_len == 0x00015404;
+// Nicira extension for nsh_c4 (118)
+struct of_oxm_nsh_c4 : of_oxm {
+    uint32_t type_len == 0x0001ec04;
     uint32_t value;
 };
 
-struct of_oxm_nsh_ch4_masked : of_oxm {
-    uint32_t type_len == 0x00015508;
+struct of_oxm_nsh_c4_masked : of_oxm {
+    uint32_t type_len == 0x0001ed08;
     uint32_t value;
     uint32_t value_mask;
 };
+
+
+// Nicira extension for nsh_mdtype (119)
+struct of_oxm_nsh_mdtype : of_oxm {
+    uint32_t type_len == 0x0001ee01;
+    uint8_t value;
+};
+
+struct of_oxm_nsh_mdtype_masked : of_oxm {
+    uint32_t type_len == 0x0001ef02;
+    uint8_t value;
+    uint8_t value_mask;
+};
+
+
+// Nicira extension for nsh_np (120)
+struct of_oxm_nsh_np : of_oxm {
+    uint32_t type_len == 0x0001f001;
+    uint8_t value;
+};
+
+struct of_oxm_nsh_np_masked : of_oxm {
+    uint32_t type_len == 0x0001f102;
+    uint8_t value;
+    uint8_t value_mask;
+};
+
+
+// Nicira extension for encap_eth_src (121)
+struct of_oxm_encap_eth_src : of_oxm {
+    uint32_t type_len == 0x0001f206;
+    of_mac_addr_t value;
+};
+
+struct of_oxm_encap_eth_src_masked : of_oxm {
+    uint32_t type_len == 0x0001f30c;
+    of_mac_addr_t value;
+    of_mac_addr_t value_mask;
+
+};
+
+
+// Nicira extension for encap_eth_dst (122)
+struct of_oxm_encap_eth_dst : of_oxm {
+    uint32_t type_len == 0x0001f406;
+    of_mac_addr_t value;
+};
+
+struct of_oxm_encap_eth_dst_masked : of_oxm {
+    uint32_t type_len == 0x0001f50c;
+    of_mac_addr_t value;
+    of_mac_addr_t value_mask;
+};
+
+
+// Nicira extension for encap_eth_type (123)
+struct of_oxm_encap_eth_type : of_oxm {
+    uint32_t type_len == 0x0001f602;
+    uint16_t value;
+};
+
+struct of_oxm_encap_eth_type_masked : of_oxm {
+    uint32_t type_len == 0x0001f704;
+    uint16_t value;
+    uint16_t value_mask;
+};
diff --git a/openflow_input/oxm_nicira_tun b/openflow_input/oxm_nicira_tun
index 408f63e..9e73fec 100644
--- a/openflow_input/oxm_nicira_tun
+++ b/openflow_input/oxm_nicira_tun
@@ -52,3 +52,64 @@
     of_ipv4_t value;
     of_ipv4_t value_mask;
 };
+
+// Nicira extension for tun_flags (104)
+struct of_oxm_tun_flags : of_oxm {
+    uint32_t type_len == 0x0001d002;
+    uint16_t value;
+};
+
+struct of_oxm_tun_flags_masked : of_oxm {
+    uint32_t type_len == 0x0001d104;
+    uint16_t value;
+    uint16_t value_mask;
+};
+
+// Nicira extension for tun_gbp_id (38)
+struct of_oxm_tun_gbp_id : of_oxm {
+    uint32_t type_len == 0x00014c02;
+    uint16_t value;
+};
+
+struct of_oxm_tun_gbp_id_masked : of_oxm {
+    uint32_t type_len == 0x00014d04;
+    uint16_t value;
+    uint16_t value_mask;
+};
+
+// Nicira extension for tun_gbp_flags (39)
+struct of_oxm_tun_gbp_flags : of_oxm {
+    uint32_t type_len == 0x00014e01;
+    uint8_t value;
+};
+
+struct of_oxm_tun_gbp_flags_masked : of_oxm {
+    uint32_t type_len == 0x00014f02;
+    uint8_t value;
+    uint8_t value_mask;
+};
+
+// Nicira extension for tun_gpe_np (111)
+struct of_oxm_tun_gpe_np : of_oxm {
+    uint32_t type_len == 0x0001de01;
+    uint8_t value;
+};
+
+struct of_oxm_tun_gpe_np_masked : of_oxm {
+    uint32_t type_len == 0x0001df02;
+    uint8_t value;
+    uint8_t value_mask;
+};
+
+// Nicira extension for tun_gpe_flags (112)
+struct of_oxm_tun_gpe_flags : of_oxm {
+    uint32_t type_len == 0x0001e001;
+    uint8_t value;
+};
+
+struct of_oxm_tun_gpe_flags_masked : of_oxm {
+    uint32_t type_len == 0x0001e102;
+    uint8_t value;
+    uint8_t value_mask;
+};
+