36 #ifndef COROSYNC_VOTEQUORUM_H_DEFINED
37 #define COROSYNC_VOTEQUORUM_H_DEFINED
45 #define VOTEQUORUM_INFO_TWONODE 1
46 #define VOTEQUORUM_INFO_QUORATE 2
47 #define VOTEQUORUM_INFO_WAIT_FOR_ALL 4
48 #define VOTEQUORUM_INFO_LAST_MAN_STANDING 8
49 #define VOTEQUORUM_INFO_AUTO_TIE_BREAKER 16
50 #define VOTEQUORUM_INFO_ALLOW_DOWNSCALE 32
51 #define VOTEQUORUM_INFO_QDEVICE_REGISTERED 64
52 #define VOTEQUORUM_INFO_QDEVICE_ALIVE 128
53 #define VOTEQUORUM_INFO_QDEVICE_CAST_VOTE 256
54 #define VOTEQUORUM_INFO_QDEVICE_MASTER_WINS 512
56 #define VOTEQUORUM_QDEVICE_NODEID 0
57 #define VOTEQUORUM_QDEVICE_MAX_NAME_LEN 255
58 #define VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT 10000
59 #define VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT 30000
61 #define VOTEQUORUM_NODESTATE_MEMBER 1
62 #define VOTEQUORUM_NODESTATE_DEAD 2
63 #define VOTEQUORUM_NODESTATE_LEAVING 3
91 votequorum_handle_t handle,
95 uint32_t node_list_entries,
99 votequorum_handle_t handle,
113 votequorum_handle_t *handle,
120 votequorum_handle_t handle);
127 votequorum_handle_t handle,
137 votequorum_handle_t handle,
144 votequorum_handle_t handle,
152 votequorum_handle_t handle,
159 votequorum_handle_t handle,
167 votequorum_handle_t handle,
169 unsigned int flags );
172 votequorum_handle_t handle);
178 votequorum_handle_t handle,
182 votequorum_handle_t handle,
191 votequorum_handle_t handle,
198 votequorum_handle_t handle,
205 votequorum_handle_t handle,
213 votequorum_handle_t handle,
215 unsigned int cast_vote,
222 votequorum_handle_t handle,
char oldname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
cs_error_t votequorum_qdevice_update(votequorum_handle_t handle, const char *oldname, const char *newname)
Update registered name of a quorum device.
#define VOTEQUORUM_QDEVICE_MAX_NAME_LEN
uint64_t votequorum_handle_t
cs_error_t votequorum_getinfo(votequorum_handle_t handle, unsigned int nodeid, struct votequorum_info *info)
Get quorum information.
cs_error_t votequorum_setexpected(votequorum_handle_t handle, unsigned int expected_votes)
set expected_votes
unsigned int highest_expected
cs_error_t votequorum_trackstart(votequorum_handle_t handle, uint64_t context, unsigned int flags)
Track node and quorum changes.
cs_error_t votequorum_dispatch(votequorum_handle_t handle, cs_dispatch_flags_t dispatch_types)
Dispatch messages and configuration changes.
cs_error_t votequorum_setvotes(votequorum_handle_t handle, unsigned int nodeid, unsigned int votes)
set votes for a node
cs_error_t votequorum_qdevice_unregister(votequorum_handle_t handle, const char *name)
Unregister a quorum device.
cs_error_t votequorum_context_get(votequorum_handle_t handle, void **context)
Save and retrieve private data/context.
void(* votequorum_notification_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t quorate, votequorum_ring_id_t ring_id, uint32_t node_list_entries, votequorum_node_t node_list[])
cs_error_t votequorum_trackstop(votequorum_handle_t handle)
cs_error_t votequorum_finalize(votequorum_handle_t handle)
Close the quorum handle.
cs_error_t votequorum_initialize(votequorum_handle_t *handle, votequorum_callbacks_t *callbacks)
Create a new quorum connection.
cs_error_t votequorum_fd_get(votequorum_handle_t handle, int *fd)
Get a file descriptor on which to poll.
cs_error_t votequorum_context_set(votequorum_handle_t handle, void *context)
unsigned int qdevice_votes
votequorum_expectedvotes_notification_fn_t votequorum_expectedvotes_notify_fn
cs_error_t votequorum_qdevice_master_wins(votequorum_handle_t handle, const char *name, unsigned int allow)
Allow qdevice to tell votequorum if master_wins can be enabled or not.
votequorum_notification_fn_t votequorum_notify_fn
char qdevice_name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
cs_error_t votequorum_qdevice_register(votequorum_handle_t handle, const char *name)
Register a quorum device.
char newname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
unsigned int node_expected_votes
void(* votequorum_expectedvotes_notification_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t expected_votes)
struct memb_ring_id ring_id
cs_error_t votequorum_qdevice_poll(votequorum_handle_t handle, const char *name, unsigned int cast_vote, votequorum_ring_id_t ring_id)
Poll a quorum device.