pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
cluster.h File Reference
#include <stdint.h>
#include <glib.h>
#include <libxml/tree.h>
#include <crm/common/xml.h>
#include <crm/common/util.h>
#include <crm/cluster/compat.h>
Include dependency graph for cluster.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  crm_peer_node_s
 
struct  crm_cluster_s
 

Macros

#define CRM_NODE_LOST   "lost"
 
#define CRM_NODE_MEMBER   "member"
 

Typedefs

typedef struct crm_cluster_s pcmk_cluster_t
 Connection to a cluster layer. More...
 
typedef struct crm_peer_node_s crm_node_t
 

Enumerations

enum  pcmk_cluster_layer { pcmk_cluster_layer_unknown = 1, pcmk_cluster_layer_invalid = 2, pcmk_cluster_layer_corosync = 32 }
 Types of cluster layer. More...
 
enum  crm_join_phase {
  crm_join_nack_quiet = -2, crm_join_nack = -1, crm_join_none = 0, crm_join_welcomed = 1,
  crm_join_integrated = 2, crm_join_finalized = 3, crm_join_confirmed = 4
}
 
enum  crm_node_flags { crm_remote_node = (1U << 0), crm_node_dirty = (1U << 1) }
 
enum  crm_ais_msg_class { crm_class_cluster = 0 }
 
enum  crm_ais_msg_types {
  crm_msg_none = 0, crm_msg_ais = 1, crm_msg_lrmd = 2, crm_msg_cib = 3,
  crm_msg_crmd = 4, crm_msg_attrd = 5, crm_msg_stonithd = 6, crm_msg_te = 7,
  crm_msg_pe = 8, crm_msg_stonith_ng = 9
}
 
enum  crm_status_type { crm_status_uname, crm_status_nstate, crm_status_processes }
 

Functions

int pcmk_cluster_connect (pcmk_cluster_t *cluster)
 
int pcmk_cluster_disconnect (pcmk_cluster_t *cluster)
 Disconnect from the cluster layer. More...
 
pcmk_cluster_tpcmk_cluster_new (void)
 Allocate a new pcmk_cluster_t object. More...
 
void pcmk_cluster_free (pcmk_cluster_t *cluster)
 Free a pcmk_cluster_t object and its dynamically allocated members. More...
 
int pcmk_cluster_set_destroy_fn (pcmk_cluster_t *cluster, void(*fn)(gpointer))
 Set the destroy function for a cluster object. More...
 
enum pcmk_cluster_layer pcmk_get_cluster_layer (void)
 Get and validate the local cluster layer. More...
 
const char * pcmk_cluster_layer_text (enum pcmk_cluster_layer layer)
 Get a log-friendly string equivalent of a cluster layer. More...
 

Variables

gboolean crm_have_quorum
 
GHashTable * crm_peer_cache
 
GHashTable * crm_remote_peer_cache
 
unsigned long long crm_peer_seq
 

Macro Definition Documentation

◆ CRM_NODE_LOST

#define CRM_NODE_LOST   "lost"
Deprecated:
Do not use (public access will be removed in a future release)

Definition at line 45 of file cluster.h.

◆ CRM_NODE_MEMBER

#define CRM_NODE_MEMBER   "member"
Deprecated:
Do not use (public access will be removed in a future release)

Definition at line 49 of file cluster.h.

Typedef Documentation

◆ crm_node_t

typedef struct crm_peer_node_s crm_node_t
Deprecated:
Do not use (public access will be removed in a future release)

◆ pcmk_cluster_t

typedef struct crm_cluster_s pcmk_cluster_t

Connection to a cluster layer.

Definition at line 169 of file cluster.h.

Enumeration Type Documentation

◆ crm_ais_msg_class

Deprecated:
Do not use (public access will be removed in a future release)
Enumerator
crm_class_cluster 

Definition at line 189 of file cluster.h.

◆ crm_ais_msg_types

Deprecated:
Do not use (public access will be removed in a future release)
Enumerator
crm_msg_none 
crm_msg_ais 
crm_msg_lrmd 
crm_msg_cib 
crm_msg_crmd 
crm_msg_attrd 
crm_msg_stonithd 
crm_msg_te 
crm_msg_pe 
crm_msg_stonith_ng 

