18 #ifndef CRM_COMMON_CLUSTER__H
19 # define CRM_COMMON_CLUSTER__H
24 # if SUPPORT_HEARTBEAT
25 # include <heartbeat/hb_api.h>
26 # include <ocf/oc_event.h>
30 # include <corosync/cpg.h>
39 # define CRM_SERVICE PCMK_SERVICE_ID
43 #define CRM_NODE_LOST "lost"
44 #define CRM_NODE_MEMBER "member"
45 #define CRM_NODE_ACTIVE CRM_NODE_MEMBER
46 #define CRM_NODE_EVICTED "evicted"
101 # if SUPPORT_HEARTBEAT
102 ll_cluster_t *hb_conn;
103 void (*hb_dispatch) (HA_Message * msg,
void *
private);
106 # if SUPPORT_COROSYNC
107 struct cpg_name group;
109 cpg_handle_t cpg_handle;
150 xmlNode *
data, gboolean ordered);
173 # if SUPPORT_HEARTBEAT
174 gboolean crm_is_heartbeat_peer_active(
const crm_node_t * node);
177 # if SUPPORT_COROSYNC
185 const struct cpg_name *groupName,
186 const struct cpg_address *member_list,
size_t member_list_entries,
187 const struct cpg_address *left_list,
size_t left_list_entries,
188 const struct cpg_address *joined_list,
size_t joined_list_entries);
233 # if SUPPORT_COROSYNC
238 static inline const char *
void crm_peer_destroy(void)
struct crm_peer_node_s crm_node_t
void crm_set_status_callback(void(*dispatch)(enum crm_status_type, crm_node_t *, const void *))
Set a client function that will be called after peer status changes.
gboolean is_openais_cluster(void)
gboolean is_heartbeat_cluster(void)
gboolean crm_is_peer_active(const crm_node_t *node)
int crm_terminate_member(int nodeid, const char *uname, void *unused)
struct crm_cluster_s crm_cluster_t
void crm_set_autoreap(gboolean autoreap)
Tell the library whether to automatically reap lost nodes.
const char * get_local_node_name(void)
void(* destroy)(gpointer)
GHashTable * crm_remote_peer_cache
void crm_remote_peer_cache_add(const char *node_name)
Add a node to the remote peer cache.
crm_node_t * crm_get_peer(unsigned int id, const char *uname)
guint crm_active_peers(void)
enum crm_ais_msg_types text2msg_type(const char *text)
char * get_node_name(uint32_t nodeid)
void crm_cluster_disconnect(crm_cluster_t *cluster)
char * pcmk_message_common_cs(cpg_handle_t handle, uint32_t nodeid, uint32_t pid, void *content, uint32_t *kind, const char **from)
crm_node_t * crm_get_peer_full(unsigned int id, const char *uname, int flags)
gboolean crm_is_corosync_peer_active(const crm_node_t *node)
void cluster_disconnect_cpg(crm_cluster_t *cluster)
void crm_remote_peer_cache_remove(const char *node_name)
Wrappers for and extensions to libxml2.
gboolean send_cluster_text(int class, const char *data, gboolean local, crm_node_t *node, enum crm_ais_msg_types dest)
unsigned long long crm_peer_seq
gboolean is_cman_cluster(void)
guint reap_crm_member(uint32_t id, const char *name)
Remove all peer cache entries matching a node ID and/or uname.
const char * name_for_cluster_type(enum cluster_type_e type)
gboolean crm_cluster_connect(crm_cluster_t *cluster)
gboolean is_corosync_cluster(void)
uint32_t get_local_nodeid(cpg_handle_t handle)
crm_node_t * crm_remote_peer_get(const char *node_name)
Get a remote node peer cache entry, creating it if necessary.
const char * crm_peer_uname(const char *uuid)
Get the node name corresponding to a node UUID.
void set_uuid(xmlNode *xml, const char *attr, crm_node_t *node)
int crm_terminate_member_no_mainloop(int nodeid, const char *uname, int *connection)
void pcmk_cpg_membership(cpg_handle_t handle, const struct cpg_name *groupName, const struct cpg_address *member_list, size_t member_list_entries, const struct cpg_address *left_list, size_t left_list_entries, const struct cpg_address *joined_list, size_t joined_list_entries)
gboolean send_cluster_message(crm_node_t *node, enum crm_ais_msg_types service, xmlNode *data, gboolean ordered)
void crm_remote_peer_cache_refresh(xmlNode *cib)
Repopulate the remote peer cache based on CIB XML.
GHashTable * crm_peer_cache
const char * crm_peer_uuid(crm_node_t *node)
gboolean cluster_connect_cpg(crm_cluster_t *cluster)
gboolean is_classic_ais_cluster(void)
enum crm_ais_msg_types type
enum cluster_type_e get_cluster_type(void)
int crm_remote_peer_cache_size(void)