36 #ifndef COROSYNC_VOTEQUORUM_H_DEFINED 37 #define COROSYNC_VOTEQUORUM_H_DEFINED 50 #define VOTEQUORUM_INFO_TWONODE 1 51 #define VOTEQUORUM_INFO_QUORATE 2 52 #define VOTEQUORUM_INFO_WAIT_FOR_ALL 4 53 #define VOTEQUORUM_INFO_LAST_MAN_STANDING 8 54 #define VOTEQUORUM_INFO_AUTO_TIE_BREAKER 16 55 #define VOTEQUORUM_INFO_ALLOW_DOWNSCALE 32 56 #define VOTEQUORUM_INFO_QDEVICE_REGISTERED 64 57 #define VOTEQUORUM_INFO_QDEVICE_ALIVE 128 58 #define VOTEQUORUM_INFO_QDEVICE_CAST_VOTE 256 59 #define VOTEQUORUM_INFO_QDEVICE_MASTER_WINS 512 61 #define VOTEQUORUM_QDEVICE_NODEID 0 62 #define VOTEQUORUM_QDEVICE_MAX_NAME_LEN 255 63 #define VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT 10000 64 #define VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT 30000 66 #define VOTEQUORUM_NODESTATE_MEMBER 1 67 #define VOTEQUORUM_NODESTATE_DEAD 2 68 #define VOTEQUORUM_NODESTATE_LEAVING 3 108 votequorum_handle_t handle,
112 uint32_t node_list_entries,
119 votequorum_handle_t handle,
138 votequorum_handle_t *handle,
147 votequorum_handle_t handle);
156 votequorum_handle_t handle,
169 votequorum_handle_t handle,
180 votequorum_handle_t handle,
191 votequorum_handle_t handle,
202 votequorum_handle_t handle,
214 votequorum_handle_t handle,
224 votequorum_handle_t handle);
233 votequorum_handle_t handle,
243 votequorum_handle_t handle,
256 votequorum_handle_t handle,
266 votequorum_handle_t handle,
277 votequorum_handle_t handle,
290 votequorum_handle_t handle,
292 unsigned int cast_vote,
303 votequorum_handle_t handle,
The votequorum_callbacks_t struct.
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
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
The votequorum_node_t struct.
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[])
The votequorum_notification_fn_t callback.
cs_error_t votequorum_trackstop(votequorum_handle_t handle)
votequorum_trackstop
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)
votequorum_context_set
cs_error_t
The cs_error_t enum.
cs_dispatch_flags_t
The cs_dispatch_flags_t enum.
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]
The votequorum_info struct.
unsigned int node_expected_votes
void(* votequorum_expectedvotes_notification_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t expected_votes)
The votequorum_expectedvotes_notification_fn_t callback.
The votequorum_ring_id_t struct.
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.