summaryrefslogtreecommitdiffstats
path: root/src/providers/dp_backend.h
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-04-27 14:57:37 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-05-07 17:14:32 -0400
commitdd025b4cbd501e2f34461f9d8359a829b81f5c2f (patch)
treeb04795563e7072d0b66ad28383d00624656363fa /src/providers/dp_backend.h
parent96a6aa73a6ea0982b349ac10b82aaf86d03ec5f5 (diff)
downloadsssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.tar.gz
sssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.tar.xz
sssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.zip
Add callback when the ID provider switches from offline to online
Allow backends to set a callback in the be_ctx that should be invoked when the ID provider goes online. This can be used to perform regular maintenance tasks that are valid only when going online.
Diffstat (limited to 'src/providers/dp_backend.h')
-rw-r--r--src/providers/dp_backend.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h
index d657af18b..496c80700 100644
--- a/src/providers/dp_backend.h
+++ b/src/providers/dp_backend.h
@@ -35,6 +35,8 @@ typedef void (*be_shutdown_fn)(void *);
typedef void (*be_req_fn_t)(struct be_req *);
typedef void (*be_async_callback_t)(struct be_req *, int, int, const char *);
+typedef void (*be_conn_online_callback_t)(void *);
+
enum bet_type {
BET_NULL = 0,
BET_ID,
@@ -76,6 +78,8 @@ struct be_client {
struct be_failover_ctx;
+struct be_conn_online_cb;
+
struct be_ctx {
struct tevent_context *ev;
struct confdb_ctx *cdb;
@@ -85,6 +89,12 @@ struct be_ctx {
const char *conf_path;
struct be_failover_ctx *be_fo;
+ /* Functions to be invoked when the
+ * backend goes online
+ */
+ struct be_conn_online_cb *online_cb_list;
+ bool run_online_cb;
+
struct be_offline_status offstat;
struct sbus_connection *mon_conn;
@@ -126,6 +136,13 @@ struct be_acct_req {
bool be_is_offline(struct be_ctx *ctx);
void be_mark_offline(struct be_ctx *ctx);
+int be_add_online_cb(TALLOC_CTX *mem_ctx,
+ struct be_ctx *ctx,
+ be_conn_online_callback_t cb,
+ void *pvt,
+ struct be_conn_online_cb **online_cb);
+void be_run_online_cb(struct be_ctx *be);
+
/* from data_provider_fo.c */
typedef void (be_svc_callback_fn_t)(void *, struct fo_server *);