dsync-brain-private.h revision 69a71891361b2b27ff68ed84b29278486628464a
#ifndef DSYNC_BRAIN_PRIVATE_H
#define DSYNC_BRAIN_PRIVATE_H
#include "hash.h"
#include "dsync-brain.h"
#include "dsync-mailbox.h"
#include "dsync-mailbox-state.h"
#define DSYNC_LOCK_FILENAME ".dovecot-sync.lock"
struct dsync_mailbox_tree_sync_change;
enum dsync_state {
/* if sync_type=STATE, the master brain knows the saved "last common
mailbox state". this state is sent to the slave. */
/* both sides send their mailbox trees */
/* master decides in which order mailboxes are synced (it knows the
slave's mailboxes by looking at the received mailbox tree) */
/* once mailbox is selected, the mails inside it are synced.
after the mails are synced, another mailbox is synced. */
};
enum dsync_box_state {
};
struct dsync_brain {
const char *process_title_prefix;
const char *sync_box;
struct mailbox *virtual_all_box;
const char *const *exclude_mailboxes;
const char *sync_flag;
char alt_char;
unsigned int import_commit_msgs_interval;
unsigned int hdr_hash_version;
unsigned int lock_timeout;
int lock_fd;
const char *lock_path;
char hierarchy_sep;
struct dsync_mailbox_tree *local_mailbox_tree;
struct dsync_mailbox_tree *remote_mailbox_tree;
struct dsync_mailbox_tree_iter *local_tree_iter;
unsigned int proctitle_update_counter;
struct dsync_transaction_log_scan *log_scan;
struct dsync_mailbox_importer *box_importer;
struct dsync_mailbox_exporter *box_exporter;
/* list of mailbox states
for master brain: given to brain at init and
for slave brain: received from DSYNC_STATE_SLAVE_RECV_LAST_COMMON */
/* DSYNC_STATE_MASTER_SEND_LAST_COMMON: current send position */
struct hash_iterate_context *mailbox_states_iter;
/* state of the mailbox we're currently syncing, changed at
init and deinit */
struct dsync_mailbox_state mailbox_state;
/* new states for synced mailboxes */
const char *changes_during_sync;
enum mail_error mail_error;
const char *const *hashed_headers;
bool master_brain:1;
bool mail_requests:1;
bool backup_send:1;
bool backup_recv:1;
bool purge:1;
bool debug:1;
bool sync_visible_namespaces:1;
bool no_mail_sync:1;
bool no_backup_overwrite:1;
bool no_mail_prefetch:1;
bool no_mailbox_renames:1;
bool changes_during_remote_sync:1;
bool require_full_resync:1;
bool verbose_proctitle:1;
bool no_notify:1;
bool failed:1;
bool empty_hdr_workaround:1;
};
const struct dsync_mailbox_tree_sync_change *change,
enum mail_error *error_r);
enum mail_error *error_r);
const struct dsync_mailbox *local_box,
const struct dsync_mailbox *remote_box,
const char **reason_r);
const struct dsync_mailbox *box1,
const struct dsync_mailbox *box2);
const char *reason);
const struct dsync_mailbox *remote_dsync_box);
#endif