Use stdbool.h instead of manually defining bool
[ira/wip.git] / source4 / lib / ldb / include / ldb.h
index 2e13a774b987f01ec1fbf603327694668048bb53..be41151409a73813e3635f186c9bb6cdfc1d0eb2 100644 (file)
 #define _LDB_H_ 1
 /*! \endcond */
 
+#include <stdbool.h>
+#include "talloc.h"
+#include "tevent.h"
+#include "ldb_errors.h"
+
 /*
   major restrictions as compared to normal LDAP:
 
-     - no async calls.
      - each record must have a unique key field
      - the key must be representable as a NULL terminated C string and may not 
        contain a comma or braces
 
   major restrictions as compared to tdb:
 
-     - no explicit locking calls
-     UPDATE: we have transactions now, better than locking --SSS.
+     - no explicit locking calls, but we have transactions when using ldb_tdb
 
 */
 
@@ -181,6 +184,7 @@ enum ldb_scope {LDB_SCOPE_DEFAULT=-1,
                LDB_SCOPE_SUBTREE=2};
 
 struct ldb_context;
+struct tevent_context;
 
 /* debugging uses one of the following levels */
 enum ldb_debug_level {LDB_DEBUG_FATAL, LDB_DEBUG_ERROR, 
@@ -203,7 +207,7 @@ struct ldb_debug_ops {
 */
 struct ldb_utf8_fns {
        void *context;
-       char *(*casefold)(void *context, TALLOC_CTX *mem_ctx, const char *s);
+       char *(*casefold)(void *context, TALLOC_CTX *mem_ctx, const char *s, size_t n);
 };
 
 /**
@@ -325,7 +329,6 @@ typedef int (*ldb_attr_comparison_t)(struct ldb_context *, TALLOC_CTX *mem_ctx,
   attribute handler structure
 
   attr                 -> The attribute name
-  flags                        -> LDB_ATTR_FLAG_*
   ldif_read_fn         -> convert from ldif to binary format
   ldif_write_fn                -> convert from binary to ldif format
   canonicalise_fn      -> canonicalise a value, for use by indexing and dn construction
@@ -349,6 +352,16 @@ struct ldb_schema_attribute {
 const struct ldb_schema_attribute *ldb_schema_attribute_by_name(struct ldb_context *ldb,
                                                                const char *name);
 
+struct ldb_dn_extended_syntax {
+       const char *name;
+       ldb_attr_handler_t read_fn;
+       ldb_attr_handler_t write_clear_fn;
+       ldb_attr_handler_t write_hex_fn;
+};
+
+const struct ldb_dn_extended_syntax *ldb_dn_extended_syntax_by_name(struct ldb_context *ldb,
+                                                                   const char *name);
+
 /**
    The attribute is not returned by default
 */
@@ -358,9 +371,9 @@ const struct ldb_schema_attribute *ldb_schema_attribute_by_name(struct ldb_conte
 #define LDB_ATTR_FLAG_ALLOCATED    (1<<1) 
 
 /**
-   The attribute is constructed from other attributes
+   The attribute is supplied by the application and should not be removed
 */
-#define LDB_ATTR_FLAG_CONSTRUCTED  (1<<1
+#define LDB_ATTR_FLAG_FIXED        (1<<2
 
 /**
   LDAP attribute syntax for a DN
@@ -651,7 +664,6 @@ enum ldb_request_type {
        LDB_DELETE,
        LDB_RENAME,
        LDB_EXTENDED,
-       LDB_SEQUENCE_NUMBER,
        LDB_REQ_REGISTER_CONTROL,
        LDB_REQ_REGISTER_PARTITION
 };
@@ -659,7 +671,6 @@ enum ldb_request_type {
 enum ldb_reply_type {
        LDB_REPLY_ENTRY,
        LDB_REPLY_REFERRAL,
-       LDB_REPLY_EXTENDED,
        LDB_REPLY_DONE
 };
 
@@ -679,28 +690,45 @@ struct ldb_extended {
        void *data; /* NULL or a valid talloc pointer! talloc_get_type() will be used on it */
 };
 
+#define LDB_EXTENDED_SEQUENCE_NUMBER   "1.3.6.1.4.1.7165.4.4.3"
+
+enum ldb_sequence_type {
+       LDB_SEQ_HIGHEST_SEQ,
+       LDB_SEQ_HIGHEST_TIMESTAMP,
+       LDB_SEQ_NEXT
+};
+
+#define LDB_SEQ_GLOBAL_SEQUENCE    0x01
+#define LDB_SEQ_TIMESTAMP_SEQUENCE 0x02
+
+struct ldb_seqnum_request {
+       enum ldb_sequence_type type;
+};
+
+struct ldb_seqnum_result {
+       uint64_t seq_num;
+       uint32_t flags;
+};
+
 struct ldb_result {
        unsigned int count;
        struct ldb_message **msgs;
-       char **refs;
        struct ldb_extended *extended;
        struct ldb_control **controls;
+       char **refs;
 };
 
 struct ldb_reply {
+       int error;
        enum ldb_reply_type type;
        struct ldb_message *message;
        struct ldb_extended *response;
-       char *referral;
        struct ldb_control **controls;
+       char *referral;
 };
 
-struct ldb_handle {
-       int status;
-       enum ldb_state state;
-       void *private_data;
-       struct ldb_module *module;
-};
+struct ldb_request;
+struct ldb_handle;
 
 struct ldb_search {
        struct ldb_dn *base;
@@ -735,19 +763,8 @@ struct ldb_register_partition {
        struct ldb_dn *dn;
 };
 
-enum ldb_sequence_type {
-       LDB_SEQ_HIGHEST_SEQ,
-       LDB_SEQ_HIGHEST_TIMESTAMP,
-       LDB_SEQ_NEXT
-};
+typedef int (*ldb_request_callback_t)(struct ldb_request *, struct ldb_reply *);
 
-struct ldb_sequence_number {
-       enum ldb_sequence_type type;
-       uint64_t seq_num;
-       uint32_t flags;
-};
-
-typedef int (*ldb_request_callback_t)(struct ldb_context *, void *, struct ldb_reply *);
 struct ldb_request {
 
        enum ldb_request_type operation;
@@ -759,7 +776,6 @@ struct ldb_request {
                struct ldb_delete del;
                struct ldb_rename rename;
                struct ldb_extended extended;
-               struct ldb_sequence_number seq_num;
                struct ldb_register_control reg_control;
                struct ldb_register_partition reg_partition;
        } op;
@@ -775,13 +791,19 @@ struct ldb_request {
 };
 
 int ldb_request(struct ldb_context *ldb, struct ldb_request *request);
+int ldb_request_done(struct ldb_request *req, int status);
+bool ldb_request_is_done(struct ldb_request *req);
 
+int ldb_modules_wait(struct ldb_handle *handle);
 int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type);
 
 int ldb_set_timeout(struct ldb_context *ldb, struct ldb_request *req, int timeout);
 int ldb_set_timeout_from_prev_req(struct ldb_context *ldb, struct ldb_request *oldreq, struct ldb_request *newreq);
 void ldb_set_create_perms(struct ldb_context *ldb, unsigned int perms);
 void ldb_set_modules_dir(struct ldb_context *ldb, const char *path);
+struct tevent_context;
+void ldb_set_event_context(struct ldb_context *ldb, struct tevent_context *ev);
+struct tevent_context * ldb_get_event_context(struct ldb_context *ldb);
 
 /**
   Initialise ldbs' global information
@@ -803,7 +825,7 @@ int ldb_global_init(void);
   \return pointer to ldb_context that should be free'd (using talloc_free())
   at the end of the program.
 */
-struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
+struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx);
 
 /**
    Connect to a database.
@@ -828,6 +850,19 @@ struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
    (that is, with LDB_FLG_RDONLY). However in read-write mode, the database will be
    created if it does not exist.
 */
+
+typedef void (*ldb_async_timeout_fn) (void *);
+typedef bool (*ldb_async_callback_fn) (void *);
+typedef int (*ldb_async_ctx_add_op_fn)(void *, time_t, void *, ldb_async_timeout_fn, ldb_async_callback_fn);
+typedef int (*ldb_async_ctx_wait_op_fn)(void *);
+
+void ldb_async_ctx_set_private_data(struct ldb_context *ldb,
+                                       void *private_data);
+void ldb_async_ctx_set_add_op(struct ldb_context *ldb,
+                               ldb_async_ctx_add_op_fn add_op);
+void ldb_async_ctx_set_wait_op(struct ldb_context *ldb,
+                               ldb_async_ctx_wait_op_fn wait_op);
+
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, const char *options[]);
 
 /*
@@ -857,13 +892,12 @@ struct ldb_dn *ldb_get_default_basedn(struct ldb_context *ldb);
 /**
   The default async search callback function 
 
-  \param ldb the context associated with the database (from ldb_init())
-  \param context the callback context (struct ldb_result *)
+  \param req the request we are callback of
   \param ares a single reply from the async core
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 
-  \note this function expects the context to always be an struct ldb_result pointer
+  \note this function expects req->context to always be an struct ldb_result pointer
   AND a talloc context, this function will steal on the context each message
   from the ares reply passed on by the async core so that in the end all the
   messages will be in the context (ldb_result)  memory tree.
@@ -872,7 +906,18 @@ struct ldb_dn *ldb_get_default_basedn(struct ldb_context *ldb);
   request that can be freed as sson as the search request is finished)
 */
 
-int ldb_search_default_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares);
+int ldb_search_default_callback(struct ldb_request *req, struct ldb_reply *ares);
+
+/**
+  The default async extended operation callback function
+
+  \param req the request we are callback of
+  \param ares a single reply from the async core
+
+  \return result code (LDB_SUCCESS on success, or a failure code)
+*/
+int ldb_op_default_callback(struct ldb_request *req, struct ldb_reply *ares);
+
 
 /**
   Helper function to build a search request
@@ -886,7 +931,8 @@ int ldb_search_default_callback(struct ldb_context *ldb, void *context, struct l
   \param attrs the search attributes for the query (pass NULL if none required)
   \param controls an array of controls
   \param context the callback function context
-  \param callback the callback function to handle the async replies
+  \param the callback function to handle the async replies
+  \param the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -900,7 +946,20 @@ int ldb_build_search_req(struct ldb_request **ret_req,
                        const char * const *attrs,
                        struct ldb_control **controls,
                        void *context,
-                       ldb_request_callback_t callback);
+                       ldb_request_callback_t callback,
+                       struct ldb_request *parent);
+
+int ldb_build_search_req_ex(struct ldb_request **ret_req,
+                       struct ldb_context *ldb,
+                       TALLOC_CTX *mem_ctx,
+                       struct ldb_dn *base,
+                       enum ldb_scope scope,
+                       struct ldb_parse_tree *tree,
+                       const char * const *attrs,
+                       struct ldb_control **controls,
+                       void *context,
+                       ldb_request_callback_t callback,
+                       struct ldb_request *parent);
 
 /**
   Helper function to build an add request
@@ -911,7 +970,8 @@ int ldb_build_search_req(struct ldb_request **ret_req,
   \param message contains the entry to be added 
   \param controls an array of controls
   \param context the callback function context
-  \param callback the callback function to handle the async replies
+  \param the callback function to handle the async replies
+  \param the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -922,7 +982,8 @@ int ldb_build_add_req(struct ldb_request **ret_req,
                        const struct ldb_message *message,
                        struct ldb_control **controls,
                        void *context,
-                       ldb_request_callback_t callback);
+                       ldb_request_callback_t callback,
+                       struct ldb_request *parent);
 
 /**
   Helper function to build a modify request
@@ -933,7 +994,8 @@ int ldb_build_add_req(struct ldb_request **ret_req,
   \param message contains the entry to be modified
   \param controls an array of controls
   \param context the callback function context
-  \param callback the callback function to handle the async replies
+  \param the callback function to handle the async replies
+  \param the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -944,7 +1006,8 @@ int ldb_build_mod_req(struct ldb_request **ret_req,
                        const struct ldb_message *message,
                        struct ldb_control **controls,
                        void *context,
-                       ldb_request_callback_t callback);
+                       ldb_request_callback_t callback,
+                       struct ldb_request *parent);
 
 /**
   Helper function to build a delete request
@@ -955,7 +1018,8 @@ int ldb_build_mod_req(struct ldb_request **ret_req,
   \param dn the DN to be deleted
   \param controls an array of controls
   \param context the callback function context
-  \param callback the callback function to handle the async replies
+  \param the callback function to handle the async replies
+  \param the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -966,7 +1030,8 @@ int ldb_build_del_req(struct ldb_request **ret_req,
                        struct ldb_dn *dn,
                        struct ldb_control **controls,
                        void *context,
-                       ldb_request_callback_t callback);
+                       ldb_request_callback_t callback,
+                       struct ldb_request *parent);
 
 /**
   Helper function to build a rename request
@@ -978,7 +1043,8 @@ int ldb_build_del_req(struct ldb_request **ret_req,
   \param newdn the new DN
   \param controls an array of controls
   \param context the callback function context
-  \param callback the callback function to handle the async replies
+  \param the callback function to handle the async replies
+  \param the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -990,7 +1056,8 @@ int ldb_build_rename_req(struct ldb_request **ret_req,
                        struct ldb_dn *newdn,
                        struct ldb_control **controls,
                        void *context,
-                       ldb_request_callback_t callback);
+                       ldb_request_callback_t callback,
+                       struct ldb_request *parent);
 
 /**
   Add a ldb_control to a ldb_request
@@ -1013,6 +1080,15 @@ int ldb_request_add_control(struct ldb_request *req, const char *oid, bool criti
 */
 struct ldb_control *ldb_request_get_control(struct ldb_request *req, const char *oid);
 
