director.h revision 2670cd577aa57eb9f915a4f4220ae48c9b4fc5fb
#ifndef DIRECTOR_H
#define DIRECTOR_H
#include "network.h"
#include "director-settings.h"
struct director;
struct mail_host;
struct user;
struct director_host_change {
because by the time its sync comes, the director itself may have
already been removed. */
unsigned int port;
/* highest change sequence from this director */
unsigned int seq;
};
struct director {
const struct director_settings *set;
unsigned int self_port;
struct director_host *self_host;
/* temporary user -> host associations */
struct user_directory *users;
/* these requests are waiting for directors to be in synced */
struct timeout *to_request;
/* director hosts are sorted by IP (and port) */
/* this array contains host changes done by directors.
while it's non-empty, new user mappings can't be added, because
different directors may see different hosts. SYNC events remove
these changes. */
unsigned int sync_seq;
/* director ring handshaking is complete.
director can start serving clients. */
unsigned int ring_handshaked:1;
unsigned int ring_handshake_warning_sent:1;
};
/* Create a new director. If listen_ip specifies an actual IP, it's used with
listen_port for finding ourself from the director_servers setting.
listen_port is used regardless by director_host_add_from_string() for hosts
without specified port. */
struct director *
/* Start connecting to other directors */
/* Send data to all directors using both left and right connections
(unless they're the same). */
const char *data);
#endif