19 #ifndef CRM_CLUSTER_INTERNAL__H
20 # define CRM_CLUSTER_INTERNAL__H
24 # define AIS_IPC_MESSAGE_SIZE (8192 * 128)
25 # define CRM_MESSAGE_IPC_ACK 0
27 # ifndef INTERFACE_MAX
28 # define INTERFACE_MAX 2
110 crm_get_cluster_proc()
129 static inline const char *
132 const char *text =
"unknown";
176 text =
"corosync-cpg";
183 text2proc(
const char *proc)
187 if (proc && strcmp(proc,
"cib") == 0) {
189 }
else if (proc && strcmp(proc,
"crmd") == 0) {
196 static inline const char *
201 }
else if (host->
size > 0) {
208 # define ais_data_len(msg) (msg->is_compressed?msg->compressed_size:msg->size)
256 static inline const char *
257 ais_error2text(
int error)
259 const char *text =
"unknown";
261 # if SUPPORT_COROSYNC
267 text =
"Library error";
270 text =
"Version error";
273 text =
"Initialization error";
278 case CS_ERR_TRY_AGAIN:
281 case CS_ERR_INVALID_PARAM:
282 text =
"Invalid parameter";
284 case CS_ERR_NO_MEMORY:
287 case CS_ERR_BAD_HANDLE:
294 text =
"Access error";
296 case CS_ERR_NOT_EXIST:
297 text =
"Doesn't exist";
299 case CS_ERR_NAME_TOO_LONG:
300 text =
"Name too long";
305 case CS_ERR_NO_SPACE:
308 case CS_ERR_INTERRUPT:
311 case CS_ERR_NAME_NOT_FOUND:
312 text =
"Name not found";
314 case CS_ERR_NO_RESOURCES:
315 text =
"No resources";
317 case CS_ERR_NOT_SUPPORTED:
318 text =
"Not supported";
320 case CS_ERR_BAD_OPERATION:
321 text =
"Bad operation";
323 case CS_ERR_FAILED_OPERATION:
324 text =
"Failed operation";
326 case CS_ERR_MESSAGE_ERROR:
327 text =
"Message error";
329 case CS_ERR_QUEUE_FULL:
332 case CS_ERR_QUEUE_NOT_AVAILABLE:
333 text =
"Queue not available";
335 case CS_ERR_BAD_FLAGS:
341 case CS_ERR_NO_SECTIONS:
342 text =
"No sections";
349 static inline const char *
352 const char *text =
"unknown";
393 # if SUPPORT_HEARTBEAT
394 extern ll_cluster_t *heartbeat_cluster;
395 gboolean send_ha_message(ll_cluster_t * hb_conn, xmlNode * msg,
396 const char *node, gboolean force_ordered);
397 gboolean ha_msg_dispatch(ll_cluster_t * cluster_conn, gpointer user_data);
400 xmlNode *convert_ha_message(xmlNode * parent, HA_Message * msg,
const char *field);
401 gboolean ccm_have_quorum(oc_ed_t event);
402 const char *ccm_event_name(oc_ed_t event);
403 crm_node_t *crm_update_ccm_node(
const oc_ev_membership_t * oc,
int offset,
const char *state,
406 gboolean heartbeat_initialize_nodelist(
void *cluster, gboolean force_member, xmlNode * xml_parent);
409 # if SUPPORT_COROSYNC
414 char *classic_node_name(
uint32_t nodeid);
436 char *cman_node_name(
uint32_t nodeid);
451 const char *uuid,
const char *
uname,
452 const char *addr,
const char *state);
456 const char *state,
int membership);
463 void (*destroy) (gpointer));
466 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)