+/**
+   check if a control with the specified "oid" exist and return it 
+  \param rep the reply struct where to add the control
+  \param oid the object identifier of the control as string
+
+  \return the control, NULL if not found 
+*/
+struct ldb_control *ldb_reply_get_control(struct ldb_reply *rep, const char *oid);
+
 /**
   Search the database
 
@@ -1020,31 +1096,21 @@ struct ldb_control *ldb_request_get_control(struct ldb_request *req, const char
   records that match an LDAP-like search expression
 
   \param ldb the context associated with the database (from ldb_init())
+  \param mem_ctx the memory context to use for the request and the results
+  \param result the return result
   \param base the Base Distinguished Name for the query (use ldb_dn_new() for an empty one)
   \param scope the search scope for the query
-  \param expression the search expression to use for this query
   \param attrs the search attributes for the query (pass NULL if none required)
-  \param res the return result
+  \param exp_fmt the search expression to use for this query (printf like)
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 
   \note use talloc_free() to free the ldb_result returned
 */
-int ldb_search(struct ldb_context *ldb, 
-              struct ldb_dn *base,
-              enum ldb_scope scope,
-              const char *expression,
-              const char * const *attrs, struct ldb_result **res);
-
-/*
- * a useful search function where you can easily define the expression and
- * that takes a memory context where results are allocated
-*/
-
-int ldb_search_exp_fmt(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
-                      struct ldb_result **result, struct ldb_dn *base,
-                      enum ldb_scope scope, const char * const *attrs,
-                      const char *exp_fmt, ...) PRINTF_ATTRIBUTE(7,8);
+int ldb_search(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
+              struct ldb_result **result, struct ldb_dn *base,
+              enum ldb_scope scope, const char * const *attrs,
+              const char *exp_fmt, ...) PRINTF_ATTRIBUTE(7,8);
 
 /**
   Add a record to the database.
@@ -1110,13 +1176,12 @@ int ldb_delete(struct ldb_context *ldb, struct ldb_dn *dn);
 /**
   The default async extended operation callback function 
 
-  \param ldb the context associated with the database (from ldb_init())
-  \param context the callback context (struct ldb_result *)
+  \param req the request we are callback of
   \param ares a single reply from the async core
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 
-  \note this function expects the context to always be an struct ldb_result pointer
+  \note this function expects req->context to always be an struct ldb_result pointer
   AND a talloc context, this function will steal on the context each message
   from the ares reply passed on by the async core so that in the end all the
   messages will be in the context (ldb_result)  memory tree.
@@ -1124,7 +1189,9 @@ int ldb_delete(struct ldb_context *ldb, struct ldb_dn *dn);
   (the request need to be freed separately and the result doe not depend on the
   request that can be freed as sson as the search request is finished)
 */
