a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen/* dsync inter-brain communicator */
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen /* send queue is full, stop sending more */
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen /* try again / error (the error handling delayed until io callback) */
0e03baa885b89cd42fb76fe0282f272f035638cdTimo Sirainen /* Server hostname. Used for determining which server does the
d487aa885845c33fb358d5b3b514eece6791db0eTimo Sirainen /* if non-NULL, sync only these namespaces (LF-separated) */
707f172cd4e4c91af86ff5bd82a60a873dec6f70Timo Sirainen /* if non-NULL, sync only this mailbox name */
70df8f39fb3db7c49b18c855178f8172176a037aTimo Sirainen /* if non-NULL, use this mailbox for finding messages with GUIDs and
70df8f39fb3db7c49b18c855178f8172176a037aTimo Sirainen copying them instead of saving them again. */
9f99b5c3e607c41c16a6380203d401250d9e2603Timo Sirainen /* if non-empty, sync only this mailbox GUID */
fd32c46c360e61de2c957c3d2241eaacab7b3eecTimo Sirainen /* Exclude these mailboxes from the sync. They can contain '*'
fd32c46c360e61de2c957c3d2241eaacab7b3eecTimo Sirainen wildcards and be \special-use flags. */
3561c7bb472a78af74d755219cc0fc71c85ff5c2Timo Sirainen /* Sync only mails with received timestamp at least this high. */
ee8294dbc7bb549557f6ba1264d66b55fbef69b6Aki Tuomi /* Sync only mails with received timestamp less or equal than this */
ae949831f1f668b5501b4b125e7f7b1767fb109bTimo Sirainen /* Don't sync mails larger than this. */
2e652d2651b2800f99a17dcb3014a009fe4660d3Timo Sirainen /* Sync only mails with specified flags. */
69a71891361b2b27ff68ed84b29278486628464aAki Tuomi /* Hashed headers */
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenvoid dsync_ibc_init_pipe(struct dsync_ibc **ibc1_r,
5332128f69ad688cc024897c2a92f6b37ef8d05cTimo Sirainendsync_ibc_init_stream(struct istream *input, struct ostream *output,
1ff34185c13dffaab10e7691844ad7aec7c716d2Timo Sirainen const char *name, const char *temp_path_prefix,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen/* I/O callback is called whenever new data is available. It's also called on
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen errors, so check first the error status. */
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenvoid dsync_ibc_set_io_callback(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenvoid dsync_ibc_send_handshake(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_handshake(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
b8e6e314eb2f9f1fc8ce2999034321bfeb7a2269Timo Sirainendsync_ibc_send_end_of_list(struct dsync_ibc *ibc, enum dsync_ibc_eol_type type);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mailbox_state(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mailbox_state(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mailbox_tree_node(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const char *const *name,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mailbox_tree_node(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const char *const **name_r,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mailbox_deletes(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mailbox_deletes(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox_delete **deletes_r,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen unsigned int *count_r, char *hierarchy_sep_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainendsync_ibc_send_mailbox_attribute(struct dsync_ibc *ibc,
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainendsync_ibc_recv_mailbox_attribute(struct dsync_ibc *ibc,
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen const struct dsync_mailbox_attribute **attr_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mail_request(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mail_request(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mail(struct dsync_ibc *ibc, const struct dsync_mail *mail);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mail(struct dsync_ibc *ibc, struct dsync_mail **mail_r);
ce0e25f26d6e67480ee39b5ca0ad634fa60c4605Timo Sirainenvoid dsync_ibc_send_finish(struct dsync_ibc *ibc, const char *error,
ce0e25f26d6e67480ee39b5ca0ad634fa60c4605Timo Sirainendsync_ibc_recv_finish(struct dsync_ibc *ibc, const char **error_r,
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainen/* Close any mail input streams that are kept open. This needs to be called
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainen before the mail is attempted to be freed (usually on error conditions). */
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainenvoid dsync_ibc_close_mail_streams(struct dsync_ibc *ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenbool dsync_ibc_has_failed(struct dsync_ibc *ibc);
ea245d7a9683e7bb9cd74fcdf1a26d049b2947ebTimo Sirainenbool dsync_ibc_has_timed_out(struct dsync_ibc *ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenbool dsync_ibc_is_send_queue_full(struct dsync_ibc *ibc);