Merge branch 'master' of github.com:floodlight/loxigen
diff --git a/c_gen/c_match.py b/c_gen/c_match.py
index 270a6ba..4001612 100644
--- a/c_gen/c_match.py
+++ b/c_gen/c_match.py
@@ -289,6 +289,11 @@
 
     OF_OXM_INDEX_BSN_IN_PORTS_128 = 36,
     OF_OXM_INDEX_BSN_LAG_ID = 37,
+    OF_OXM_INDEX_BSN_VRF = 38,
+    OF_OXM_INDEX_BSN_GLOBAL_VRF_ALLOWED = 39,
+    OF_OXM_INDEX_BSN_L3_INTERFACE_CLASS_ID = 40,
+    OF_OXM_INDEX_BSN_L3_SRC_CLASS_ID = 41,
+    OF_OXM_INDEX_BSN_L3_DST_CLASS_ID = 42,
 };
 
 #define OF_OXM_BIT(index) (((uint64_t) 1) << (index))
diff --git a/c_gen/c_type_maps.py b/c_gen/c_type_maps.py
index ab4b3e0..8883193 100644
--- a/c_gen/c_type_maps.py
+++ b/c_gen/c_type_maps.py
@@ -600,6 +600,16 @@
         case 0x01: return OF_OXM_BSN_IN_PORTS_128_MASKED;
         case 0x02: return OF_OXM_BSN_LAG_ID;
         case 0x03: return OF_OXM_BSN_LAG_ID_MASKED;