-int ldb_extended_default_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares);
+
+int ldb_extended_default_callback(struct ldb_request *req, struct ldb_reply *ares);
+
 
 /**
   Helper function to build a extended request
@@ -1137,7 +1204,8 @@ int ldb_extended_default_callback(struct ldb_context *ldb, void *context, struct
   it needs to be NULL or a valid talloc pointer! talloc_get_type() will be used on it  
   \param controls an array of controls
   \param context the callback function context
-  \param callback the callback function to handle the async replies
+  \param the callback function to handle the async replies
+  \param the parent request if any
 
   \return result code (LDB_SUCCESS on success, or a failure code)
 */
@@ -1148,7 +1216,8 @@ int ldb_build_extended_req(struct ldb_request **ret_req,
                           void *data,/* NULL or a valid talloc pointer! talloc_get_type() will be used on it */
                           struct ldb_control **controls,
                           void *context,
-                          ldb_request_callback_t callback);
+                          ldb_request_callback_t callback,
+                          struct ldb_request *parent);
 
 /**
   call an extended operation
@@ -1169,6 +1238,11 @@ int ldb_extended(struct ldb_context *ldb,
                 void *data,/* NULL or a valid talloc pointer! talloc_get_type() will be used on it */
                 struct ldb_result **res);
 
