|
corosync
3.1.6
|
#include <config.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/uio.h>#include <errno.h>#include <qb/qbdefs.h>#include <qb/qbipcc.h>#include <corosync/corotypes.h>#include <corosync/corodefs.h>#include <corosync/hdb.h>#include <corosync/votequorum.h>#include <corosync/ipc_votequorum.h>#include "util.h"
Go to the source code of this file.
Data Structures | |
| struct | votequorum_inst |
Functions | |
| DECLARE_HDB_DATABASE (votequorum_handle_t_db, votequorum_inst_free) | |
| cs_error_t | votequorum_initialize (votequorum_handle_t *handle, votequorum_callbacks_t *callbacks) |
| Create a new quorum connection. More... | |
| cs_error_t | votequorum_finalize (votequorum_handle_t handle) |
| Close the quorum handle. More... | |
| cs_error_t | votequorum_getinfo (votequorum_handle_t handle, unsigned int nodeid, struct votequorum_info *info) |
| Get quorum information. More... | |
| cs_error_t | votequorum_setexpected (votequorum_handle_t handle, unsigned int expected_votes) |
| set expected_votes More... | |
| cs_error_t | votequorum_setvotes (votequorum_handle_t handle, unsigned int nodeid, unsigned int votes) |
| set votes for a node More... | |
| cs_error_t | votequorum_trackstart (votequorum_handle_t handle, uint64_t context, unsigned int flags) |
| Track node and quorum changes. More... | |
| cs_error_t | votequorum_trackstop (votequorum_handle_t handle) |
| votequorum_trackstop More... | |
| cs_error_t | votequorum_context_get (votequorum_handle_t handle, void **context) |
| Save and retrieve private data/context. More... | |
| cs_error_t | votequorum_context_set (votequorum_handle_t handle, void *context) |
| votequorum_context_set More... | |
| cs_error_t | votequorum_fd_get (votequorum_handle_t handle, int *fd) |
| Get a file descriptor on which to poll. More... | |
| cs_error_t | votequorum_dispatch (votequorum_handle_t handle, cs_dispatch_flags_t dispatch_types) |
| Dispatch messages and configuration changes. More... | |
| cs_error_t | votequorum_qdevice_register (votequorum_handle_t handle, const char *name) |
| Register a quorum device. More... | |
| 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. More... | |
| 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. More... | |
| cs_error_t | votequorum_qdevice_update (votequorum_handle_t handle, const char *oldname, const char *newname) |
| Update registered name of a quorum device. More... | |
| cs_error_t | votequorum_qdevice_unregister (votequorum_handle_t handle, const char *name) |
| Unregister a quorum device. More... | |
| DECLARE_HDB_DATABASE | ( | votequorum_handle_t_db | , |
| votequorum_inst_free | |||
| ) |
| cs_error_t votequorum_context_get | ( | votequorum_handle_t | handle, |
| void ** | context | ||
| ) |
Save and retrieve private data/context.
| handle | |
| context |
Definition at line 370 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_context_set | ( | votequorum_handle_t | handle, |
| void * | context | ||
| ) |
votequorum_context_set
| handle | |
| context |
Definition at line 389 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_dispatch | ( | votequorum_handle_t | handle, |
| cs_dispatch_flags_t | dispatch_types | ||
| ) |
Dispatch messages and configuration changes.
| handle | |
| dispatch_types |
Definition at line 428 of file lib/votequorum.c.
References votequorum_inst::callbacks, CS_DISPATCH_ALL, CS_DISPATCH_BLOCKING, CS_DISPATCH_ONE, CS_DISPATCH_ONE_NONBLOCKING, CS_ERR_INVALID_PARAM, hdb_error_to_cs(), IPC_DISPATCH_SIZE, and ring_id.
| cs_error_t votequorum_fd_get | ( | votequorum_handle_t | handle, |
| int * | fd | ||
| ) |
Get a file descriptor on which to poll.
| handle | |
| fd |
Definition at line 409 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_finalize | ( | votequorum_handle_t | handle | ) |
Close the quorum handle.
| handle |
Definition at line 119 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_getinfo | ( | votequorum_handle_t | handle, |
| unsigned int | nodeid, | ||
| struct votequorum_info * | info | ||
| ) |
Get quorum information.
| handle | |
| nodeid | |
| info |
Definition at line 148 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_initialize | ( | votequorum_handle_t * | handle, |
| votequorum_callbacks_t * | callbacks | ||
| ) |
Create a new quorum connection.
| handle | |
| callbacks |
Definition at line 72 of file lib/votequorum.c.
References hdb_error_to_cs().
| 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.
| handle | |
| name | |
| allow |
Definition at line 669 of file lib/votequorum.c.
References CS_ERR_INVALID_PARAM, hdb_error_to_cs(), and VOTEQUORUM_QDEVICE_MAX_NAME_LEN.
| 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.
| handle | |
| name | |
| cast_vote | |
| ring_id |
Definition at line 619 of file lib/votequorum.c.
References CS_ERR_INVALID_PARAM, hdb_error_to_cs(), and VOTEQUORUM_QDEVICE_MAX_NAME_LEN.
| cs_error_t votequorum_qdevice_register | ( | votequorum_handle_t | handle, |
| const char * | name | ||
| ) |
Register a quorum device.
it will be DEAD until polled
| handle | |
| name |
Definition at line 572 of file lib/votequorum.c.
References CS_ERR_INVALID_PARAM, hdb_error_to_cs(), and VOTEQUORUM_QDEVICE_MAX_NAME_LEN.
| cs_error_t votequorum_qdevice_unregister | ( | votequorum_handle_t | handle, |
| const char * | name | ||
| ) |
Unregister a quorum device.
| handle | |
| name |
Definition at line 767 of file lib/votequorum.c.
References CS_ERR_INVALID_PARAM, hdb_error_to_cs(), and 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.
| handle | |
| oldname | |
| newname |
Definition at line 717 of file lib/votequorum.c.
References CS_ERR_INVALID_PARAM, hdb_error_to_cs(), newname, oldname, and VOTEQUORUM_QDEVICE_MAX_NAME_LEN.
| cs_error_t votequorum_setexpected | ( | votequorum_handle_t | handle, |
| unsigned int | expected_votes | ||
| ) |
set expected_votes
| handle | |
| expected_votes |
Definition at line 202 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_setvotes | ( | votequorum_handle_t | handle, |
| unsigned int | nodeid, | ||
| unsigned int | votes | ||
| ) |
set votes for a node
| handle | |
| nodeid | |
| votes |
Definition at line 244 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_trackstart | ( | votequorum_handle_t | handle, |
| uint64_t | context, | ||
| unsigned int | flags | ||
| ) |
Track node and quorum changes.
| handle | |
| context | |
| flags |
Definition at line 287 of file lib/votequorum.c.
References hdb_error_to_cs().
| cs_error_t votequorum_trackstop | ( | votequorum_handle_t | handle | ) |
votequorum_trackstop
| handle |
Definition at line 330 of file lib/votequorum.c.
References hdb_error_to_cs().