/* See the DRL-LICENSE file for this file's software license. */ #ifndef _ZK_DRL_ #define _ZK_DRL_ #define _XOPEN_SOURCE 600 #include #include #include #include static const uint16_t UNSUREACK = 3; static const uint16_t NACK = 4; typedef struct zkdrlcontext { /** The host string that should be passed to zookeeper_init when using * zookeeper. This consists of comma-separated ipaddr:port pairs. Example: * "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" */ char *zk_host; pthread_rwlock_t *limiter_lock; comm_t *comm; uint32_t id; in_addr_t local_addr; zhandle_t *zkhandle; } zkdrlcontext_t; int zk_drl_init(comm_t *comm, uint32_t id, limiter_t *limiter, ident_config *config); int zk_drl_close(comm_t *comm); int zk_drl_recv(comm_t *comm, uint32_t id, int sock, remote_limiter_t *remote, message_t *msg); void zk_drl_restart(comm_t *comm, int32_t view_number); #endif /* _ZK_DRL_ */