+/**
+  Obtain current/next database sequence number
+*/
+int ldb_sequence_number(struct ldb_context *ldb, enum ldb_sequence_type type, uint64_t *seq_num);
+
 /**
   start a transaction
 */
@@ -1213,7 +1287,7 @@ void ldb_set_utf8_default(struct ldb_context *ldb);
    \note The default function is not yet UTF8 aware. Provide your own
          set of functions through ldb_set_utf8_fns()
 */
-char *ldb_casefold(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char *s);
+char *ldb_casefold(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char *s, size_t n);
 
 /**
    Check the attribute name is valid according to rfc2251
@@ -1376,14 +1450,82 @@ int ldb_base64_decode(char *s);
 
 /* The following definitions come from lib/ldb/common/ldb_dn.c  */
 
+/**
+  Get the linear form of a DN (without any extended components)
+  
+  \param dn The DN to linearize
+*/
+
+const char *ldb_dn_get_linearized(struct ldb_dn *dn);
+
+/**
+  Allocate a copy of the linear form of a DN (without any extended components) onto the supplied memory context 
+  
+  \param dn The DN to linearize
+  \param mem_ctx TALLOC context to return result on
+*/
+
+char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
+
+/**
+  Get the linear form of a DN (with any extended components)
+  
+  \param mem_ctx TALLOC context to return result on
+  \param dn The DN to linearize
+  \param mode Style of extended DN to return (0 is HEX representation of binary form, 1 is a string form)
+*/
+char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode);
+const struct ldb_val *ldb_dn_get_extended_component(struct ldb_dn *dn, const char *name);
+int ldb_dn_set_extended_component(struct ldb_dn *dn, const char *name, const struct ldb_val *val);
+
+void ldb_dn_remove_extended_components(struct ldb_dn *dn);
+bool ldb_dn_has_extended(struct ldb_dn *dn);
+
+int ldb_dn_extended_add_syntax(struct ldb_context *ldb, 
+                              unsigned flags,
+                              const struct ldb_dn_extended_syntax *syntax);
+
+/** 
+  Allocate a new DN from a string
+
+  \param mem_ctx TALLOC context to return resulting ldb_dn structure on
+  \param dn The new DN 
+
+  \note The DN will not be parsed at this time.  Use ldb_dn_validate to tell if the DN is syntacticly correct
+*/
+
 struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *dn);