+        case 0x04: return OF_OXM_BSN_VRF;
+        case 0x05: return OF_OXM_BSN_VRF_MASKED;
+        case 0x06: return OF_OXM_BSN_GLOBAL_VRF_ALLOWED;
+        case 0x07: return OF_OXM_BSN_GLOBAL_VRF_ALLOWED_MASKED;
+        case 0x08: return OF_OXM_BSN_L3_INTERFACE_CLASS_ID;
+        case 0x09: return OF_OXM_BSN_L3_INTERFACE_CLASS_ID_MASKED;
+        case 0x0a: return OF_OXM_BSN_L3_SRC_CLASS_ID;
+        case 0x0b: return OF_OXM_BSN_L3_SRC_CLASS_ID_MASKED;
+        case 0x0c: return OF_OXM_BSN_L3_DST_CLASS_ID;
+        case 0x0d: return OF_OXM_BSN_L3_DST_CLASS_ID_MASKED;
         default: return OF_OBJECT_INVALID;
         }
     } else {
diff --git a/c_gen/templates/loci_show.h b/c_gen/templates/loci_show.h
index de96a4b..f4d3f92 100644
--- a/c_gen/templates/loci_show.h
+++ b/c_gen/templates/loci_show.h
@@ -346,5 +346,10 @@
 #define LOCI_SHOW_u32_tx_interval_ms(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
 #define LOCI_SHOW_u8_slot_num(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
 #define LOCI_SHOW_u32_bsn_lag_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_bsn_vrf(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u8_bsn_global_vrf_allowed(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u32_bsn_l3_interface_class_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_bsn_l3_src_class_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_bsn_l3_dst_class_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
 
 #endif /* _LOCI_SHOW_H_ */
diff --git a/c_gen/templates/of_type_maps.c b/c_gen/templates/of_type_maps.c
index df49492..fabd25f 100644
--- a/c_gen/templates/of_type_maps.c
+++ b/c_gen/templates/of_type_maps.c
@@ -596,6 +596,36 @@
     case OF_OXM_BSN_LAG_ID_MASKED:
         type_len = 0x00030300 | (type_len & 0xff);
         break;
+    case OF_OXM_BSN_VRF:
+        type_len = 0x00030400 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_VRF_MASKED:
+        type_len = 0x00030500 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_GLOBAL_VRF_ALLOWED:
+        type_len = 0x00030600 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_GLOBAL_VRF_ALLOWED_MASKED:
+        type_len = 0x00030700 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_L3_INTERFACE_CLASS_ID:
+        type_len = 0x00030800 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_L3_INTERFACE_CLASS_ID_MASKED:
+        type_len = 0x00030900 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_L3_SRC_CLASS_ID:
+        type_len = 0x00030a00 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_L3_SRC_CLASS_ID_MASKED:
+        type_len = 0x00030b00 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_L3_DST_CLASS_ID:
+        type_len = 0x00030c00 | (type_len & 0xff);
+        break;
+    case OF_OXM_BSN_L3_DST_CLASS_ID_MASKED:
+        type_len = 0x00030d00 | (type_len & 0xff);
+        break;
     default:
         wire_type = of_object_to_wire_type(id, obj->version);
         ASSERT(wire_type >= 0);
diff --git a/java_gen/java_model.py b/java_gen/java_model.py
index 2ffec92..2b17afa 100644
--- a/java_gen/java_model.py
+++ b/java_gen/java_model.py
@@ -143,6 +143,16 @@
                 "OFOxmBsnInPorts128Masked": OxmMapEntry("OFBitMask128", "BSN_IN_PORTS_128", True),
                 "OFOxmBsnLagId":            OxmMapEntry("LagId", "BSN_LAG_ID", False),
                 "OFOxmBsnLagIdMasked":      OxmMapEntry("LagId", "BSN_LAG_ID", True),
+                "OFOxmBsnVrf":              OxmMapEntry("VRF", "BSN_VRF", False),
+                "OFOxmBsnVrfMasked":        OxmMapEntry("VRF", "BSN_VRF", True),
+                "OFOxmBsnGlobalVrfAllowed":          OxmMapEntry("OFBooleanValue", "BSN_GLOBAL_VRF_ALLOWED", False),
+                "OFOxmBsnGlobalVrfAllowedMasked":    OxmMapEntry("OFBooleanValue", "BSN_GLOBAL_VRF_ALLOWED", True),
+                "OFOxmBsnL3InterfaceClassId":        OxmMapEntry("ClassId", "BSN_L3_INTERFACE_CLASS_ID", False),
+                "OFOxmBsnL3InterfaceClassIdMasked":  OxmMapEntry("ClassId", "BSN_L3_INTERFACE_CLASS_ID", True),
+                "OFOxmBsnL3SrcClassId":              OxmMapEntry("ClassId", "BSN_L3_SRC_CLASS_ID", False),
+                "OFOxmBsnL3SrcClassIdMasked":        OxmMapEntry("ClassId", "BSN_L3_SRC_CLASS_ID", True),
+                "OFOxmBsnL3DstClassId":              OxmMapEntry("ClassId", "BSN_L3_DST_CLASS_ID", False),
+                "OFOxmBsnL3DstClassIdMasked":        OxmMapEntry("ClassId", "BSN_L3_DST_CLASS_ID", True),
                 }
 
     # Registry of nullable properties:
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 0bae34a..2772a86 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -464,6 +464,12 @@
          .op(read="OFBufferId.of(bb.readInt())", write="bb.writeInt($name.getInt())", default="OFBufferId.NO_BUFFER")
 lag_id = JType("LagId") \
          .op(version=ANY, read="LagId.read4Bytes(bb)", write="$name.write4Bytes(bb)", default="LagId.NONE")
+vrf = JType("VRF") \
+         .op(version=ANY, read="VRF.read4Bytes(bb)", write="$name.write4Bytes(bb)", default="VRF.ZERO")
+class_id = JType("ClassId") \
+         .op(version=ANY, read="ClassId.read4Bytes(bb)", write="$name.write4Bytes(bb)", default="ClassId.NONE")
+boolean_value = JType('OFBooleanValue', 'OFBooleanValue') \
+        .op(read='OFBooleanValue.of(bb.readByte() != 0)', write='bb.writeByte($name.getInt())', default="OFBooleanValue.FALSE")
 
 generic_t = JType("T")
 
