openflow_input: add inheritance
diff --git a/openflow_input/standard-1.2 b/openflow_input/standard-1.2
index 8b4fa3f..b49c83f 100644
--- a/openflow_input/standard-1.2
+++ b/openflow_input/standard-1.2
@@ -447,6 +447,7 @@
     OFPCR_ROLE_SLAVE = 3,
 };
 
+/* XXX rename to of_message */
 struct of_header {
     uint8_t version;
     uint8_t type;
@@ -454,14 +455,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;
@@ -469,7 +470,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;
@@ -477,7 +478,7 @@
     of_octets_t data;
 };
 
-struct of_experimenter {
+struct of_experimenter : of_header {
     uint8_t version;
     uint8_t type == 4;
     uint16_t length;
@@ -487,28 +488,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;
@@ -517,7 +518,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;
@@ -526,7 +527,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;
@@ -552,14 +553,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;
@@ -573,7 +574,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;
@@ -583,7 +584,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;
@@ -604,7 +605,7 @@
     list(of_oxm_t) oxm_list;
 };
 
-struct of_action_output {
+struct of_action_output : of_action {
     uint16_t type == 0;
     uint16_t len;
     of_port_no_t port;
@@ -612,90 +613,90 @@
     pad(6);
 };
 
-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_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_set_field {
+struct of_action_set_field : of_action {
     uint16_t type == 25;
     uint16_t len;
     of_oxm_t field;
 };
 
-struct of_action_experimenter {
+struct of_action_experimenter : of_action {
     uint16_t type == 65535;
     uint16_t len;
     uint32_t experimenter;
@@ -714,14 +715,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);
@@ -729,34 +730,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;
@@ -777,7 +799,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;
@@ -798,7 +820,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;
@@ -819,7 +841,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;
@@ -840,7 +862,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;
@@ -870,7 +892,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;
@@ -882,7 +904,7 @@
     list(of_bucket_t) buckets;
 };
 
-struct of_packet_out {
+struct of_packet_out : of_header {
     uint8_t version;
     uint8_t type == 13;
     uint16_t length;
@@ -895,7 +917,7 @@
     of_octets_t data;
 };
 
-struct of_packet_in {
+struct of_packet_in : of_header {
     uint8_t version;
     uint8_t type == 10;
     uint16_t length;
@@ -909,7 +931,7 @@
     of_octets_t data; /* FIXME: Ensure total_len gets updated */
 };
 
-struct of_flow_removed {
+struct of_flow_removed : of_header {
     uint8_t version;
     uint8_t type == 11;
     uint16_t length;
@@ -927,7 +949,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;
@@ -1040,7 +1062,27 @@
 // STATS: 
 //  Desc, flow, agg, table, port, queue, group, group_desc, group_feat, 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;
@@ -1050,7 +1092,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;
@@ -1065,7 +1107,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;
@@ -1083,7 +1125,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;
@@ -1094,7 +1136,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;
@@ -1112,7 +1154,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;
@@ -1126,7 +1168,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;
@@ -1136,7 +1178,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;
@@ -1147,7 +1189,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;
@@ -1159,7 +1201,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;
@@ -1170,7 +1212,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;
@@ -1182,7 +1224,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;
@@ -1193,7 +1235,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;
@@ -1205,7 +1247,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;
@@ -1216,7 +1258,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;
@@ -1226,7 +1268,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;
@@ -1237,7 +1279,7 @@
     list(of_group_desc_stats_entry_t) entries;
 };
 
-struct of_group_features_stats_request {
+struct of_group_features_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1247,7 +1289,7 @@
     pad(4);
 };
 
-struct of_group_features_stats_reply {
+struct of_group_features_stats_reply : of_stats_reply {
     uint8_t version;
     uint8_t type == 19;
     uint16_t length;
@@ -1267,7 +1309,7 @@
     uint32_t actions_ff;
 };
 
-struct of_experimenter_stats_request {
+struct of_experimenter_stats_request : of_stats_request {
     uint8_t version;
     uint8_t type == 18;
     uint16_t length;
@@ -1280,7 +1322,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;
@@ -1301,7 +1343,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);
@@ -1309,7 +1351,7 @@
     pad(6);
 };
 
-struct of_queue_prop_max_rate {
+struct of_queue_prop_max_rate : of_queue_prop {
     uint16_t type == 2;
     uint16_t len;
     pad(4);
@@ -1317,7 +1359,7 @@
     pad(6);
 };
 
-struct of_queue_prop_experimenter {
+struct of_queue_prop_experimenter : of_queue_prop {
     uint16_t type == 65535;
     uint16_t len;
     pad(4);
@@ -1334,7 +1376,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;
@@ -1343,7 +1385,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;
@@ -1353,7 +1395,7 @@
     list(of_packet_queue_t) queues;
 };
 
-struct of_role_request {
+struct of_role_request : of_header {
     uint8_t version;
     uint8_t type == 24;
     uint16_t length;
@@ -1363,7 +1405,7 @@
     uint64_t generation_id;
 };
 
-struct of_role_reply {
+struct of_role_reply : of_header {
     uint8_t version;
     uint8_t type == 25;
     uint16_t length;