1*d3273b5bSchristos /* $NetBSD: db_plugin.c,v 1.2 2017/01/28 21:31:49 christos Exp $ */
2b9d004c6Schristos
3b9d004c6Schristos /*
4b9d004c6Schristos */
5b9d004c6Schristos
6b9d004c6Schristos #include "krb5_locl.h"
7b9d004c6Schristos #include "db_plugin.h"
8b9d004c6Schristos
9b9d004c6Schristos /* Default plugin (DB using binary search of sorted text file) follows */
10b9d004c6Schristos static heim_base_once_t db_plugins_once = HEIM_BASE_ONCE_INIT;
11b9d004c6Schristos
12b9d004c6Schristos static krb5_error_code KRB5_LIB_CALL
db_plugins_plcallback(krb5_context context,const void * plug,void * plugctx,void * userctx)13b9d004c6Schristos db_plugins_plcallback(krb5_context context, const void *plug, void *plugctx,
14b9d004c6Schristos void *userctx)
15b9d004c6Schristos {
16b9d004c6Schristos return 0;
17b9d004c6Schristos }
18b9d004c6Schristos
19b9d004c6Schristos static void
db_plugins_init(void * arg)20b9d004c6Schristos db_plugins_init(void *arg)
21b9d004c6Schristos {
22b9d004c6Schristos krb5_context context = arg;
23b9d004c6Schristos (void)_krb5_plugin_run_f(context, "krb5", KRB5_PLUGIN_DB,
24b9d004c6Schristos KRB5_PLUGIN_DB_VERSION_0, 0, NULL,
25b9d004c6Schristos db_plugins_plcallback);
26b9d004c6Schristos }
27b9d004c6Schristos
28b9d004c6Schristos KRB5_LIB_FUNCTION void KRB5_LIB_CALL
_krb5_load_db_plugins(krb5_context context)29b9d004c6Schristos _krb5_load_db_plugins(krb5_context context)
30b9d004c6Schristos {
31b9d004c6Schristos heim_base_once_f(&db_plugins_once, context, db_plugins_init);
32b9d004c6Schristos }
33b9d004c6Schristos
34