aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2010-01-14 13:10:35 -0800
committerJustin Pettit <jpettit@nicira.com>2010-01-14 13:10:35 -0800
commitf3d645212a60b4c0e99e66488ab8ef9fd1e8d8cb (patch)
tree1783bbeddeedb8256e74e654c48f77d472567b0a /lib
parent5ff22a0642fb299140e7b3e62588be692386c0b8 (diff)
ovsdb: Provide helper function to determine if IDL has ever connected
Diffstat (limited to 'lib')
-rw-r--r--lib/ovsdb-idl.c6
-rw-r--r--lib/ovsdb-idl.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 635dcccb..a4407a57 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -291,6 +291,12 @@ ovsdb_idl_get_seqno(const struct ovsdb_idl *idl)
return idl->change_seqno;
}
+bool
+ovsdb_idl_has_ever_connected(const struct ovsdb_idl *idl)
+{
+ return ovsdb_idl_get_seqno(idl) != 0;
+}
+
void
ovsdb_idl_force_reconnect(struct ovsdb_idl *idl)
{
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index fb551b48..88514b94 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -16,6 +16,7 @@
#ifndef OVSDB_IDL_H
#define OVSDB_IDL_H 1
+#include <stdbool.h>
#include <stdint.h>
struct json;
@@ -29,6 +30,7 @@ void ovsdb_idl_run(struct ovsdb_idl *);
void ovsdb_idl_wait(struct ovsdb_idl *);
unsigned int ovsdb_idl_get_seqno(const struct ovsdb_idl *);
+bool ovsdb_idl_has_ever_connected(const struct ovsdb_idl *);
void ovsdb_idl_force_reconnect(struct ovsdb_idl *);
enum ovsdb_idl_txn_status {