3 #include "system/filesys.h"
4 #include "lib/tdb/include/tdb.h"
9 /* this private structure is used by the ltdb backend in the
13 unsigned int connect_flags;
15 /* a double is used for portability and ease of string
16 handling. It has plenty of digits of precision */
17 double sequence_number;
20 struct ldb_message *baseinfo;
21 struct ldb_message *indexlist;
22 struct ldb_message *attributes;
23 struct ldb_message *subclasses;
31 /* error if an internal ldb+tdb error */
32 const char *last_err_string;
35 /* special record types */
36 #define LTDB_INDEX "@INDEX"
37 #define LTDB_INDEXLIST "@INDEXLIST"
38 #define LTDB_IDX "@IDX"
39 #define LTDB_IDXATTR "@IDXATTR"
40 #define LTDB_BASEINFO "@BASEINFO"
41 #define LTDB_ATTRIBUTES "@ATTRIBUTES"
42 #define LTDB_SUBCLASSES "@SUBCLASSES"
44 /* special attribute types */
45 #define LTDB_SEQUENCE_NUMBER "sequenceNumber"
46 #define LTDB_OBJECTCLASS "objectClass"
48 /* The following definitions come from lib/ldb/ldb_tdb/ldb_cache.c */
50 int ltdb_cache_reload(struct ldb_module *module);
51 int ltdb_cache_load(struct ldb_module *module);
52 int ltdb_increase_sequence_number(struct ldb_module *module);
53 int ltdb_check_at_attributes_values(const struct ldb_val *value);
55 /* The following definitions come from lib/ldb/ldb_tdb/ldb_index.c */
57 struct ldb_parse_tree;
59 int ltdb_search_indexed(struct ldb_module *module,
62 struct ldb_parse_tree *tree,
63 const char * const attrs[], struct ldb_message ***res);
64 int ltdb_index_add(struct ldb_module *module, const struct ldb_message *msg);
65 int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg);
66 int ltdb_reindex(struct ldb_module *module);
68 /* The following definitions come from lib/ldb/ldb_tdb/ldb_pack.c */
70 int ltdb_pack_data(struct ldb_module *module,
71 const struct ldb_message *message,
72 struct TDB_DATA *data);
73 void ltdb_unpack_data_free(struct ldb_module *module,
74 struct ldb_message *message);
75 int ltdb_unpack_data(struct ldb_module *module,
76 const struct TDB_DATA *data,
77 struct ldb_message *message);
79 /* The following definitions come from lib/ldb/ldb_tdb/ldb_search.c */
81 int ltdb_has_wildcard(struct ldb_module *module, const char *attr_name,
82 const struct ldb_val *val);
83 void ltdb_search_dn1_free(struct ldb_module *module, struct ldb_message *msg);
84 int ltdb_search_dn1(struct ldb_module *module, const char *dn, struct ldb_message *msg);
85 int ltdb_add_attr_results(struct ldb_module *module, struct ldb_message *msg,
86 const char * const attrs[],
88 struct ldb_message ***res);
89 int ltdb_search(struct ldb_module *module, const char *base,
90 enum ldb_scope scope, const char *expression,
91 const char * const attrs[], struct ldb_message ***res);
92 int ltdb_search_bytree(struct ldb_module *module, const char *base,
93 enum ldb_scope scope, struct ldb_parse_tree *tree,
94 const char * const attrs[], struct ldb_message ***res);
97 /* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c */
98 struct TDB_DATA ltdb_key(struct ldb_module *module, const char *dn);
99 int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
100 int ltdb_delete_noindex(struct ldb_module *module, const char *dn);
101 int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *msg);
102 int ltdb_lock_read(struct ldb_module *module);
103 int ltdb_unlock_read(struct ldb_module *module);
105 int ltdb_index_del_value(struct ldb_module *module, const char *dn,
106 struct ldb_message_element *el, int v_idx);
108 struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx,
109 const char *path, int hash_size, int tdb_flags,
110 int open_flags, mode_t mode);