10 #ifndef CRM_COMMON_CLUSTER__H 11 # define CRM_COMMON_CLUSTER__H 19 # include <libxml/tree.h> 24 # include <corosync/cpg.h> 33 #define CRM_NODE_LOST "lost" 34 #define CRM_NODE_MEMBER "member" 84 struct cpg_name group;
86 cpg_handle_t cpg_handle;
121 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);
196 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 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
crm_node_t * crm_get_peer(unsigned int id, const char *uname)
guint crm_active_peers(void)
char * get_node_name(uint32_t nodeid)
void crm_cluster_disconnect(crm_cluster_t *cluster)
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)
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)
enum crm_ais_msg_types text2msg_type(const char *text)
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)
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)
enum crm_ais_msg_types type
enum cluster_type_e get_cluster_type(void)
int crm_remote_peer_cache_size(void)