@@ -557,6 +563,21 @@
         'of_oxm_bsn_lag_id' : { 'value' : lag_id },
         'of_oxm_bsn_lag_id_masked' : { 'value' : lag_id, 'value_mask' : lag_id },
 
+        'of_oxm_bsn_vrf' : { 'value' : vrf },
+        'of_oxm_bsn_vrf_masked' : { 'value' : vrf, 'value_mask' : vrf },
+
+        'of_oxm_bsn_global_vrf_allowed' : { 'value' : boolean_value },
+        'of_oxm_bsn_global_vrf_allowed_masked' : { 'value' : boolean_value, 'value_mask' : boolean_value },
+
+        'of_oxm_bsn_l3_interface_class_id' : { 'value' : class_id },
+        'of_oxm_bsn_l3_interface_class_id_masked' : { 'value' : class_id, 'value_mask' : class_id },
+
+        'of_oxm_bsn_l3_src_class_id' : { 'value' : class_id },
+        'of_oxm_bsn_l3_src_class_id_masked' : { 'value' : class_id, 'value_mask' : class_id },
+
+        'of_oxm_bsn_l3_dst_class_id' : { 'value' : class_id },
+        'of_oxm_bsn_l3_dst_class_id_masked' : { 'value' : class_id, 'value_mask' : class_id },
+
         'of_table_stats_entry': { 'wildcards': table_stats_wildcards },
         'of_match_v1': { 'vlan_vid' : vlan_vid, 'vlan_pcp': vlan_pcp,
                 'eth_type': eth_type, 'ip_dscp': ip_dscp, 'ip_proto': ip_proto,
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 574cb55..1831626 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
@@ -1,6 +1,7 @@
 package org.projectfloodlight.openflow.protocol.match;
 
 import org.projectfloodlight.openflow.types.ArpOpcode;
+import org.projectfloodlight.openflow.types.ClassId;
 import org.projectfloodlight.openflow.types.EthType;
 import org.projectfloodlight.openflow.types.ICMPv4Code;
 import org.projectfloodlight.openflow.types.ICMPv4Type;
@@ -13,6 +14,7 @@
 import org.projectfloodlight.openflow.types.LagId;
 import org.projectfloodlight.openflow.types.MacAddress;
 import org.projectfloodlight.openflow.types.OFBitMask128;
+import org.projectfloodlight.openflow.types.OFBooleanValue;
 import org.projectfloodlight.openflow.types.OFMetadata;
 import org.projectfloodlight.openflow.types.OFPort;
 import org.projectfloodlight.openflow.types.OFValueType;
@@ -21,6 +23,7 @@
 import org.projectfloodlight.openflow.types.U8;
 import org.projectfloodlight.openflow.types.VlanPcp;
 import org.projectfloodlight.openflow.types.VlanVid;
+import org.projectfloodlight.openflow.types.VRF;
 
 @SuppressWarnings("unchecked")
 public class MatchField<F extends OFValueType<F>> {
@@ -178,6 +181,21 @@
     public final static MatchField<LagId> BSN_LAG_ID =
             new MatchField<LagId>("bsn_lag_id", MatchFields.BSN_LAG_ID);
 
+    public final static MatchField<VRF> BSN_VRF =
+            new MatchField<VRF>("bsn_vrf", MatchFields.BSN_VRF);
+
+    public final static MatchField<OFBooleanValue> BSN_GLOBAL_VRF_ALLOWED =
+            new MatchField<OFBooleanValue>("bsn_global_vrf_allowed", MatchFields.BSN_GLOBAL_VRF_ALLOWED);
+
+    public final static MatchField<ClassId> BSN_L3_INTERFACE_CLASS_ID =
+            new MatchField<ClassId>("bsn_l3_interface_class_id", MatchFields.BSN_L3_INTERFACE_CLASS_ID);
+
+    public final static MatchField<ClassId> BSN_L3_SRC_CLASS_ID =
+            new MatchField<ClassId>("bsn_l3_src_class_id", MatchFields.BSN_L3_SRC_CLASS_ID);
+
+    public final static MatchField<ClassId> BSN_L3_DST_CLASS_ID =
+            new MatchField<ClassId>("bsn_l3_dst_class_id", MatchFields.BSN_L3_DST_CLASS_ID);
+
     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 e41f786..6d9b20e 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
@@ -40,4 +40,9 @@
     MPLS_TC,
     BSN_IN_PORTS_128,
     BSN_LAG_ID,
+    BSN_VRF,
+    BSN_GLOBAL_VRF_ALLOWED,
+    BSN_L3_INTERFACE_CLASS_ID,
+    BSN_L3_SRC_CLASS_ID,
+    BSN_L3_DST_CLASS_ID,
 }
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
index 72ed3da..b082f8b 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
@@ -2,6 +2,8 @@
 
 import javax.annotation.concurrent.Immutable;
 
+import org.jboss.netty.buffer.ChannelBuffer;
+
 import com.google.common.hash.PrimitiveSink;
 import com.google.common.primitives.UnsignedInts;
 
@@ -65,6 +67,14 @@
         return true;
     }
 
