summaryrefslogtreecommitdiff
path: root/server/providers
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-11-24 17:18:36 -0500
committerSimo Sorce <idra@samba.org>2008-11-24 17:19:14 -0500
commit98bf10fa12c08463a1f625403c4621f1bbeb0bcc (patch)
tree71a348b04b20a51db039fcd900c4128e530441c9 /server/providers
parent4ed04a82c352a717bd2c18cebe134fffdcafd721 (diff)
downloadsssd-98bf10fa12c08463a1f625403c4621f1bbeb0bcc.tar.gz
sssd-98bf10fa12c08463a1f625403c4621f1bbeb0bcc.tar.bz2
sssd-98bf10fa12c08463a1f625403c4621f1bbeb0bcc.zip
change structure name
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/data_provider.c9
-rw-r--r--server/providers/data_provider.h11
2 files changed, 13 insertions, 7 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c
index 7adcbf6a..cc78c38c 100644
--- a/server/providers/data_provider.c
+++ b/server/providers/data_provider.c
@@ -226,7 +226,7 @@ static int check_online(DBusMessage *message, void *data, DBusMessage **r)
static int init_data_providers(struct dp_ctx *dpctx)
{
TALLOC_CTX *tmp_ctx;
- struct dp_module *module;
+ struct dp_mod_ctx *module;
char **doms;
char *sec;
char *mod_name;
@@ -291,22 +291,23 @@ static int init_data_providers(struct dp_ctx *dpctx)
goto done;
}
- dpctx->modules = talloc_array(tmp_ctx, struct dp_module *, num_mods +1);
+ dpctx->modules = talloc_array(tmp_ctx, struct dp_mod_ctx *, num_mods +1);
if (!dpctx->modules) {
ret = ENOMEM;
goto done;
}
- module = talloc(dpctx->modules, struct dp_module);
+ module = talloc(dpctx->modules, struct dp_mod_ctx);
if (!module) {
ret = ENOMEM;
goto done;
}
dpctx->modules[num_mods] = module;
+ module->dp_ctx = dpctx;
module->domain = talloc_strdup(dpctx->modules, doms[i]);
module->name = talloc_steal(dpctx->modules, mod_name);
- ret = mod_init_fn(module, &module->ops, &module->pvt_data);
+ ret = mod_init_fn(module);
if (ret != EOK) {
DEBUG(0, ("Error (%d) in module (%s) initialization!\n",
ret, mod_name));
diff --git a/server/providers/data_provider.h b/server/providers/data_provider.h
index 7ed796ac..be00d51d 100644
--- a/server/providers/data_provider.h
+++ b/server/providers/data_provider.h
@@ -41,9 +41,14 @@ struct dp_mod_ops {
int (*check_online)(void *pvt_data, int *reply);
};
-typedef int (*sssm_init_fn_t)(TALLOC_CTX *, struct dp_mod_ops **, void **);
+#define MOD_OFFLINE 0x0000
+#define MOD_ONLINE 0x0001
-struct dp_module {
+struct dp_mod_ctx;
+typedef int (*sssm_init_fn_t)(struct dp_mod_ctx *);
+
+struct dp_mod_ctx {
+ struct dp_ctx *dp_ctx;
const char *name;
const char *domain;
struct dp_mod_ops *ops;
@@ -55,7 +60,7 @@ struct dp_ctx {
struct confdb_ctx *cdb;
struct ldb_context *ldb;
struct service_sbus_ctx *ss_ctx;
- struct dp_module **modules;
+ struct dp_mod_ctx **modules;
};
struct dp_client {