openflow_input: add inheritance
diff --git a/openflow_input/standard-1.1 b/openflow_input/standard-1.1
index 553e665..4366af8 100644
--- a/openflow_input/standard-1.1
+++ b/openflow_input/standard-1.1
@@ -407,6 +407,7 @@
     OFPQT_MIN_RATE = 1,
 };
 
+/* XXX rename to of_message */
 struct of_header {
     uint8_t version;
     uint8_t type;
@@ -414,14 +415,14 @@
     uint32_t xid;
 };
 
-struct of_hello {
+struct of_hello : of_header {
     uint8_t version;
     uint8_t type == 0;
     uint16_t length;
     uint32_t xid;
 };
 
-struct of_echo_request {
+struct of_echo_request : of_header {
     uint8_t version;
     uint8_t type == 2;
     uint16_t length;
@@ -429,7 +430,7 @@
     of_octets_t data;
 };
 
-struct of_echo_reply {
+struct of_echo_reply : of_header {
     uint8_t version;
     uint8_t type == 3;
     uint16_t length;
@@ -437,7 +438,7 @@
     of_octets_t data;
 };
 
-struct of_experimenter {
+struct of_experimenter : of_header {
     uint8_t version;
     uint8_t type == 4;
     uint16_t length;
@@ -447,28 +448,28 @@
     of_octets_t data;
 };
 
-struct of_barrier_request {
+struct of_barrier_request : of_header {
     uint8_t version;
     uint8_t type == 20;
     uint16_t length;
     uint32_t xid;
 };
 
-struct of_barrier_reply {
+struct of_barrier_reply : of_header {
     uint8_t version;
     uint8_t type == 21;
     uint16_t length;
     uint32_t xid;
 };
 
-struct of_get_config_request {
+struct of_get_config_request : of_header {
     uint8_t version;
     uint8_t type == 7;
     uint16_t length;
     uint32_t xid;
 };
 
-struct of_get_config_reply {
+struct of_get_config_reply : of_header {
     uint8_t version;
     uint8_t type == 8;
     uint16_t length;
@@ -477,7 +478,7 @@
     uint16_t miss_send_len;
 };
 
-struct of_set_config {
+struct of_set_config : of_header {
     uint8_t version;
     uint8_t type == 9;
     uint16_t length;
@@ -486,7 +487,7 @@
     uint16_t miss_send_len;
 };
 
-struct of_table_mod {
+struct of_table_mod : of_header {
     uint8_t version;
     uint8_t type == 17;
     uint16_t length;
@@ -512,14 +513,14 @@
     uint32_t max_speed;
 };
 
-struct of_features_request {
+struct of_features_request : of_header {
     uint8_t version;
     uint8_t type == 5;
     uint16_t length;
     uint32_t xid;
 };
 
-struct of_features_reply {
+struct of_features_reply : of_header {
     uint8_t version;
     uint8_t type == 6;
     uint16_t length;
@@ -533,7 +534,7 @@
     list(of_port_desc_t) ports;
 };
 
-struct of_port_status {
+struct of_port_status : of_header {
     uint8_t version;
     uint8_t type == 12;
     uint16_t length;
@@ -543,7 +544,7 @@
     of_port_desc_t desc;
 };
 
-struct of_port_mod {
+struct of_port_mod : of_header {
     uint8_t version;
     uint8_t type == 16;
     uint16_t length;
@@ -558,7 +559,7 @@
     pad(4);
 };
 
-struct of_packet_in {
+struct of_packet_in : of_header {
     uint8_t version;
     uint8_t type == 10;
     uint16_t length;
@@ -572,7 +573,7 @@
     of_octets_t data;
 };
 
-struct of_action_output {
+struct of_action_output : of_action {
     uint16_t type == 0;
     uint16_t len;
     of_port_no_t port;
@@ -580,165 +581,165 @@
     pad(6);
 };
 
-struct of_action_set_vlan_vid {
+struct of_action_set_vlan_vid : of_action {
     uint16_t type == 1;
     uint16_t len;
     uint16_t vlan_vid;
     pad(2);
 };
 
-struct of_action_set_vlan_pcp {
+struct of_action_set_vlan_pcp : of_action {
     uint16_t type == 2;
     uint16_t len;
     uint8_t vlan_pcp;
     pad(3);
 };
 
-struct of_action_set_dl_src {
+struct of_action_set_dl_src : of_action {
     uint16_t type == 3;
     uint16_t len;
     of_mac_addr_t dl_addr;
     pad(6);
 };
 
-struct of_action_set_dl_dst {
+struct of_action_set_dl_dst : of_action {
     uint16_t type == 4;
     uint16_t len;
     of_mac_addr_t dl_addr;
     pad(6);
 };
 
-struct of_action_set_nw_src {
+struct of_action_set_nw_src : of_action {
     uint16_t type == 5;
     uint16_t len;
     uint32_t nw_addr;
 };
 
-struct of_action_set_nw_dst {
+struct of_action_set_nw_dst : of_action {
     uint16_t type == 6;
     uint16_t len;
     uint32_t nw_addr;
 };
 
-struct of_action_set_nw_tos {
+struct of_action_set_nw_tos : of_action {
     uint16_t type == 7;
     uint16_t len;
     uint8_t nw_tos;
     pad(3);
 };
 
-struct of_action_set_nw_ecn {
+struct of_action_set_nw_ecn : of_action {
     uint16_t type == 8;
     uint16_t len;
     uint8_t nw_ecn;
     pad(3);
 };
 
-struct of_action_set_tp_src {
+struct of_action_set_tp_src : of_action {
     uint16_t type == 9;
     uint16_t len;
     uint16_t tp_port;
     pad(2);
 };
 
-struct of_action_set_tp_dst {
+struct of_action_set_tp_dst : of_action {
     uint16_t type == 10;
     uint16_t len;
     uint16_t tp_port;
     pad(2);
 };
 
-struct of_action_copy_ttl_out {
+struct of_action_copy_ttl_out : of_action {
     uint16_t type == 11;
     uint16_t len;
     pad(4);
 };
 
-struct of_action_copy_ttl_in {
+struct of_action_copy_ttl_in : of_action {
     uint16_t type == 12;
     uint16_t len;
     pad(4);
 };
 
-struct of_action_set_mpls_label {
+struct of_action_set_mpls_label : of_action {
     uint16_t type == 13;
     uint16_t len;
     uint32_t mpls_label;
 };
 
-struct of_action_set_mpls_tc {
+struct of_action_set_mpls_tc : of_action {
     uint16_t type == 14;
     uint16_t len;
     uint8_t mpls_tc;
     pad(3);
 };
 
-struct of_action_set_mpls_ttl {
+struct of_action_set_mpls_ttl : of_action {
     uint16_t type == 15;
     uint16_t len;
     uint8_t mpls_ttl;
     pad(3);
 };
 
-struct of_action_dec_mpls_ttl {
+struct of_action_dec_mpls_ttl : of_action {
     uint16_t type == 16;
     uint16_t len;
     pad(4);
 };
 
-struct of_action_push_vlan {
+struct of_action_push_vlan : of_action {
     uint16_t type == 17;
     uint16_t len;
     uint16_t ethertype;
     pad(2);
 };
 
-struct of_action_pop_vlan {
+struct of_action_pop_vlan : of_action {
     uint16_t type == 18;
     uint16_t len;
     pad(4);
 };
 
-struct of_action_push_mpls {
+struct of_action_push_mpls : of_action {
     uint16_t type == 19;
     uint16_t len;
     uint16_t ethertype;
     pad(2);
 };
 
-struct of_action_pop_mpls {
+struct of_action_pop_mpls : of_action {
     uint16_t type == 20;
     uint16_t len;
     uint16_t ethertype;
     pad(2);
 };
 
-struct of_action_set_queue {
+struct of_action_set_queue : of_action {
     uint16_t type == 21;
     uint16_t len;
     uint32_t queue_id;
 };
 
-struct of_action_group {
+struct of_action_group : of_action {
     uint16_t type == 22;
     uint16_t len;
     uint32_t group_id;
 };
 
-struct of_action_set_nw_ttl {
+struct of_action_set_nw_ttl : of_action {
     uint16_t type == 23;
     uint16_t len;
     uint8_t nw_ttl;
     pad(3);
 };
 
-struct of_action_dec_nw_ttl {
+struct of_action_dec_nw_ttl : of_action {
     uint16_t type == 24;
     uint16_t len;
     pad(4);
 };
 
-struct of_action_experimenter {
+struct of_action_experimenter : of_action {
     uint16_t type == 65535;
     uint16_t len;
     uint32_t experimenter;
@@ -751,7 +752,7 @@
     pad(4);
 };
 
-struct of_packet_out {
+struct of_packet_out : of_header {
     uint8_t version;
     uint8_t type == 13;
     uint16_t length;
@@ -798,14 +799,14 @@
     pad(4);
 };
 
-struct of_instruction_goto_table {
+struct of_instruction_goto_table : of_instruction {
     uint16_t type == 1;
     uint16_t len;
     uint8_t table_id;
     pad(3);
 };
 
-struct of_instruction_write_metadata {
+struct of_instruction_write_metadata : of_instruction {
     uint16_t type == 2;
     uint16_t len;
     pad(4);
@@ -813,34 +814,55 @@
     uint64_t metadata_mask;
 };
 
-struct of_instruction_write_actions {
+struct of_instruction_write_actions : of_instruction {
     uint16_t type == 3;
     uint16_t len;
     pad(4);
     list(of_action_t) actions;
 };
 
-struct of_instruction_apply_actions {
+struct of_instruction_apply_actions : of_instruction {
     uint16_t type == 4;
     uint16_t len;
     pad(4);
     list(of_action_t) actions;
 };
 
-struct of_instruction_clear_actions {
+struct of_instruction_clear_actions : of_instruction {
     uint16_t type == 5;
     uint16_t len;
     pad(4);
 };
 
-struct of_instruction_experimenter {
+struct of_instruction_experimenter : of_instruction {
     uint16_t type == 65535;
     uint16_t len;
     uint32_t experimenter;
     of_octets_t data;
 };
 
-struct of_flow_add {
+struct of_flow_mod : of_header {
+    uint8_t version;
+    uint8_t type == 14;
+    uint16_t length;
+    uint32_t xid;
+    uint64_t cookie;
+    uint64_t cookie_mask;
+    uint8_t table_id;
+    of_fm_cmd_t _command;
+    uint16_t idle_timeout;
+    uint16_t hard_timeout;
+    uint16_t priority;
+    uint32_t buffer_id;
+    of_port_no_t out_port;
+    uint32_t out_group;
+    uint16_t flags;
+    pad(2);
+    of_match_t match;
+    list(of_instruction_t) instructions;
+};
+
+struct of_flow_add : of_flow_mod {
     uint8_t version;
     uint8_t type == 14;
     uint16_t length;
@@ -861,7 +883,7 @@
     list(of_instruction_t) instructions;
 };
 
-struct of_flow_modify {
+struct of_flow_modify : of_flow_mod {
     uint8_t version;
     uint8_t type == 14;
     uint16_t length;
@@ -882,7 +904,7 @@
     list(of_instruction_t) instructions;
 };
 
-struct of_flow_modify_strict {
+struct of_flow_modify_strict : of_flow_mod {
     uint8_t version;
     uint8_t type == 14;
     uint16_t length;
@@ -903,7 +925,7 @@
     list(of_instruction_t) instructions;
 };
 
-struct of_flow_delete {
+struct of_flow_delete : of_flow_mod {
     uint8_t version;
     uint8_t type == 14;
     uint16_t length;
@@ -924,7 +946,7 @@
     list(of_instruction_t) instructions;
 };
 
-struct of_flow_delete_strict {
+struct of_flow_delete_strict : of_flow_mod {
     uint8_t version;
     uint8_t type == 14;
     uint16_t length;
@@ -954,7 +976,7 @@
     list(of_action_t) actions;
 };
 
-struct of_group_mod {
+struct of_group_mod : of_header {
     uint8_t version;
     uint8_t type == 15;
     uint16_t length;
@@ -966,7 +988,7 @@
     list(of_bucket_t) buckets;
 };
 
-struct of_flow_removed {
+struct of_flow_removed : of_header {
     uint8_t version;
     uint8_t type == 11;
     uint16_t length;
@@ -984,7 +1006,7 @@
     of_match_t match;
 };
 
-struct of_error_msg {
+struct of_error_msg : of_header {
     uint8_t version;
     uint8_t type == 1;
     uint16_t length;
@@ -1080,7 +1102,27 @@
 
 // STATS:  Desc, flow, agg, table, port, queue, group, group_desc, experi
 
-struct of_desc_stats_request {
+struct of_stats_request : of_header {
+    uint8_t version;
+    uint8_t type == 18;
+    uint16_t length;
+    uint32_t xid;
+    uint16_t stats_type;
+    uint16_t flags;
+    pad(4);
+};
+
+struct of_stats_reply : of_header {
+    uint8_t version;
+    uint8_t type == 19;
+    uint16_t length;
+    uint32_t xid;
+    uint16_t stats_type;
+    uint16_t flags;
+    pad(4);
+};
+
+struct of_desc_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1090,7 +1132,7 @@
     pad(4);
 };
 
-struct of_desc_stats_reply {
+struct of_desc_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1105,7 +1147,7 @@
     of_desc_str_t dp_desc;
 };
 
-struct of_flow_stats_request {
+struct of_flow_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1123,7 +1165,7 @@
     of_match_t match;
 };
 
-struct of_flow_stats_reply {
+struct of_flow_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1134,7 +1176,7 @@
     list(of_flow_stats_entry_t) entries;
 };
 
-struct of_aggregate_stats_request {
+struct of_aggregate_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1152,7 +1194,7 @@
     of_match_t match;
 };
 
-struct of_aggregate_stats_reply {
+struct of_aggregate_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1166,7 +1208,7 @@
     pad(4);
 };
 
-struct of_table_stats_request {
+struct of_table_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1176,7 +1218,7 @@
     pad(4);
 };
 
-struct of_table_stats_reply {
+struct of_table_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1187,7 +1229,7 @@
     list(of_table_stats_entry_t) entries;
 };
 
-struct of_port_stats_request {
+struct of_port_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1199,7 +1241,7 @@
     pad(4);
 };
 
-struct of_port_stats_reply {
+struct of_port_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1210,7 +1252,7 @@
     list(of_port_stats_entry_t) entries;
 };
 
-struct of_queue_stats_request {
+struct of_queue_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1222,7 +1264,7 @@
     uint32_t queue_id;
 };
 
-struct of_queue_stats_reply {
+struct of_queue_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1233,7 +1275,7 @@
     list(of_queue_stats_entry_t) entries;
 };
 
-struct of_group_stats_request {
+struct of_group_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1245,7 +1287,7 @@
     pad(4);
 };
 
-struct of_group_stats_reply {
+struct of_group_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1256,7 +1298,7 @@
     list(of_group_stats_entry_t) entries;
 };
 
-struct of_group_desc_stats_request {
+struct of_group_desc_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1266,7 +1308,7 @@
     pad(4);
 };
 
-struct of_group_desc_stats_reply {
+struct of_group_desc_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1277,7 +1319,7 @@
     list(of_group_desc_stats_entry_t) entries;
 };
 
-struct of_experimenter_stats_request {
+struct of_experimenter_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1290,7 +1332,7 @@
     of_octets_t data;
 };
 
-struct of_experimenter_stats_reply {
+struct of_experimenter_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1311,7 +1353,7 @@
     pad(4);
 };
 
-struct of_queue_prop_min_rate {
+struct of_queue_prop_min_rate : of_queue_prop {
     uint16_t type == 1;
     uint16_t len;
     pad(4);
@@ -1326,7 +1368,7 @@
     list(of_queue_prop_t) properties;
 };
 
-struct of_queue_get_config_request {
+struct of_queue_get_config_request : of_header {
     uint8_t version;
     uint8_t type == 22;
     uint16_t length;
@@ -1335,7 +1377,7 @@
     pad(4);
 };
 
-struct of_queue_get_config_reply {
+struct of_queue_get_config_reply : of_header {
     uint8_t version;
     uint8_t type == 23;
     uint16_t length;