diff options
Diffstat (limited to 'source4/lib/ldb/include')
-rw-r--r-- | source4/lib/ldb/include/ldb.h | 46 | ||||
-rw-r--r-- | source4/lib/ldb/include/ldb_private.h | 3 |
2 files changed, 49 insertions, 0 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index a6cec7f774..4a40e34363 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -560,15 +560,51 @@ enum ldb_request_type { LDB_REQ_MODIFY, LDB_REQ_DELETE, LDB_REQ_RENAME, + LDB_ASYNC_SEARCH, + LDB_ASYNC_ADD, + LDB_ASYNC_MODIFY, + LDB_ASYNC_DELETE, + LDB_ASYNC_RENAME, + LDB_REQ_REGISTER }; +enum ldb_reply_type { + LDB_REPLY_ENTRY, + LDB_REPLY_REFERRAL, + LDB_REPLY_DONE +}; + +enum ldb_async_wait_type { + LDB_WAIT_ALL, + LDB_WAIT_NONE +}; + +enum ldb_async_state { + LDB_ASYNC_PENDING, + LDB_ASYNC_DONE +}; + struct ldb_result { unsigned int count; struct ldb_message **msgs; + char **refs; struct ldb_control **controls; }; +struct ldb_async_result { + enum ldb_reply_type type; + struct ldb_message *message; + char *referral; + struct ldb_control **controls; +}; + +struct ldb_async_handle { + int status; + enum ldb_async_state state; + void *private_data; +}; + struct ldb_search { const struct ldb_dn *base; enum ldb_scope scope; @@ -613,10 +649,20 @@ struct ldb_request { struct ldb_control **controls; struct ldb_credentials *creds; + + struct { + void *context; + int (*callback)(struct ldb_context *, void *, struct ldb_async_result *); + + time_t timeout; + struct ldb_async_handle *handle; + } async; }; int ldb_request(struct ldb_context *ldb, struct ldb_request *request); +int ldb_async_wait(struct ldb_context *ldb, struct ldb_async_handle *handle, enum ldb_async_wait_type type); + /** Initialise an ldb context diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h index 90632744ed..db34b58858 100644 --- a/source4/lib/ldb/include/ldb_private.h +++ b/source4/lib/ldb/include/ldb_private.h @@ -105,6 +105,8 @@ struct ldb_context { char *err_string; int transaction_active; + + int (*async_wait)(struct ldb_async_handle *, enum ldb_async_wait_type); }; /* the modules init function */ @@ -132,6 +134,7 @@ int ldb_next_del_trans(struct ldb_module *module); int ldb_next_second_stage_init(struct ldb_module *module); void ldb_set_errstring(struct ldb_module *module, char *err_string); +void ldb_reset_err_string(struct ldb_context *ldb); /* The following definitions come from lib/ldb/common/ldb_debug.c */ void ldb_debug(struct ldb_context *ldb, enum ldb_debug_level level, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4); |