diff options
author | Simo Sorce <simo@redhat.com> | 2012-07-19 19:35:43 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-08-01 22:24:44 +0200 |
commit | 87ed72b47859e673b636c85f35b85f1546c7ed3d (patch) | |
tree | 7feadb7a4316ad4148924b5424132e793c1c7c5c /src/providers/ipa/ipa_subdomains.c | |
parent | 204cfc89a076fd32bf34f2abb3f809304aaa88ab (diff) | |
download | sssd-87ed72b47859e673b636c85f35b85f1546c7ed3d.tar.gz sssd-87ed72b47859e673b636c85f35b85f1546c7ed3d.tar.bz2 sssd-87ed72b47859e673b636c85f35b85f1546c7ed3d.zip |
Expose an initializer function from subdomain
Instead of exporting internal structures, expose an initilizer function
like the autofs code and initialize everything inside the
ipa_subdomains.c file.
Diffstat (limited to 'src/providers/ipa/ipa_subdomains.c')
-rw-r--r-- | src/providers/ipa/ipa_subdomains.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c index 8a49c634..a8c05c2a 100644 --- a/src/providers/ipa/ipa_subdomains.c +++ b/src/providers/ipa/ipa_subdomains.c @@ -56,6 +56,13 @@ struct ipa_subdomains_req_params { const char *attrs[8]; }; +struct ipa_subdomains_ctx { + struct sdap_id_ctx *sdap_id_ctx; + struct sdap_search_base **search_bases; + struct sdap_search_base **master_search_bases; + struct sdap_search_base **ranges_search_bases; +}; + static void ipa_subdomains_reply(struct be_req *be_req, int dp_err, int result) { be_req->fn(be_req, dp_err, result, NULL); @@ -651,3 +658,31 @@ done: } ipa_subdomains_reply(be_req, dp_error, ret); } + +struct bet_ops ipa_subdomains_ops = { + .handler = ipa_subdomains_handler, + .finalize = NULL +}; + +int ipa_subdom_init(struct be_ctx *be_ctx, + struct ipa_id_ctx *id_ctx, + struct bet_ops **ops, + void **pvt_data) +{ + struct ipa_subdomains_ctx *ctx; + + ctx = talloc_zero(id_ctx, struct ipa_subdomains_ctx); + if (ctx == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + return ENOMEM; + } + + ctx->sdap_id_ctx = id_ctx->sdap_id_ctx; + ctx->search_bases = id_ctx->ipa_options->subdomains_search_bases; + ctx->master_search_bases = id_ctx->ipa_options->master_domain_search_bases; + ctx->ranges_search_bases = id_ctx->ipa_options->ranges_search_bases; + *ops = &ipa_subdomains_ops; + *pvt_data = ctx; + + return EOK; +} |