+    public void write4Bytes(ChannelBuffer c) {
+        c.writeInt(rawValue);
+    }
+
+    public static ClassId read4Bytes(ChannelBuffer c) {
+        return ClassId.of(c.readInt());
+    }
+
     @Override
     public int compareTo(ClassId o) {
         return UnsignedInts.compare(rawValue, rawValue);
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBooleanValue.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBooleanValue.java
new file mode 100644
index 0000000..b386e54
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFBooleanValue.java
@@ -0,0 +1,107 @@
+/**
+ *    Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
+ *    University
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *    not use this file except in compliance with the License. You may obtain
+ *    a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    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
+ *    License for the specific language governing permissions and limitations
+ *    under the License.
+ **/
+
+package org.projectfloodlight.openflow.types;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.projectfloodlight.openflow.exceptions.OFParseError;
+import org.projectfloodlight.openflow.protocol.OFMessageReader;
+import org.projectfloodlight.openflow.protocol.Writeable;
+
+import com.google.common.hash.PrimitiveSink;
+
+public class OFBooleanValue implements Writeable, OFValueType<OFBooleanValue> {
+    public final static OFBooleanValue TRUE = new OFBooleanValue(true);
+    public final static OFBooleanValue FALSE = new OFBooleanValue(false);
+
+    private final boolean value;
+
+    private OFBooleanValue(boolean value) {
+      this.value = value;
+    }
+
+    public static OFBooleanValue of(boolean value) {
+      return value ? TRUE : FALSE;
+    }
+
+    public boolean getValue() {
+      return value;
+    }
+
+    public int getInt() {
+      return value ? 1 : 0;
+    }
+
+    @Override
+    public String toString() {
+        return "" + value;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + getInt();
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        OFBooleanValue other = (OFBooleanValue) obj;
+        if (value != other.value)
+            return false;
+        return true;
+    }
+
+    @Override
+    public void writeTo(ChannelBuffer bb) {
+        bb.writeByte(getInt());
+    }
+
+    private static class Reader implements OFMessageReader<OFBooleanValue> {
+        @Override
+        public OFBooleanValue readFrom(ChannelBuffer bb) throws OFParseError {
+            return of(bb.readByte() != 0);
+        }
+    }
+
+    @Override
+    public int getLength() {
+        return 1;
+    }
+
+    @Override
+    public OFBooleanValue applyMask(OFBooleanValue mask) {
+        return of(value && mask.value);
+    }
+
+    @Override
+    public int compareTo(OFBooleanValue o) {
+        return getInt() - o.getInt();
+    }
+
+    @Override
+    public void putTo(PrimitiveSink sink) {
+        sink.putByte((byte)getInt());
+    }
+}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VRF.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VRF.java
index b3f187f..b742da5 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VRF.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VRF.java
@@ -12,6 +12,7 @@
     static final int LENGTH = 4;
     private final int rawValue;
 
+    public static final VRF ZERO = VRF.of(0x0);
     public static final VRF NO_MASK = VRF.of(0xFFFFFFFF);
     public static final VRF FULL_MASK = VRF.of(0x00000000);
 
diff --git a/loxi_front_end/match.py b/loxi_front_end/match.py
index c0e5188..c715455 100644
--- a/loxi_front_end/match.py
+++ b/loxi_front_end/match.py
@@ -414,6 +414,51 @@
         takes_mask_in_spec=False,
         order=1001,
         ),
