summaryrefslogtreecommitdiffstats
path: root/src/providers/data_provider_callbacks.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-05-14 10:57:19 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-05-27 14:44:13 -0400
commit8eb2a35e3b180e76da4be5beab11cdb4038860b2 (patch)
tree7b208e0e42cb21eccdc372007f75af516a402ce0 /src/providers/data_provider_callbacks.c
parentf6085645026b9ee26e970d8f9a4e7b8cba077361 (diff)
downloadsssd-8eb2a35e3b180e76da4be5beab11cdb4038860b2.tar.gz
sssd-8eb2a35e3b180e76da4be5beab11cdb4038860b2.tar.xz
sssd-8eb2a35e3b180e76da4be5beab11cdb4038860b2.zip
Add offline callbacks
Diffstat (limited to 'src/providers/data_provider_callbacks.c')
-rw-r--r--src/providers/data_provider_callbacks.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/providers/data_provider_callbacks.c b/src/providers/data_provider_callbacks.c
index 00bc8fd5d..555271306 100644
--- a/src/providers/data_provider_callbacks.c
+++ b/src/providers/data_provider_callbacks.c
@@ -180,3 +180,25 @@ void be_run_online_cb(struct be_ctx *be) {
DEBUG(9, ("Online call back list is empty, nothing to do.\n"));
}
}
+
+int be_add_offline_cb(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, be_callback_t cb,
+ void *pvt, struct be_cb **offline_cb)
+{
+ return be_add_cb(mem_ctx, ctx, cb, pvt, &ctx->offline_cb_list, offline_cb);
+}
+
+void be_run_offline_cb(struct be_ctx *be) {
+ int ret;
+
+ if (be->offline_cb_list) {
+ DEBUG(3, ("Going offline. Running callbacks.\n"));
+
+ ret = be_run_cb(be, be->offline_cb_list);
+ if (ret != EOK) {
+ DEBUG(1, ("be_run_cb failed.\n"));
+ }
+
+ } else {
+ DEBUG(9, ("Offline call back list is empty, nothing to do.\n"));
+ }
+}