+/* Sets the options for all of the JSON-RPC sessions managed by 'remote' to
+ * 'options'. */
+static void
+ovsdb_jsonrpc_session_set_all_options(
+ struct ovsdb_jsonrpc_remote *remote,
+ const struct ovsdb_jsonrpc_options *options)
+{
+ struct ovsdb_jsonrpc_session *s;
+
+ LIST_FOR_EACH (s, node, &remote->sessions) {
+ ovsdb_jsonrpc_session_set_options(s, options);
+ }
+}
+
+static void
+ovsdb_jsonrpc_session_get_status(const struct ovsdb_jsonrpc_remote *remote,
+ struct shash *shash)
+{
+ const struct ovsdb_jsonrpc_session *s;
+ const struct jsonrpc_session *js;
+ const char *name;
+ struct ovsdb_jsonrpc_remote_status *status;
+ struct reconnect_stats rstats;
+
+ /* We only look at the first session in the list. There should be only one
+ * node in the list for outbound connections. We don't track status for
+ * each individual inbound connection if someone configures the DB that
+ * way. Since outbound connections are the norm, this is fine. */
+ if (list_is_empty(&remote->sessions)) {
+ return;
+ }
+ s = CONTAINER_OF(remote->sessions.next, struct ovsdb_jsonrpc_session, node);
+ js = s->js;
+ if (!js) {
+ return;
+ }
+ name = jsonrpc_session_get_name(js);
+
+ status = xzalloc(sizeof *status);
+ shash_add(shash, name, status);
+
+ status->is_connected = jsonrpc_session_is_connected(js);
+ status->last_error = jsonrpc_session_get_status(js);
+
+ jsonrpc_session_get_reconnect_stats(js, &rstats);
+ status->state = rstats.state;
+ status->state_elapsed = rstats.state_elapsed;
+
+ return;
+}
+