summaryrefslogtreecommitdiffstats
path: root/src/providers/dp_backend.h
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2013-10-21 13:37:37 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-10-22 19:11:36 +0200
commit0a320004a9937295ba66a348d1e60682cfdceb26 (patch)
treeb29163f7a61d90cb5d872c6514e0b03f9356d0c9 /src/providers/dp_backend.h
parent9de5878d247b77b8f520a57727cd55f42e179caa (diff)
downloadsssd-0a320004a9937295ba66a348d1e60682cfdceb26.tar.gz
sssd-0a320004a9937295ba66a348d1e60682cfdceb26.tar.xz
sssd-0a320004a9937295ba66a348d1e60682cfdceb26.zip
Add unconditional online callbacks
Currently online callbacks are only executed if the backend was offline before. This patch add a new class of callback which are always called if the backend gets a request to go online. They can be used e.g. to reset timeouts until a more sophisticated method (OpenLMI, sssctl) is available.
Diffstat (limited to 'src/providers/dp_backend.h')
-rw-r--r--src/providers/dp_backend.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h
index 76590a39e..fc71b60ca 100644
--- a/src/providers/dp_backend.h
+++ b/src/providers/dp_backend.h
@@ -126,6 +126,11 @@ struct be_ctx {
bool run_online_cb;
struct be_cb *offline_cb_list;
struct be_cb *reconnect_cb_list;
+ /* In contrast to online_cb_list which are only run if the backend is
+ * offline the unconditional_online_cb_list should be run whenever the
+ * backend receives a request to go online. The typical use case is to
+ * reset timers independenly of the state of the backend. */
+ struct be_cb *unconditional_online_cb_list;
struct be_offline_status offstat;
@@ -200,6 +205,10 @@ int be_add_online_cb(TALLOC_CTX *mem_ctx,
void *pvt,
struct be_cb **online_cb);
void be_run_online_cb(struct be_ctx *be);
+int be_add_unconditional_online_cb(TALLOC_CTX *mem_ctx, struct be_ctx *ctx,
+ be_callback_t cb, void *pvt,
+ struct be_cb **unconditional_online_cb);
+void be_run_unconditional_online_cb(struct be_ctx *be);
int be_add_offline_cb(TALLOC_CTX *mem_ctx,
struct be_ctx *ctx,