46#include <sys/socket.h>
47#include <sys/select.h>
66 qb_ipcc_connection_t *
c;
76static void cfg_inst_free (
void *inst);
94 goto error_no_destroy;
106 goto error_put_destroy;
113 (void)hdb_handle_put (&cfg_hdb, *cfg_handle);
118 (void)hdb_handle_put (&cfg_hdb, *cfg_handle);
120 (void)hdb_handle_destroy (&cfg_hdb, *cfg_handle);
128 int32_t *selection_fd)
134 if (error !=
CS_OK) {
140 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
155 struct qb_ipc_response_header *dispatch_data;
160 if (error !=
CS_OK) {
172 dispatch_data = (
struct qb_ipc_response_header *)dispatch_buf;
197 if (error !=
CS_OK) {
211 switch (dispatch_data->id) {
242 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
247static void cfg_inst_free (
void *inst)
261 if (error !=
CS_OK) {
269 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
275 (void)hdb_handle_destroy (&cfg_hdb, cfg_handle);
277 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
285 char ***interface_names,
287 unsigned int *interface_count)
297 if (error !=
CS_OK) {
313 if (error !=
CS_OK) {
314 goto exit_handle_put;
318 *interface_names = malloc (
sizeof (
char *) * *interface_count);
319 if (*interface_names == NULL) {
322 memset (*interface_names, 0,
sizeof (
char *) * *interface_count);
324 *status = malloc (
sizeof (
char *) * *interface_count);
325 if (*status == NULL) {
327 goto error_free_interface_names_array;
329 memset (*status, 0,
sizeof (
char *) * *interface_count);
333 if ((*(interface_names))[i] == NULL) {
335 goto error_free_interface_names;
341 if ((*(status))[i] == NULL) {
343 goto error_free_status;
346 goto exit_handle_put;
349 for (j = 0; j < i; j++) {
350 free ((*(status))[j]);
352 i = *interface_count;
354error_free_interface_names:
355 for (j = 0; j < i; j++) {
356 free ((*(interface_names))[j]);
361error_free_interface_names_array:
362 free (*interface_names);
365 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
381 size_t cfg_node_status_size;
382 void *res_lib_cfg_nodestatuget_ptr;
402 if (error !=
CS_OK) {
417 res_lib_cfg_nodestatuget_ptr,
419 if (error !=
CS_OK) {
425 if (error !=
CS_OK) {
445 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
468 if (error !=
CS_OK) {
481 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
498 if (error !=
CS_OK) {
514 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
536 if (error !=
CS_OK) {
557 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
575 if (error !=
CS_OK) {
592 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
610 if (error !=
CS_OK) {
644 const char *addr_buf;
646 char zeroes[
sizeof(
struct sockaddr_storage)];
650 if (error !=
CS_OK) {
653 memset(zeroes, 0,
sizeof(zeroes));
668 if (error !=
CS_OK) {
673 addrlen =
sizeof(
struct sockaddr_in);
675 addrlen =
sizeof(
struct sockaddr_in6);
680 struct sockaddr_in *in;
681 struct sockaddr_in6 *in6;
686 in = (
struct sockaddr_in *)addrs[i].address;
687 if (memcmp(addr_buf, zeroes, addrlen) == 0) {
690 in->sin_family = AF_INET;
692 memcpy(&in->sin_addr, addr_buf,
sizeof(
struct in_addr));
695 in6 = (
struct sockaddr_in6 *)addrs[i].address;
697 if (memcmp(addr_buf, zeroes, addrlen) == 0) {
698 in6->sin6_family = 0;
700 in6->sin6_family = AF_INET6;
702 memcpy(&in6->sin6_addr, addr_buf,
sizeof(
struct in6_addr));
712 hdb_handle_put (&cfg_hdb, cfg_handle);
719 unsigned int *local_nodeid)
728 if (error !=
CS_OK) {
745 if (error !=
CS_OK) {
754 (void)hdb_handle_put (&cfg_hdb, handle);
769 if (error !=
CS_OK) {
786 if (error !=
CS_OK) {
793 (void)hdb_handle_put (&cfg_hdb, handle);
808 if (error !=
CS_OK) {
825 if (error !=
CS_OK) {
832 (void)hdb_handle_put (&cfg_hdb, handle);
corosync_cfg_node_status_version_t
corosync_cfg_shutdown_reply_flags_t
enum corosync_cfg_shutdown_reply_flags_t
uint64_t corosync_cfg_handle_t
corosync_cfg_shutdown_flags_t
Shutdown types.
cs_dispatch_flags_t
The cs_dispatch_flags_t enum.
@ CS_DISPATCH_ONE_NONBLOCKING
cs_error_t qb_to_cs_error(int result)
qb_to_cs_error
#define CS_MAX_NAME_LENGTH
cs_error_t
The cs_error_t enum.
#define CS_IPC_TIMEOUT_MS
@ MESSAGE_REQ_CFG_RELOAD_CONFIG
@ MESSAGE_REQ_CFG_RINGSTATUSGET
@ MESSAGE_REQ_CFG_TRACKSTART
@ MESSAGE_REQ_CFG_TRACKSTOP
@ MESSAGE_REQ_CFG_NODESTATUSGET
@ MESSAGE_REQ_CFG_REOPEN_LOG_FILES
@ MESSAGE_REQ_CFG_TRYSHUTDOWN
@ MESSAGE_REQ_CFG_REPLYTOSHUTDOWN
@ MESSAGE_REQ_CFG_KILLNODE
@ MESSAGE_REQ_CFG_GET_NODE_ADDRS
@ MESSAGE_REQ_CFG_LOCAL_GET
@ MESSAGE_RES_CFG_TESTSHUTDOWN
cs_error_t corosync_cfg_trackstart(corosync_cfg_handle_t cfg_handle, uint8_t track_flags)
corosync_cfg_trackstart Track CFG for shutdown requests
cs_error_t corosync_cfg_fd_get(corosync_cfg_handle_t cfg_handle, int32_t *selection_fd)
corosync_cfg_fd_get
cs_error_t corosync_cfg_finalize(corosync_cfg_handle_t cfg_handle)
corosync_cfg_finalize
cs_error_t corosync_cfg_ring_status_get(corosync_cfg_handle_t cfg_handle, char ***interface_names, char ***status, unsigned int *interface_count)
corosync_cfg_ring_status_get
cs_error_t corosync_cfg_kill_node(corosync_cfg_handle_t cfg_handle, unsigned int nodeid, const char *reason)
corosync_cfg_kill_node
cs_error_t corosync_cfg_replyto_shutdown(corosync_cfg_handle_t cfg_handle, corosync_cfg_shutdown_reply_flags_t response)
corosync_cfg_replyto_shutdown
cs_error_t corosync_cfg_dispatch(corosync_cfg_handle_t cfg_handle, cs_dispatch_flags_t dispatch_flags)
corosync_cfg_dispatch
cs_error_t corosync_cfg_trackstop(corosync_cfg_handle_t cfg_handle)
corosync_cfg_trackstop Stop tracking CFG for shutdown requests
cs_error_t corosync_cfg_initialize(corosync_cfg_handle_t *cfg_handle, const corosync_cfg_callbacks_t *cfg_callbacks)
corosync_cfg_initialize
cs_error_t corosync_cfg_reload_config(corosync_cfg_handle_t handle)
corosync_cfg_reload_config
cs_error_t corosync_cfg_get_node_addrs(corosync_cfg_handle_t cfg_handle, unsigned int nodeid, size_t max_addrs, int *num_addrs, corosync_cfg_node_address_t *addrs)
corosync_cfg_get_node_addrs
cs_error_t corosync_cfg_reopen_log_files(corosync_cfg_handle_t handle)
Reopen logging files.
cs_error_t corosync_cfg_local_get(corosync_cfg_handle_t handle, unsigned int *local_nodeid)
corosync_cfg_local_get
cs_error_t corosync_cfg_try_shutdown(corosync_cfg_handle_t cfg_handle, corosync_cfg_shutdown_flags_t flags)
corosync_cfg_try_shutdown
cs_error_t corosync_cfg_node_status_get(corosync_cfg_handle_t cfg_handle, unsigned int nodeid, corosync_cfg_node_status_version_t version, void *node_status)
corosync_cfg_node_status_get
DECLARE_HDB_DATABASE(cfg_hdb, cfg_inst_free)
cs_error_t hdb_error_to_cs(int res)
#define IPC_DISPATCH_SIZE
#define IPC_RESPONSE_SIZE
corosync_cfg_callbacks_t callbacks
struct corosync_cfg_shutdown_callback_t
corosync_cfg_shutdown_callback_t corosync_cfg_shutdown_callback
The req_lib_cfg_get_node_addrs struct.
The req_lib_cfg_killnode struct.
The req_lib_cfg_local_get struct.
The req_lib_cfg_nodestatusget struct.
The req_lib_cfg_reload_config struct.
The req_lib_cfg_reopen_log_files struct.
The req_lib_cfg_replytoshutdown struct.
The req_lib_cfg_ringstatusget struct.
struct qb_ipc_request_header header
struct qb_ipc_request_header header
The req_lib_cfg_tryshutdown struct.
The res_lib_cfg_get_node_addrs struct.
The res_lib_cfg_killnode struct.
The res_lib_cfg_local_get struct.
The res_lib_cfg_nodestatusget struct.
The res_lib_cfg_reload_config struct.
The res_lib_cfg_reopen_log_files struct.
The res_lib_cfg_replytoshutdown struct.
The res_lib_cfg_ringstatusget struct.
The res_lib_cfg_testshutdown struct.
struct qb_ipc_response_header header
struct qb_ipc_response_header header
The res_lib_cfg_tryshutdown struct.