@@ -267,9 +267,13 @@ static void bfd_status_changed(struct bfd *) OVS_REQUIRES(mutex);
static void bfd_forwarding_if_rx_update(struct bfd *) OVS_REQUIRES(mutex);
static void bfd_unixctl_show(struct unixctl_conn *, int argc,
- const char *argv[], void *aux OVS_UNUSED);
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED);
static void bfd_unixctl_set_forwarding_override(struct unixctl_conn *,
int argc, const char *argv[],
+ enum ovs_output_fmt fmt
+ OVS_UNUSED,
void *aux OVS_UNUSED);
static void log_msg(enum vlog_level, const struct msg *, const char *message,
const struct bfd *) OVS_REQUIRES(mutex);
@@ -339,9 +343,10 @@ void
bfd_init(void)
{
unixctl_command_register("bfd/show", "[interface]", 0, 1,
- bfd_unixctl_show, NULL);
+ OVS_OUTPUT_FMT_TEXT, bfd_unixctl_show, NULL);
unixctl_command_register("bfd/set-forwarding",
"[interface] normal|false|true", 1, 2,
+ OVS_OUTPUT_FMT_TEXT,
bfd_unixctl_set_forwarding_override, NULL);
}
@@ -1311,7 +1316,8 @@ bfd_put_details(struct ds *ds, const struct bfd *bfd) OVS_REQUIRES(mutex)
static void
bfd_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
- void *aux OVS_UNUSED) OVS_EXCLUDED(mutex)
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
+ OVS_EXCLUDED(mutex)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct bfd *bfd;
@@ -1340,7 +1346,9 @@ out:
static void
bfd_unixctl_set_forwarding_override(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
OVS_EXCLUDED(mutex)
{
const char *forward_str = argv[argc - 1];
@@ -327,10 +327,12 @@ lookup_remote_mp(const struct cfm *cfm, uint64_t mpid) OVS_REQUIRES(mutex)
void
cfm_init(void)
{
- unixctl_command_register("cfm/show", "[interface]", 0, 1, cfm_unixctl_show,
+ unixctl_command_register("cfm/show", "[interface]", 0, 1,
+ OVS_OUTPUT_FMT_TEXT, cfm_unixctl_show,
NULL);
unixctl_command_register("cfm/set-fault", "[interface] normal|false|true",
- 1, 2, cfm_unixctl_set_fault, NULL);
+ 1, 2, OVS_OUTPUT_FMT_TEXT, cfm_unixctl_set_fault,
+ NULL);
}
/* Records the status change and changes the global connectivity seq. */
@@ -1061,7 +1063,8 @@ cfm_print_details(struct ds *ds, struct cfm *cfm) OVS_REQUIRES(mutex)
static void
cfm_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
- void *aux OVS_UNUSED) OVS_EXCLUDED(mutex)
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
+ OVS_EXCLUDED(mutex)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct cfm *cfm;
@@ -1088,7 +1091,9 @@ out:
static void
cfm_unixctl_set_fault(struct unixctl_conn *conn, int argc, const char *argv[],
- void *aux OVS_UNUSED) OVS_EXCLUDED(mutex)
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
+ OVS_EXCLUDED(mutex)
{
const char *fault_str = argv[argc - 1];
int fault_override;
@@ -61,7 +61,9 @@ coverage_counter_register(struct coverage_counter* counter)
static void
coverage_unixctl_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct svec lines;
char *reply;
@@ -76,7 +78,9 @@ coverage_unixctl_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
coverage_unixctl_read_counter(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
unsigned long long count;
char *reply;
@@ -96,9 +100,10 @@ coverage_unixctl_read_counter(struct unixctl_conn *conn, int argc OVS_UNUSED,
void
coverage_init(void)
{
- unixctl_command_register("coverage/show", "", 0, 0,
+ unixctl_command_register("coverage/show", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
coverage_unixctl_show, NULL);
unixctl_command_register("coverage/read-counter", "COUNTER", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
coverage_unixctl_read_counter, NULL);
}
@@ -66,6 +66,7 @@ struct dpctl_command {
const char *usage;
int min_args;
int max_args;
+ int output_fmts;
dpctl_command_handler *handler;
enum { DP_RO, DP_RW} mode;
};
@@ -2990,69 +2991,93 @@ out:
}
static const struct dpctl_command all_commands[] = {
- { "add-dp", "dp [iface...]", 1, INT_MAX, dpctl_add_dp, DP_RW },
- { "del-dp", "dp", 1, 1, dpctl_del_dp, DP_RW },
- { "add-if", "dp iface...", 2, INT_MAX, dpctl_add_if, DP_RW },
- { "del-if", "dp iface...", 2, INT_MAX, dpctl_del_if, DP_RW },
- { "set-if", "dp iface...", 2, INT_MAX, dpctl_set_if, DP_RW },
- { "dump-dps", "", 0, 0, dpctl_dump_dps, DP_RO },
- { "show", "[-s] [dp...]", 0, INT_MAX, dpctl_show, DP_RO },
+ { "add-dp", "dp [iface...]", 1, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ dpctl_add_dp, DP_RW },
+ { "del-dp", "dp", 1, 1, OVS_OUTPUT_FMT_TEXT, dpctl_del_dp, DP_RW },
+ { "add-if", "dp iface...", 2, INT_MAX, OVS_OUTPUT_FMT_TEXT, dpctl_add_if,
+ DP_RW },
+ { "del-if", "dp iface...", 2, INT_MAX, OVS_OUTPUT_FMT_TEXT, dpctl_del_if,
+ DP_RW },
+ { "set-if", "dp iface...", 2, INT_MAX, OVS_OUTPUT_FMT_TEXT, dpctl_set_if,
+ DP_RW },
+ { "dump-dps", "", 0, 0, OVS_OUTPUT_FMT_TEXT, dpctl_dump_dps, DP_RO },
+ { "show", "[-s] [dp...]", 0, INT_MAX, OVS_OUTPUT_FMT_TEXT, dpctl_show,
+ DP_RO },
{ "dump-flows", "[-m] [--names] [dp] [filter=..] [type=..] [pmd=..]",
- 0, 6, dpctl_dump_flows, DP_RO },
- { "add-flow", "[dp] flow actions", 2, 3, dpctl_add_flow, DP_RW },
- { "mod-flow", "[dp] flow actions", 2, 3, dpctl_mod_flow, DP_RW },
- { "get-flow", "[dp] ufid", 1, 2, dpctl_get_flow, DP_RO },
- { "del-flow", "[dp] flow", 1, 2, dpctl_del_flow, DP_RW },
- { "add-flows", "[dp] file", 1, 2, dpctl_process_flows, DP_RW },
- { "mod-flows", "[dp] file", 1, 2, dpctl_process_flows, DP_RW },
- { "del-flows", "[dp] [file]", 0, 2, dpctl_del_flows, DP_RW },
+ 0, 6, OVS_OUTPUT_FMT_TEXT, dpctl_dump_flows, DP_RO },
+ { "add-flow", "[dp] flow actions", 2, 3, OVS_OUTPUT_FMT_TEXT,
+ dpctl_add_flow, DP_RW },
+ { "mod-flow", "[dp] flow actions", 2, 3, OVS_OUTPUT_FMT_TEXT,
+ dpctl_mod_flow, DP_RW },
+ { "get-flow", "[dp] ufid", 1, 2, OVS_OUTPUT_FMT_TEXT, dpctl_get_flow,
+ DP_RO },
+ { "del-flow", "[dp] flow", 1, 2, OVS_OUTPUT_FMT_TEXT, dpctl_del_flow,
+ DP_RW },
+ { "add-flows", "[dp] file", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_process_flows, DP_RW },
+ { "mod-flows", "[dp] file", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_process_flows, DP_RW },
+ { "del-flows", "[dp] [file]", 0, 2, OVS_OUTPUT_FMT_TEXT, dpctl_del_flows,
+ DP_RW },
{ "offload-stats-show", "[dp]",
- 0, 1, dpctl_offload_stats_show, DP_RO },
+ 0, 1, OVS_OUTPUT_FMT_TEXT, dpctl_offload_stats_show, DP_RO },
{ "dump-conntrack", "[-m] [-s] [dp] [zone=N]",
- 0, 4, dpctl_dump_conntrack, DP_RO },
+ 0, 4, OVS_OUTPUT_FMT_TEXT, dpctl_dump_conntrack, DP_RO },
{ "dump-conntrack-exp", "[dp] [zone=N]",
- 0, 2, dpctl_dump_conntrack_exp, DP_RO },
+ 0, 2, OVS_OUTPUT_FMT_TEXT, dpctl_dump_conntrack_exp, DP_RO },
{ "flush-conntrack", "[dp] [zone=N] [ct-orig-tuple] [ct-reply-tuple]",
- 0, 4, dpctl_flush_conntrack, DP_RW },
- { "cache-get-size", "[dp]", 0, 1, dpctl_cache_get_size, DP_RO },
- { "cache-set-size", "dp cache <size>", 3, 3, dpctl_cache_set_size, DP_RW },
+ 0, 4, OVS_OUTPUT_FMT_TEXT, dpctl_flush_conntrack, DP_RW },
+ { "cache-get-size", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpctl_cache_get_size, DP_RO },
+ { "cache-set-size", "dp cache <size>", 3, 3, OVS_OUTPUT_FMT_TEXT,
+ dpctl_cache_set_size, DP_RW },
{ "ct-stats-show", "[dp] [zone=N]",
- 0, 3, dpctl_ct_stats_show, DP_RO },
- { "ct-bkts", "[dp] [gt=N]", 0, 2, dpctl_ct_bkts, DP_RO },
- { "ct-set-maxconns", "[dp] maxconns", 1, 2, dpctl_ct_set_maxconns,
- DP_RW },
- { "ct-get-maxconns", "[dp]", 0, 1, dpctl_ct_get_maxconns, DP_RO },
- { "ct-get-nconns", "[dp]", 0, 1, dpctl_ct_get_nconns, DP_RO },
- { "ct-enable-tcp-seq-chk", "[dp]", 0, 1, dpctl_ct_enable_tcp_seq_chk,
- DP_RW },
- { "ct-disable-tcp-seq-chk", "[dp]", 0, 1, dpctl_ct_disable_tcp_seq_chk,
- DP_RW },
- { "ct-get-tcp-seq-chk", "[dp]", 0, 1, dpctl_ct_get_tcp_seq_chk, DP_RO },
+ 0, 3, OVS_OUTPUT_FMT_TEXT, dpctl_ct_stats_show, DP_RO },
+ { "ct-bkts", "[dp] [gt=N]", 0, 2, OVS_OUTPUT_FMT_TEXT, dpctl_ct_bkts,
+ DP_RO },
+ { "ct-set-maxconns", "[dp] maxconns", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_set_maxconns, DP_RW },
+ { "ct-get-maxconns", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_get_maxconns, DP_RO },
+ { "ct-get-nconns", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT, dpctl_ct_get_nconns,
+ DP_RO },
+ { "ct-enable-tcp-seq-chk", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_enable_tcp_seq_chk, DP_RW },
+ { "ct-disable-tcp-seq-chk", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_disable_tcp_seq_chk, DP_RW },
+ { "ct-get-tcp-seq-chk", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_get_tcp_seq_chk, DP_RO },
{ "ct-set-limits", "[dp] [default=L] [zone=N,limit=L]...", 1, INT_MAX,
- dpctl_ct_set_limits, DP_RO },
- { "ct-del-limits", "[dp] zone=N1[,N2]...", 1, 2, dpctl_ct_del_limits,
- DP_RO },
- { "ct-get-limits", "[dp] [zone=N1[,N2]...]", 0, 2, dpctl_ct_get_limits,
- DP_RO },
- { "ct-get-sweep-interval", "[dp]", 0, 1, dpctl_ct_get_sweep, DP_RO },
- { "ct-set-sweep-interval", "[dp] ms", 1, 2, dpctl_ct_set_sweep, DP_RW },
- { "ipf-set-enabled", "[dp] v4|v6", 1, 2, dpctl_ipf_set_enabled, DP_RW },
- { "ipf-set-disabled", "[dp] v4|v6", 1, 2, dpctl_ipf_set_disabled, DP_RW },
+ OVS_OUTPUT_FMT_TEXT, dpctl_ct_set_limits, DP_RO },
+ { "ct-del-limits", "[dp] zone=N1[,N2]...", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_del_limits, DP_RO },
+ { "ct-get-limits", "[dp] [zone=N1[,N2]...]", 0, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_get_limits, DP_RO },
+ { "ct-get-sweep-interval", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_get_sweep, DP_RO },
+ { "ct-set-sweep-interval", "[dp] ms", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_set_sweep, DP_RW },
+ { "ipf-set-enabled", "[dp] v4|v6", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ipf_set_enabled, DP_RW },
+ { "ipf-set-disabled", "[dp] v4|v6", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ipf_set_disabled, DP_RW },
{ "ipf-set-min-frag", "[dp] v4|v6 minfragment", 2, 3,
- dpctl_ipf_set_min_frag, DP_RW },
+ OVS_OUTPUT_FMT_TEXT, dpctl_ipf_set_min_frag, DP_RW },
{ "ipf-set-max-nfrags", "[dp] maxfrags", 1, 2,
- dpctl_ipf_set_max_nfrags, DP_RW },
- { "ipf-get-status", "[dp]", 0, 1, dpctl_ct_ipf_get_status,
- DP_RO },
- { "help", "", 0, INT_MAX, dpctl_help, DP_RO },
- { "list-commands", "", 0, INT_MAX, dpctl_list_commands, DP_RO },
+ OVS_OUTPUT_FMT_TEXT, dpctl_ipf_set_max_nfrags, DP_RW },
+ { "ipf-get-status", "[dp]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpctl_ct_ipf_get_status, DP_RO },
+ { "help", "", 0, INT_MAX, OVS_OUTPUT_FMT_TEXT, dpctl_help, DP_RO },
+ { "list-commands", "", 0, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ dpctl_list_commands, DP_RO },
/* Undocumented commands for testing. */
- { "parse-actions", "actions", 1, INT_MAX, dpctl_parse_actions, DP_RO },
+ { "parse-actions", "actions", 1, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ dpctl_parse_actions, DP_RO },
{ "normalize-actions", "actions",
- 2, INT_MAX, dpctl_normalize_actions, DP_RO },
+ 2, INT_MAX, OVS_OUTPUT_FMT_TEXT, dpctl_normalize_actions, DP_RO },
- { NULL, NULL, 0, 0, NULL, DP_RO },
+ { NULL, NULL, 0, 0, 0, NULL, DP_RO },
};
static const struct dpctl_command *get_all_dpctl_commands(void)
@@ -3111,7 +3136,7 @@ dpctl_unixctl_print(void *userdata, bool error OVS_UNUSED, const char *msg)
static void
dpctl_unixctl_handler(struct unixctl_conn *conn, int argc, const char *argv[],
- void *aux)
+ enum ovs_output_fmt fmt, void *aux)
{
struct ds ds = DS_EMPTY_INITIALIZER;
bool error = false;
@@ -3120,6 +3145,7 @@ dpctl_unixctl_handler(struct unixctl_conn *conn, int argc, const char *argv[],
.is_appctl = true,
.output = dpctl_unixctl_print,
.aux = &ds,
+ .format = fmt,
};
/* Parse options (like getopt). Unfortunately it does
@@ -3208,6 +3234,7 @@ dpctl_unixctl_register(void)
p->usage,
p->min_args,
p->max_args,
+ p->output_fmts,
dpctl_unixctl_handler,
p->handler);
free(cmd_name);
@@ -213,7 +213,8 @@ static cookie_io_functions_t dpdk_log_func = {
static void
dpdk_unixctl_mem_stream(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux)
{
void (*callback)(FILE *) = aux;
char *response = NULL;
@@ -260,6 +261,7 @@ dpdk_parse_log_level(const char *s)
static void
dpdk_unixctl_log_set(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
int i;
@@ -427,14 +429,15 @@ dpdk_init__(const struct smap *ovs_other_config)
}
}
- unixctl_command_register("dpdk/lcore-list", "", 0, 0,
- dpdk_unixctl_mem_stream, rte_lcore_dump);
- unixctl_command_register("dpdk/log-list", "", 0, 0,
+ unixctl_command_register("dpdk/lcore-list", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ dpdk_unixctl_mem_stream, rte_lcore_dump);
+ unixctl_command_register("dpdk/log-list", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
dpdk_unixctl_mem_stream, rte_log_dump);
unixctl_command_register("dpdk/log-set", "{level | pattern:level}", 0,
- INT_MAX, dpdk_unixctl_log_set, NULL);
+ INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ dpdk_unixctl_log_set, NULL);
unixctl_command_register("dpdk/get-malloc-stats", "", 0, 0,
- dpdk_unixctl_mem_stream,
+ OVS_OUTPUT_FMT_TEXT, dpdk_unixctl_mem_stream,
malloc_dump_stats_wrapper);
/* We are called from the main thread here */
@@ -706,6 +706,7 @@ pmd_perf_log_susp_iteration_neighborhood(struct pmd_perf_stats *s)
void
pmd_perf_log_set_cmd(struct unixctl_conn *conn,
int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
unsigned int it_before, it_after, us_thr, q_thr;
@@ -432,6 +432,7 @@ void pmd_perf_format_ms_history(struct ds *str, struct pmd_perf_stats *s,
int n_ms);
void pmd_perf_log_set_cmd(struct unixctl_conn *conn,
int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED);
#ifdef __cplusplus
@@ -1010,6 +1010,7 @@ sorted_poll_thread_list(struct dp_netdev *dp,
static void
dpif_netdev_subtable_lookup_get(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
@@ -1021,7 +1022,9 @@ dpif_netdev_subtable_lookup_get(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
dpif_netdev_subtable_lookup_set(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
/* This function requires 2 parameters (argv[1] and argv[2]) to execute.
* argv[1] is subtable name
@@ -1101,7 +1104,9 @@ dpif_netdev_subtable_lookup_set(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
dpif_netdev_impl_get(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
struct shash_node *node;
@@ -1125,7 +1130,8 @@ dpif_netdev_impl_get(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
dpif_netdev_impl_set(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
/* This function requires just one parameter, the DPIF name. */
const char *dpif_name = argv[1];
@@ -1187,6 +1193,7 @@ dpif_netdev_impl_set(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
dpif_miniflow_extract_impl_get(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
@@ -1211,7 +1218,9 @@ dpif_miniflow_extract_impl_get(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
dpif_miniflow_extract_impl_set(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
/* This command takes some optional and mandatory arguments. The function
* here first parses all of the options, saving results in local variables.
@@ -1400,7 +1409,9 @@ error:
static void
dpif_netdev_pmd_rebalance(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
struct dp_netdev *dp = NULL;
@@ -1430,7 +1441,7 @@ dpif_netdev_pmd_rebalance(struct unixctl_conn *conn, int argc,
static void
dpif_netdev_pmd_info(struct unixctl_conn *conn, int argc, const char *argv[],
- void *aux)
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux)
{
struct ds reply = DS_EMPTY_INITIALIZER;
struct dp_netdev_pmd_thread **pmd_list;
@@ -1529,9 +1540,8 @@ dpif_netdev_pmd_info(struct unixctl_conn *conn, int argc, const char *argv[],
}
static void
-pmd_perf_show_cmd(struct unixctl_conn *conn, int argc,
- const char *argv[],
- void *aux OVS_UNUSED)
+pmd_perf_show_cmd(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt, void *aux OVS_UNUSED)
{
struct pmd_perf_params par;
long int it_hist = 0, ms_hist = 0;
@@ -1567,12 +1577,13 @@ pmd_perf_show_cmd(struct unixctl_conn *conn, int argc,
par.iter_hist_len = it_hist;
par.ms_hist_len = ms_hist;
par.command_type = PMD_INFO_PERF_SHOW;
- dpif_netdev_pmd_info(conn, argc, argv, &par);
+ dpif_netdev_pmd_info(conn, argc, argv, fmt, &par);
}
static void
-dpif_netdev_bond_show(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+dpif_netdev_bond_show(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
struct dp_netdev *dp = NULL;
@@ -1622,60 +1633,60 @@ dpif_netdev_init(void)
sleep_aux = PMD_INFO_SLEEP_SHOW;
unixctl_command_register("dpif-netdev/pmd-stats-show", "[-pmd core] [dp]",
- 0, 3, dpif_netdev_pmd_info,
+ 0, 3, OVS_OUTPUT_FMT_TEXT, dpif_netdev_pmd_info,
(void *)&show_aux);
unixctl_command_register("dpif-netdev/pmd-stats-clear", "[-pmd core] [dp]",
- 0, 3, dpif_netdev_pmd_info,
+ 0, 3, OVS_OUTPUT_FMT_TEXT, dpif_netdev_pmd_info,
(void *)&clear_aux);
unixctl_command_register("dpif-netdev/pmd-rxq-show", "[-pmd core] "
"[-secs secs] [dp]",
- 0, 5, dpif_netdev_pmd_info,
+ 0, 5, OVS_OUTPUT_FMT_TEXT, dpif_netdev_pmd_info,
(void *)&poll_aux);
unixctl_command_register("dpif-netdev/pmd-sleep-show", "[dp]",
- 0, 1, dpif_netdev_pmd_info,
+ 0, 1, OVS_OUTPUT_FMT_TEXT, dpif_netdev_pmd_info,
(void *)&sleep_aux);
unixctl_command_register("dpif-netdev/pmd-perf-show",
"[-nh] [-it iter-history-len]"
" [-ms ms-history-len]"
" [-pmd core] [dp]",
- 0, 8, pmd_perf_show_cmd,
+ 0, 8, OVS_OUTPUT_FMT_TEXT, pmd_perf_show_cmd,
NULL);
unixctl_command_register("dpif-netdev/pmd-rxq-rebalance", "[dp]",
- 0, 1, dpif_netdev_pmd_rebalance,
- NULL);
+ 0, 1, OVS_OUTPUT_FMT_TEXT,
+ dpif_netdev_pmd_rebalance, NULL);
unixctl_command_register("dpif-netdev/pmd-perf-log-set",
"on|off [-b before] [-a after] [-e|-ne] "
"[-us usec] [-q qlen]",
- 0, 10, pmd_perf_log_set_cmd,
+ 0, 10, OVS_OUTPUT_FMT_TEXT, pmd_perf_log_set_cmd,
NULL);
unixctl_command_register("dpif-netdev/bond-show", "[dp]",
- 0, 1, dpif_netdev_bond_show,
+ 0, 1, OVS_OUTPUT_FMT_TEXT, dpif_netdev_bond_show,
NULL);
unixctl_command_register("dpif-netdev/subtable-lookup-prio-set",
"[lookup_func] [prio]",
- 2, 2, dpif_netdev_subtable_lookup_set,
- NULL);
+ 2, 2, OVS_OUTPUT_FMT_TEXT,
+ dpif_netdev_subtable_lookup_set, NULL);
unixctl_command_register("dpif-netdev/subtable-lookup-info-get", "",
- 0, 0, dpif_netdev_subtable_lookup_get,
- NULL);
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ dpif_netdev_subtable_lookup_get, NULL);
unixctl_command_register("dpif-netdev/subtable-lookup-prio-get", NULL,
- 0, 0, dpif_netdev_subtable_lookup_get,
- NULL);
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ dpif_netdev_subtable_lookup_get, NULL);
unixctl_command_register("dpif-netdev/dpif-impl-set",
"dpif_implementation_name",
- 1, 1, dpif_netdev_impl_set,
+ 1, 1, OVS_OUTPUT_FMT_TEXT, dpif_netdev_impl_set,
NULL);
unixctl_command_register("dpif-netdev/dpif-impl-get", "",
- 0, 0, dpif_netdev_impl_get,
+ 0, 0, OVS_OUTPUT_FMT_TEXT, dpif_netdev_impl_get,
NULL);
unixctl_command_register("dpif-netdev/miniflow-parser-set",
"[-pmd core] miniflow_implementation_name"
" [study_pkt_cnt]",
- 1, 5, dpif_miniflow_extract_impl_set,
- NULL);
+ 1, 5, OVS_OUTPUT_FMT_TEXT,
+ dpif_miniflow_extract_impl_set, NULL);
unixctl_command_register("dpif-netdev/miniflow-parser-get", "",
- 0, 0, dpif_miniflow_extract_impl_get,
- NULL);
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ dpif_miniflow_extract_impl_get, NULL);
return 0;
}
@@ -9833,7 +9844,9 @@ const struct dpif_class dpif_netdev_class = {
static void
dpif_dummy_change_port_number(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct dp_netdev_port *port;
struct dp_netdev *dp;
@@ -9929,7 +9942,8 @@ dpif_dummy_register(enum dummy_level level)
unixctl_command_register("dpif-dummy/change-port-number",
"dp port new-number",
- 3, 3, dpif_dummy_change_port_number, NULL);
+ 3, 3, OVS_OUTPUT_FMT_TEXT,
+ dpif_dummy_change_port_number, NULL);
}
/* Datapath Classifier. */
@@ -124,7 +124,9 @@ dpif_netlink_set_features(struct dpif *dpif_, uint32_t new_features);
static void
dpif_netlink_unixctl_dispatch_mode(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux);
struct dpif_netlink_flow {
/* Generic Netlink header. */
@@ -4651,6 +4653,7 @@ dpif_netlink_init(void)
ovs_tunnels_out_of_tree = dpif_netlink_rtnl_probe_oot_tunnels();
unixctl_command_register("dpif-netlink/dispatch-mode", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
dpif_netlink_unixctl_dispatch_mode, NULL);
ovsthread_once_done(&once);
@@ -5304,6 +5307,7 @@ static void
dpif_netlink_unixctl_dispatch_mode(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
@@ -225,10 +225,11 @@ parse_lacp_packet(const struct dp_packet *p, enum pdu_subtype *subtype)
void
lacp_init(void)
{
- unixctl_command_register("lacp/show", "[port]", 0, 1,
+ unixctl_command_register("lacp/show", "[port]", 0, 1, OVS_OUTPUT_FMT_TEXT,
lacp_unixctl_show, NULL);
unixctl_command_register("lacp/show-stats", "[port]", 0, 1,
- lacp_unixctl_show_stats, NULL);
+ OVS_OUTPUT_FMT_TEXT, lacp_unixctl_show_stats,
+ NULL);
}
static void
@@ -1114,6 +1115,7 @@ lacp_print_stats(struct ds *ds, struct lacp *lacp) OVS_REQUIRES(mutex)
static void
lacp_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED) OVS_EXCLUDED(mutex)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -1144,6 +1146,7 @@ static void
lacp_unixctl_show_stats(struct unixctl_conn *conn,
int argc,
const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED) OVS_EXCLUDED(mutex)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -160,7 +160,8 @@ memory_report(const struct simap *usage)
static void
memory_unixctl_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
conns = xrealloc(conns, (n_conns + 1) * sizeof *conns);
conns[n_conns++] = conn;
@@ -173,7 +174,7 @@ memory_init(void)
if (!inited) {
inited = true;
- unixctl_command_register("memory/show", "", 0, 0,
+ unixctl_command_register("memory/show", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
memory_unixctl_show, NULL);
next_check = time_boot_msec() + MEMORY_CHECK_INTERVAL;
@@ -4217,7 +4217,9 @@ netdev_dpdk_set_admin_state__(struct netdev_dpdk *dev, bool admin_state)
static void
netdev_dpdk_set_admin_state(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
bool up;
@@ -4262,7 +4264,9 @@ netdev_dpdk_set_admin_state(struct unixctl_conn *conn, int argc,
static void
netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds used_interfaces = DS_EMPTY_INITIALIZER;
struct rte_eth_dev_info dev_info;
@@ -4329,6 +4333,7 @@ error:
static void
netdev_dpdk_get_mempool_info(struct unixctl_conn *conn,
int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
size_t size;
@@ -4841,19 +4846,22 @@ netdev_dpdk_class_init(void)
ovs_thread_create("dpdk_watchdog", dpdk_watchdog, NULL);
unixctl_command_register("netdev-dpdk/set-admin-state",
"[netdev] up|down", 1, 2,
+ OVS_OUTPUT_FMT_TEXT,
netdev_dpdk_set_admin_state, NULL);
unixctl_command_register("netdev-dpdk/detach",
"pci address of device", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
netdev_dpdk_detach, NULL);
unixctl_command_register("netdev-dpdk/get-mempool-info",
- "[netdev]", 0, 1,
+ "[netdev]", 0, 1, OVS_OUTPUT_FMT_TEXT,
netdev_dpdk_get_mempool_info, NULL);
ret = rte_eth_dev_callback_register(RTE_ETH_ALL,
RTE_ETH_EVENT_INTR_RESET,
- dpdk_eth_event_callback, NULL);
+ dpdk_eth_event_callback,
+ NULL);
if (ret != 0) {
VLOG_ERR("Ethernet device callback register error: %s",
rte_strerror(-ret));
@@ -1848,7 +1848,8 @@ netdev_dummy_queue_packet(struct netdev_dummy *dummy, struct dp_packet *packet,
static void
netdev_dummy_receive(struct unixctl_conn *conn,
- int argc, const char *argv[], void *aux OVS_UNUSED)
+ int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct netdev_dummy *dummy_dev;
struct netdev *netdev;
@@ -1931,7 +1932,9 @@ netdev_dummy_set_admin_state__(struct netdev_dummy *dev, bool admin_state)
static void
netdev_dummy_set_admin_state(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
bool up;
@@ -1997,7 +2000,9 @@ display_conn_state__(struct ds *s, const char *name,
static void
netdev_dummy_conn_state(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
enum dummy_netdev_conn_state state = CONN_STATE_UNKNOWN;
struct ds s;
@@ -2039,7 +2044,9 @@ netdev_dummy_conn_state(struct unixctl_conn *conn, int argc,
static void
netdev_dummy_ip4addr(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct netdev *netdev = netdev_from_name(argv[1]);
@@ -2064,7 +2071,8 @@ netdev_dummy_ip4addr(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
netdev_dummy_ip6addr(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct netdev *netdev = netdev_from_name(argv[1]);
@@ -2116,18 +2124,20 @@ netdev_dummy_register(enum dummy_level level)
{
unixctl_command_register("netdev-dummy/receive",
"name [--qid queue_id] packet|flow [--len packet_len]",
- 2, INT_MAX, netdev_dummy_receive, NULL);
+ 2, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ netdev_dummy_receive, NULL);
unixctl_command_register("netdev-dummy/set-admin-state",
- "[netdev] up|down", 1, 2,
+ "[netdev] up|down", 1, 2, OVS_OUTPUT_FMT_TEXT,
netdev_dummy_set_admin_state, NULL);
unixctl_command_register("netdev-dummy/conn-state",
- "[netdev]", 0, 1,
+ "[netdev]", 0, 1, OVS_OUTPUT_FMT_TEXT,
netdev_dummy_conn_state, NULL);
unixctl_command_register("netdev-dummy/ip4addr",
"[netdev] ipaddr/mask-prefix-len", 2, 2,
- netdev_dummy_ip4addr, NULL);
+ OVS_OUTPUT_FMT_TEXT, netdev_dummy_ip4addr,
+ NULL);
unixctl_command_register("netdev-dummy/ip6addr",
- "[netdev] ip6addr", 2, 2,
+ "[netdev] ip6addr", 2, 2, OVS_OUTPUT_FMT_TEXT,
netdev_dummy_ip6addr, NULL);
if (level == DUMMY_OVERRIDE_ALL) {
@@ -1181,7 +1181,9 @@ netdev_geneve_build_header(const struct netdev *netdev,
void
netdev_tnl_egress_port_range(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
int val1, val2;
@@ -142,5 +142,7 @@ netdev_tnl_push_ip_header(struct dp_packet *packet, const void *header,
int size, int *ip_tot_size, ovs_be32 ipv6_label);
void
netdev_tnl_egress_port_range(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED);
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED);
#endif
@@ -1389,6 +1389,7 @@ netdev_vport_tunnel_register(void)
}
unixctl_command_register("tnl/egress_port_range", "min max", 0, 2,
+ OVS_OUTPUT_FMT_TEXT,
netdev_tnl_egress_port_range, NULL);
ovsthread_once_done(&once);
@@ -916,7 +916,8 @@ odp_actions_impl_set(const char *name)
static void
action_impl_set(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
@@ -936,7 +937,8 @@ action_impl_set(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
action_impl_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
@@ -949,10 +951,10 @@ static void
odp_execute_unixctl_init(void)
{
unixctl_command_register("odp-execute/action-impl-set", "name",
- 1, 1, action_impl_set,
+ 1, 1, OVS_OUTPUT_FMT_TEXT, action_impl_set,
NULL);
unixctl_command_register("odp-execute/action-impl-show", "",
- 0, 0, action_impl_show,
+ 0, 0, OVS_OUTPUT_FMT_TEXT, action_impl_show,
NULL);
}
@@ -326,7 +326,8 @@ aa_print_isid_status(struct ds *ds, struct lldp *lldp) OVS_REQUIRES(mutex)
static void
aa_unixctl_status(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
OVS_EXCLUDED(mutex)
{
struct lldp *lldp;
@@ -345,7 +346,8 @@ aa_unixctl_status(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
aa_unixctl_show_isid(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
OVS_EXCLUDED(mutex)
{
struct lldp *lldp;
@@ -364,7 +366,8 @@ aa_unixctl_show_isid(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
aa_unixctl_statistics(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
OVS_EXCLUDED(mutex)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -644,11 +647,12 @@ void
lldp_init(void)
{
unixctl_command_register("autoattach/status", "[bridge]", 0, 1,
- aa_unixctl_status, NULL);
+ OVS_OUTPUT_FMT_TEXT, aa_unixctl_status, NULL);
unixctl_command_register("autoattach/show-isid", "[bridge]", 0, 1,
- aa_unixctl_show_isid, NULL);
+ OVS_OUTPUT_FMT_TEXT, aa_unixctl_show_isid, NULL);
unixctl_command_register("autoattach/statistics", "[bridge]", 0, 1,
- aa_unixctl_statistics, NULL);
+ OVS_OUTPUT_FMT_TEXT, aa_unixctl_statistics,
+ NULL);
}
/* Returns true if 'lldp' should process packets from 'flow'. Sets
@@ -389,8 +389,8 @@ scan_ipv4_route(const char *s, ovs_be32 *addr, unsigned int *plen)
}
static void
-ovs_router_add(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ovs_router_add(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct in6_addr src6 = in6addr_any;
struct in6_addr gw6 = in6addr_any;
@@ -463,7 +463,8 @@ ovs_router_add(struct unixctl_conn *conn, int argc,
static void
ovs_router_del(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct in6_addr ip6;
uint32_t mark = 0;
@@ -494,7 +495,8 @@ ovs_router_del(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovs_router_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ovs_router_entry *rt;
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -534,8 +536,9 @@ ovs_router_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
}
static void
-ovs_router_lookup_cmd(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ovs_router_lookup_cmd(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct in6_addr gw, src = in6addr_any;
char iface[IFNAMSIZ];
@@ -605,14 +608,15 @@ ovs_router_init(void)
unixctl_command_register("ovs/route/add",
"ip/plen output_bridge [gw] "
"[pkt_mark=mark] [src=src_ip]",
- 2, 5, ovs_router_add, NULL);
+ 2, 5, OVS_OUTPUT_FMT_TEXT, ovs_router_add,
+ NULL);
unixctl_command_register("ovs/route/show", "", 0, 0,
- ovs_router_show, NULL);
+ OVS_OUTPUT_FMT_TEXT, ovs_router_show, NULL);
unixctl_command_register("ovs/route/del", "ip/plen "
- "[pkt_mark=mark]", 1, 2, ovs_router_del,
- NULL);
+ "[pkt_mark=mark]", 1, 2, OVS_OUTPUT_FMT_TEXT,
+ ovs_router_del, NULL);
unixctl_command_register("ovs/route/lookup", "ip_addr "
- "[pkt_mark=mark]", 1, 2,
+ "[pkt_mark=mark]", 1, 2, OVS_OUTPUT_FMT_TEXT,
ovs_router_lookup_cmd, NULL);
ovsthread_once_done(&once);
}
@@ -129,9 +129,11 @@ static struct rstp_port *rstp_get_root_port__(const struct rstp *rstp)
static rstp_identifier rstp_get_root_id__(const struct rstp *rstp)
OVS_REQUIRES(rstp_mutex);
static void rstp_unixctl_tcn(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux);
static void rstp_unixctl_show(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux);
const char *
rstp_state_name(enum rstp_state state)
@@ -248,10 +250,10 @@ void
rstp_init(void)
OVS_EXCLUDED(rstp_mutex)
{
- unixctl_command_register("rstp/tcn", "[bridge]", 0, 1, rstp_unixctl_tcn,
- NULL);
- unixctl_command_register("rstp/show", "[bridge]", 0, 1, rstp_unixctl_show,
- NULL);
+ unixctl_command_register("rstp/tcn", "[bridge]", 0, 1,
+ OVS_OUTPUT_FMT_TEXT, rstp_unixctl_tcn, NULL);
+ unixctl_command_register("rstp/show", "[bridge]", 0, 1,
+ OVS_OUTPUT_FMT_TEXT, rstp_unixctl_show, NULL);
}
/* Creates and returns a new RSTP instance that initially has no ports. */
@@ -1550,8 +1552,8 @@ rstp_find(const char *name)
}
static void
-rstp_unixctl_tcn(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+rstp_unixctl_tcn(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
OVS_EXCLUDED(rstp_mutex)
{
ovs_mutex_lock(&rstp_mutex);
@@ -1651,8 +1653,8 @@ rstp_print_details(struct ds *ds, const struct rstp *rstp)
}
static void
-rstp_unixctl_show(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+rstp_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
OVS_EXCLUDED(rstp_mutex)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -314,7 +314,8 @@ stopwatch_show_protected(int argc, const char *argv[], struct ds *s)
static void
stopwatch_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ds s = DS_EMPTY_INITIALIZER;
bool success;
@@ -351,7 +352,8 @@ stopwatch_packet_write(struct stopwatch_packet *pkt)
static void
stopwatch_reset(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct stopwatch_packet *pkt = stopwatch_packet_create(OP_RESET);
if (argc > 1) {
@@ -488,9 +490,9 @@ static void
do_init_stopwatch(void)
{
unixctl_command_register("stopwatch/show", "[NAME]", 0, 1,
- stopwatch_show, NULL);
+ OVS_OUTPUT_FMT_TEXT, stopwatch_show, NULL);
unixctl_command_register("stopwatch/reset", "[NAME]", 0, 1,
- stopwatch_reset, NULL);
+ OVS_OUTPUT_FMT_TEXT, stopwatch_reset, NULL);
guarded_list_init(&stopwatch_commands);
latch_init(&stopwatch_latch);
stopwatch_thread_id = ovs_thread_create(
@@ -233,9 +233,11 @@ static bool stp_timer_expired(struct stp_timer *, int elapsed, int timeout);
static void stp_send_bpdu(struct stp_port *, const void *, size_t)
OVS_REQUIRES(mutex);
static void stp_unixctl_tcn(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux);
static void stp_unixctl_show(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux);
void
stp_init(void)
@@ -249,10 +251,10 @@ stp_init(void)
* the call back function, but for now this is what we have. */
ovs_mutex_init_recursive(&mutex);
- unixctl_command_register("stp/tcn", "[bridge]", 0, 1, stp_unixctl_tcn,
- NULL);
+ unixctl_command_register("stp/tcn", "[bridge]", 0, 1,
+ OVS_OUTPUT_FMT_TEXT, stp_unixctl_tcn, NULL);
unixctl_command_register("stp/show", "[bridge]", 0, 1,
- stp_unixctl_show, NULL);
+ OVS_OUTPUT_FMT_TEXT, stp_unixctl_show, NULL);
ovsthread_once_done(&once);
}
}
@@ -1611,8 +1613,8 @@ stp_find(const char *name) OVS_REQUIRES(mutex)
}
static void
-stp_unixctl_tcn(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+stp_unixctl_tcn(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
ovs_mutex_lock(&mutex);
if (argc > 1) {
@@ -1702,8 +1704,8 @@ stp_print_details(struct ds *ds, const struct stp *stp)
}
static void
-stp_unixctl_show(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+stp_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -765,8 +765,9 @@ get_cpu_usage(void)
* advancing, except due to later calls to "time/warp". */
static void
timeval_stop_cb(struct unixctl_conn *conn,
- int argc OVS_UNUSED, const char *argv[] OVS_UNUSED,
- void *aux OVS_UNUSED)
+ int argc OVS_UNUSED, const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
ovs_mutex_lock(&monotonic_clock.mutex);
atomic_store_relaxed(&monotonic_clock.slow_path, true);
@@ -789,7 +790,8 @@ timeval_stop_cb(struct unixctl_conn *conn,
* Does not affect wall clock readings. */
static void
timeval_warp_cb(struct unixctl_conn *conn,
- int argc OVS_UNUSED, const char *argv[], void *aux OVS_UNUSED)
+ int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
long long int total_warp = argc > 2 ? atoll(argv[1]) : 0;
long long int msecs = argc > 2 ? atoll(argv[2]) : atoll(argv[1]);
@@ -818,9 +820,10 @@ void
timeval_dummy_register(void)
{
timewarp_enabled = true;
- unixctl_command_register("time/stop", "", 0, 0, timeval_stop_cb, NULL);
+ unixctl_command_register("time/stop", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ timeval_stop_cb, NULL);
unixctl_command_register("time/warp", "[large_msecs] msecs", 1, 2,
- timeval_warp_cb, NULL);
+ OVS_OUTPUT_FMT_TEXT, timeval_warp_cb, NULL);
}
@@ -273,7 +273,9 @@ tnl_neigh_flush(const char br_name[IFNAMSIZ])
static void
tnl_neigh_cache_flush(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct tnl_neigh_entry *neigh;
bool changed = false;
@@ -291,8 +293,9 @@ tnl_neigh_cache_flush(struct unixctl_conn *conn, int argc OVS_UNUSED,
}
static void
-tnl_neigh_cache_aging(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+tnl_neigh_cache_aging(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
long long int new_exp, curr_exp;
struct tnl_neigh_entry *neigh;
@@ -348,7 +351,8 @@ lookup_any(const char *host_name, struct in6_addr *address)
static void
tnl_neigh_cache_add(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
const char *br_name = argv[1];
struct eth_addr mac;
@@ -370,7 +374,9 @@ tnl_neigh_cache_add(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
tnl_neigh_cache_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct tnl_neigh_entry *neigh;
@@ -404,20 +410,23 @@ void
tnl_neigh_cache_init(void)
{
atomic_init(&neigh_aging, NEIGH_ENTRY_DEFAULT_IDLE_TIME_MS);
- unixctl_command_register("tnl/arp/show", "", 0, 0,
+ unixctl_command_register("tnl/arp/show", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
tnl_neigh_cache_show, NULL);
unixctl_command_register("tnl/arp/set", "BRIDGE IP MAC", 3, 3,
- tnl_neigh_cache_add, NULL);
+ OVS_OUTPUT_FMT_TEXT, tnl_neigh_cache_add, NULL);
unixctl_command_register("tnl/arp/flush", "", 0, 0,
- tnl_neigh_cache_flush, NULL);
+ OVS_OUTPUT_FMT_TEXT, tnl_neigh_cache_flush,
+ NULL);
unixctl_command_register("tnl/arp/aging", "[SECS]", 0, 1,
- tnl_neigh_cache_aging, NULL);
+ OVS_OUTPUT_FMT_TEXT, tnl_neigh_cache_aging,
+ NULL);
unixctl_command_register("tnl/neigh/show", "", 0, 0,
- tnl_neigh_cache_show, NULL);
+ OVS_OUTPUT_FMT_TEXT, tnl_neigh_cache_show, NULL);
unixctl_command_register("tnl/neigh/set", "BRIDGE IP MAC", 3, 3,
- tnl_neigh_cache_add, NULL);
- unixctl_command_register("tnl/neigh/flush", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT, tnl_neigh_cache_add, NULL);
+ unixctl_command_register("tnl/neigh/flush", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
tnl_neigh_cache_flush, NULL);
unixctl_command_register("tnl/neigh/aging", "[SECS]", 0, 1,
- tnl_neigh_cache_aging, NULL);
+ OVS_OUTPUT_FMT_TEXT, tnl_neigh_cache_aging,
+ NULL);
}
@@ -354,7 +354,8 @@ tnl_port_show_v(struct ds *ds)
static void
tnl_port_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct tnl_port *p;
@@ -523,5 +524,6 @@ tnl_port_map_init(void)
classifier_init(&cls, flow_segment_u64s);
ovs_list_init(&addr_list);
ovs_list_init(&port_list);
- unixctl_command_register("tnl/ports/show", "-v", 0, 1, tnl_port_show, NULL);
+ unixctl_command_register("tnl/ports/show", "-v", 0, 1,
+ OVS_OUTPUT_FMT_TEXT, tnl_port_show, NULL);
}
@@ -67,7 +67,8 @@ static const char *rpc_marker = "execute/v1";
static void
unixctl_list_commands(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
const struct shash_node **nodes = shash_sort(&commands);
@@ -91,31 +92,12 @@ unixctl_list_commands(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
unixctl_version(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
unixctl_command_reply(conn, ovs_get_program_version());
}
-/* Registers a unixctl command with the given 'name'. 'usage' describes the
- * arguments to the command; it is used only for presentation to the user in
- * "list-commands" output. (If 'usage' is NULL, then the command is hidden.)
- *
- * 'cb' is called when the command is received. It is passed an array
- * containing the command name and arguments, plus a copy of 'aux'. Normally
- * 'cb' should reply by calling unixctl_command_reply() or
- * unixctl_command_reply_error() before it returns, but if the command cannot
- * be handled immediately then it can defer the reply until later. A given
- * connection can only process a single request at a time, so a reply must be
- * made eventually to avoid blocking that connection. */
-void
-unixctl_command_register(const char *name, const char *usage,
- int min_args, int max_args,
- unixctl_cb_func *cb, void *aux)
-{
- unixctl_command_register_fmt(name, usage, min_args, max_args,
- OVS_OUTPUT_FMT_TEXT, cb, aux);
-}
-
/* Registers a unixctl command with the given 'name'. 'usage' describes the
* arguments to the command; it is used only for presentation to the user in
* "list-commands" output. (If 'usage' is NULL, then the command is hidden.)
@@ -130,9 +112,9 @@ unixctl_command_register(const char *name, const char *usage,
* connection can only process a single request at a time, so a reply must be
* made eventually to avoid blocking that connection. */
void
-unixctl_command_register_fmt(const char *name, const char *usage,
- int min_args, int max_args, int output_fmts,
- unixctl_cb_func *cb, void *aux)
+unixctl_command_register(const char *name, const char *usage,
+ int min_args, int max_args, int output_fmts,
+ unixctl_cb_func *cb, void *aux)
{
struct unixctl_command *command;
struct unixctl_command *lookup = shash_find_data(&commands, name);
@@ -290,9 +272,10 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp)
return error;
}
- unixctl_command_register("list-commands", "", 0, 0, unixctl_list_commands,
- NULL);
- unixctl_command_register("version", "", 0, 0, unixctl_version, NULL);
+ unixctl_command_register("list-commands", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ unixctl_list_commands, NULL);
+ unixctl_command_register("version", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ unixctl_version, NULL);
struct unixctl_server *server = xmalloc(sizeof *server);
server->listener = listener;
@@ -390,14 +373,6 @@ process_command(struct unixctl_conn *conn, struct jsonrpc_msg *request)
goto error;
}
- /* TODO: Remove this check once output format will be passed to the command
- * handler below. */
- if (fmt != OVS_OUTPUT_FMT_TEXT) {
- error = xasprintf("output format \"%s\" has not been implemented yet",
- ovs_output_fmt_to_string(fmt));
- goto error;
- }
-
/* extract command args */
svec_add(&argv, method);
for (size_t i = args_offset; i < params->n; i++) {
@@ -405,10 +380,7 @@ process_command(struct unixctl_conn *conn, struct jsonrpc_msg *request)
}
svec_terminate(&argv);
- /* TODO: Output format will be passed as 'fmt' to the command in later
- * patch. */
- command->cb(conn, argv.n, (const char **) argv.names, /* fmt, */
- command->aux);
+ command->cb(conn, argv.n, (const char **) argv.names, fmt, command->aux);
svec_destroy(&argv);
@@ -44,20 +44,12 @@ int unixctl_client_transact(struct jsonrpc *client,
/* Command registration. */
struct unixctl_conn;
-/* TODO: Output format will be passed as 'fmt' to the command in later patch.
- */
typedef void unixctl_cb_func(struct unixctl_conn *,
int argc, const char *argv[],
- /* enum ovs_output_fmt fmt, */ void *aux);
-/* TODO: unixctl_command_register() will be replaced with
- * unixctl_command_register_fmt() in a later patch of this series. It is
- * is kept temporarily to reduce the amount of changes in this patch. */
+ enum ovs_output_fmt fmt, void *aux);
void unixctl_command_register(const char *name, const char *usage,
- int min_args, int max_args,
+ int min_args, int max_args, int output_fmts,
unixctl_cb_func *cb, void *aux);
-void unixctl_command_register_fmt(const char *name, const char *usage,
- int min_args, int max_args, int output_fmts,
- unixctl_cb_func *cb, void *aux);
void unixctl_command_reply_error(struct unixctl_conn *, const char *error);
void unixctl_command_reply(struct unixctl_conn *, const char *body);
void unixctl_command_reply_json(struct unixctl_conn *,
@@ -689,6 +689,7 @@ vlog_facility_exists(const char* facility, int *value)
static void
vlog_unixctl_set(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
int i;
@@ -710,7 +711,8 @@ vlog_unixctl_set(struct unixctl_conn *conn, int argc, const char *argv[],
static void
vlog_unixctl_list(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
char *msg = vlog_get_levels();
unixctl_command_reply(conn, msg);
@@ -719,7 +721,9 @@ vlog_unixctl_list(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
vlog_unixctl_list_pattern(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
char *msg;
@@ -730,7 +734,9 @@ vlog_unixctl_list_pattern(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
vlog_unixctl_reopen(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
bool has_log_file;
@@ -752,7 +758,9 @@ vlog_unixctl_reopen(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
vlog_unixctl_close(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
ovs_mutex_lock(&log_file_mutex);
if (log_fd >= 0) {
@@ -811,14 +819,18 @@ set_rate_limits(struct unixctl_conn *conn, int argc,
static void
vlog_enable_rate_limit(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
set_rate_limits(conn, argc, argv, true);
}
static void
vlog_disable_rate_limit(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
set_rate_limits(conn, argc, argv, false);
}
@@ -860,20 +872,24 @@ vlog_init(void)
free(s);
}
- unixctl_command_register(
- "vlog/set", "{spec | PATTERN:destination:pattern}",
- 0, INT_MAX, vlog_unixctl_set, NULL);
- unixctl_command_register("vlog/list", "", 0, 0, vlog_unixctl_list,
- NULL);
+ unixctl_command_register("vlog/set",
+ "{spec | PATTERN:destination:pattern}",
+ 0, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ vlog_unixctl_set, NULL);
+ unixctl_command_register("vlog/list", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ vlog_unixctl_list, NULL);
unixctl_command_register("vlog/list-pattern", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
vlog_unixctl_list_pattern, NULL);
unixctl_command_register("vlog/enable-rate-limit", "[module]...",
- 0, INT_MAX, vlog_enable_rate_limit, NULL);
+ 0, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ vlog_enable_rate_limit, NULL);
unixctl_command_register("vlog/disable-rate-limit", "[module]...",
- 0, INT_MAX, vlog_disable_rate_limit, NULL);
- unixctl_command_register("vlog/reopen", "", 0, 0,
+ 0, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ vlog_disable_rate_limit, NULL);
+ unixctl_command_register("vlog/reopen", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
vlog_unixctl_reopen, NULL);
- unixctl_command_register("vlog/close", "", 0, 0,
+ unixctl_command_register("vlog/close", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
vlog_unixctl_close, NULL);
ovs_rwlock_rdlock(&pattern_rwlock);
@@ -1472,6 +1472,7 @@ bond_lookup_member(struct bond *bond, const char *member_name)
static void
bond_unixctl_list(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -1617,6 +1618,7 @@ bond_print_details(struct ds *ds, const struct bond *bond)
static void
bond_unixctl_show(struct unixctl_conn *conn,
int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -1648,6 +1650,7 @@ out:
static void
bond_unixctl_migrate(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
const char *bond_s = argv[1];
@@ -1701,6 +1704,7 @@ out:
static void
bond_unixctl_set_active_member(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
const char *bond_s = argv[1];
@@ -1773,6 +1777,7 @@ out:
static void
bond_unixctl_enable_member(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
enable_member(conn, argv, true);
@@ -1781,6 +1786,7 @@ bond_unixctl_enable_member(struct unixctl_conn *conn,
static void
bond_unixctl_disable_member(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
enable_member(conn, argv, false);
@@ -1788,6 +1794,7 @@ bond_unixctl_disable_member(struct unixctl_conn *conn,
static void
bond_unixctl_hash(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
const char *mac_s = argv[1];
@@ -1831,27 +1838,34 @@ bond_unixctl_hash(struct unixctl_conn *conn, int argc, const char *argv[],
void
bond_init(void)
{
- unixctl_command_register("bond/list", "", 0, 0, bond_unixctl_list, NULL);
- unixctl_command_register("bond/show", "[port]", 0, 1, bond_unixctl_show,
- NULL);
+ unixctl_command_register("bond/list", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ bond_unixctl_list, NULL);
+ unixctl_command_register("bond/show", "[port]", 0, 1, OVS_OUTPUT_FMT_TEXT,
+ bond_unixctl_show, NULL);
unixctl_command_register("bond/migrate", "port hash member", 3, 3,
- bond_unixctl_migrate, NULL);
+ OVS_OUTPUT_FMT_TEXT, bond_unixctl_migrate, NULL);
unixctl_command_register("bond/set-active-member", "port member", 2, 2,
+ OVS_OUTPUT_FMT_TEXT,
bond_unixctl_set_active_member, NULL);
unixctl_command_register("bond/enable-member", "port member", 2, 2,
- bond_unixctl_enable_member, NULL);
+ OVS_OUTPUT_FMT_TEXT, bond_unixctl_enable_member,
+ NULL);
unixctl_command_register("bond/disable-member", "port member", 2, 2,
- bond_unixctl_disable_member, NULL);
+ OVS_OUTPUT_FMT_TEXT, bond_unixctl_disable_member,
+ NULL);
unixctl_command_register("bond/hash", "mac [vlan] [basis]", 1, 3,
- bond_unixctl_hash, NULL);
+ OVS_OUTPUT_FMT_TEXT, bond_unixctl_hash, NULL);
/* Backward-compatibility command names. */
unixctl_command_register("bond/set-active-slave", NULL, 2, 2,
+ OVS_OUTPUT_FMT_TEXT,
bond_unixctl_set_active_member, NULL);
unixctl_command_register("bond/enable-slave", NULL, 2, 2,
- bond_unixctl_enable_member, NULL);
+ OVS_OUTPUT_FMT_TEXT, bond_unixctl_enable_member,
+ NULL);
unixctl_command_register("bond/disable-slave", NULL, 2, 2,
- bond_unixctl_disable_member, NULL);
+ OVS_OUTPUT_FMT_TEXT, bond_unixctl_disable_member,
+ NULL);
}
static void
@@ -471,6 +471,7 @@ free_ct_states(struct ovs_list *ct_states)
static void
ofproto_unixctl_trace(struct unixctl_conn *conn, int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ofproto_dpif *ofproto;
@@ -500,7 +501,9 @@ ofproto_unixctl_trace(struct unixctl_conn *conn, int argc, const char *argv[],
static void
ofproto_unixctl_trace_actions(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
enum ofputil_protocol usable_protocols;
struct ofproto_dpif *ofproto;
@@ -870,12 +873,13 @@ ofproto_dpif_trace_init(void)
unixctl_command_register(
"ofproto/trace",
"{[dp_name] odp_flow | bridge br_flow} [OPTIONS...] "
- "[-generate|packet]", 1, INT_MAX, ofproto_unixctl_trace, NULL);
+ "[-generate|packet]", 1, INT_MAX, OVS_OUTPUT_FMT_TEXT,
+ ofproto_unixctl_trace, NULL);
unixctl_command_register(
"ofproto/trace-packet-out",
"[-consistent] {[dp_name] odp_flow | bridge br_flow} [OPTIONS...] "
"[-generate|packet] actions",
- 2, INT_MAX, ofproto_unixctl_trace_actions, NULL);
+ 2, INT_MAX, OVS_OUTPUT_FMT_TEXT, ofproto_unixctl_trace_actions, NULL);
}
void
@@ -354,25 +354,38 @@ static void revalidator_pause(struct revalidator *);
static void revalidator_sweep(struct revalidator *);
static void revalidator_purge(struct revalidator *);
static void upcall_unixctl_show(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt,
+ void *aux);
static void upcall_unixctl_disable_megaflows(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt,
+ void *aux);
static void upcall_unixctl_enable_megaflows(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt,
+ void *aux);
static void upcall_unixctl_disable_ufid(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt, void *aux);
static void upcall_unixctl_enable_ufid(struct unixctl_conn *, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt, void *aux);
static void upcall_unixctl_set_flow_limit(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt, void *aux);
static void upcall_unixctl_dump_wait(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux);
+ const char *argv[],
+ enum ovs_output_fmt fmt, void *aux);
static void upcall_unixctl_purge(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux);
+ const char *argv[], enum ovs_output_fmt fmt,
+ void *aux);
static void upcall_unixctl_pause(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux);
+ const char *argv[], enum ovs_output_fmt fmt,
+ void *aux);
static void upcall_unixctl_resume(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux);
+ const char *argv[], enum ovs_output_fmt fmt,
+ void *aux);
static struct udpif_key *ukey_create_from_upcall(struct upcall *,
struct flow_wildcards *);
@@ -430,26 +443,36 @@ udpif_init(void)
{
static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
if (ovsthread_once_start(&once)) {
- unixctl_command_register("upcall/show", "", 0, 0, upcall_unixctl_show,
+ unixctl_command_register("upcall/show", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ upcall_unixctl_show,
NULL);
unixctl_command_register("upcall/disable-megaflows", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
upcall_unixctl_disable_megaflows, NULL);
unixctl_command_register("upcall/enable-megaflows", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
upcall_unixctl_enable_megaflows, NULL);
unixctl_command_register("upcall/disable-ufid", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
upcall_unixctl_disable_ufid, NULL);
unixctl_command_register("upcall/enable-ufid", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
upcall_unixctl_enable_ufid, NULL);
unixctl_command_register("upcall/set-flow-limit", "flow-limit-number",
- 1, 1, upcall_unixctl_set_flow_limit, NULL);
+ 1, 1, OVS_OUTPUT_FMT_TEXT,
+ upcall_unixctl_set_flow_limit, NULL);
unixctl_command_register("revalidator/wait", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
upcall_unixctl_dump_wait, NULL);
unixctl_command_register("revalidator/purge", "", 0, 0,
- upcall_unixctl_purge, NULL);
+ OVS_OUTPUT_FMT_TEXT, upcall_unixctl_purge,
+ NULL);
unixctl_command_register("revalidator/pause", NULL, 0, 0,
- upcall_unixctl_pause, NULL);
+ OVS_OUTPUT_FMT_TEXT, upcall_unixctl_pause,
+ NULL);
unixctl_command_register("revalidator/resume", NULL, 0, 0,
- upcall_unixctl_resume, NULL);
+ OVS_OUTPUT_FMT_TEXT, upcall_unixctl_resume,
+ NULL);
ovsthread_once_done(&once);
}
}
@@ -3072,7 +3095,9 @@ dp_purge_cb(void *aux, unsigned pmd_id)
static void
upcall_unixctl_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
uint64_t n_offloaded_flows;
@@ -3126,6 +3151,7 @@ static void
upcall_unixctl_disable_megaflows(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
atomic_store_relaxed(&enable_megaflows, false);
@@ -3141,6 +3167,7 @@ static void
upcall_unixctl_enable_megaflows(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
atomic_store_relaxed(&enable_megaflows, true);
@@ -3154,7 +3181,9 @@ upcall_unixctl_enable_megaflows(struct unixctl_conn *conn,
* documented in the man page. */
static void
upcall_unixctl_disable_ufid(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
atomic_store_relaxed(&enable_ufid, false);
unixctl_command_reply(conn, "Datapath dumping tersely using UFID disabled");
@@ -3166,7 +3195,9 @@ upcall_unixctl_disable_ufid(struct unixctl_conn *conn, int argc OVS_UNUSED,
* in the man page. */
static void
upcall_unixctl_enable_ufid(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
atomic_store_relaxed(&enable_ufid, true);
unixctl_command_reply(conn, "Datapath dumping tersely using UFID enabled "
@@ -3181,6 +3212,7 @@ static void
upcall_unixctl_set_flow_limit(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -3199,6 +3231,7 @@ static void
upcall_unixctl_dump_wait(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
if (ovs_list_is_singleton(&all_udpifs)) {
@@ -3217,7 +3250,9 @@ upcall_unixctl_dump_wait(struct unixctl_conn *conn,
static void
upcall_unixctl_purge(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct udpif *udpif;
@@ -3241,7 +3276,9 @@ upcall_unixctl_purge(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
upcall_unixctl_pause(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct udpif *udpif;
@@ -3253,7 +3290,9 @@ upcall_unixctl_pause(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
upcall_unixctl_resume(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct udpif *udpif;
@@ -5832,7 +5832,9 @@ ofproto_dpif_lookup_by_uuid(const struct uuid *uuid)
static void
ofproto_unixctl_fdb_flush(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ofproto_dpif *ofproto;
@@ -5859,7 +5861,9 @@ ofproto_unixctl_fdb_flush(struct unixctl_conn *conn, int argc,
static void
ofproto_unixctl_mcast_snooping_flush(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ofproto_dpif *ofproto;
@@ -5897,7 +5901,9 @@ ofbundle_get_a_port(const struct ofbundle *bundle)
static void
ofproto_unixctl_fdb_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
const struct ofproto_dpif *ofproto;
@@ -5933,7 +5939,9 @@ ofproto_unixctl_fdb_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ofproto_unixctl_fdb_add(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
const struct ofproto_dpif *ofproto;
const struct mac_entry *mac_entry;
@@ -5998,7 +6006,9 @@ ofproto_unixctl_fdb_add(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ofproto_unixctl_fdb_delete(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
const struct ofproto_dpif *ofproto;
const char *br_name = argv[1];
@@ -6024,7 +6034,9 @@ ofproto_unixctl_fdb_delete(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ofproto_unixctl_fdb_stats_clear(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ofproto_dpif *ofproto;
@@ -6051,7 +6063,9 @@ ofproto_unixctl_fdb_stats_clear(struct unixctl_conn *conn, int argc,
static void
ofproto_unixctl_fdb_stats_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
const struct ofproto_dpif *ofproto;
@@ -6092,6 +6106,7 @@ static void
ofproto_unixctl_mcast_snooping_show(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -6164,6 +6179,7 @@ get_ofprotos(struct shash *ofproto_shash)
static void
ofproto_unixctl_dpif_dump_dps(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -6410,7 +6426,9 @@ dpif_show_backer(const struct dpif_backer *backer, struct ds *ds)
static void
ofproto_unixctl_dpif_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
const struct shash_node **backers;
@@ -6429,6 +6447,7 @@ ofproto_unixctl_dpif_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ofproto_unixctl_dpif_dump_flows(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
const struct ofproto_dpif *ofproto;
@@ -6523,6 +6542,7 @@ ofproto_unixctl_dpif_dump_flows(struct unixctl_conn *conn,
static void
ofproto_unixctl_dpif_show_dp_features(struct unixctl_conn *conn,
int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -6542,6 +6562,7 @@ ofproto_unixctl_dpif_show_dp_features(struct unixctl_conn *conn,
static void
ofproto_unixctl_dpif_set_dp_features(struct unixctl_conn *conn,
int argc, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
@@ -6578,31 +6599,40 @@ ofproto_unixctl_init(void)
registered = true;
unixctl_command_register("fdb/add", "bridge port vlan mac", 4, 4,
- ofproto_unixctl_fdb_add, NULL);
+ OVS_OUTPUT_FMT_TEXT, ofproto_unixctl_fdb_add,
+ NULL);
unixctl_command_register("fdb/del", "bridge vlan mac", 3, 3,
- ofproto_unixctl_fdb_delete, NULL);
+ OVS_OUTPUT_FMT_TEXT, ofproto_unixctl_fdb_delete,
+ NULL);
unixctl_command_register("fdb/flush", "[bridge]", 0, 1,
- ofproto_unixctl_fdb_flush, NULL);
- unixctl_command_register("fdb/show", "bridge", 1, 1,
+ OVS_OUTPUT_FMT_TEXT, ofproto_unixctl_fdb_flush,
+ NULL);
+ unixctl_command_register("fdb/show", "bridge", 1, 1, OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_fdb_show, NULL);
unixctl_command_register("fdb/stats-clear", "[bridge]", 0, 1,
+ OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_fdb_stats_clear, NULL);
unixctl_command_register("fdb/stats-show", "bridge", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_fdb_stats_show, NULL);
unixctl_command_register("mdb/flush", "[bridge]", 0, 1,
+ OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_mcast_snooping_flush, NULL);
- unixctl_command_register("mdb/show", "bridge", 1, 1,
+ unixctl_command_register("mdb/show", "bridge", 1, 1, OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_mcast_snooping_show, NULL);
- unixctl_command_register("dpif/dump-dps", "", 0, 0,
+ unixctl_command_register("dpif/dump-dps", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_dpif_dump_dps, NULL);
- unixctl_command_register("dpif/show", "", 0, 0, ofproto_unixctl_dpif_show,
- NULL);
+ unixctl_command_register("dpif/show", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ofproto_unixctl_dpif_show, NULL);
unixctl_command_register("dpif/show-dp-features", "bridge", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_dpif_show_dp_features, NULL);
unixctl_command_register("dpif/dump-flows",
"[-m] [--names | --no-names] bridge", 1, INT_MAX,
+ OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_dpif_dump_flows, NULL);
- unixctl_command_register("dpif/set-dp-features", "bridge", 1, 3 ,
+ unixctl_command_register("dpif/set-dp-features", "bridge", 1, 3,
+ OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_dpif_set_dp_features, NULL);
}
@@ -6366,7 +6366,7 @@ handle_flow_mod__(struct ofproto *ofproto, const struct ofputil_flow_mod *fm,
error = ofproto_flow_mod_start(ofproto, &ofm);
if (!error) {
ofproto_bump_tables_version(ofproto);
- error = ofproto_flow_mod_finish(ofproto, &ofm, req);
+ error = ofproto_flow_mod_finish(ofproto, &ofm, req);
ofmonitor_flush(ofproto->connmgr);
}
ovs_mutex_unlock(&ofproto_mutex);
@@ -8437,7 +8437,7 @@ do_bundle_commit(struct ofconn *ofconn, uint32_t id, uint16_t flags)
/* Send error referring to the original message. */
ofconn_send_error(ofconn, be->msg, error);
error = OFPERR_OFPBFC_MSG_FAILED;
-
+
/* 2. Revert. Undo all the changes made above. */
LIST_FOR_EACH_REVERSE_CONTINUE(be, node, &bundle->msg_list) {
if (be->type == OFPTYPE_FLOW_MOD) {
@@ -9453,7 +9453,9 @@ ofproto_lookup(const char *name)
static void
ofproto_unixctl_list(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ofproto *ofproto;
struct ds results;
@@ -9475,7 +9477,7 @@ ofproto_unixctl_init(void)
}
registered = true;
- unixctl_command_register("ofproto/list", "", 0, 0,
+ unixctl_command_register("ofproto/list", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
ofproto_unixctl_list, NULL);
}
@@ -141,7 +141,7 @@ ofproto_tunnel_init(void)
if (ovsthread_once_start(&once)) {
fat_rwlock_init(&rwlock);
unixctl_command_register("ofproto/list-tunnels", "", 0, 0,
- tnl_unixctl_list, NULL);
+ OVS_OUTPUT_FMT_TEXT, tnl_unixctl_list, NULL);
ovsthread_once_done(&once);
}
}
@@ -756,7 +756,7 @@ tnl_port_build_header(const struct ofport_dpif *ofport,
static void
tnl_unixctl_list(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[] OVS_UNUSED,
- void *aux OVS_UNUSED)
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
struct ds reply = DS_EMPTY_INITIALIZER;
@@ -62,6 +62,7 @@ static bool use_column_diff = true;
static void
ovsdb_file_column_diff_enable(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *arg OVS_UNUSED)
{
use_column_diff = true;
@@ -76,7 +77,8 @@ ovsdb_file_column_diff_disable(void)
}
use_column_diff = false;
unixctl_command_register("ovsdb/file/column-diff-enable", "",
- 0, 0, ovsdb_file_column_diff_enable, NULL);
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_file_column_diff_enable, NULL);
}
static struct ovsdb_error *
@@ -1253,7 +1253,8 @@ parse_monitor_columns(char *arg, const char *server, const char *database,
static void
ovsdb_client_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *exiting_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *exiting_)
{
bool *exiting = exiting_;
*exiting = true;
@@ -1262,7 +1263,8 @@ ovsdb_client_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_client_block(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *blocked_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *blocked_)
{
bool *blocked = blocked_;
@@ -1276,7 +1278,8 @@ ovsdb_client_block(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_client_unblock(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *blocked_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *blocked_)
{
bool *blocked = blocked_;
@@ -1290,7 +1293,8 @@ ovsdb_client_unblock(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_client_cond_change(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *rpc_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *rpc_)
{
struct jsonrpc *rpc = rpc_;
struct json *monitor_cond_update_requests = json_object_create();
@@ -1404,13 +1408,16 @@ do_monitor__(struct jsonrpc *rpc, const char *database,
ovs_fatal(error, "failed to create unixctl server");
}
- unixctl_command_register("exit", "", 0, 0,
+ unixctl_command_register("exit", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
ovsdb_client_exit, &exiting);
unixctl_command_register("ovsdb-client/block", "", 0, 0,
- ovsdb_client_block, &blocked);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_client_block,
+ &blocked);
unixctl_command_register("ovsdb-client/unblock", "", 0, 0,
- ovsdb_client_unblock, &blocked);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_client_unblock,
+ &blocked);
unixctl_command_register("ovsdb-client/cond_change", "TABLE COND", 2, 2,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_client_cond_change, rpc);
} else {
unixctl = NULL;
@@ -2244,7 +2251,9 @@ create_lock_request(struct ovsdb_client_lock_req *lock_req)
static void
ovsdb_client_lock(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *lock_req_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *lock_req_)
{
struct ovsdb_client_lock_req *lock_req = lock_req_;
lock_req_init(lock_req, "lock", argv[1]);
@@ -2253,7 +2262,9 @@ ovsdb_client_lock(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_client_unlock(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *lock_req_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *lock_req_)
{
struct ovsdb_client_lock_req *lock_req = lock_req_;
lock_req_init(lock_req, "unlock", argv[1]);
@@ -2262,7 +2273,8 @@ ovsdb_client_unlock(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_client_steal(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *lock_req_)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *lock_req_)
{
struct ovsdb_client_lock_req *lock_req = lock_req_;
lock_req_init(lock_req, "steal", argv[1]);
@@ -2292,13 +2304,13 @@ do_lock(struct jsonrpc *rpc, const char *method, const char *lock)
ovs_fatal(error, "failed to create unixctl server");
}
- unixctl_command_register("unlock", "LOCK", 1, 1,
+ unixctl_command_register("unlock", "LOCK", 1, 1, OVS_OUTPUT_FMT_TEXT,
ovsdb_client_unlock, &lock_req);
- unixctl_command_register("steal", "LOCK", 1, 1,
+ unixctl_command_register("steal", "LOCK", 1, 1, OVS_OUTPUT_FMT_TEXT,
ovsdb_client_steal, &lock_req);
- unixctl_command_register("lock", "LOCK", 1, 1,
+ unixctl_command_register("lock", "LOCK", 1, 1, OVS_OUTPUT_FMT_TEXT,
ovsdb_client_lock, &lock_req);
- unixctl_command_register("exit", "", 0, 0,
+ unixctl_command_register("exit", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
ovsdb_client_exit, &exiting);
} else {
unixctl = NULL;
@@ -431,70 +431,94 @@ main(int argc, char *argv[])
VLOG_INFO("%s (Open vSwitch) %s", program_name, VERSION);
}
- unixctl_command_register("exit", "", 0, 0, ovsdb_server_exit, &exiting);
+ unixctl_command_register("exit", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_server_exit, &exiting);
unixctl_command_register("ovsdb-server/compact", "", 0, 1,
- ovsdb_server_compact, &all_dbs);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_compact,
+ &all_dbs);
unixctl_command_register("ovsdb-server/memory-trim-on-compaction",
- "on|off", 1, 1,
+ "on|off", 1, 1, OVS_OUTPUT_FMT_TEXT,
ovsdb_server_memory_trim_on_compaction, NULL);
unixctl_command_register("ovsdb-server/reconnect", "", 0, 0,
- ovsdb_server_reconnect, jsonrpc);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_reconnect,
+ jsonrpc);
unixctl_command_register("ovsdb-server/add-remote", "REMOTE", 1, 1,
- ovsdb_server_add_remote, &server_config);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_add_remote,
+ &server_config);
unixctl_command_register("ovsdb-server/remove-remote", "REMOTE", 1, 1,
- ovsdb_server_remove_remote, &server_config);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_remove_remote,
+ &server_config);
unixctl_command_register("ovsdb-server/list-remotes", "", 0, 0,
- ovsdb_server_list_remotes, &remotes);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_list_remotes,
+ &remotes);
unixctl_command_register("ovsdb-server/add-db", "DB", 1, 1,
- ovsdb_server_add_database, &server_config);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_add_database,
+ &server_config);
unixctl_command_register("ovsdb-server/remove-db", "DB", 1, 1,
- ovsdb_server_remove_database, &server_config);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_remove_database,
+ &server_config);
unixctl_command_register("ovsdb-server/list-dbs", "", 0, 0,
- ovsdb_server_list_databases, &all_dbs);
+ OVS_OUTPUT_FMT_TEXT, ovsdb_server_list_databases,
+ &all_dbs);
unixctl_command_register("ovsdb-server/tlog-set", "DB:TABLE on|off",
- 2, 2, ovsdb_server_tlog_set, &all_dbs);
+ 2, 2, OVS_OUTPUT_FMT_TEXT, ovsdb_server_tlog_set,
+ &all_dbs);
unixctl_command_register("ovsdb-server/tlog-list", "",
- 0, 0, ovsdb_server_tlog_list, &all_dbs);
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_server_tlog_list, &all_dbs);
unixctl_command_register("ovsdb-server/perf-counters-show", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_perf_counters_show, NULL);
unixctl_command_register("ovsdb-server/perf-counters-clear", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_perf_counters_clear, NULL);
unixctl_command_register("ovsdb-server/set-active-ovsdb-server", "", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_set_active_ovsdb_server,
&server_config);
unixctl_command_register("ovsdb-server/get-active-ovsdb-server", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_get_active_ovsdb_server,
&server_config);
unixctl_command_register("ovsdb-server/connect-active-ovsdb-server", "",
- 0, 0, ovsdb_server_connect_active_ovsdb_server,
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_server_connect_active_ovsdb_server,
&server_config);
unixctl_command_register("ovsdb-server/disconnect-active-ovsdb-server", "",
- 0, 0, ovsdb_server_disconnect_active_ovsdb_server,
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_server_disconnect_active_ovsdb_server,
&server_config);
unixctl_command_register(
"ovsdb-server/set-active-ovsdb-server-probe-interval", "", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_set_active_ovsdb_server_probe_interval, &server_config);
unixctl_command_register(
"ovsdb-server/set-relay-source-probe-interval", "", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_set_relay_source_interval, &server_config);
unixctl_command_register("ovsdb-server/set-sync-exclude-tables", "",
- 0, 1, ovsdb_server_set_sync_exclude_tables,
+ 0, 1, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_server_set_sync_exclude_tables,
&server_config);
unixctl_command_register("ovsdb-server/get-sync-exclude-tables", "",
- 0, 0, ovsdb_server_get_sync_exclude_tables,
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_server_get_sync_exclude_tables,
NULL);
unixctl_command_register("ovsdb-server/sync-status", "",
- 0, 0, ovsdb_server_get_sync_status,
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_server_get_sync_status,
&server_config);
unixctl_command_register("ovsdb-server/get-db-storage-status", "DB", 1, 1,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_get_db_storage_status,
&server_config);
/* Simulate the behavior of OVS release prior to version 2.5 that
* does not support the monitor_cond method. */
unixctl_command_register("ovsdb-server/disable-monitor-cond", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT,
ovsdb_server_disable_monitor_cond, jsonrpc);
if (is_backup) {
@@ -1404,6 +1428,7 @@ report_error_if_changed(char *error, char **last_errorp)
static void
ovsdb_server_set_active_ovsdb_server(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *config_)
{
struct server_config *config = config_;
@@ -1421,6 +1446,7 @@ static void
ovsdb_server_get_active_ovsdb_server(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *config_ )
{
struct server_config *config = config_;
@@ -1432,6 +1458,7 @@ static void
ovsdb_server_connect_active_ovsdb_server(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *config_)
{
struct server_config *config = config_;
@@ -1457,6 +1484,7 @@ static void
ovsdb_server_disconnect_active_ovsdb_server(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *config_)
{
struct server_config *config = config_;
@@ -1469,9 +1497,11 @@ ovsdb_server_disconnect_active_ovsdb_server(struct unixctl_conn *conn,
static void
ovsdb_server_set_active_ovsdb_server_probe_interval(struct unixctl_conn *conn,
- int argc OVS_UNUSED,
- const char *argv[],
- void *config_)
+ int argc OVS_UNUSED,
+ const char *argv[],
+ enum ovs_output_fmt fmt
+ OVS_UNUSED,
+ void *config_)
{
struct server_config *config = config_;
@@ -1493,6 +1523,7 @@ static void
ovsdb_server_set_relay_source_interval(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *config_)
{
struct server_config *config = config_;
@@ -1513,6 +1544,7 @@ static void
ovsdb_server_set_sync_exclude_tables(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *config_)
{
struct server_config *config = config_;
@@ -1539,6 +1571,7 @@ static void
ovsdb_server_get_sync_exclude_tables(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *arg_ OVS_UNUSED)
{
char *reply = get_excluded_tables();
@@ -1549,6 +1582,7 @@ ovsdb_server_get_sync_exclude_tables(struct unixctl_conn *conn,
static void
ovsdb_server_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *exiting_)
{
bool *exiting = exiting_;
@@ -1559,6 +1593,7 @@ ovsdb_server_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_server_perf_counters_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *arg_ OVS_UNUSED)
{
char *s = perf_counters_to_string();
@@ -1570,6 +1605,7 @@ ovsdb_server_perf_counters_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_server_perf_counters_clear(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *arg_ OVS_UNUSED)
{
perf_counters_clear();
@@ -1583,6 +1619,7 @@ static void
ovsdb_server_disable_monitor_cond(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *jsonrpc_)
{
struct ovsdb_jsonrpc_server *jsonrpc = jsonrpc_;
@@ -1595,7 +1632,8 @@ ovsdb_server_disable_monitor_cond(struct unixctl_conn *conn,
static void
ovsdb_server_compact(struct unixctl_conn *conn, int argc,
- const char *argv[], void *dbs_)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *dbs_)
{
const char *db_name = argc < 2 ? NULL : argv[1];
struct shash *all_dbs = dbs_;
@@ -1658,6 +1696,7 @@ static void
ovsdb_server_memory_trim_on_compaction(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *arg OVS_UNUSED)
{
bool old_trim_memory = trim_memory;
@@ -1689,7 +1728,9 @@ ovsdb_server_memory_trim_on_compaction(struct unixctl_conn *conn,
* connections and reconnect. */
static void
ovsdb_server_reconnect(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *jsonrpc_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *jsonrpc_)
{
struct ovsdb_jsonrpc_server *jsonrpc = jsonrpc_;
ovsdb_jsonrpc_server_reconnect(
@@ -1701,7 +1742,9 @@ ovsdb_server_reconnect(struct unixctl_conn *conn, int argc OVS_UNUSED,
* ovsdb-server services. */
static void
ovsdb_server_add_remote(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *config_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *config_)
{
struct server_config *config = config_;
const char *remote = argv[1];
@@ -1730,7 +1773,9 @@ ovsdb_server_add_remote(struct unixctl_conn *conn, int argc OVS_UNUSED,
* that ovsdb-server services. */
static void
ovsdb_server_remove_remote(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *config_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *config_)
{
struct server_config *config = config_;
struct sset_node *node;
@@ -1748,7 +1793,9 @@ ovsdb_server_remove_remote(struct unixctl_conn *conn, int argc OVS_UNUSED,
/* "ovsdb-server/list-remotes": outputs a list of configured rmeotes. */
static void
ovsdb_server_list_remotes(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *remotes_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *remotes_)
{
struct sset *remotes = remotes_;
const char **list, **p;
@@ -1770,7 +1817,9 @@ ovsdb_server_list_remotes(struct unixctl_conn *conn, int argc OVS_UNUSED,
/* "ovsdb-server/add-db DB": adds the DB to ovsdb-server. */
static void
ovsdb_server_add_database(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *config_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *config_)
{
struct server_config *config = config_;
const char *filename = argv[1];
@@ -1812,7 +1861,9 @@ remove_db(struct server_config *config, struct shash_node *node, char *comment)
static void
ovsdb_server_remove_database(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *config_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *config_)
{
struct server_config *config = config_;
struct shash_node *node;
@@ -1834,7 +1885,9 @@ ovsdb_server_remove_database(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_server_list_databases(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *all_dbs_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *all_dbs_)
{
struct shash *all_dbs = all_dbs_;
const struct shash_node **nodes;
@@ -1859,7 +1912,9 @@ ovsdb_server_list_databases(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_server_tlog_set(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *all_dbs_)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *all_dbs_)
{
struct shash *all_dbs = all_dbs_;
const char *name_ = argv[1];
@@ -1905,7 +1960,9 @@ out:
static void
ovsdb_server_tlog_list(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *all_dbs_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *all_dbs_)
{
const struct shash_node **db_nodes;
struct ds s = DS_EMPTY_INITIALIZER;
@@ -1940,7 +1997,9 @@ ovsdb_server_tlog_list(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ovsdb_server_get_sync_status(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *config_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *config_)
{
struct server_config *config = config_;
bool is_backup = *config->is_backup;
@@ -1960,6 +2019,7 @@ static void
ovsdb_server_get_db_storage_status(struct unixctl_conn *conn,
int argc OVS_UNUSED,
const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *config_)
{
struct server_config *config = config_;
@@ -186,6 +186,7 @@ static bool use_no_data_conversion = true;
static void
ovsdb_no_data_conversion_enable(struct unixctl_conn *conn, int argc OVS_UNUSED,
const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *arg OVS_UNUSED)
{
use_no_data_conversion = true;
@@ -200,7 +201,8 @@ ovsdb_no_data_conversion_disable(void)
}
use_no_data_conversion = false;
unixctl_command_register("ovsdb/file/no-data-conversion-enable", "",
- 0, 0, ovsdb_no_data_conversion_enable, NULL);
+ 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ovsdb_no_data_conversion_enable, NULL);
}
/* Returns true if the database storage allows conversion records without
@@ -4603,6 +4603,7 @@ raft_lookup_by_name(const char *name)
static void
raft_unixctl_cid(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct raft *raft = raft_lookup_by_name(argv[1]);
@@ -4620,6 +4621,7 @@ raft_unixctl_cid(struct unixctl_conn *conn,
static void
raft_unixctl_sid(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct raft *raft = raft_lookup_by_name(argv[1]);
@@ -4651,6 +4653,7 @@ raft_put_sid(const char *title, const struct uuid *sid,
static void
raft_unixctl_status(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
struct raft *raft = raft_lookup_by_name(argv[1]);
@@ -4809,7 +4812,8 @@ raft_unixctl_leave__(struct unixctl_conn *conn, struct raft *raft)
static void
raft_unixctl_leave(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct raft *raft = raft_lookup_by_name(argv[1]);
if (!raft) {
@@ -4845,7 +4849,8 @@ raft_lookup_server_best_match(struct raft *raft, const char *id)
static void
raft_unixctl_kick(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
const char *cluster_name = argv[1];
const char *server_name = argv[2];
@@ -4918,6 +4923,7 @@ raft_log_election_timer(struct raft *raft)
static void
raft_unixctl_change_election_timer(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
const char *cluster_name = argv[1];
@@ -4972,6 +4978,7 @@ raft_unixctl_change_election_timer(struct unixctl_conn *conn,
static void
raft_unixctl_set_backlog_threshold(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
const char *cluster_name = argv[1];
@@ -5008,6 +5015,7 @@ raft_unixctl_set_backlog_threshold(struct unixctl_conn *conn,
static void
raft_unixctl_failure_test(struct unixctl_conn *conn OVS_UNUSED,
int argc OVS_UNUSED, const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *aux OVS_UNUSED)
{
const char *test = argv[1];
@@ -5062,22 +5070,24 @@ raft_init(void)
if (!ovsthread_once_start(&once)) {
return;
}
- unixctl_command_register("cluster/cid", "DB", 1, 1,
+ unixctl_command_register("cluster/cid", "DB", 1, 1, OVS_OUTPUT_FMT_TEXT,
raft_unixctl_cid, NULL);
- unixctl_command_register("cluster/sid", "DB", 1, 1,
+ unixctl_command_register("cluster/sid", "DB", 1, 1, OVS_OUTPUT_FMT_TEXT,
raft_unixctl_sid, NULL);
- unixctl_command_register("cluster/status", "DB", 1, 1,
+ unixctl_command_register("cluster/status", "DB", 1, 1, OVS_OUTPUT_FMT_TEXT,
raft_unixctl_status, NULL);
- unixctl_command_register("cluster/leave", "DB", 1, 1,
+ unixctl_command_register("cluster/leave", "DB", 1, 1, OVS_OUTPUT_FMT_TEXT,
raft_unixctl_leave, NULL);
unixctl_command_register("cluster/kick", "DB SERVER", 2, 2,
- raft_unixctl_kick, NULL);
+ OVS_OUTPUT_FMT_TEXT, raft_unixctl_kick, NULL);
unixctl_command_register("cluster/change-election-timer", "DB TIME", 2, 2,
+ OVS_OUTPUT_FMT_TEXT,
raft_unixctl_change_election_timer, NULL);
unixctl_command_register("cluster/set-backlog-threshold",
- "DB N_MSGS N_BYTES", 3, 3,
+ "DB N_MSGS N_BYTES", 3, 3, OVS_OUTPUT_FMT_TEXT,
raft_unixctl_set_backlog_threshold, NULL);
unixctl_command_register("cluster/failure-test", "FAILURE SCENARIO", 1, 1,
- raft_unixctl_failure_test, NULL);
+ OVS_OUTPUT_FMT_TEXT, raft_unixctl_failure_test,
+ NULL);
ovsthread_once_done(&once);
}
@@ -20,19 +20,16 @@ commands = {}
class _UnixctlCommand(object):
- # TODO: Output format will be passed as 'fmt' to the command in later
- # patch.
- def __init__(self, usage, min_args, max_args, # fmt,
- callback, aux):
+ def __init__(self, usage, min_args, max_args, fmt, callback, aux):
self.usage = usage
self.min_args = min_args
self.max_args = max_args
- #self.fmt = fmt
+ self.fmt = fmt
self.callback = callback
self.aux = aux
-def _unixctl_help(conn, unused_argv, unused_aux):
+def _unixctl_help(conn, unused_argv, unused_fmt, unused_aux):
reply = "The available commands are:\n"
command_names = sorted(commands.keys())
for name in command_names:
@@ -46,7 +43,7 @@ def _unixctl_help(conn, unused_argv, unused_aux):
conn.reply(reply)
-def command_register_fmt(name, usage, min_args, max_args, fmt, callback, aux):
+def command_register(name, usage, min_args, max_args, fmt, callback, aux):
""" Registers a command with the given 'name' to be exposed by the
UnixctlServer. 'usage' describes the arguments to the command; it is used
only for presentation to the user in "help" output. 'output_fmts' is a
@@ -70,31 +67,10 @@ def command_register_fmt(name, usage, min_args, max_args, fmt, callback, aux):
assert callable(callback)
if name not in commands:
- commands[name] = _UnixctlCommand(usage, min_args, max_args, # fmt,
+ commands[name] = _UnixctlCommand(usage, min_args, max_args, fmt,
callback, aux)
-# TODO: command_register() will be replaced with command_register_fmt() in a
-# later patch of this series. It is is kept temporarily to reduce the
-# amount of changes in this patch.
-def command_register(name, usage, min_args, max_args, callback, aux):
- """ Registers a command with the given 'name' to be exposed by the
- UnixctlServer. 'usage' describes the arguments to the command; it is used
- only for presentation to the user in "help" output.
-
- 'callback' is called when the command is received. It is passed a
- UnixctlConnection object, the list of arguments as unicode strings, and
- 'aux'. Normally 'callback' should reply by calling
- UnixctlConnection.reply() or UnixctlConnection.reply_error() before it
- returns, but if the command cannot be handled immediately, then it can
- defer the reply until later. A given connection can only process a single
- request at a time, so a reply must be made eventually to avoid blocking
- that connection."""
-
- command_register_fmt(name, usage, min_args, max_args,
- ovs.util.OutputFormat.TEXT, callback, aux)
-
-
def socket_name_from_target(target):
assert isinstance(target, str)
@@ -113,4 +89,5 @@ def socket_name_from_target(target):
return 0, "%s/%s.%d.ctl" % (ovs.dirs.RUNDIR, target, pid)
-command_register("help", "", 0, 0, _unixctl_help, None)
+command_register("help", "", 0, 0, ovs.util.OutputFormat.TEXT,
+ _unixctl_help, None)
@@ -137,22 +137,14 @@ class UnixctlConnection(object):
'"%s" command takes at most %d arguments'
% (method, command.max_args))
- # TODO: Remove this check once output format will be passed to the
- # command handler below.
- if fmt != ovs.util.OutputFormat.TEXT:
- raise ValueError(
- 'output format "%s" has not been implemented yet'
- % fmt.name.lower())
-
unicode_params = [str(p) for p in params]
- command.callback(self, unicode_params, # fmt,
- command.aux)
+ command.callback(self, unicode_params, fmt, command.aux)
except Exception as e:
self.reply_error(str(e))
-def _unixctl_version(conn, unused_argv, version):
+def _unixctl_version(conn, unused_argv, unused_fmt, version):
assert isinstance(conn, UnixctlConnection)
version = "%s (Open vSwitch) %s" % (ovs.util.PROGRAM_NAME, version)
conn.reply(version)
@@ -230,6 +222,7 @@ class UnixctlServer(object):
return error, None
ovs.unixctl.command_register("version", "", 0, 0,
+ ovs.util.OutputFormat.TEXT,
_unixctl_version,
version)
@@ -237,8 +237,10 @@ class Vlog(object):
logger.disabled = True
ovs.unixctl.command_register("vlog/reopen", "", 0, 0,
+ ovs.util.OutputFormat.TEXT,
Vlog._unixctl_vlog_reopen, None)
ovs.unixctl.command_register("vlog/close", "", 0, 0,
+ ovs.util.OutputFormat.TEXT,
Vlog._unixctl_vlog_close, None)
try:
# Windows limitation on Python 2, sys.maxsize is a long number
@@ -248,8 +250,10 @@ class Vlog(object):
except AttributeError:
maxsize_int = sys.maxsize
ovs.unixctl.command_register("vlog/set", "spec", 1, maxsize_int,
+ ovs.util.OutputFormat.TEXT,
Vlog._unixctl_vlog_set, None)
ovs.unixctl.command_register("vlog/list", "", 0, 0,
+ ovs.util.OutputFormat.TEXT,
Vlog._unixctl_vlog_list, None)
@staticmethod
@@ -406,7 +410,7 @@ class Vlog(object):
Vlog.__file_handler.close()
@staticmethod
- def _unixctl_vlog_reopen(conn, unused_argv, unused_aux):
+ def _unixctl_vlog_reopen(conn, unused_argv, unused_fmt, unused_aux):
if Vlog.__log_file:
Vlog.reopen_log_file()
conn.reply(None)
@@ -414,7 +418,7 @@ class Vlog(object):
conn.reply("Logging to file not configured")
@staticmethod
- def _unixctl_vlog_close(conn, unused_argv, unused_aux):
+ def _unixctl_vlog_close(conn, unused_argv, unused_fmt, unused_aux):
if Vlog.__log_file:
if sys.platform != 'win32':
logger = logging.getLogger("file")
@@ -424,7 +428,7 @@ class Vlog(object):
conn.reply(None)
@staticmethod
- def _unixctl_vlog_set(conn, argv, unused_aux):
+ def _unixctl_vlog_set(conn, argv, unused_fmt, unused_aux):
for arg in argv:
msg = Vlog.set_levels_from_string(arg)
if msg:
@@ -433,7 +437,7 @@ class Vlog(object):
conn.reply(None)
@staticmethod
- def _unixctl_vlog_list(conn, unused_argv, unused_aux):
+ def _unixctl_vlog_list(conn, unused_argv, unused_fmt, unused_aux):
conn.reply(Vlog.get_levels())
@@ -201,7 +201,8 @@ test_netflow_main(int argc, char *argv[])
if (error) {
ovs_fatal(error, "failed to create unixctl server");
}
- unixctl_command_register("exit", "", 0, 0, test_netflow_exit, &exiting);
+ unixctl_command_register("exit", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ test_netflow_exit, &exiting);
daemonize_complete();
@@ -294,6 +295,7 @@ usage(void)
static void
test_netflow_exit(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *exiting_)
{
bool *exiting = exiting_;
@@ -715,7 +715,8 @@ test_sflow_main(int argc, char *argv[])
if (error) {
ovs_fatal(error, "failed to create unixctl server");
}
- unixctl_command_register("exit", "", 0, 0, test_sflow_exit, &exiting);
+ unixctl_command_register("exit", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ test_sflow_exit, &exiting);
daemonize_complete();
@@ -804,6 +805,7 @@ usage(void)
static void
test_sflow_exit(struct unixctl_conn *conn,
int argc OVS_UNUSED, const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
void *exiting_)
{
bool *exiting = exiting_;
@@ -33,7 +33,9 @@ OVS_NO_RETURN static void usage(void);
static void
test_unixctl_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *exiting_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *exiting_)
{
bool *exiting = exiting_;
*exiting = true;
@@ -42,21 +44,26 @@ test_unixctl_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
test_unixctl_echo(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
unixctl_command_reply(conn, argv[1]);
}
static void
test_unixctl_echo_error(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
unixctl_command_reply_error(conn, argv[1]);
}
static void
test_unixctl_log(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux OVS_UNUSED)
{
VLOG_INFO("%s", argv[1]);
unixctl_command_reply(conn, NULL);
@@ -64,7 +71,9 @@ test_unixctl_log(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
test_unixctl_block(struct unixctl_conn *conn OVS_UNUSED, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux OVS_UNUSED)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
VLOG_INFO("%s", argv[1]);
unixctl_command_reply(conn, NULL);
@@ -88,12 +97,16 @@ test_unixctl_main(int argc, char *argv[])
if (retval) {
exit(EXIT_FAILURE);
}
- unixctl_command_register("exit", "", 0, 0, test_unixctl_exit, &exiting);
- unixctl_command_register("echo", "ARG", 1, 1, test_unixctl_echo, NULL);
- unixctl_command_register("echo_error", "ARG", 1, 1,
+ unixctl_command_register("exit", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ test_unixctl_exit, &exiting);
+ unixctl_command_register("echo", "ARG", 1, 1, OVS_OUTPUT_FMT_TEXT,
+ test_unixctl_echo, NULL);
+ unixctl_command_register("echo_error", "ARG", 1, 1, OVS_OUTPUT_FMT_TEXT,
test_unixctl_echo_error, NULL);
- unixctl_command_register("log", "ARG", 1, 1, test_unixctl_log, NULL);
- unixctl_command_register("block", "", 0, 0, test_unixctl_block, NULL);
+ unixctl_command_register("log", "ARG", 1, 1, OVS_OUTPUT_FMT_TEXT,
+ test_unixctl_log, NULL);
+ unixctl_command_register("block", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ test_unixctl_block, NULL);
daemonize_complete();
VLOG_INFO("Entering run loop.");
@@ -17,12 +17,13 @@ import argparse
import ovs.daemon
import ovs.unixctl
import ovs.unixctl.server
+import ovs.util
vlog = ovs.vlog.Vlog("test-unixctl")
exiting = False
-def unixctl_exit(conn, unused_argv, aux):
+def unixctl_exit(conn, unused_argv, unused_fmt, aux):
assert aux == "aux_exit"
global exiting
@@ -30,22 +31,22 @@ def unixctl_exit(conn, unused_argv, aux):
conn.reply(None)
-def unixctl_echo(conn, argv, aux):
+def unixctl_echo(conn, argv, unused_fmt, aux):
assert aux == "aux_echo"
conn.reply(str(argv))
-def unixctl_echo_error(conn, argv, aux):
+def unixctl_echo_error(conn, argv, unused_fmt, aux):
assert aux == "aux_echo_error"
conn.reply_error(str(argv))
-def unixctl_log(conn, argv, unused_aux):
+def unixctl_log(conn, argv, unused_fmt, unused_aux):
vlog.info(str(argv[0]))
conn.reply(None)
-def unixctl_block(conn, unused_argv, unused_aux):
+def unixctl_block(conn, unused_argv, unused_fmt, unused_aux):
pass
@@ -66,13 +67,19 @@ def main():
ovs.util.ovs_fatal(error, "could not create unixctl server at %s"
% args.unixctl, vlog)
- ovs.unixctl.command_register("exit", "", 0, 0, unixctl_exit, "aux_exit")
- ovs.unixctl.command_register("echo", "[arg ...]", 1, 2, unixctl_echo,
+ ovs.unixctl.command_register("exit", "", 0, 0, ovs.util.OutputFormat.TEXT,
+ unixctl_exit, "aux_exit")
+ ovs.unixctl.command_register("echo", "[arg ...]", 1, 2,
+ ovs.util.OutputFormat.TEXT, unixctl_echo,
"aux_echo")
- ovs.unixctl.command_register("log", "[arg ...]", 1, 2, unixctl_log, None)
+ ovs.unixctl.command_register("log", "[arg ...]", 1, 2,
+ ovs.util.OutputFormat.TEXT, unixctl_log,
+ None)
ovs.unixctl.command_register("echo_error", "[arg ...]", 1, 2,
+ ovs.util.OutputFormat.TEXT,
unixctl_echo_error, "aux_echo_error")
- ovs.unixctl.command_register("block", "", 0, 0, unixctl_block, None)
+ ovs.unixctl.command_register("block", "", 0, 0, ovs.util.OutputFormat.TEXT,
+ unixctl_block, None)
ovs.daemon.daemonize_complete()
vlog.info("Entering run loop.")
@@ -524,7 +524,8 @@ usage(void)
static void
ofctl_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *exiting_)
+ const char *argv[] OVS_UNUSED, enum ovs_output_fmt fmt OVS_UNUSED,
+ void *exiting_)
{
bool *exiting = exiting_;
*exiting = true;
@@ -1935,7 +1936,8 @@ openflow_from_hex(const char *hex, struct ofpbuf **msgp)
static void
ofctl_send(struct unixctl_conn *conn, int argc,
- const char *argv[], void *vconn_)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *vconn_)
{
struct vconn *vconn = vconn_;
struct ds reply;
@@ -1981,7 +1983,8 @@ ofctl_send(struct unixctl_conn *conn, int argc,
static void
unixctl_packet_out(struct unixctl_conn *conn, int OVS_UNUSED argc,
- const char *argv[], void *vconn_)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *vconn_)
{
struct vconn *vconn = vconn_;
enum ofputil_protocol protocol
@@ -2042,7 +2045,8 @@ struct barrier_aux {
static void
ofctl_barrier(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *aux_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED, void *aux_)
{
struct barrier_aux *aux = aux_;
struct ofpbuf *msg;
@@ -2065,7 +2069,8 @@ ofctl_barrier(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ofctl_set_output_file(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
int fd;
@@ -2083,7 +2088,9 @@ ofctl_set_output_file(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ofctl_block(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *blocked_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *blocked_)
{
bool *blocked = blocked_;
@@ -2097,7 +2104,9 @@ ofctl_block(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
ofctl_unblock(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *blocked_)
+ const char *argv[] OVS_UNUSED,
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *blocked_)
{
bool *blocked = blocked_;
@@ -2132,19 +2141,21 @@ monitor_vconn(struct vconn *vconn, bool reply_to_echo_requests,
if (error) {
ovs_fatal(error, "failed to create unixctl server");
}
- unixctl_command_register("exit", "", 0, 0, ofctl_exit, &exiting);
+ unixctl_command_register("exit", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ofctl_exit, &exiting);
unixctl_command_register("ofctl/send", "OFMSG...", 1, INT_MAX,
- ofctl_send, vconn);
+ OVS_OUTPUT_FMT_TEXT, ofctl_send, vconn);
unixctl_command_register("ofctl/packet-out", "\"in_port=<port> packet=<hex data> actions=...\"", 1, 1,
- unixctl_packet_out, vconn);
- unixctl_command_register("ofctl/barrier", "", 0, 0,
+ OVS_OUTPUT_FMT_TEXT, unixctl_packet_out, vconn);
+ unixctl_command_register("ofctl/barrier", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
ofctl_barrier, &barrier_aux);
unixctl_command_register("ofctl/set-output-file", "FILE", 1, 1,
- ofctl_set_output_file, NULL);
-
- unixctl_command_register("ofctl/block", "", 0, 0, ofctl_block, &blocked);
- unixctl_command_register("ofctl/unblock", "", 0, 0, ofctl_unblock,
- &blocked);
+ OVS_OUTPUT_FMT_TEXT, ofctl_set_output_file,
+ NULL);
+ unixctl_command_register("ofctl/block", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ofctl_block, &blocked);
+ unixctl_command_register("ofctl/unblock", "", 0, 0, OVS_OUTPUT_FMT_TEXT,
+ ofctl_unblock, &blocked);
daemonize_complete();
@@ -513,13 +513,16 @@ bridge_init(const char *remote)
/* Register unixctl commands. */
unixctl_command_register("qos/show-types", "interface", 1, 1,
- qos_unixctl_show_types, NULL);
+ OVS_OUTPUT_FMT_TEXT, qos_unixctl_show_types,
+ NULL);
unixctl_command_register("qos/show", "interface", 1, 1,
- qos_unixctl_show, NULL);
+ OVS_OUTPUT_FMT_TEXT, qos_unixctl_show, NULL);
unixctl_command_register("bridge/dump-flows", "[--offload-stats] bridge",
- 1, 2, bridge_unixctl_dump_flows, NULL);
+ 1, 2, OVS_OUTPUT_FMT_TEXT,
+ bridge_unixctl_dump_flows, NULL);
unixctl_command_register("bridge/reconnect", "[bridge]", 0, 1,
- bridge_unixctl_reconnect, NULL);
+ OVS_OUTPUT_FMT_TEXT, bridge_unixctl_reconnect,
+ NULL);
lacp_init();
bond_init();
cfm_init();
@@ -3466,7 +3469,8 @@ qos_unixctl_show_queue(unsigned int queue_id,
static void
qos_unixctl_show_types(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct sset types = SSET_INITIALIZER(&types);
@@ -3504,7 +3508,8 @@ qos_unixctl_show_types(struct unixctl_conn *conn, int argc OVS_UNUSED,
static void
qos_unixctl_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[], enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct ds ds = DS_EMPTY_INITIALIZER;
struct smap smap = SMAP_INITIALIZER(&smap);
@@ -3624,7 +3629,9 @@ bridge_lookup(const char *name)
* stack, including those normally hidden. */
static void
bridge_unixctl_dump_flows(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct bridge *br;
struct ds results;
@@ -3654,7 +3661,9 @@ bridge_unixctl_dump_flows(struct unixctl_conn *conn, int argc,
* drop their controller connections and reconnect. */
static void
bridge_unixctl_reconnect(struct unixctl_conn *conn, int argc,
- const char *argv[], void *aux OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED,
+ void *aux OVS_UNUSED)
{
struct bridge *br;
if (argc > 1) {
@@ -111,7 +111,7 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
unixctl_command_register("exit", "[--cleanup]", 0, 1,
- ovs_vswitchd_exit, NULL);
+ OVS_OUTPUT_FMT_TEXT, ovs_vswitchd_exit, NULL);
bridge_init(remote);
free(remote);
@@ -308,7 +308,8 @@ usage(void)
static void
ovs_vswitchd_exit(struct unixctl_conn *conn, int argc,
- const char *argv[], void *args OVS_UNUSED)
+ const char *argv[],
+ enum ovs_output_fmt fmt OVS_UNUSED, void *args OVS_UNUSED)
{
exit_args.n_conns++;
exit_args.conns = xrealloc(exit_args.conns,