summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-01 18:41:32 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-01 18:55:19 +1100
commitd103f2d346d721de6975f32649a8c75d5230dc5b (patch)
tree0b8cc98f67901cc73549025c4b99deb67b3d2fa0 /source4/lib/ldb/include
parentc74601e0b333f81570dfca6959e047d83e6ab32c (diff)
downloadsamba-d103f2d346d721de6975f32649a8c75d5230dc5b.tar.gz
samba-d103f2d346d721de6975f32649a8c75d5230dc5b.tar.bz2
samba-d103f2d346d721de6975f32649a8c75d5230dc5b.zip
s4-ldb: added support for general ldb hooks in modules
this allows a ldb module to register a hook function called at various stages of processing. It will be initially used for ldb command line hooks, but should work generally. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib/ldb/include')
-rw-r--r--source4/lib/ldb/include/ldb_module.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/source4/lib/ldb/include/ldb_module.h b/source4/lib/ldb/include/ldb_module.h
index 71c3cd8f7b..800bf72e44 100644
--- a/source4/lib/ldb/include/ldb_module.h
+++ b/source4/lib/ldb/include/ldb_module.h
@@ -185,7 +185,7 @@ struct ldb_backend_ops {
const char *ldb_default_modules_dir(void);
-int ldb_register_backend(const char *url_prefix, ldb_connect_fn);
+int ldb_register_backend(const char *url_prefix, ldb_connect_fn, bool);
struct ldb_handle *ldb_handle_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb);
@@ -233,4 +233,23 @@ int ldb_modules_load(const char *modules_path, const char *version);
/* init functions prototype */
typedef int (*ldb_module_init_fn)(const char *);
+/*
+ general ldb hook function
+ */
+enum ldb_module_hook_type { LDB_MODULE_HOOK_CMDLINE_OPTIONS = 1,
+ LDB_MODULE_HOOK_CMDLINE_PRECONNECT = 2,
+ LDB_MODULE_HOOK_CMDLINE_POSTCONNECT = 3 };
+
+typedef int (*ldb_hook_fn)(struct ldb_context *, enum ldb_module_hook_type );
+
+/*
+ register a ldb hook function
+ */
+int ldb_register_hook(ldb_hook_fn hook_fn);
+
+/*
+ call ldb hooks of a given type
+ */
+int ldb_modules_hook(struct ldb_context *ldb, enum ldb_module_hook_type t);
+
#endif