ofp-parse: Fix parsing, formatting of multiple fields in NTR extension.
[cascardo/ovs.git] / utilities / ovs-vsctl.c
index ce05c47..36290db 100644 (file)
@@ -201,6 +201,7 @@ parse_options(int argc, char *argv[], struct shash *local_options)
         OPT_NO_SYSLOG,
         OPT_NO_WAIT,
         OPT_DRY_RUN,
+        OPT_BOOTSTRAP_CA_CERT,
         OPT_PEER_CA_CERT,
         OPT_LOCAL,
         OPT_RETRY,
@@ -224,6 +225,7 @@ parse_options(int argc, char *argv[], struct shash *local_options)
         VLOG_LONG_OPTIONS,
         TABLE_LONG_OPTIONS,
         STREAM_SSL_LONG_OPTIONS,
+        {"bootstrap-ca-cert", required_argument, NULL, OPT_BOOTSTRAP_CA_CERT},
         {"peer-ca-cert", required_argument, NULL, OPT_PEER_CA_CERT},
         {NULL, 0, NULL, 0},
     };
@@ -324,6 +326,10 @@ parse_options(int argc, char *argv[], struct shash *local_options)
             stream_ssl_set_peer_ca_cert_file(optarg);
             break;
 
+        case OPT_BOOTSTRAP_CA_CERT:
+            stream_ssl_set_ca_cert_file(optarg, true);
+            break;
+
         case '?':
             exit(EXIT_FAILURE);
 
@@ -477,7 +483,7 @@ struct vsctl_iface {
     struct vsctl_port *port;
 };
 
-/* Casts 'base' into 'strcut vsctl_context'. */
+/* Casts 'base' into 'struct vsctl_context'. */
 static struct vsctl_context *
 vsctl_context_cast(struct ctl_context *base)
 {
@@ -975,50 +981,56 @@ cmd_init(struct ctl_context *ctx OVS_UNUSED)
 {
 }
 
-struct cmd_show_table cmd_show_tables[] = {
+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}
+      &ovsrec_open_vswitch_col_ovs_version},
+     {NULL, NULL, NULL}
     },
 
     {&ovsrec_table_bridge,
      &ovsrec_bridge_col_name,
      {&ovsrec_bridge_col_controller,
       &ovsrec_bridge_col_fail_mode,
-      &ovsrec_bridge_col_ports}
+      &ovsrec_bridge_col_ports},
+     {NULL, NULL, NULL}
     },
 
     {&ovsrec_table_port,
      &ovsrec_port_col_name,
      {&ovsrec_port_col_tag,
       &ovsrec_port_col_trunks,
-      &ovsrec_port_col_interfaces}
+      &ovsrec_port_col_interfaces},
+     {NULL, NULL, NULL}
     },
 
     {&ovsrec_table_interface,
      &ovsrec_interface_col_name,
      {&ovsrec_interface_col_type,
       &ovsrec_interface_col_options,
-      &ovsrec_interface_col_error}
+      &ovsrec_interface_col_error},
+     {NULL, NULL, NULL}
     },
 
     {&ovsrec_table_controller,
      &ovsrec_controller_col_target,
      {&ovsrec_controller_col_is_connected,
       NULL,
-      NULL}
+      NULL},
+     {NULL, NULL, NULL}
     },
 
     {&ovsrec_table_manager,
      &ovsrec_manager_col_target,
      {&ovsrec_manager_col_is_connected,
       NULL,
-      NULL}
+      NULL},
+     {NULL, NULL, NULL}
     },
 
-    {NULL, NULL, {NULL, NULL, NULL}}
+    {NULL, NULL, {NULL, NULL, NULL}, {NULL, NULL, NULL}}
 };
 
 static void
@@ -1079,10 +1091,8 @@ cmd_emer_reset(struct ctl_context *ctx)
         /* We only want to save the "hwaddr" key from other_config. */
         hwaddr = smap_get(&br->other_config, "hwaddr");
         if (hwaddr) {
-            struct smap smap = SMAP_INITIALIZER(&smap);
-            smap_add(&smap, "hwaddr", hwaddr);
+            const struct smap smap = SMAP_CONST1(&smap, "hwaddr", hwaddr);
             ovsrec_bridge_set_other_config(br, &smap);
-            smap_destroy(&smap);
         } else {
             ovsrec_bridge_set_other_config(br, NULL);
         }
@@ -2771,6 +2781,6 @@ static const struct ctl_command_syntax vsctl_commands[] = {
 static void
 vsctl_cmd_init(void)
 {
-    ctl_init(tables, vsctl_exit);
+    ctl_init(tables, cmd_show_tables, vsctl_exit);
     ctl_register_commands(vsctl_commands);
 }