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 /* well known attribute flags */
49 #define LTDB_FLAG_CASE_INSENSITIVE (1<<0)
50 #define LTDB_FLAG_INTEGER (1<<1)
51 #define LTDB_FLAG_WILDCARD (1<<2)
52 #define LTDB_FLAG_OBJECTCLASS (1<<3)
53 #define LTDB_FLAG_HIDDEN (1<<4)
55 /* The following definitions come from lib/ldb/ldb_tdb/ldb_cache.c */
57 int ltdb_cache_reload(struct ldb_module *module);
58 int ltdb_cache_load(struct ldb_module *module);
59 int ltdb_increase_sequence_number(struct ldb_module *module);
60 int ltdb_attribute_flags(struct ldb_module *module, const char *attr_name);
62 /* The following definitions come from lib/ldb/ldb_tdb/ldb_index.c */
64 struct ldb_parse_tree;
66 int ltdb_search_indexed(struct ldb_module *module,
69 struct ldb_parse_tree *tree,
70 const char * const attrs[], struct ldb_message ***res);
71 int ltdb_index_add(struct ldb_module *module, const struct ldb_message *msg);
72 int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg);
73 int ltdb_reindex(struct ldb_module *module);
75 /* The following definitions come from lib/ldb/ldb_tdb/ldb_pack.c */
77 int ltdb_pack_data(struct ldb_module *module,
78 const struct ldb_message *message,
79 struct TDB_DATA *data);
80 void ltdb_unpack_data_free(struct ldb_module *module,
81 struct ldb_message *message);
82 int ltdb_unpack_data(struct ldb_module *module,
83 const struct TDB_DATA *data,
84 struct ldb_message *message);
86 /* The following definitions come from lib/ldb/ldb_tdb/ldb_search.c */
88 int ltdb_has_wildcard(struct ldb_module *module, const char *attr_name,
89 const struct ldb_val *val);
90 void ltdb_search_dn1_free(struct ldb_module *module, struct ldb_message *msg);
91 int ltdb_search_dn1(struct ldb_module *module, const char *dn, struct ldb_message *msg);
92 int ltdb_search_dn(struct ldb_module *module, char *dn,
93 const char * const attrs[], struct ldb_message ***res);
94 int ltdb_add_attr_results(struct ldb_module *module, struct ldb_message *msg,
95 const char * const attrs[],
97 struct ldb_message ***res);
98 int ltdb_search(struct ldb_module *module, const char *base,
99 enum ldb_scope scope, const char *expression,
100 const char * const attrs[], struct ldb_message ***res);
102 /* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c */
103 struct TDB_DATA ltdb_key(struct ldb_module *module, const char *dn);
104 int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
105 int ltdb_delete_noindex(struct ldb_module *module, const char *dn);
106 int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *msg);
107 int ltdb_lock_read(struct ldb_module *module);
108 int ltdb_unlock_read(struct ldb_module *module);
110 /* The following definitions come from lib/ldb/ldb_tdb/ldb_match.c */
111 int ltdb_val_equal(struct ldb_module *module,
112 const char *attr_name,
113 const struct ldb_val *v1, const struct ldb_val *v2);
114 int ltdb_message_match(struct ldb_module *module,
115 struct ldb_message *msg,
116 struct ldb_parse_tree *tree,
118 enum ldb_scope scope);
120 int ltdb_index_del_value(struct ldb_module *module, const char *dn,
121 struct ldb_message_element *el, int v_idx);