10 #ifndef CRM_CLUSTER_INTERNAL__H 11 # define CRM_CLUSTER_INTERNAL__H 15 #define pcmk__set_peer_flags(peer, flags_to_set) do { \ 16 (peer)->flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \ 17 "Peer", (peer)->uname, \ 18 (peer)->flags, (flags_to_set), \ 22 #define pcmk__clear_peer_flags(peer, flags_to_clear) do { \ 23 (peer)->flags = pcmk__clear_flags_as(__func__, __LINE__, \ 25 "Peer", (peer)->uname, \ 26 (peer)->flags, (flags_to_clear), \ 44 # include <qb/qbipc_common.h> 45 # include <corosync/corotypes.h> 46 typedef struct qb_ipc_response_header cs_ipc_header_response_t;
93 static inline uint32_t
94 crm_get_cluster_proc(
void)
106 static inline const char *
109 const char *text =
"unknown";
116 text =
"pacemaker-based";
119 text =
"pacemaker-controld";
122 text =
"pacemaker-schedulerd";
125 text =
"pacemaker-execd";
128 text =
"pacemaker-attrd";
131 text =
"pacemaker-fenced";
134 text =
"corosync-cpg";
140 static inline const char *
152 # define ais_data_len(msg) (msg->is_compressed?msg->compressed_size:msg->size) 188 static inline const char *
189 ais_error2text(
int error)
191 const char *text =
"unknown";
193 # if SUPPORT_COROSYNC 199 text =
"Library error";
202 text =
"Version error";
205 text =
"Initialization error";
210 case CS_ERR_TRY_AGAIN:
213 case CS_ERR_INVALID_PARAM:
214 text =
"Invalid parameter";
216 case CS_ERR_NO_MEMORY:
219 case CS_ERR_BAD_HANDLE:
226 text =
"Access error";
228 case CS_ERR_NOT_EXIST:
229 text =
"Doesn't exist";
231 case CS_ERR_NAME_TOO_LONG:
232 text =
"Name too long";
237 case CS_ERR_NO_SPACE:
240 case CS_ERR_INTERRUPT:
243 case CS_ERR_NAME_NOT_FOUND:
244 text =
"Name not found";
246 case CS_ERR_NO_RESOURCES:
247 text =
"No resources";
249 case CS_ERR_NOT_SUPPORTED:
250 text =
"Not supported";
252 case CS_ERR_BAD_OPERATION:
253 text =
"Bad operation";
255 case CS_ERR_FAILED_OPERATION:
256 text =
"Failed operation";
258 case CS_ERR_MESSAGE_ERROR:
259 text =
"Message error";
261 case CS_ERR_QUEUE_FULL:
264 case CS_ERR_QUEUE_NOT_AVAILABLE:
265 text =
"Queue not available";
267 case CS_ERR_BAD_FLAGS:
273 case CS_ERR_NO_SECTIONS:
274 text =
"No sections";
281 static inline const char *
284 const char *text =
"unknown";
323 # if SUPPORT_COROSYNC 345 uint32_t flag,
const char *status);
347 const char *state, uint64_t membership);
354 void (*destroy) (gpointer));
enum crm_ais_msg_types type
gboolean send_cpg_iov(struct iovec *iov)
void crm_reap_unseen_nodes(uint64_t ring_id)
void terminate_cs_connection(crm_cluster_t *cluster)
cs_ipc_header_response_t header __attribute__((aligned(8)))
crm_node_t * crm_update_peer_state(const char *source, crm_node_t *node, const char *state, uint64_t membership)
Update a node's state and membership information.
gboolean cluster_connect_quorum(gboolean(*dispatch)(unsigned long long, gboolean), void(*destroy)(gpointer))
gboolean init_cs_connection(crm_cluster_t *cluster)
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)
gboolean check_message_sanity(const AIS_Message *msg, const char *data)
char * corosync_node_name(uint64_t cmap_handle, uint32_t nodeid)
int corosync_cmap_has_config(const char *prefix)
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_find_known_peer_full(unsigned int id, const char *uname, int flags)
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)
char * get_corosync_uuid(crm_node_t *node)
void crm_update_peer_uname(crm_node_t *node, const char *uname)
void crm_peer_caches_refresh(xmlNode *cib)
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)