#include <errno.h>
#include <getopt.h>
+#include <inttypes.h>
#include <signal.h>
#include <unistd.h>
struct ovsdb_jsonrpc_remote_status status;
struct ovsdb_row *rw_row;
const char *target;
- char *keys[8], *values[8];
+ char *keys[9], *values[9];
size_t n = 0;
/* Get the "target" (protocol/host/port) spec. */
keys[n] = xstrdup("n_connections");
values[n++] = xasprintf("%d", status.n_connections);
}
+ if (status.bound_port != htons(0)) {
+ keys[n] = xstrdup("bound_port");
+ values[n++] = xasprintf("%"PRIu16, ntohs(status.bound_port));
+ }
write_string_string_column(rw_row, "status", keys, values, n);
ovsdb_jsonrpc_server_free_remote_status(&status);
LEAK_CHECKER_OPTION_ENUMS,
DAEMON_OPTION_ENUMS
};
- static struct option long_options[] = {
+ static const struct option long_options[] = {
{"remote", required_argument, NULL, OPT_REMOTE},
{"unixctl", required_argument, NULL, OPT_UNIXCTL},
{"run", required_argument, NULL, OPT_RUN},