Definition at line 197 of file cluster.h.

◆ crm_join_phase

Deprecated:
Do not use (public access will be removed in a future release)
Enumerator
crm_join_nack_quiet 

Not allowed to join, but don't send a nack message.

crm_join_nack 
crm_join_none 
crm_join_welcomed 
crm_join_integrated 
crm_join_finalized 
crm_join_confirmed 

Definition at line 54 of file cluster.h.

◆ crm_node_flags

Deprecated:
Do not use (public access will be removed in a future release)
Enumerator
crm_remote_node 
crm_node_dirty 

Definition at line 73 of file cluster.h.

◆ crm_status_type

Deprecated:
Do not use (public access will be removed in a future release)
Enumerator
crm_status_uname 
crm_status_nstate 
crm_status_processes 

Definition at line 214 of file cluster.h.

◆ pcmk_cluster_layer

Types of cluster layer.

Enumerator
pcmk_cluster_layer_unknown 

Unknown cluster layer.

pcmk_cluster_layer_invalid 

Invalid cluster layer.

pcmk_cluster_layer_corosync 

Corosync Cluster Engine.

Definition at line 225 of file cluster.h.

Function Documentation

◆ pcmk_cluster_connect()

int pcmk_cluster_connect ( pcmk_cluster_t cluster)

Definition at line 123 of file cluster.c.

◆ pcmk_cluster_disconnect()

int pcmk_cluster_disconnect ( pcmk_cluster_t cluster)

Disconnect from the cluster layer.

Parameters
[in,out]clusterCluster object to disconnect
Returns
Standard Pacemaker return code

Definition at line 154 of file cluster.c.

◆ pcmk_cluster_free()

void pcmk_cluster_free ( pcmk_cluster_t cluster)

Free a pcmk_cluster_t object and its dynamically allocated members.

Parameters
[in,out]clusterCluster object to free

Definition at line 197 of file cluster.c.

◆ pcmk_cluster_layer_text()

const char* pcmk_cluster_layer_text ( enum pcmk_cluster_layer  layer)

Get a log-friendly string equivalent of a cluster layer.

Parameters
[in]layerCluster layer
Returns
Log-friendly string corresponding to layer

Definition at line 388 of file cluster.c.

◆ pcmk_cluster_new()

pcmk_cluster_t* pcmk_cluster_new ( void  )

Allocate a new pcmk_cluster_t object.

Returns
A newly allocated pcmk_cluster_t object (guaranteed not NULL)
Note
The caller is responsible for freeing the return value using pcmk_cluster_free().

Definition at line 186 of file cluster.c.

◆ pcmk_cluster_set_destroy_fn()

int pcmk_cluster_set_destroy_fn ( pcmk_cluster_t cluster,
void(*)(gpointer)  fn 
)

Set the destroy function for a cluster object.

Parameters
[in,out]clusterCluster object
[in]fnDestroy function to set
Returns
Standard Pacemaker return code

Definition at line 216 of file cluster.c.

◆ pcmk_get_cluster_layer()

enum pcmk_cluster_layer pcmk_get_cluster_layer ( void  )

Get and validate the local cluster layer.

If a cluster layer is not configured via the PCMK__ENV_CLUSTER_TYPE local option, this will try to detect an active cluster from among the supported cluster layers.

Returns
Local cluster layer
Note
This will fatally exit if the configured cluster layer is invalid.

Definition at line 415 of file cluster.c.

Variable Documentation

◆ crm_have_quorum

gboolean crm_have_quorum
Deprecated:
Do not use (public access will be removed in a future release)

Definition at line 68 of file membership.c.

◆ crm_peer_cache

GHashTable* crm_peer_cache
Deprecated:
Do not use (public access will be removed in a future release)

Definition at line 40 of file membership.c.

◆ crm_peer_seq

unsigned long long crm_peer_seq
Deprecated:
Do not use (public access will be removed in a future release)

Definition at line 67 of file membership.c.

◆ crm_remote_peer_cache

GHashTable* crm_remote_peer_cache
Deprecated:
Do not use (public access will be removed in a future release)

Definition at line 57 of file membership.c.