10 #ifndef PCMK__CRM_CLUSTER__H 11 # define PCMK__CRM_CLUSTER__H 15 # include <libxml/tree.h> 24 # include <corosync/cpg.h> 32 #define CRM_NODE_LOST "lost" 33 #define CRM_NODE_MEMBER "member" 89 struct cpg_name group;
91 cpg_handle_t cpg_handle;
124 xmlNode *
data, gboolean ordered);
143 # if SUPPORT_COROSYNC 150 const struct cpg_name *groupName,
151 const struct cpg_address *member_list,
size_t member_list_entries,
152 const struct cpg_address *left_list,
size_t left_list_entries,
153 const struct cpg_address *joined_list,
size_t joined_list_entries);
159 uint32_t *kind,
const char **from);
200 static inline const char *
214 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1) 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 crm_is_peer_active(const crm_node_t *node)
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)
Get the local node's name.
void(* destroy)(gpointer)
GHashTable * crm_remote_peer_cache
crm_node_t * crm_get_peer(unsigned int id, const char *uname)
Get a cluster node cache entry.
guint crm_active_peers(void)
enum crm_ais_msg_types type
char * get_node_name(uint32_t nodeid)
Get the node name corresponding to a cluster node ID.
void crm_cluster_disconnect(crm_cluster_t *cluster)
Disconnect from the cluster layer.
gboolean send_cluster_text(enum crm_ais_msg_class msg_class, const char *data, gboolean local, crm_node_t *node, enum crm_ais_msg_types dest)
char * pcmk_message_common_cs(cpg_handle_t handle, uint32_t nodeid, uint32_t pid, void *content, uint32_t *kind, const char **from)
Extract text data from a Corosync CPG message.
crm_node_t * crm_get_peer_full(unsigned int id, const char *uname, int flags)
Get a node cache entry (cluster or Pacemaker Remote)
gboolean crm_is_corosync_peer_active(const crm_node_t *node)
Check whether a Corosync cluster peer is active.
void cluster_disconnect_cpg(crm_cluster_t *cluster)
Disconnect from Corosync CPG.
enum crm_ais_msg_types text2msg_type(const char *text)
Get the message type equivalent of a string.
void crm_remote_peer_cache_remove(const char *node_name)
Wrappers for and extensions to libxml2.
unsigned long long crm_peer_seq
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)
Get a log-friendly string equivalent of a cluster type.
gboolean crm_cluster_connect(crm_cluster_t *cluster)
Connect to the cluster layer.
Deprecated Pacemaker cluster API.
gboolean is_corosync_cluster(void)
Check whether the local cluster is a Corosync cluster.
uint32_t get_local_nodeid(cpg_handle_t handle)
Get the local Corosync node ID (via CPG)
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)
Add a node's UUID as an XML attribute.
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)
Handle a CPG configuration change event.
gboolean send_cluster_message(crm_node_t *node, enum crm_ais_msg_types service, xmlNode *data, gboolean ordered)
Send an XML message via the cluster messaging layer.
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)
Get (and set if needed) a node's UUID.
gboolean cluster_connect_cpg(crm_cluster_t *cluster)
Connect to Corosync CPG.
enum cluster_type_e get_cluster_type(void)
Get (and validate) the local cluster type.
int crm_remote_peer_cache_size(void)