[ONOS-3390] Add nicira extension of reg0~7 match to onos-loxi

Change-Id: I0ad76da9b205b9e9d3ffbd184149f88858ada7e3
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 24df9b6..6b47fc3 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -777,12 +777,36 @@
         'of_oxm_och_sigtype' : { 'value' : u8obj },
         'of_oxm_och_sigtype_basic' : { 'value' : u8obj },
         'of_oxm_och_sigid' : {'value' : sig_id},
-        'of_oxm_och_sigid_basic' : {'value' : sig_id},  
+        'of_oxm_och_sigid_basic' : {'value' : sig_id},
 
         'of_bundle_add_msg' : { 'data' : of_message },
 
         'of_oxm_exp_odu_sigtype' : { 'value' : u8obj },
-	'of_oxm_exp_och_sigtype' : { 'value' : u8obj },
+        'of_oxm_exp_och_sigtype' : { 'value' : u8obj },
+
+        'of_oxm_reg0' : { 'value' : u32obj },
+        'of_oxm_reg0_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+
+        'of_oxm_reg1' : { 'value' : u32obj },
+        'of_oxm_reg1_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+
+        'of_oxm_reg2' : { 'value' : u32obj },
+        'of_oxm_reg2_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+
+        'of_oxm_reg3' : { 'value' : u32obj },
+        'of_oxm_reg3_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+
+        'of_oxm_reg4' : { 'value' : u32obj },
+        'of_oxm_reg4_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+
+        'of_oxm_reg5' : { 'value' : u32obj },
+        'of_oxm_reg5_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+
+        'of_oxm_reg6' : { 'value' : u32obj },
+        'of_oxm_reg6_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
+
+        'of_oxm_reg7' : { 'value' : u32obj },
+        'of_oxm_reg7_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
 }
 
 
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 2250832..c911132 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
@@ -276,7 +276,7 @@
     public final static MatchField<CircuitSignalID> OCH_SIGID_BASIC =
             new MatchField<CircuitSignalID>("och_sigid_basic",
                                     MatchFields.OCH_SIGID);
-    
+
     public final static MatchField<OFBooleanValue> BSN_L2_CACHE_HIT =
             new MatchField<OFBooleanValue>("bsn_l2_cache_hit", MatchFields.BSN_L2_CACHE_HIT);
 
@@ -294,16 +294,40 @@
 
     public final static MatchField<OduSignalID> EXP_ODU_SIG_ID =
             new MatchField<OduSignalID>("exp_odu_sig_id", MatchFields.EXP_ODU_SIG_ID);
-    
+
     public final static MatchField<U8> EXP_ODU_SIGTYPE =
             new MatchField<U8>("exp_odu_sigtype", MatchFields.EXP_ODU_SIGTYPE);
-    
+
     public final static MatchField<CircuitSignalID> EXP_OCH_SIG_ID =
             new MatchField<CircuitSignalID>("exp_och_sig_id", MatchFields.EXP_OCH_SIG_ID);
-    
+
     public final static MatchField<U8> EXP_OCH_SIGTYPE =
             new MatchField<U8>("exp_och_sigtype", MatchFields.EXP_OCH_SIGTYPE);
 
+    public final static MatchField<U32> REG0 =
+            new MatchField<U32>("reg0", MatchFields.REG0);
+
+    public final static MatchField<U32> REG1 =
+            new MatchField<U32>("reg1", MatchFields.REG1);
+
+    public final static MatchField<U32> REG2 =
+            new MatchField<U32>("reg2", MatchFields.REG2);
+
+    public final static MatchField<U32> REG3 =
+            new MatchField<U32>("reg3", MatchFields.REG3);
+
+    public final static MatchField<U32> REG4 =
+            new MatchField<U32>("reg4", MatchFields.REG4);
+
+    public final static MatchField<U32> REG5 =
+            new MatchField<U32>("reg5", MatchFields.REG5);
+
+    public final static MatchField<U32> REG6 =
+            new MatchField<U32>("reg6", MatchFields.REG6);
+
+    public final static MatchField<U32> REG7 =
+            new MatchField<U32>("reg7", MatchFields.REG7);
+
     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 4c80d7f..be36713 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
