57
47
struct tdb_wrap *next;
60
struct ldb_wrap_context {
62
struct tevent_context *ev;
67
52
struct ldb_wrap *next;
68
53
struct ldb_wrap *prev;
69
struct ldb_wrap_context context;
54
struct ldb_wrap_context {
56
struct tevent_context *ev;
70
59
struct ldb_context *ldb;
74
#define MAPISTORE_NAMESPACE_COMMON "://"
77
mapistore database context.
79
This structure stores parameters for mapistore database
80
initialization and backend initialization.
82
#define DFLT_MDB_FIRSTORG "First Organization"
83
#define DFLT_MDB_FIRSTOU "First Organization Unit"
84
#define TMPL_MDB_SERVERDN "CN=%s,%s"
85
#define TMPL_MDB_FIRSTORGDN "CN=%s,CN=%s,%s"
86
#define TMPL_MDB_USERSTORE "CN=%s,%s"
88
struct mapistoredb_conf {
102
struct mapistoredb_context {
103
struct loadparm_context *lp_ctx;
104
struct mapistoredb_conf *param;
105
struct mapistore_context *mstore_ctx;
108
#define MDB_INIT_LDIF_TMPL \
110
"checkBaseOnSearch: TRUE\n\n" \
113
"@IDXATTR: objectClass\n\n" \
114
"dn: @ATTRIBUTES@\n" \
115
"cn: CASE_INSENSITIVE\n" \
116
"dn: CASE_INSENSITIVE\n\n"
118
#define MDB_ROOTDSE_LDIF_TMPL \
120
"defaultNamingContext: CN=%s,%s,%s\n" \
121
"rootDomainNamingContext: %s\n" \
122
"vendorName: OpenChange Project (http://www.openchange.org)\n\n"
124
#define MDB_SERVER_LDIF_TMPL \
126
"objectClass: top\n" \
127
"objectClass: server\n" \
131
"objectClass: top\n" \
132
"objectClass: org\n" \
135
"dn: CN=%s,CN=%s,%s\n" \
136
"objectClass: top\n" \
137
"objectClass: ou\n" \
140
#define MDB_USER_STORE_LDIF_TMPL \
142
"objectClass: top\n" \
143
"objectClass: store\n" \
144
"objectClass: container\n" \
146
"GlobalCount: 0x1\n" \
150
#define MDB_MAILBOX_LDIF_TMPL \
151
"dn: CN=Folders,CN=%s,%s\n" \
152
"objectClass: top\n" \
153
"objectClass: container\n" \
158
"objectClass: mailbox\n" \
159
"objectClass: container\n" \
160
"MailboxGUID: %s\n" \
161
"ReplicaGUID: %s\n" \
164
"mapistore_uri: %s\n" \
165
"distinguishedName: %s\n"
167
/** Named properties database ldif */
168
#define MDB_NPROPS_INIT_LDIF_TMPL \
170
"checkBaseOnSearch: TRUE\n\n" \
173
"@IDXATTR: objectClass\n" \
174
"@IDXATTR: mapped_id\n\n" \
175
"dn: @ATTRIBUTES@\n" \
176
"cn: CASE_INSENSITIVE\n" \
177
"dn: CASE_INSENSITIVE\n\n"
179
#define MDB_NPROPS_ROOTDSE_LDIF_TMPL \
181
"defaultNamingContext: DC=server\n" \
182
"rootDomainNamingContext: DC=server\n" \
183
"vendorName: OpenChange Project (http://www.openchange.org)\n\n"
185
#define MDB_NPROPS_USER_LDIF \
186
"dn: CN=%s,CN=Users,CN=Server\n" \
187
"objectClass: user\n" \
188
"objectClass: container\n" \
189
"mapping_index: 0x%.4x\n" \
192
#define MDB_NPROPS_MAPPED_INDEX_CHANGE_LDIF \
193
"dn: CN=%s,CN=Server\n" \
194
"changetype: modify\n" \
195
"replace: mapping_index\n" \
196
"mapping_index: 0x%.4x\n\n"
198
enum MAPISTORE_NAMEDPROPS_TYPE {
199
MAPISTORE_NAMEDPROPS_INTERNAL = 0,
200
MAPISTORE_NAMEDPROPS_EXTERNAL = 1
204
63
Identifier mapping context.
287
130
#define MAPISTORE_DB_NAME_USED_ID "mapistore_id_mapping_used.tdb"
290
Mapistore opaque context to pass down to backends
292
Semantically, encapsulating the mstore_ctx within a container's
293
structure help abstracting mapistore logic from backend's
294
perspective and write a specific API dealing exclusively with this
133
MAPIStore management defines
297
struct mapistore_backend_context {
298
struct mapistore_context *mstore_ctx;
135
#define MAPISTORE_MQUEUE_IPC "/mapistore_ipc"
136
#define MAPISTORE_MQUEUE_NEWMAIL_FMT "/%s#newmail"
141
Properties used in mapistore but not referenced anymore in MS-OXCPROPS.pdf
143
#define PR_ATTACH_ID 0x3f880014
144
#define PR_MODIFIER_FLAGS 0x405a0003
145
#define PR_RECIPIENT_ON_NORMAL_MSG_COUNT 0x66af0003
303
147
/* definitions from mapistore_processing.c */
304
enum MAPISTORE_ERROR mapistore_init_mapping_context(struct processing_context *);
305
enum MAPISTORE_ERROR mapistore_get_context_id(struct processing_context *, uint32_t *);
306
enum MAPISTORE_ERROR mapistore_free_context_id(struct processing_context *, uint32_t);
308
enum MAPISTORE_ERROR mapistore_ldb_write_ldif_string_to_store(struct ldb_context *, const char *);
309
enum MAPISTORE_ERROR mapistore_write_ldif_string_to_store(struct processing_context *, const char *);
310
enum MAPISTORE_ERROR mapistore_ldb_write_ldif_file_to_store(struct ldb_context *, const char *);
311
enum MAPISTORE_ERROR mapistore_get_new_fmid(struct processing_context *, const char *, uint64_t *);
312
enum MAPISTORE_ERROR mapistore_get_new_allocation_range(struct processing_context *, const char *, uint64_t, uint64_t *, uint64_t *);
313
enum MAPISTORE_ERROR mapistore_get_mailbox_uri(struct processing_context *, const char *, char **);
148
const char *mapistore_get_mapping_path(void);
149
enum mapistore_error mapistore_init_mapping_context(struct processing_context *);
150
enum mapistore_error mapistore_get_context_id(struct processing_context *, uint32_t *);
151
enum mapistore_error mapistore_free_context_id(struct processing_context *, uint32_t);
315
154
/* definitions from mapistore_backend.c */
316
enum MAPISTORE_ERROR mapistore_backend_init(TALLOC_CTX *, const char *);
317
enum MAPISTORE_ERROR mapistore_backend_get_next_backend(const char **, const char **, const char **, uint32_t *);
318
enum MAPISTORE_ERROR mapistore_backend_get_namedprops_ldif(TALLOC_CTX *, const char *, char **, enum MAPISTORE_NAMEDPROPS_PROVISION_TYPE *);
319
struct backend_context *mapistore_backend_create_context(TALLOC_CTX *, const char *, const char *, const char *, const char *);
320
enum MAPISTORE_ERROR mapistore_backend_add_ref_count(struct backend_context *);
321
enum MAPISTORE_ERROR mapistore_backend_delete_context(struct backend_context *);
322
enum MAPISTORE_ERROR mapistore_backend_create_uri(TALLOC_CTX *, enum MAPISTORE_DFLT_FOLDERS, const char *, const char *, char **);
323
enum MAPISTORE_ERROR mapistore_backend_root_mkdir(struct backend_context *, enum MAPISTORE_DFLT_FOLDERS, const char *, const char *);
324
enum MAPISTORE_ERROR mapistore_backend_release_record(struct backend_context *, const char *, uint8_t);
325
enum MAPISTORE_ERROR mapistore_get_path(struct backend_context *, const char *, uint8_t, char **);
326
enum MAPISTORE_ERROR mapistore_backend_opendir(struct backend_context *, const char *, const char *);
327
enum MAPISTORE_ERROR mapistore_backend_closedir(struct backend_context *, const char *folder_uri);
328
enum MAPISTORE_ERROR mapistore_backend_mkdir(struct backend_context *, char *, const char *, const char *, enum FOLDER_TYPE, char **);
329
enum MAPISTORE_ERROR mapistore_backend_readdir_count(struct backend_context *, const char *, enum MAPISTORE_TABLE_TYPE, uint32_t *);
330
enum MAPISTORE_ERROR mapistore_backend_rmdir(struct backend_context *, const char *, const char *);
331
enum MAPISTORE_ERROR mapistore_backend_get_table_property(struct backend_context *, const char *,
332
enum MAPISTORE_TABLE_TYPE, uint32_t, enum MAPITAGS, void **);
333
enum MAPISTORE_ERROR mapistore_backend_openmessage(struct backend_context *, const char *, const char *, struct mapistore_message *);
334
enum MAPISTORE_ERROR mapistore_backend_createmessage(struct backend_context *, const char *, char **, bool *);
335
enum MAPISTORE_ERROR mapistore_backend_savechangesmessage(struct backend_context *, const char *, uint8_t);
336
enum MAPISTORE_ERROR mapistore_backend_submitmessage(struct backend_context *, const char *, uint8_t);
337
enum MAPISTORE_ERROR mapistore_backend_getprops(struct backend_context *, const char *, uint8_t,
338
struct SPropTagArray *, struct SRow *);
339
enum MAPISTORE_ERROR mapistore_backend_setprops(struct backend_context *, const char *, uint8_t, struct SRow *);
340
enum MAPISTORE_ERROR mapistore_backend_get_uri_by_name(struct backend_context *, const char *, const char *, char **);
341
enum MAPISTORE_ERROR mapistore_backend_deletemessage(struct backend_context *, const char *, enum MAPISTORE_DELETION_TYPE);
155
enum mapistore_error mapistore_backend_init(TALLOC_CTX *, const char *);
156
enum mapistore_error mapistore_backend_registered(const char *);
157
enum mapistore_error mapistore_backend_list_contexts(const char *, struct tdb_wrap *, TALLOC_CTX *, struct mapistore_contexts_list **);
158
enum mapistore_error mapistore_backend_create_context(TALLOC_CTX *, struct mapistore_connection_info *, struct tdb_wrap *, const char *, const char *, uint64_t, struct backend_context **);
159
enum mapistore_error mapistore_backend_create_root_folder(const char *, enum mapistore_context_role, uint64_t, const char *, TALLOC_CTX *, char **);
160
enum mapistore_error mapistore_backend_add_ref_count(struct backend_context *);
161
enum mapistore_error mapistore_backend_delete_context(struct backend_context *);
162
enum mapistore_error mapistore_backend_get_path(struct backend_context *, TALLOC_CTX *, uint64_t, char **);
164
enum mapistore_error mapistore_backend_folder_open_folder(struct backend_context *, void *, TALLOC_CTX *, uint64_t, void **);
165
enum mapistore_error mapistore_backend_folder_create_folder(struct backend_context *, void *, TALLOC_CTX *, uint64_t, struct SRow *, void **);
166
enum mapistore_error mapistore_backend_folder_delete(struct backend_context *, void *);
167
enum mapistore_error mapistore_backend_folder_open_message(struct backend_context *, void *, TALLOC_CTX *, uint64_t, bool, void **);
168
enum mapistore_error mapistore_backend_folder_create_message(struct backend_context *, void *, TALLOC_CTX *, uint64_t, uint8_t, void **);
169
enum mapistore_error mapistore_backend_folder_delete_message(struct backend_context *, void *, uint64_t, uint8_t);
170
enum mapistore_error mapistore_backend_folder_move_copy_messages(struct backend_context *, void *, void *, uint32_t, uint64_t *, uint64_t *, struct Binary_r **, uint8_t);
171
enum mapistore_error mapistore_backend_folder_get_deleted_fmids(struct backend_context *, void *, TALLOC_CTX *, enum mapistore_table_type, uint64_t, struct I8Array_r **, uint64_t *);
172
enum mapistore_error mapistore_backend_folder_get_child_count(struct backend_context *, void *, enum mapistore_table_type, uint32_t *);
173
enum mapistore_error mapistore_backend_folder_get_child_fid_by_name(struct backend_context *, void *, const char *, uint64_t *);
174
enum mapistore_error mapistore_backend_folder_open_table(struct backend_context *, void *, TALLOC_CTX *, enum mapistore_table_type, uint32_t, void **, uint32_t *);
175
enum mapistore_error mapistore_backend_folder_modify_permissions(struct backend_context *, void *, uint8_t, uint16_t, struct PermissionData *);
177
enum mapistore_error mapistore_backend_message_get_message_data(struct backend_context *, void *, TALLOC_CTX *, struct mapistore_message **);
178
enum mapistore_error mapistore_backend_message_modify_recipients(struct backend_context *, void *, struct SPropTagArray *, uint16_t, struct mapistore_message_recipient *);
179
enum mapistore_error mapistore_backend_message_set_read_flag(struct backend_context *, void *, uint8_t);
180
enum mapistore_error mapistore_backend_message_save(struct backend_context *, void *);
181
enum mapistore_error mapistore_backend_message_submit(struct backend_context *, void *, enum SubmitFlags);
182
enum mapistore_error mapistore_backend_message_get_attachment_table(struct backend_context *, void *, TALLOC_CTX *, void **, uint32_t *);
183
enum mapistore_error mapistore_backend_message_open_attachment(struct backend_context *, void *, TALLOC_CTX *, uint32_t, void **);
184
enum mapistore_error mapistore_backend_message_create_attachment(struct backend_context *, void *, TALLOC_CTX *, void **, uint32_t *);
185
enum mapistore_error mapistore_backend_message_attachment_open_embedded_message(struct backend_context *, void *, TALLOC_CTX *, void **, uint64_t *, struct mapistore_message **msg);
187
enum mapistore_error mapistore_backend_table_get_available_properties(struct backend_context *, void *, TALLOC_CTX *, struct SPropTagArray **);
188
enum mapistore_error mapistore_backend_table_set_columns(struct backend_context *, void *, uint16_t, enum MAPITAGS *);
189
enum mapistore_error mapistore_backend_table_set_restrictions(struct backend_context *, void *, struct mapi_SRestriction *, uint8_t *);
190
enum mapistore_error mapistore_backend_table_set_sort_order(struct backend_context *, void *, struct SSortOrderSet *, uint8_t *);
191
enum mapistore_error mapistore_backend_table_get_row(struct backend_context *, void *, TALLOC_CTX *, enum mapistore_query_type, uint32_t, struct mapistore_property_data **);
192
enum mapistore_error mapistore_backend_table_get_row_count(struct backend_context *, void *, enum mapistore_query_type, uint32_t *);
193
enum mapistore_error mapistore_backend_table_handle_destructor(struct backend_context *, void *, uint32_t);
195
enum mapistore_error mapistore_backend_properties_get_available_properties(struct backend_context *, void *, TALLOC_CTX *, struct SPropTagArray **);
196
enum mapistore_error mapistore_backend_properties_get_properties(struct backend_context *, void *, TALLOC_CTX *, uint16_t, enum MAPITAGS *, struct mapistore_property_data *);
197
enum mapistore_error mapistore_backend_properties_set_properties(struct backend_context *, void *, struct SRow *);
199
enum mapistore_error mapistore_backend_manager_generate_uri(struct backend_context *, TALLOC_CTX *, const char *, const char *, const char *, const char *, char **);
343
201
/* definitions from mapistore_tdb_wrap.c */
344
struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *, const char *, int, int, int, mode_t);
202
struct tdb_wrap *mapistore_tdb_wrap_open(TALLOC_CTX *, const char *, int, int, int, mode_t);
346
204
/* definitions from mapistore_ldb_wrap.c */
347
205
struct ldb_context *mapistore_ldb_wrap_connect(TALLOC_CTX *, struct tevent_context *, const char *, unsigned int);
349
207
/* definitions from mapistore_indexing.c */
350
enum MAPISTORE_ERROR mapistore_indexing_dump_object(struct mapistore_indexing_entry *);
351
enum MAPISTORE_ERROR mapistore_indexing_dump_reverse_entry(struct mapistore_indexing_entry_r *);
352
enum MAPISTORE_ERROR mapistore_indexing_record_search_uri(struct mapistore_indexing_context_list *, const char *);
353
enum MAPISTORE_ERROR mapistore_indexing_get_record_fmid_by_uri(struct mapistore_indexing_context_list *, const char *, uint64_t *);
354
enum MAPISTORE_ERROR mapistore_indexing_get_record_uri_by_fmid(struct mapistore_indexing_context_list *, uint64_t, char **);
357
208
struct indexing_context_list *mapistore_indexing_search(struct mapistore_context *, const char *);
358
enum MAPISTORE_ERROR mapistore_indexing_search_existing_fmid(struct indexing_context_list *, uint64_t, bool *);
359
enum MAPISTORE_ERROR mapistore_indexing_record_add_fmid(struct mapistore_context *, uint32_t, uint64_t, uint8_t);
360
enum MAPISTORE_ERROR mapistore_indexing_record_del_fmid(struct mapistore_context *, uint32_t, uint64_t, enum MAPISTORE_DELETION_TYPE);
361
enum MAPISTORE_ERROR mapistore_indexing_add_ref_count(struct indexing_context_list *);
362
enum MAPISTORE_ERROR mapistore_indexing_del_ref_count(struct indexing_context_list *);
366
enum MAPISTORE_ERROR mapistore_indexing_context_add_ref(struct mapistore_context *, const char *);
209
enum mapistore_error mapistore_indexing_add(struct mapistore_context *, const char *, struct indexing_context_list **);
210
enum mapistore_error mapistore_indexing_search_existing_fmid(struct indexing_context_list *, uint64_t, bool *);
211
enum mapistore_error mapistore_indexing_record_add(TALLOC_CTX *, struct indexing_context_list *, uint64_t, const char *);
212
enum mapistore_error mapistore_indexing_record_add_fmid(struct mapistore_context *, uint32_t, const char *, uint64_t);
213
enum mapistore_error mapistore_indexing_record_del_fmid(struct mapistore_context *, uint32_t, const char *, uint64_t, uint8_t);
214
// enum mapistore_error mapistore_indexing_add_ref_count(struct indexing_context_list *);
215
// enum mapistore_error mapistore_indexing_del_ref_count(struct indexing_context_list *);
369
217
/* definitions from mapistore_namedprops.c */
370
enum MAPISTORE_ERROR mapistore_namedprops_init(TALLOC_CTX *, struct ldb_context **);
218
enum mapistore_error mapistore_namedprops_init(TALLOC_CTX *, struct ldb_context **);