[ovs-dev] [PATCH] ovsdb idl: API to get the idl session

Arunkumar Rg arunkumar.rg at gmail.com
Tue Oct 9 07:26:37 UTC 2018


Added an API in ovsdb-idl to get the idl->session. This API is useful in
the
ovsdb client code as the session information returned by this API would be
used to get the details about the remote session.

Signed-off-by: Arunkumar R G <arunkumar.rg at gmail.com>

---
 lib/ovsdb-idl.c | 6 ++++++
 lib/ovsdb-idl.h | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 6a19b07..01e00f2 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -976,6 +976,12 @@ ovsdb_idl_is_connected(const struct ovsdb_idl *idl)
     return idl->session && jsonrpc_session_is_connected(idl->session);
 }

+struct jsonrpc_session *
+ovsdb_idl_get_session(const struct ovsdb_idl *idl)
+{
+    return idl->session;
+}
+
 /* Returns the last error reported on a connection by 'idl'.  The return
value
  * is 0 only if no connection made by 'idl' has ever encountered an error
and
  * a negative response to a schema request has never been received. See
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index 8a168eb..201ba1e 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -55,6 +55,7 @@ struct ovsdb_idl_row;
 struct ovsdb_idl_column;
 struct ovsdb_idl_table_class;
 struct uuid;
+struct jsonrpc_session;

 struct ovsdb_idl *ovsdb_idl_create(const char *remote,
                                    const struct ovsdb_idl_class *,
@@ -76,6 +77,8 @@ bool ovsdb_idl_is_lock_contended(const struct ovsdb_idl
*);

 const struct uuid  * ovsdb_idl_get_monitor_id(const struct ovsdb_idl *);
 unsigned int ovsdb_idl_get_seqno(const struct ovsdb_idl *);
+struct jsonrpc_session *ovsdb_idl_get_session(const struct ovsdb_idl *);
+
 bool ovsdb_idl_has_ever_connected(const struct ovsdb_idl *);
 void ovsdb_idl_enable_reconnect(struct ovsdb_idl *);
 void ovsdb_idl_force_reconnect(struct ovsdb_idl *);
--
1.8.3.1


More information about the dev mailing list