+}
+
+static void
+ofp_to_string__(const struct ofp_header *oh,
+ const struct ofputil_msg_type *type, struct ds *string,
+ int verbosity)
+{
+ enum ofputil_msg_code code;
+ const void *msg = oh;
+
+ ds_put_format(string, "%s (xid=0x%"PRIx32"):",
+ ofputil_msg_type_name(type), ntohl(oh->xid));
+
+ code = ofputil_msg_type_code(type);
+ switch (code) {
+ case OFPUTIL_MSG_INVALID:
+ break;
+
+ case OFPUTIL_OFPT_HELLO:
+ ds_put_char(string, '\n');
+ ds_put_hex_dump(string, oh + 1, ntohs(oh->length) - sizeof *oh,
+ 0, true);
+ break;
+
+ case OFPUTIL_OFPT_ERROR:
+ ofp_print_error_msg(string, msg);
+ break;
+
+ case OFPUTIL_OFPT_ECHO_REQUEST:
+ case OFPUTIL_OFPT_ECHO_REPLY:
+ ofp_print_echo(string, oh, verbosity);
+ break;
+
+ case OFPUTIL_OFPT_FEATURES_REQUEST:
+ break;
+
+ case OFPUTIL_OFPT_FEATURES_REPLY:
+ ofp_print_switch_features(string, msg);
+ break;
+
+ case OFPUTIL_OFPT_GET_CONFIG_REQUEST:
+ break;
+
+ case OFPUTIL_OFPT_GET_CONFIG_REPLY:
+ case OFPUTIL_OFPT_SET_CONFIG:
+ ofp_print_switch_config(string, msg);
+ break;
+
+ case OFPUTIL_OFPT_PACKET_IN:
+ ofp_print_packet_in(string, msg, verbosity);
+ break;
+
+ case OFPUTIL_OFPT_FLOW_REMOVED:
+ case OFPUTIL_NXT_FLOW_REMOVED:
+ ofp_print_flow_removed(string, msg);
+ break;
+
+ case OFPUTIL_OFPT_PORT_STATUS:
+ ofp_print_port_status(string, msg);
+ break;
+
+ case OFPUTIL_OFPT_PACKET_OUT:
+ ofp_print_packet_out(string, msg, verbosity);
+ break;
+
+ case OFPUTIL_OFPT_FLOW_MOD:
+ ofp_print_flow_mod(string, msg, code, verbosity);
+ break;
+
+ case OFPUTIL_OFPT_PORT_MOD:
+ ofp_print_port_mod(string, msg);
+ break;
+
+ case OFPUTIL_OFPT_BARRIER_REQUEST:
+ case OFPUTIL_OFPT_BARRIER_REPLY:
+ break;
+
+ case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REQUEST:
+ case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REPLY:
+ /* XXX */
+ break;
+
+ case OFPUTIL_OFPST_DESC_REQUEST:
+ ofp_print_stats_request(string, oh);
+ break;
+
+ case OFPUTIL_OFPST_FLOW_REQUEST:
+ case OFPUTIL_NXST_FLOW_REQUEST:
+ case OFPUTIL_OFPST_AGGREGATE_REQUEST:
+ case OFPUTIL_NXST_AGGREGATE_REQUEST:
+ ofp_print_stats_request(string, oh);
+ ofp_print_flow_stats_request(string, msg);
+ break;
+
+ case OFPUTIL_OFPST_TABLE_REQUEST:
+ ofp_print_stats_request(string, oh);
+ break;
+
+ case OFPUTIL_OFPST_PORT_REQUEST:
+ ofp_print_stats_request(string, oh);
+ ofp_print_ofpst_port_request(string, msg);
+ break;
+
+ case OFPUTIL_OFPST_QUEUE_REQUEST:
+ ofp_print_stats_request(string, oh);
+ ofp_print_ofpst_queue_request(string, msg);
+ break;
+
+ case OFPUTIL_OFPST_DESC_REPLY:
+ ofp_print_stats_reply(string, oh);
+ ofp_print_ofpst_desc_reply(string, msg);
+ break;
+
+ case OFPUTIL_OFPST_FLOW_REPLY:
+ case OFPUTIL_NXST_FLOW_REPLY:
+ ofp_print_stats_reply(string, oh);
+ ofp_print_flow_stats_reply(string, oh);
+ break;
+
+ case OFPUTIL_OFPST_QUEUE_REPLY:
+ ofp_print_stats_reply(string, oh);
+ ofp_print_ofpst_queue_reply(string, oh, verbosity);
+ break;
+
+ case OFPUTIL_OFPST_PORT_REPLY:
+ ofp_print_stats_reply(string, oh);
+ ofp_print_ofpst_port_reply(string, oh, verbosity);
+ break;
+
+ case OFPUTIL_OFPST_TABLE_REPLY:
+ ofp_print_stats_reply(string, oh);
+ ofp_print_ofpst_table_reply(string, oh, verbosity);
+ break;
+
+ case OFPUTIL_OFPST_AGGREGATE_REPLY:
+ ofp_print_stats_reply(string, oh);
+ ofp_print_ofpst_aggregate_reply(string, msg);
+ break;
+
+ case OFPUTIL_NXT_ROLE_REQUEST:
+ case OFPUTIL_NXT_ROLE_REPLY:
+ ofp_print_nxt_role_message(string, msg);
+ break;
+
+ case OFPUTIL_NXT_FLOW_MOD_TABLE_ID:
+ ofp_print_nxt_flow_mod_table_id(string, msg);
+ break;
+
+ case OFPUTIL_NXT_SET_FLOW_FORMAT:
+ ofp_print_nxt_set_flow_format(string, msg);
+ break;
+
+ case OFPUTIL_NXT_FLOW_MOD:
+ ofp_print_flow_mod(string, msg, code, verbosity);
+ break;
+
+ case OFPUTIL_NXST_AGGREGATE_REPLY:
+ ofp_print_stats_reply(string, oh);
+ ofp_print_nxst_aggregate_reply(string, msg);
+ break;
+ }
+}