+
+    bsn_vrf = dict(
+        name="bsn_vrf",
+        m_type="uint32_t",
+        print_type="PRIu32",
+        conditions="",
+        takes_mask_in_spec=False,
+        order=1002,
+        ),
+
+    bsn_global_vrf_allowed = dict(
+        name="bsn_global_vrf_allowed",
+        m_type="uint8_t",
+        print_type="PRIu8",
+        conditions="",
+        takes_mask_in_spec=False,
+        order=1003,
+        ),
+
+    bsn_l3_interface_class_id = dict(
+        name="bsn_l3_interface_class_id",
+        m_type="uint32_t",
+        print_type="PRIu32",
+        conditions="",
+        takes_mask_in_spec=True,
+        order=1003,
+        ),
+
+    bsn_l3_src_class_id = dict(
+        name="bsn_l3_src_class_id",
+        m_type="uint32_t",
+        print_type="PRIu32",
+        conditions="",
+        takes_mask_in_spec=True,
+        order=1004,
+        ),
+
+    bsn_l3_dst_class_id = dict(
+        name="bsn_l3_dst_class_id",
+        m_type="uint32_t",
+        print_type="PRIu32",
+        conditions="",
+        takes_mask_in_spec=True,
+        order=1005,
+        ),
 )
 
 match_keys_sorted = of_match_members.keys()