+/** 
+  Allocate a new DN from a printf style format string and arguments
+
+  \param mem_ctx TALLOC context to return resulting ldb_dn structure on
+  \param new_fms The new DN as a format string (plus arguments)
+
+  \note The DN will not be parsed at this time.  Use ldb_dn_validate to tell if the DN is syntacticly correct
+*/
+
 struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *new_fmt, ...) PRINTF_ATTRIBUTE(3,4);
+/** 
+  Allocate a new DN from a struct ldb_val (useful to avoid buffer overrun)
+
+  \param mem_ctx TALLOC context to return resulting ldb_dn structure on
+  \param dn The new DN 
+
+  \note The DN will not be parsed at this time.  Use ldb_dn_validate to tell if the DN is syntacticly correct
+*/
+
+struct ldb_dn *ldb_dn_from_ldb_val(void *mem_ctx, struct ldb_context *ldb, const struct ldb_val *strdn);
+
+/**
+  Determine if this DN is syntactically valid 
+
+  \param dn The DN to validate
+*/
+
 bool ldb_dn_validate(struct ldb_dn *dn);
 
 char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value);
-const char *ldb_dn_get_linearized(struct ldb_dn *dn);
 const char *ldb_dn_get_casefold(struct ldb_dn *dn);
-char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
 char *ldb_dn_alloc_casefold(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
 
 int ldb_dn_compare_base(struct ldb_dn *base, struct ldb_dn *dn);
@@ -1502,6 +1644,8 @@ int ldb_msg_add_fmt(struct ldb_message *msg,
 */
 int ldb_msg_element_compare(struct ldb_message_element *el1, 
                            struct ldb_message_element *el2);
+int ldb_msg_element_compare_name(struct ldb_message_element *el1, 
+                                struct ldb_message_element *el2);
 
 /**
    Find elements in a message.
@@ -1599,8 +1743,8 @@ int ldb_set_debug(struct ldb_context *ldb,
   this allows the user to set custom utf8 function for error reporting
 */
 void ldb_set_utf8_fns(struct ldb_context *ldb,
-                       void *context,
-                       char *(*casefold)(void *, void *, const char *));
+                     void *context,
+                     char *(*casefold)(void *, void *, const char *, size_t n));
 
 /**
    this sets up debug to print messages on stderr
@@ -1615,14 +1759,16 @@ const char **ldb_attr_list_copy(TALLOC_CTX *mem_ctx, const char * const *attrs);
 const char **ldb_attr_list_copy_add(TALLOC_CTX *mem_ctx, const char * const *attrs, const char *new_attr);
 int ldb_attr_in_list(const char * const *attrs, const char *attr);
 
+int ldb_msg_rename_attr(struct ldb_message *msg, const char *attr, const char *replace);
+int ldb_msg_copy_attr(struct ldb_message *msg, const char *attr, const char *replace);
+void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr);
+void ldb_msg_remove_element(struct ldb_message *msg, struct ldb_message_element *el);
+
 
 void ldb_parse_tree_attr_replace(struct ldb_parse_tree *tree, 
                                 const char *attr, 
                                 const char *replace);
 
-int ldb_msg_rename_attr(struct ldb_message *msg, const char *attr, const char *replace);
-int ldb_msg_copy_attr(struct ldb_message *msg, const char *attr, const char *replace);
-void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr);
 
 /**
    Convert a time structure to a string