Merge into master from pull request #375:
fix to support ports > 32768 (https://github.com/floodlight/loxigen/pull/375)
diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py
index a9a0576..9add81b 100644
--- a/c_gen/c_code_gen.py
+++ b/c_gen/c_code_gen.py
@@ -621,7 +621,7 @@
 } of_bitmap_512_t;
 
 extern const of_mac_addr_t of_mac_addr_all_ones;
-extern const of_mac_addr_t of_mac_addr_all_zeroes;
+extern const of_mac_addr_t of_mac_addr_all_zeros;
 
 extern const of_ipv6_t of_ipv6_all_ones;
 extern const of_ipv6_t of_ipv6_all_zeros;
diff --git a/openflow_input/bsn_lua b/openflow_input/bsn_lua
index 9b6438e..d941666 100644
--- a/openflow_input/bsn_lua
+++ b/openflow_input/bsn_lua
@@ -29,7 +29,13 @@
 // governing permissions and limitations under the EPL.
 
 // IVS supports running sandboxed Lua code as the forwarding pipeline.
-// This extension allows the controller to upload the Lua code.
+// This extension allows the controller to upload the Lua code, send
+// commands to it, and receive async notifications.
+//
+// Most of the data passed between the controller and the Lua code is
+// opaque to the rest of the switch. It's assumed that the controller
+// is tightly coupled to the Lua code it uploaded, so there's no need
+// to version the protocol between them.
 
 #version 4
 #version 5
@@ -66,3 +72,37 @@
     of_str64_t filename;
     of_octets_t data;
 };
+
+// Send a command to Lua
+
+struct of_bsn_lua_command_request : of_bsn_header {
+    uint8_t version;
+    uint8_t type == 4;
+    uint16_t length;
+    uint32_t xid;
+    uint32_t experimenter == 0x5c16c7;
+    uint32_t subtype == 65;
+    of_octets_t data;
+};
+
+struct of_bsn_lua_command_reply : of_bsn_header {
+    uint8_t version;
+    uint8_t type == 4;
+    uint16_t length;
+    uint32_t xid;
+    uint32_t experimenter == 0x5c16c7;
+    uint32_t subtype == 66;
+    of_octets_t data;
+};
+
+// Async message from Lua to the controller
+
+struct of_bsn_lua_notification : of_bsn_header {
+    uint8_t version;
+    uint8_t type == 4;
+    uint16_t length;
+    uint32_t xid;
+    uint32_t experimenter == 0x5c16c7;
+    uint32_t subtype == 67;
+    of_octets_t data;
+};
diff --git a/openflow_input/bsn_tlv b/openflow_input/bsn_tlv
index 65a7fb1..af0fb96 100644
--- a/openflow_input/bsn_tlv
+++ b/openflow_input/bsn_tlv
@@ -432,3 +432,39 @@
     uint16_t length;
     list(of_bsn_tlv_t) value;
 };
+
+struct of_bsn_tlv_tcp_src : of_bsn_tlv {
+    uint16_t type == 65;
+    uint16_t length;
+    uint16_t value;
+};
+
+struct of_bsn_tlv_tcp_dst : of_bsn_tlv {
+    uint16_t type == 66;
+    uint16_t length;
+    uint16_t value;
+};
+
+struct of_bsn_tlv_ip_proto : of_bsn_tlv {
+    uint16_t type == 67;
+    uint16_t length;
+    uint8_t value;
+};
+
+struct of_bsn_tlv_icmp_type : of_bsn_tlv {
+    uint16_t type == 68;
+    uint16_t length;
+    uint8_t value;
+};
+
+struct of_bsn_tlv_icmp_code : of_bsn_tlv {
+    uint16_t type == 69;
+    uint16_t length;
+    uint8_t value;
+};
+
+struct of_bsn_tlv_icmp_id : of_bsn_tlv {
+    uint16_t type == 70;
+    uint16_t length;
+    uint16_t value;
+};