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
60 #define VOTEQUORUM_NODESTATE_MEMBER 1
61 #define VOTEQUORUM_NODESTATE_DEAD 2
62 #define VOTEQUORUM_NODESTATE_LEAVING 3
85 votequorum_handle_t handle,
88 uint32_t node_list_entries,
92 votequorum_handle_t handle,
106 votequorum_handle_t *handle,
113 votequorum_handle_t handle);
120 votequorum_handle_t handle,
130 votequorum_handle_t handle,
137 votequorum_handle_t handle,
145 votequorum_handle_t handle,
152 votequorum_handle_t handle,
160 votequorum_handle_t handle,
162 unsigned int flags );
165 votequorum_handle_t handle);
171 votequorum_handle_t handle,
175 votequorum_handle_t handle,
184 votequorum_handle_t handle,
191 votequorum_handle_t handle,
198 votequorum_handle_t handle,
206 votequorum_handle_t handle,
208 unsigned int cast_vote);
214 votequorum_handle_t handle,
cs_error_t votequorum_trackstart(votequorum_handle_t handle, uint64_t context, unsigned int flags)
Track node and quorum changes.
char oldname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
cs_error_t votequorum_setvotes(votequorum_handle_t handle, unsigned int nodeid, unsigned int votes)
set votes for a node
cs_error_t votequorum_initialize(votequorum_handle_t *handle, votequorum_callbacks_t *callbacks)
Create a new quorum connection.
cs_error_t votequorum_context_set(votequorum_handle_t handle, void *context)
#define VOTEQUORUM_QDEVICE_MAX_NAME_LEN
uint64_t votequorum_handle_t
void(* votequorum_notification_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t quorate, uint32_t node_list_entries, votequorum_node_t node_list[])
unsigned int highest_expected
cs_error_t votequorum_dispatch(votequorum_handle_t handle, cs_dispatch_flags_t dispatch_types)
Dispatch messages and configuration changes.
cs_error_t votequorum_qdevice_poll(votequorum_handle_t handle, const char *name, unsigned int cast_vote)
Poll a quorum device.
cs_error_t votequorum_qdevice_update(votequorum_handle_t handle, const char *oldname, const char *newname)
Update registered name of a quorum device.
cs_error_t votequorum_finalize(votequorum_handle_t handle)
Close the quorum handle.
cs_error_t votequorum_setexpected(votequorum_handle_t handle, unsigned int expected_votes)
set expected_votes
cs_error_t votequorum_fd_get(votequorum_handle_t handle, int *fd)
Get a file descriptor on which to poll.
void(* votequorum_expectedvotes_notification_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t expected_votes)
cs_error_t votequorum_qdevice_register(votequorum_handle_t handle, const char *name)
Register a quorum device.
cs_error_t votequorum_context_get(votequorum_handle_t handle, void **context)
Save and retrieve private data/context.
unsigned int qdevice_votes
votequorum_expectedvotes_notification_fn_t votequorum_expectedvotes_notify_fn
votequorum_notification_fn_t votequorum_notify_fn
char qdevice_name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
char newname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
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.
cs_error_t votequorum_trackstop(votequorum_handle_t handle)
unsigned int node_expected_votes
cs_error_t votequorum_qdevice_unregister(votequorum_handle_t handle, const char *name)
Unregister a quorum device.
cs_error_t votequorum_getinfo(votequorum_handle_t handle, unsigned int nodeid, struct votequorum_info *info)
Get quorum information.