~ubuntu-branches/ubuntu/trusty/dovecot/trusty-updates

« back to all changes in this revision

Viewing changes to src/doveadm/dsync/dsync-ibc.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (1.15.3) (96.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140108093549-814nkqdcxfbvgktg
Tags: 1:2.2.9-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef DSYNC_IBC_H
 
2
#define DSYNC_IBC_H
 
3
 
 
4
/* dsync inter-brain communicator */
 
5
 
 
6
#include "ioloop.h"
 
7
#include "guid.h"
 
8
#include "dsync-brain.h"
 
9
 
 
10
struct dsync_mailbox;
 
11
struct dsync_mailbox_state;
 
12
struct dsync_mailbox_node;
 
13
struct dsync_mailbox_delete;
 
14
struct dsync_mailbox_attribute;
 
15
struct dsync_mail;
 
16
struct dsync_mail_change;
 
17
struct dsync_mail_request;
 
18
 
 
19
enum dsync_ibc_send_ret {
 
20
        DSYNC_IBC_SEND_RET_OK   = 1,
 
21
        /* send queue is full, stop sending more */
 
22
        DSYNC_IBC_SEND_RET_FULL = 0
 
23
};
 
24
 
 
25
enum dsync_ibc_recv_ret {
 
26
        DSYNC_IBC_RECV_RET_FINISHED     = -1,
 
27
        /* try again / error (the error handling delayed until io callback) */
 
28
        DSYNC_IBC_RECV_RET_TRYAGAIN     = 0,
 
29
        DSYNC_IBC_RECV_RET_OK           = 1
 
30
};
 
31
 
 
32
enum dsync_ibc_eol_type {
 
33
        DSYNC_IBC_EOL_MAILBOX_STATE,
 
34
        DSYNC_IBC_EOL_MAILBOX_TREE,
 
35
        DSYNC_IBC_EOL_MAILBOX_ATTRIBUTE,
 
36
        DSYNC_IBC_EOL_MAILBOX,
 
37
        DSYNC_IBC_EOL_MAIL_CHANGES,
 
38
        DSYNC_IBC_EOL_MAIL_REQUESTS,
 
39
        DSYNC_IBC_EOL_MAILS
 
40
};
 
41
 
 
42
struct dsync_ibc_settings {
 
43
        /* Server hostname. Used for determining which server does the
 
44
           locking. */
 
45
        const char *hostname;
 
46
        /* if non-NULL, sync only this namespace */
 
47
        const char *sync_ns_prefix;
 
48
        /* if non-NULL, sync only this mailbox name */
 
49
        const char *sync_box;
 
50
        /* if non-empty, sync only this mailbox GUID */
 
51
        guid_128_t sync_box_guid;
 
52
        /* Exclude these mailboxes from the sync. They can contain '*'
 
53
           wildcards and be \special-use flags. */
 
54
        const char *const *exclude_mailboxes;
 
55
 
 
56
        enum dsync_brain_sync_type sync_type;
 
57
        enum dsync_brain_flags brain_flags;
 
58
        unsigned int lock_timeout;
 
59
};
 
60
 
 
61
void dsync_ibc_init_pipe(struct dsync_ibc **ibc1_r,
 
62
                         struct dsync_ibc **ibc2_r);
 
63
struct dsync_ibc *
 
64
dsync_ibc_init_stream(struct istream *input, struct ostream *output,
 
65
                      const char *name, const char *temp_path_prefix);
 
66
void dsync_ibc_deinit(struct dsync_ibc **ibc);
 
67
 
 
68
/* I/O callback is called whenever new data is available. It's also called on
 
69
   errors, so check first the error status. */
 
70
void dsync_ibc_set_io_callback(struct dsync_ibc *ibc,
 
71
                               io_callback_t *callback, void *context);
 
72
 
 
73
void dsync_ibc_send_handshake(struct dsync_ibc *ibc,
 
74
                              const struct dsync_ibc_settings *set);
 
75
enum dsync_ibc_recv_ret
 
76
dsync_ibc_recv_handshake(struct dsync_ibc *ibc,
 
77
                         const struct dsync_ibc_settings **set_r);
 
78
 
 
79
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
80
dsync_ibc_send_end_of_list(struct dsync_ibc *ibc, enum dsync_ibc_eol_type type);
 
81
 
 
82
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
83
dsync_ibc_send_mailbox_state(struct dsync_ibc *ibc,
 
84
                             const struct dsync_mailbox_state *state);
 
85
enum dsync_ibc_recv_ret
 
86
dsync_ibc_recv_mailbox_state(struct dsync_ibc *ibc,
 
87
                             struct dsync_mailbox_state *state_r);
 
88
 
 
89
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
90
dsync_ibc_send_mailbox_tree_node(struct dsync_ibc *ibc,
 
91
                                 const char *const *name,
 
92
                                 const struct dsync_mailbox_node *node);
 
93
enum dsync_ibc_recv_ret
 
94
dsync_ibc_recv_mailbox_tree_node(struct dsync_ibc *ibc,
 
95
                                 const char *const **name_r,
 
96
                                 const struct dsync_mailbox_node **node_r);
 
97
 
 
98
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
99
dsync_ibc_send_mailbox_deletes(struct dsync_ibc *ibc,
 
100
                               const struct dsync_mailbox_delete *deletes,
 
101
                               unsigned int count, char hierarchy_sep);
 
102
enum dsync_ibc_recv_ret
 
103
dsync_ibc_recv_mailbox_deletes(struct dsync_ibc *ibc,
 
104
                               const struct dsync_mailbox_delete **deletes_r,
 
105
                               unsigned int *count_r, char *hierarchy_sep_r);
 
106
 
 
107
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
108
dsync_ibc_send_mailbox(struct dsync_ibc *ibc,
 
109
                       const struct dsync_mailbox *dsync_box);
 
110
enum dsync_ibc_recv_ret
 
111
dsync_ibc_recv_mailbox(struct dsync_ibc *ibc,
 
112
                       const struct dsync_mailbox **dsync_box_r);
 
113
 
 
114
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
115
dsync_ibc_send_mailbox_attribute(struct dsync_ibc *ibc,
 
116
                                 const struct dsync_mailbox_attribute *attr);
 
117
enum dsync_ibc_recv_ret
 
118
dsync_ibc_recv_mailbox_attribute(struct dsync_ibc *ibc,
 
119
                                 const struct dsync_mailbox_attribute **attr_r);
 
120
 
 
121
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
122
dsync_ibc_send_change(struct dsync_ibc *ibc,
 
123
                      const struct dsync_mail_change *change);
 
124
enum dsync_ibc_recv_ret
 
125
dsync_ibc_recv_change(struct dsync_ibc *ibc,
 
126
                      const struct dsync_mail_change **change_r);
 
127
 
 
128
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
129
dsync_ibc_send_mail_request(struct dsync_ibc *ibc,
 
130
                            const struct dsync_mail_request *request);
 
131
enum dsync_ibc_recv_ret
 
132
dsync_ibc_recv_mail_request(struct dsync_ibc *ibc,
 
133
                            const struct dsync_mail_request **request_r);
 
134
 
 
135
enum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
 
136
dsync_ibc_send_mail(struct dsync_ibc *ibc, const struct dsync_mail *mail);
 
137
enum dsync_ibc_recv_ret
 
138
dsync_ibc_recv_mail(struct dsync_ibc *ibc, struct dsync_mail **mail_r);
 
139
 
 
140
/* Close any mail input streams that are kept open. This needs to be called
 
141
   before the mail is attempted to be freed (usually on error conditions). */
 
142
void dsync_ibc_close_mail_streams(struct dsync_ibc *ibc);
 
143
 
 
144
bool dsync_ibc_has_failed(struct dsync_ibc *ibc);
 
145
bool dsync_ibc_has_timed_out(struct dsync_ibc *ibc);
 
146
bool dsync_ibc_is_send_queue_full(struct dsync_ibc *ibc);
 
147
bool dsync_ibc_has_pending_data(struct dsync_ibc *ibc);
 
148
 
 
149
#endif