replicator-connection.h revision 447e086422f1ab7cc16833583ed70a4af7a84bc5
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose#ifndef REPLICATOR_CONNECTION_H
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose#define REPLICATOR_CONNECTION_H
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose#include "replication-common.h"
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosetypedef void replicator_sync_callback_t(bool success, void *context);
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosestruct replicator_connection *
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosereplicator_connection_create_unix(const char *path,
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose replicator_sync_callback_t *callback);
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosestruct replicator_connection *
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosereplicator_connection_create_inet(const struct ip_addr *ips,
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose unsigned int ips_count, unsigned int port,
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose replicator_sync_callback_t *callback);
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosevoid replicator_connection_destroy(struct replicator_connection **conn);
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosevoid replicator_connection_notify(struct replicator_connection *conn,
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose const char *username,
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose enum replication_priority priority);
45726939a48e605b0166521f94300ae04981a3a7Sumit Bosevoid replicator_connection_notify_sync(struct replicator_connection *conn,
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose const char *username, void *context);
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose
45726939a48e605b0166521f94300ae04981a3a7Sumit Boseextern struct replicator_connection *replicator;
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose#endif
45726939a48e605b0166521f94300ae04981a3a7Sumit Bose