+struct cmd_show_table {
+ const struct ovsdb_idl_table_class *table;
+ const struct ovsdb_idl_column *name_column;
+ const struct ovsdb_idl_column *columns[3];
+ bool recurse;
+};
+
+static struct cmd_show_table cmd_show_tables[] = {
+ {&ovsrec_table_open_vswitch,
+ NULL,
+ {&ovsrec_open_vswitch_col_manager_options,
+ &ovsrec_open_vswitch_col_bridges,
+ &ovsrec_open_vswitch_col_ovs_version},
+ false},
+
+ {&ovsrec_table_bridge,
+ &ovsrec_bridge_col_name,
+ {&ovsrec_bridge_col_controller,
+ &ovsrec_bridge_col_fail_mode,
+ &ovsrec_bridge_col_ports},
+ false},
+
+ {&ovsrec_table_port,
+ &ovsrec_port_col_name,
+ {&ovsrec_port_col_tag,
+ &ovsrec_port_col_trunks,
+ &ovsrec_port_col_interfaces},
+ false},
+
+ {&ovsrec_table_interface,
+ &ovsrec_interface_col_name,
+ {&ovsrec_interface_col_type,
+ &ovsrec_interface_col_options,
+ NULL},
+ false},
+
+ {&ovsrec_table_controller,
+ &ovsrec_controller_col_target,
+ {&ovsrec_controller_col_is_connected,
+ NULL,
+ NULL},
+ false},
+
+ {&ovsrec_table_manager,
+ &ovsrec_manager_col_target,
+ {&ovsrec_manager_col_is_connected,
+ NULL,
+ NULL},
+ false},
+};
+
+static void
+pre_cmd_show(struct vsctl_context *ctx)
+{
+ struct cmd_show_table *show;
+
+ for (show = cmd_show_tables;
+ show < &cmd_show_tables[ARRAY_SIZE(cmd_show_tables)];
+ show++) {
+ size_t i;
+
+ ovsdb_idl_add_table(ctx->idl, show->table);
+ if (show->name_column) {
+ ovsdb_idl_add_column(ctx->idl, show->name_column);
+ }
+ for (i = 0; i < ARRAY_SIZE(show->columns); i++) {
+ const struct ovsdb_idl_column *column = show->columns[i];
+ if (column) {
+ ovsdb_idl_add_column(ctx->idl, column);
+ }