10 #ifndef PCMK__CRM_CLUSTER_INTERNAL__H 11 #define PCMK__CRM_CLUSTER_INTERNAL__H 17 #include <libxml/tree.h> 23 #include <corosync/cpg.h> 105 struct cpg_name group;
107 cpg_handle_t cpg_handle;
108 #endif // SUPPORT_COROSYNC 176 static inline uint32_t
177 crm_get_cluster_proc(
void)
197 static inline const char *
198 pcmk__cs_err_str(
int error)
200 # if SUPPORT_COROSYNC 202 case CS_OK:
return "OK";
203 case CS_ERR_LIBRARY:
return "Library error";
204 case CS_ERR_VERSION:
return "Version error";
205 case CS_ERR_INIT:
return "Initialization error";
206 case CS_ERR_TIMEOUT:
return "Timeout";
207 case CS_ERR_TRY_AGAIN:
return "Try again";
208 case CS_ERR_INVALID_PARAM:
return "Invalid parameter";
209 case CS_ERR_NO_MEMORY:
return "No memory";
210 case CS_ERR_BAD_HANDLE:
return "Bad handle";
211 case CS_ERR_BUSY:
return "Busy";
212 case CS_ERR_ACCESS:
return "Access error";
213 case CS_ERR_NOT_EXIST:
return "Doesn't exist";
214 case CS_ERR_NAME_TOO_LONG:
return "Name too long";
215 case CS_ERR_EXIST:
return "Exists";
216 case CS_ERR_NO_SPACE:
return "No space";
217 case CS_ERR_INTERRUPT:
return "Interrupt";
218 case CS_ERR_NAME_NOT_FOUND:
return "Name not found";
219 case CS_ERR_NO_RESOURCES:
return "No resources";
220 case CS_ERR_NOT_SUPPORTED:
return "Not supported";
221 case CS_ERR_BAD_OPERATION:
return "Bad operation";
222 case CS_ERR_FAILED_OPERATION:
return "Failed operation";
223 case CS_ERR_MESSAGE_ERROR:
return "Message error";
224 case CS_ERR_QUEUE_FULL:
return "Queue full";
225 case CS_ERR_QUEUE_NOT_AVAILABLE:
return "Queue not available";
226 case CS_ERR_BAD_FLAGS:
return "Bad flags";
227 case CS_ERR_TOO_BIG:
return "Too big";
228 case CS_ERR_NO_SECTIONS:
return "No sections";
231 return "Corosync error";
234 # if SUPPORT_COROSYNC 241 #define pcmk__init_cmap(handle) cmap_initialize_map((handle), CMAP_MAP_ICMAP) 243 #define pcmk__init_cmap(handle) cmap_initialize(handle) 250 const struct cpg_name *group_name,
251 const struct cpg_address *member_list,
252 size_t member_list_entries,
253 const struct cpg_address *left_list,
254 size_t left_list_entries,
255 const struct cpg_address *joined_list,
256 size_t joined_list_entries);
259 uint32_t
pid,
void *content,
const char **from);
270 uint32_t flag,
const char *status);
274 uint64_t membership);
277 const char *expected);
282 void (*destroy) (gpointer));
286 const xmlNode *
data);
318 const char *xml_id, uint32_t
flags);
324 #endif // PCMK__CRM_CLUSTER_INTERNAL__H pcmk__node_status_t * pcmk__get_node(unsigned int id, const char *uname, const char *xml_id, uint32_t flags)
Implementation of pcmk__cluster_private_t.
uint32_t flags
Group of enum pcmk__node_status_flags
void pcmk__reap_unseen_nodes(uint64_t ring_id)
void pcmk__cluster_forget_cluster_node(uint32_t id, const char *node_name)
const char * pcmk__node_name_from_uuid(const char *uuid)
Search for cluster nodes from membership cache.
bool pcmk__corosync_add_nodes(xmlNode *xml_parent)
Node connection state updated.
void pcmk__cluster_forget_remote_node(const char *node_name)
const char * pcmk__cluster_local_node_name(void)
void pcmk__cpg_confchg_cb(cpg_handle_t handle, const struct cpg_name *group_name, 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)
char * node_name
Local node name at cluster layer.
uint32_t cluster_layer_id
Cluster-layer numeric node ID.
pcmk__node_status_t * pcmk__search_node_caches(unsigned int id, const char *uname, uint32_t flags)
enum pcmk_ipc_server server
Server this connection is for (if any)
char * pcmk__corosync_cluster_name(void)
pcmk__election_t * election
Election state (if election is needed)
Node process group membership updated.
void * user_data
Arbitrary data (must be freeable by free())
unsigned int pcmk__cluster_num_active_nodes(void)
bool pcmk__cluster_is_node_active(const pcmk__node_status_t *node)
pcmk_ipc_server
Available IPC interfaces.
bool pcmk__cluster_has_quorum(void)
void pcmk__update_peer_expected(const char *source, pcmk__node_status_t *node, const char *expected)
Node's cache entry is dirty.
pcmk__node_status_t * pcmk__cluster_lookup_remote_node(const char *node_name)
void pcmk__cluster_init_node_caches(void)
unsigned int pcmk__cluster_num_remote_nodes(void)
uint32_t node_id
Local node ID at cluster layer.
struct pcmk__node_status pcmk__node_status_t
Node status data (may be a cluster node or a Pacemaker Remote node)
GHashTable * pcmk__remote_peer_cache
Search for cluster member nodes and remote nodes.
void pcmk__cluster_set_autoreap(bool enable)
Search for cluster nodes from CIB (as of last cache refresh)
void pcmk__cluster_destroy_node_caches(void)
void pcmk__corosync_quorum_connect(gboolean(*dispatch)(unsigned long long, gboolean), void(*destroy)(gpointer))
const char * pcmk__cluster_node_uuid(pcmk__node_status_t *node)
pcmk__node_status_t * pcmk__update_peer_state(const char *source, pcmk__node_status_t *node, const char *state, uint64_t membership)
Update a node's state and membership information.
GHashTable * pcmk__peer_cache
char * pcmk__cluster_node_name(uint32_t nodeid)
struct pcmk__election pcmk__election_t
IPC interface to Pacemaker daemons.
void pcmk__purge_node_from_cache(const char *node_name, uint32_t node_id)
time_t when_lost
When CPG membership was last lost.
bool pcmk__cluster_send_message(const pcmk__node_status_t *node, enum pcmk_ipc_server service, const xmlNode *data)
pcmk__node_status_t * crm_update_peer_proc(const char *source, pcmk__node_status_t *peer, uint32_t flag, const char *status)
Node status data (may be a cluster node or a Pacemaker Remote node)
void pcmk__cluster_set_status_callback(void(*dispatch)(enum pcmk__node_update, pcmk__node_status_t *, const void *))
enum pcmk_cluster_layer pcmk_get_cluster_layer(void)
Get and validate the local cluster layer.
char * name
Node name as known to cluster layer, or Pacemaker Remote node name.
char * pcmk__cpg_message_data(cpg_handle_t handle, uint32_t sender_id, uint32_t pid, void *content, const char **from)
void pcmk__refresh_node_caches_from_cib(xmlNode *cib)