Merge into master from pull request #316:
pyloxi: reduce boilerplate code required for each module (https://github.com/floodlight/loxigen/pull/316)
diff --git a/c_gen/codegen.py b/c_gen/codegen.py
index ea05826..07b0ade 100644
--- a/c_gen/codegen.py
+++ b/c_gen/codegen.py
@@ -124,7 +124,7 @@
 # TODO remove header classes and use the corresponding class instead
 def generate_header_classes(install_dir):
     for cls in of_g.standard_class_order:
-        if cls.find("_header") < 0 or cls in ["of_header", "of_bsn_header", "of_nicira_header"]:
+        if not cls.endswith("_header") or cls in ["of_header", "of_bsn_header", "of_nicira_header"]:
             continue
         with template_utils.open_output(install_dir, "loci/src/%s.c" % cls) as out:
             util.render_template(out, "class.c",
diff --git a/c_gen/type_maps.py b/c_gen/type_maps.py
index 7b745a6..6cbb3a5 100644
--- a/c_gen/type_maps.py
+++ b/c_gen/type_maps.py
@@ -150,7 +150,7 @@
     """
     Returns True if cls is a virtual class
     """
-    if cls.find("header") > 0:
+    if cls.endswith("header"):
         return True
     if loxi_utils.class_is_list(cls):
         return True
diff --git a/openflow_input/bsn_tlv b/openflow_input/bsn_tlv
index c4c8995..cc81b96 100644
--- a/openflow_input/bsn_tlv
+++ b/openflow_input/bsn_tlv
@@ -208,3 +208,69 @@
     uint16_t length;
     of_mac_addr_t value;
 };
+
+struct of_bsn_tlv_external_gateway_mac : of_bsn_tlv {
+    uint16_t type == 29;
+    uint16_t length;
+    of_mac_addr_t value;
+};
+
+struct of_bsn_tlv_sampling_rate : of_bsn_tlv {
+    uint16_t type == 30;
+    uint16_t length;
+    uint32_t value;
+};
+
+struct of_bsn_tlv_header_size : of_bsn_tlv {
+    uint16_t type == 31;
+    uint16_t length;
+    uint32_t value; /* bytes */
+};
+
+struct of_bsn_tlv_eth_src : of_bsn_tlv {
+    uint16_t type == 32;
+    uint16_t length;
+    of_mac_addr_t value;
+};
+
+struct of_bsn_tlv_eth_dst : of_bsn_tlv {
+    uint16_t type == 33;
+    uint16_t length;
+    of_mac_addr_t value;
+};
+
+struct of_bsn_tlv_ipv4_src : of_bsn_tlv {
+    uint16_t type == 34;
+    uint16_t length;
+    of_ipv4_t value;
+};
+
+struct of_bsn_tlv_ipv4_dst : of_bsn_tlv {
+    uint16_t type == 35;
+    uint16_t length;
+    of_ipv4_t value;
+};
+
+struct of_bsn_tlv_udp_src : of_bsn_tlv {
+    uint16_t type == 36;
+    uint16_t length;
+    uint16_t value;
+};
+
+struct of_bsn_tlv_udp_dst : of_bsn_tlv {
+    uint16_t type == 37;
+    uint16_t length;
+    uint16_t value;
+};
+
+struct of_bsn_tlv_sub_agent_id : of_bsn_tlv {
+    uint16_t type == 38;
+    uint16_t length;
+    uint32_t value;
+};
+
+struct of_bsn_tlv_tx_bytes : of_bsn_tlv {
+    uint16_t type == 39;
+    uint16_t length;
+    uint64_t value;
+};
diff --git a/wireshark_gen/templates/openflow.lua b/wireshark_gen/templates/openflow.lua
index 9ce51d2..ef826c1 100644
--- a/wireshark_gen/templates/openflow.lua
+++ b/wireshark_gen/templates/openflow.lua
@@ -52,7 +52,7 @@
 
 :: for version, ofproto in ir.items():
 :: for enum in ofproto.enums:
-local enum_v${version.wire_version}_${enum.name} = {
+enum_v${version.wire_version}_${enum.name} = {
 :: for (name, value) in enum.values:
     [${value}] = "${name}",
 :: #endfor