diff --git a/openflow_input/bsn_global_vrf_allowed b/openflow_input/bsn_global_vrf_allowed
new file mode 100644
index 0000000..543c6fd
--- /dev/null
+++ b/openflow_input/bsn_global_vrf_allowed
@@ -0,0 +1,47 @@
+// Copyright 2013, 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 removed
+// 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 the LoxiGen Compiler."
+//
+// You may not use this file except in compliance with the EPL or
+// LOXI Exception. You may obtain 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
+
+/*
+ * Global VRF allowed flag for SwitchLight
+ */
+
+struct of_oxm_bsn_global_vrf_allowed : of_oxm {
+    uint32_t type_len == 0x00030601;
+    uint8_t value;
+};
+
+struct of_oxm_bsn_global_vrf_allowed_masked : of_oxm {
+    uint32_t type_len == 0x00030701;
+    uint8_t value;
+    uint8_t value_mask;
+};
diff --git a/openflow_input/bsn_l3_dst_class_id b/openflow_input/bsn_l3_dst_class_id
new file mode 100644
index 0000000..385add7
--- /dev/null
+++ b/openflow_input/bsn_l3_dst_class_id
@@ -0,0 +1,47 @@
+// Copyright 2013, 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 removed
+// 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 the LoxiGen Compiler."
+//
+// You may not use this file except in compliance with the EPL or
+// LOXI Exception. You may obtain 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
+
+/*
+ * L3 destination class ID for SwitchLight
+ */
+
+struct of_oxm_bsn_l3_dst_class_id : of_oxm {
+    uint32_t type_len == 0x00030c04;
+    uint32_t value;
+};
+
+struct of_oxm_bsn_l3_dst_class_id_masked : of_oxm {
+    uint32_t type_len == 0x00030d04;
+    uint32_t value;
+    uint32_t value_mask;
+};
diff --git a/openflow_input/bsn_l3_interface_class_id b/openflow_input/bsn_l3_interface_class_id
new file mode 100644
index 0000000..efeb949
--- /dev/null
+++ b/openflow_input/bsn_l3_interface_class_id
@@ -0,0 +1,47 @@
+// Copyright 2013, 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 removed
+// 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 the LoxiGen Compiler."
+//
+// You may not use this file except in compliance with the EPL or
+// LOXI Exception. You may obtain 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
+
+/*
+ * L3 interface class ID for SwitchLight
+ */
+
+struct of_oxm_bsn_l3_interface_class_id : of_oxm {
+    uint32_t type_len == 0x00030804;
+    uint32_t value;
+};
+
+struct of_oxm_bsn_l3_interface_class_id_masked : of_oxm {
+    uint32_t type_len == 0x00030904;
+    uint32_t value;
+    uint32_t value_mask;
+};
diff --git a/openflow_input/bsn_l3_src_class_id b/openflow_input/bsn_l3_src_class_id
new file mode 100644
index 0000000..f18aab9
--- /dev/null
+++ b/openflow_input/bsn_l3_src_class_id
@@ -0,0 +1,47 @@
+// Copyright 2013, 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 removed
+// 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 the LoxiGen Compiler."
+//
+// You may not use this file except in compliance with the EPL or
+// LOXI Exception. You may obtain 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
+
+/*
+ * L3 source class ID for SwitchLight
+ */
+
+struct of_oxm_bsn_l3_src_class_id : of_oxm {
+    uint32_t type_len == 0x00030a04;
+    uint32_t value;
+};
+
+struct of_oxm_bsn_l3_src_class_id_masked : of_oxm {
+    uint32_t type_len == 0x00030b04;
+    uint32_t value;
+    uint32_t value_mask;
+};
diff --git a/openflow_input/bsn_vrf b/openflow_input/bsn_vrf
new file mode 100644
index 0000000..3641faa
--- /dev/null
+++ b/openflow_input/bsn_vrf
@@ -0,0 +1,47 @@
+// Copyright 2013, 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 removed
+// 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 the LoxiGen Compiler."
+//
+// You may not use this file except in compliance with the EPL or
+// LOXI Exception. You may obtain 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
+
+/*
+ * Virtual Routing/Forwarding ID for SwitchLight
+ */
+
+struct of_oxm_bsn_vrf : of_oxm {
+    uint32_t type_len == 0x00030404;
+    uint32_t value;
+};
+
+struct of_oxm_bsn_vrf_masked : of_oxm {
+    uint32_t type_len == 0x00030504;
+    uint32_t value;
+    uint32_t value_mask;
+};
diff --git a/test_data/of13/oxm_bsn_global_vrf_allowed.data b/test_data/of13/oxm_bsn_global_vrf_allowed.data
new file mode 100644
index 0000000..d5fe8d7
--- /dev/null
+++ b/test_data/of13/oxm_bsn_global_vrf_allowed.data
@@ -0,0 +1,12 @@
+-- binary
+00 03 # class
+06 # type/masked
+01 # length
+01 # value
+-- python
+ofp.oxm.bsn_global_vrf_allowed(1)
+-- c
+obj = of_oxm_bsn_global_vrf_allowed_new(OF_VERSION_1_3);
+of_oxm_bsn_global_vrf_allowed_value_set(obj, 1);
+-- java
+builder.setValue(OFBooleanValue.TRUE)
diff --git a/test_data/of13/oxm_bsn_l3_src_class_id.data b/test_data/of13/oxm_bsn_l3_src_class_id.data
new file mode 100644
index 0000000..5da07e3
--- /dev/null
+++ b/test_data/of13/oxm_bsn_l3_src_class_id.data
@@ -0,0 +1,12 @@
+-- binary
+00 03 # class
+0a # type/masked
+04 # length
+12 34 56 78 # value
+-- python
+ofp.oxm.bsn_l3_src_class_id(0x12345678)
+-- c
+obj = of_oxm_bsn_l3_src_class_id_new(OF_VERSION_1_3);
+of_oxm_bsn_l3_src_class_id_value_set(obj, 0x12345678);
+-- java
+builder.setValue(ClassId.of(0x12345678))
diff --git a/wireshark_gen/field_info.py b/wireshark_gen/field_info.py
index 28f4cdb..4a80a8e 100644
--- a/wireshark_gen/field_info.py
+++ b/wireshark_gen/field_info.py
@@ -111,6 +111,11 @@
     ('of_action_id', 'type'): 'ofp_action_type',
     ('of_instruction_apply_actions', 'type'): 'ofp_instruction_type',
     ('of_instruction_write_actions', 'type'): 'ofp_instruction_type',
