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
60#define VOTEQUORUM_INFO_QDEVICE_HAS_EXTRA_INFO 1024
62#define VOTEQUORUM_QDEVICE_NODEID 0
63#define VOTEQUORUM_QDEVICE_MAX_NAME_LEN 255
64#define VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT 10000
65#define VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT 30000
67#define VOTEQUORUM_NODESTATE_MEMBER 1
68#define VOTEQUORUM_NODESTATE_DEAD 2
69#define VOTEQUORUM_NODESTATE_LEAVING 3
71#define VOTEQUORUM_QDEVICE_EXTRA_NODEINFO_MAXSIZE 4096
338 unsigned int cast_vote,
unsigned int nodeid
the ID of the node whose info needs updating
cs_dispatch_flags_t
The cs_dispatch_flags_t enum.
cs_error_t
The cs_error_t enum.
char oldname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
char newname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
uint32_t ei_size
length of the extra info
cs_error_t votequorum_qdevice_register(votequorum_handle_t handle, const char *name)
Register a quorum device.
cs_error_t votequorum_setvotes(votequorum_handle_t handle, unsigned int nodeid, unsigned int votes)
set votes for a node
void(* votequorum_nodelist_notification_fn_t)(votequorum_handle_t handle, uint64_t context, votequorum_ring_id_t ring_id, uint32_t node_list_entries, uint32_t node_list[])
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.
uint64_t votequorum_handle_t
votequorum_handle_t
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.
void(* votequorum_quorum_notification_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t quorate, uint32_t node_list_entries, votequorum_node_t node_list[])
The votequorum_quorum_notification_fn_t callback.
cs_error_t votequorum_context_get(votequorum_handle_t handle, void **context)
Save and retrieve private data/context.
cs_error_t votequorum_set_qdevice_extra_info(votequorum_handle_t handle, uint32_t ei_size, const void *extra_info)
set the current extra_info for this node, should only be used by the qdevice
cs_error_t votequorum_finalize(votequorum_handle_t handle)
Close the quorum handle.
cs_error_t votequorum_trackstop(votequorum_handle_t handle)
votequorum_trackstop
cs_error_t votequorum_qdevice_unregister(votequorum_handle_t handle, const char *name)
Unregister a quorum device.
cs_error_t votequorum_fd_get(votequorum_handle_t handle, int *fd)
Get a file descriptor on which to poll.
cs_error_t votequorum_model_initialize(votequorum_handle_t *handle, const votequorum_model_v1_data_t *model)
Create a new quorum connection.
cs_error_t votequorum_get_qdevice_extra_info(votequorum_handle_t handle, unsigned int nodeid, uint32_t *ei_size, void *extra_info)
request the current extra_info for a node
cs_error_t votequorum_context_set(votequorum_handle_t handle, void *context)
votequorum_context_set
#define VOTEQUORUM_QDEVICE_MAX_NAME_LEN
cs_error_t votequorum_trackstart(votequorum_handle_t handle, uint64_t context, unsigned int flags)
Track node and quorum changes.
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_dispatch(votequorum_handle_t handle, cs_dispatch_flags_t dispatch_types)
Dispatch messages and configuration changes.
void(* votequorum_expectedvotes_notification_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t expected_votes)
The votequorum_expectedvotes_notification_fn_t callback.
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
void(* votequorum_qdevice_extra_info_fn_t)(votequorum_handle_t handle, uint64_t context, uint32_t nodeid, uint32_t ei_size, void *extra_info)
Callback to be notified of changes to a node's extra info.
cs_error_t votequorum_initialize(votequorum_handle_t *handle, votequorum_callbacks_t *callbacks)
Create a new quorum connection.
The votequorum_callbacks_t struct.
votequorum_nodelist_notification_fn_t votequorum_nodelist_notify_fn
votequorum_expectedvotes_notification_fn_t votequorum_expectedvotes_notify_fn
votequorum_quorum_notification_fn_t votequorum_quorum_notify_fn
The votequorum_info struct.
unsigned int qdevice_votes
unsigned int highest_expected
char qdevice_name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
unsigned int node_expected_votes
votequorum_nodelist_notification_fn_t votequorum_nodelist_notify_fn
votequorum_qdevice_extra_info_fn_t votequorum_qdevice_extra_info_fn
votequorum_expectedvotes_notification_fn_t votequorum_expectedvotes_notify_fn
votequorum_quorum_notification_fn_t votequorum_quorum_notify_fn
The votequorum_node_t struct.
The votequorum_ring_id_t struct.
struct memb_ring_id ring_id