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;
32 /* special record types */
33 #define LTDB_INDEX "@INDEX"
34 #define LTDB_INDEXLIST "@INDEXLIST"
35 #define LTDB_IDX "@IDX"
36 #define LTDB_IDXATTR "@IDXATTR"
37 #define LTDB_BASEINFO "@BASEINFO"
38 #define LTDB_ATTRIBUTES "@ATTRIBUTES"
39 #define LTDB_SUBCLASSES "@SUBCLASSES"
41 /* special attribute types */
42 #define LTDB_SEQUENCE_NUMBER "sequenceNumber"
43 #define LTDB_OBJECTCLASS "objectClass"
45 /* The following definitions come from lib/ldb/ldb_tdb/ldb_cache.c */
47 int ltdb_cache_reload(struct ldb_module *module);
48 int ltdb_cache_load(struct ldb_module *module);
49 int ltdb_increase_sequence_number(struct ldb_module *module);
50 int ltdb_check_at_attributes_values(const struct ldb_val *value);
52 /* The following definitions come from lib/ldb/ldb_tdb/ldb_index.c */
54 struct ldb_parse_tree;
56 int ltdb_search_indexed(struct ldb_module *module,
57 const struct ldb_dn *base,
59 struct ldb_parse_tree *tree,
60 const char * const attrs[], struct ldb_result **res);
61 int ltdb_index_add(struct ldb_module *module, const struct ldb_message *msg);
62 int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg);
63 int ltdb_reindex(struct ldb_module *module);
65 /* The following definitions come from lib/ldb/ldb_tdb/ldb_pack.c */
67 int ltdb_pack_data(struct ldb_module *module,
68 const struct ldb_message *message,
69 struct TDB_DATA *data);
70 void ltdb_unpack_data_free(struct ldb_module *module,
71 struct ldb_message *message);
72 int ltdb_unpack_data(struct ldb_module *module,
73 const struct TDB_DATA *data,
74 struct ldb_message *message);
76 /* The following definitions come from lib/ldb/ldb_tdb/ldb_search.c */
78 int ltdb_has_wildcard(struct ldb_module *module, const char *attr_name,
79 const struct ldb_val *val);
80 void ltdb_search_dn1_free(struct ldb_module *module, struct ldb_message *msg);
81 int ltdb_search_dn1(struct ldb_module *module, const struct ldb_dn *dn, struct ldb_message *msg);
82 int ltdb_add_attr_results(struct ldb_module *module, struct ldb_message *msg,
83 const char * const attrs[],
85 struct ldb_message ***res);
86 int ltdb_search_bytree(struct ldb_module *module, const struct ldb_dn *base,
87 enum ldb_scope scope, struct ldb_parse_tree *tree,
88 const char * const attrs[], struct ldb_result **res);
91 /* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c */
92 struct TDB_DATA ltdb_key(struct ldb_module *module, const struct ldb_dn *dn);
93 int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
94 int ltdb_delete_noindex(struct ldb_module *module, const struct ldb_dn *dn);
95 int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *msg);
97 int ltdb_index_del_value(struct ldb_module *module, const char *dn,
98 struct ldb_message_element *el, int v_idx);
100 struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx,
101 const char *path, int hash_size, int tdb_flags,
102 int open_flags, mode_t mode);