+    ('of_group_mod', 'group_type'): 'ofp_group_type',
+    ('of_group_mod', 'type'): 'ofp_type',
+    ('of_group_mod', 'command'): 'ofp_group_mod_commane',
+    ('of_group_mod', 'group_id'): 'ofp_group',
+
 }
 
 # Override oftype_to_base for certain field names
diff --git a/wireshark_gen/templates/_oftype_readers.lua b/wireshark_gen/templates/_oftype_readers.lua
index c258953..4f5d7f9 100644
--- a/wireshark_gen/templates/_oftype_readers.lua
+++ b/wireshark_gen/templates/_oftype_readers.lua
@@ -134,6 +134,7 @@
     local list = nil
     if not reader2.is_empty() then
         list = subtree:add(fields[field_name], reader2.peek_all(0))
+        list:set_text("List of matches")
     end
     while not reader2.is_empty() do
         local match_len = 4 + reader2.peek(3,1):uint()
@@ -143,7 +144,6 @@
         child_subtree:set_text(info)
     end
     subtree:set_text("OXM")
-    list:set_text("List of matches")
     reader.skip_align()
 end
 
@@ -155,3 +155,27 @@
     local info = dissect_of_instruction(reader, child_subtree, version)
     child_subtree:set_text("Instructions")
 end
+
+function read_list_of_bucket_t(reader, version, subtree, field_name)
+    if reader.is_empty() then
+        return
+    end
+    local bucket_list_subtree = subtree:add(fields[field_name], reader.peek_all(0))
+    bucket_list_subtree:set_text("List of buckets")
+    while not reader.is_empty() do
+        local bucket_len = reader.peek(0,2):uint()
+        local child_reader = reader.slice(bucket_len)
+        local child_subtree = bucket_list_subtree:add(fields[field_name], child_reader.peek_all(0))
+        local info = dissect_of_bucket(child_reader, child_subtree, version)
+        child_subtree:set_text(info)
+    end
+end
+
+function read_of_oxm_t(reader, version, subtree, field_name)
+    if reader.is_empty() then
+        return
+    end
+    local child_subtree = subtree:add(fields[field_name], reader.peek_all(0))
+    local info = dissect_of_oxm(reader, child_subtree, version)
+    child_subtree:set_text(info)
+end
diff --git a/wireshark_gen/templates/openflow.lua b/wireshark_gen/templates/openflow.lua
index 067dbdd..f2791d1 100644
--- a/wireshark_gen/templates/openflow.lua
+++ b/wireshark_gen/templates/openflow.lua
@@ -119,6 +119,12 @@
 :: #endfor
 }
 
+local of_bucket_dissectors = {
+:: for version in ir:
+    [${version}] = dissect_of_bucket_v${version},
+:: #endfor
+}
+
 function dissect_of_message(buf, root)
     local reader = OFReader.new(buf)
     local subtree = root:add(p_of, buf(0))
@@ -168,6 +174,15 @@
     return info
 end
 
+function dissect_of_bucket(reader, subtree, version_val)
+    local info = "unknown"
+    if of_bucket_dissectors[version_val] then
+        info = of_bucket_dissectors[version_val](reader, subtree)
+    end
+
+    return info
+end
+
 -- of dissector function
 function p_of.dissector (buf, pkt, root)
     local offset = 0