@@ -77,4 +77,12 @@
     EXP_ODU_SIGTYPE,
     EXP_OCH_SIG_ID,
     EXP_OCH_SIGTYPE,
+    REG0,
+    REG1,
+    REG2,
+    REG3,
+    REG4,
+    REG5,
+    REG6,
+    REG7,
 }
diff --git a/openflow_input/oxm_nicira_reg b/openflow_input/oxm_nicira_reg
new file mode 100644
index 0000000..b328dcf
--- /dev/null
+++ b/openflow_input/oxm_nicira_reg
@@ -0,0 +1,126 @@
+// Copyright 2015, Big Switch Networks, Inc.
+//
+// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+// the following special exception:
+//
+// LOXI Exception
+//
+// As a special exception to the terms of the EPL, you may distribute libraries
+// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+// that copyright and licensing notices generated by LoxiGen are not altered or removd
+// from the LoxiGen Libraries and the notice provided below is (i) included in
+// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+// documentation for the LoxiGen Libraries, if distributed in binary form.
+//
+// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by t"
+//
+// You may not use this file except in compliance with the EPL or LOXI Exception. Youn
+// a copy of the EPL at:
+//
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// EPL for the specific language governing permissions and limitations
+// under the EPL.
+
+#version 3
+#version 4
+#version 5
+
+// Nicira extension for reg0
+struct of_oxm_reg0 : of_oxm {
+    uint32_t type_len == 0x00010004;
+    uint32_t value;
+};
+
+struct of_oxm_reg0_masked : of_oxm {
+    uint32_t type_len == 0x00010108;
+    uint32_t value;
+    uint32_t value_mask;
+};
+
+// Nicira extension for reg1
+struct of_oxm_reg1 : of_oxm {
+    uint32_t type_len == 0x00010204;
+    uint32_t value;
+};
+
+struct of_oxm_reg1_masked : of_oxm {
+    uint32_t type_len == 0x00010308;
+    uint32_t value;
+    uint32_t value_mask;
+};
+
+// Nicira extension for reg2
+struct of_oxm_reg2 : of_oxm {
+    uint32_t type_len == 0x00010404;
+    uint32_t value;
+};
+
+struct of_oxm_reg2_masked : of_oxm {
+    uint32_t type_len == 0x00010508;
+    uint32_t value;
+    uint32_t value_mask;
+};
+
+// Nicira extension for reg3
+struct of_oxm_reg3 : of_oxm {
+    uint32_t type_len == 0x00010604;
+    uint32_t value;
+};
+
+struct of_oxm_reg3_masked : of_oxm {
+    uint32_t type_len == 0x00010708;
+    uint32_t value;
+    uint32_t value_mask;
+};
+
+// Nicira extension for reg4
+struct of_oxm_reg4 : of_oxm {
+    uint32_t type_len == 0x00010804;
+    uint32_t value;
+};
+
+struct of_oxm_reg4_masked : of_oxm {
+    uint32_t type_len == 0x00010908;
+    uint32_t value;
+    uint32_t value_mask;
+};
+
+// Nicira extension for reg5
+struct of_oxm_reg5 : of_oxm {
+    uint32_t type_len == 0x00010a04;
+    uint32_t value;
+};
+
+struct of_oxm_reg5_masked : of_oxm {
+    uint32_t type_len == 0x00010b08;
+    uint32_t value;
+    uint32_t value_mask;
+};
+
+// Nicira extension for reg6
+struct of_oxm_reg6 : of_oxm {
+    uint32_t type_len == 0x00010c04;
+    uint32_t value;
+};
+
+struct of_oxm_reg6_masked : of_oxm {
+    uint32_t type_len == 0x00010d08;
+    uint32_t value;
+    uint32_t value_mask;
+};
+
+// Nicira extension for reg7
+struct of_oxm_reg7 : of_oxm {
+    uint32_t type_len == 0x00010e04;
+    uint32_t value;
+};
+
+struct of_oxm_reg7_masked : of_oxm {
+    uint32_t type_len == 0x00011008;
+    uint32_t value;
+    uint32_t value_mask;
+};