19 #ifndef CRM_CLUSTER_INTERNAL__H
20 # define CRM_CLUSTER_INTERNAL__H
24 # define AIS_IPC_NAME "ais-crm-ipc"
25 # define AIS_IPC_MESSAGE_SIZE 8192*128
26 # define CRM_MESSAGE_IPC_ACK 0
28 # ifndef INTERFACE_MAX
29 # define INTERFACE_MAX 2
112 crm_get_cluster_proc()
131 static inline const char *
134 const char *text =
"unknown";
178 text =
"corosync-cpg";
185 text2proc(
const char *proc)
189 if (proc && strcmp(proc,
"cib") == 0) {
191 }
else if (proc && strcmp(proc,
"crmd") == 0) {
198 static inline const char *
203 }
else if (host->
size > 0) {
210 # define ais_data_len(msg) (msg->is_compressed?msg->compressed_size:msg->size)
258 static inline const char *
259 ais_error2text(
int error)
261 const char *text =
"unknown";
263 # if SUPPORT_COROSYNC
269 text =
"Library error";
272 text =
"Version error";
275 text =
"Initialization error";
280 case CS_ERR_TRY_AGAIN:
283 case CS_ERR_INVALID_PARAM:
284 text =
"Invalid parameter";
286 case CS_ERR_NO_MEMORY:
289 case CS_ERR_BAD_HANDLE:
296 text =
"Access error";
298 case CS_ERR_NOT_EXIST:
299 text =
"Doesn't exist";
301 case CS_ERR_NAME_TOO_LONG:
302 text =
"Name too long";
307 case CS_ERR_NO_SPACE:
310 case CS_ERR_INTERRUPT:
313 case CS_ERR_NAME_NOT_FOUND:
314 text =
"Name not found";
316 case CS_ERR_NO_RESOURCES:
317 text =
"No resources";
319 case CS_ERR_NOT_SUPPORTED:
320 text =
"Not supported";
322 case CS_ERR_BAD_OPERATION:
323 text =
"Bad operation";
325 case CS_ERR_FAILED_OPERATION:
326 text =
"Failed operation";
328 case CS_ERR_MESSAGE_ERROR:
329 text =
"Message error";
331 case CS_ERR_QUEUE_FULL:
334 case CS_ERR_QUEUE_NOT_AVAILABLE:
335 text =
"Queue not available";
337 case CS_ERR_BAD_FLAGS:
343 case CS_ERR_NO_SECTIONS:
344 text =
"No sections";
351 static inline const char *
354 const char *text =
"unknown";
395 # if SUPPORT_HEARTBEAT
396 extern ll_cluster_t *heartbeat_cluster;
397 gboolean send_ha_message(ll_cluster_t * hb_conn, xmlNode * msg,
398 const char *node, gboolean force_ordered);
399 gboolean ha_msg_dispatch(ll_cluster_t * cluster_conn, gpointer user_data);
402 xmlNode *convert_ha_message(xmlNode * parent, HA_Message * msg,
const char *field);
403 gboolean ccm_have_quorum(oc_ed_t event);
404 const char *ccm_event_name(oc_ed_t event);
405 crm_node_t *crm_update_ccm_node(
const oc_ev_membership_t * oc,
int offset,
const char *state,
408 gboolean heartbeat_initialize_nodelist(
void *cluster, gboolean force_member, xmlNode * xml_parent);
411 # if SUPPORT_COROSYNC
416 char *classic_node_name(
uint32_t nodeid);
438 char *cman_node_name(
uint32_t nodeid);
453 const char *uuid,
const char *
uname,
454 const char *addr,
const char *state);
458 const char *state,
int membership);
465 void (*destroy) (gpointer));
468 void (*destroy) (gpointer));
bool send_plugin_text(int class, struct iovec *iov)
enum crm_ais_msg_types type
gboolean send_cpg_iov(struct iovec *iov)
void crm_reap_unseen_nodes(uint64_t ring_id)
char * corosync_node_name(uint64_tcmap_handle, uint32_t nodeid)
char * get_corosync_uuid(crm_node_t *peer)
void terminate_cs_connection(crm_cluster_t *cluster)
int get_corosync_id(int id, const char *uuid)
cs_ipc_header_response_t header __attribute__((aligned(8)))
enum crm_ais_msg_types text2msg_type(const char *text)
gboolean cluster_connect_quorum(gboolean(*dispatch)(unsigned long long, gboolean), void(*destroy)(gpointer))
crm_node_t * crm_update_peer(const char *source, unsigned int id, uint64_t born, uint64_t seen, int32_t votes, uint32_t children, const char *uuid, const char *uname, const char *addr, const char *state)
gboolean init_cs_connection(crm_cluster_t *cluster)
void plugin_handle_membership(AIS_Message *msg)
cs_ipc_header_response_t header __attribute__((aligned(8)))
char * corosync_cluster_name(void)
crm_node_t * crm_update_peer_proc(const char *source, crm_node_t *peer, uint32_t flag, const char *status)
enum crm_proc_flag __attribute__
gboolean check_message_sanity(const AIS_Message *msg, const char *data)
enum crm_quorum_source get_quorum_source(void)
#define ais_data_len(msg)
int corosync_cmap_has_config(const char *prefix)
struct qb_ipc_response_header cs_ipc_header_response_t
enum cluster_type_e find_corosync_variant(void)
void crm_update_peer_expected(const char *source, crm_node_t *node, const char *expected)
gboolean init_cs_connection_once(crm_cluster_t *cluster)
crm_node_t * crm_update_peer_state(const char *source, crm_node_t *node, const char *state, int membership)
Update a node's state and membership information.
char * get_ais_data(const AIS_Message *msg)
gboolean node_name_is_valid(const char *key, const char *name)
crm_node_t * crm_find_peer_full(unsigned int id, const char *uname, int flags)
gboolean send_cluster_message_cs(xmlNode *msg, gboolean local, crm_node_t *node, enum crm_ais_msg_types dest)
void set_node_uuid(const char *uname, const char *uuid)
cs_ipc_header_response_t header __attribute__((aligned(8)))
void crm_update_peer_uname(crm_node_t *node, const char *uname)
gboolean init_cman_connection(gboolean(*dispatch)(unsigned long long, gboolean), void(*destroy)(gpointer))
crm_node_t * crm_find_peer(unsigned int id, const char *uname)
gboolean corosync_initialize_nodelist(void *cluster, gboolean force_member, xmlNode *xml_parent)
enum crm_ais_msg_types type
enum cluster_type_e get_cluster_type(void)