pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Functions
cluster.c File Reference
#include <crm_internal.h>
#include <dlfcn.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <glib.h>
#include <crm/crm.h>
#include <crm/common/ipc.h>
#include <crm/common/xml.h>
#include <crm/cluster/internal.h>
#include "crmcluster_private.h"
#include <crm/cluster/compat.h>
Include dependency graph for cluster.c:

Go to the source code of this file.

Functions

 CRM_TRACE_INIT_DATA (cluster)
 
enum crm_ais_msg_types pcmk__cluster_parse_msg_type (const char *text)
 
const char * pcmk__cluster_node_uuid (crm_node_t *node)
 
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...
 
bool pcmk__cluster_send_message (const crm_node_t *node, enum crm_ais_msg_types service, const xmlNode *data)
 
char * pcmk__cluster_node_name (uint32_t nodeid)
 
const char * pcmk__cluster_local_node_name (void)
 
const char * pcmk__node_name_from_uuid (const char *uuid)
 
const char * pcmk_cluster_layer_text (enum pcmk_cluster_layer layer)
 Get a log-friendly string equivalent of a cluster layer. More...
 
enum pcmk_cluster_layer pcmk_get_cluster_layer (void)
 Get and validate the local cluster layer. More...
 
void set_uuid (xmlNode *xml, const char *attr, crm_node_t *node)
 
gboolean crm_cluster_connect (pcmk_cluster_t *cluster)
 
void crm_cluster_disconnect (pcmk_cluster_t *cluster)
 
const char * name_for_cluster_type (enum cluster_type_e type)
 
enum cluster_type_e get_cluster_type (void)
 
gboolean is_corosync_cluster (void)
 
gboolean send_cluster_message (const crm_node_t *node, enum crm_ais_msg_types service, const xmlNode *data, gboolean ordered)
 
const char * crm_peer_uuid (crm_node_t *peer)
 
char * get_node_name (uint32_t nodeid)
 
const char * get_local_node_name (void)
 
const char * crm_peer_uname (const char *uuid)
 

Function Documentation

◆ crm_cluster_connect()

gboolean crm_cluster_connect ( pcmk_cluster_t cluster)
Deprecated:
Use pcmk_cluster_connect() instead

Definition at line 477 of file cluster.c.

◆ crm_cluster_disconnect()

void crm_cluster_disconnect ( pcmk_cluster_t cluster)
Deprecated:
Use pcmk_cluster_disconnect() instead

Definition at line 483 of file cluster.c.

◆ crm_peer_uname()

const char* crm_peer_uname ( const char *  uuid)
Deprecated:
Do not use

Definition at line 541 of file cluster.c.

◆ crm_peer_uuid()

const char* crm_peer_uuid ( crm_node_t node)
Deprecated:
Do not use

Definition at line 523 of file cluster.c.

◆ CRM_TRACE_INIT_DATA()

CRM_TRACE_INIT_DATA ( cluster  )

◆ get_cluster_type()

enum cluster_type_e get_cluster_type ( void  )
Deprecated:
Use pcmk_get_cluster_layer() instead

Definition at line 504 of file cluster.c.

◆ get_local_node_name()

const char* get_local_node_name ( void  )
Deprecated:
Do not use

Definition at line 535 of file cluster.c.

◆ get_node_name()

char* get_node_name ( uint32_t  nodeid)
Deprecated:
Do not use

Definition at line 529 of file cluster.c.

◆ is_corosync_cluster()

gboolean is_corosync_cluster ( void  )
Deprecated:
Use pcmk_get_cluster_layer() instead

Definition at line 510 of file cluster.c.

◆ name_for_cluster_type()

const char* name_for_cluster_type ( enum cluster_type_e  type)
Deprecated:
Use pcmk_cluster_layer_text() instead

Definition at line 489 of file cluster.c.

◆ pcmk__cluster_local_node_name()

const char* pcmk__cluster_local_node_name ( void  )

Definition at line 325 of file cluster.c.

◆ pcmk__cluster_node_name()

char* pcmk__cluster_node_name ( uint32_t  nodeid)

Definition at line 269 of file cluster.c.

◆ pcmk__cluster_node_uuid()

const char* pcmk__cluster_node_uuid ( crm_node_t node)

Definition at line 89 of file cluster.c.

◆ pcmk__cluster_parse_msg_type()

enum crm_ais_msg_types pcmk__cluster_parse_msg_type ( const char *  text)

Definition at line 44 of file cluster.c.

◆ pcmk__cluster_send_message()

bool pcmk__cluster_send_message ( const crm_node_t node,
enum crm_ais_msg_types  service,
const xmlNode *  data 
)

Definition at line 236 of file cluster.c.

◆ pcmk__node_name_from_uuid()

const char* pcmk__node_name_from_uuid ( const char *  uuid)

Definition at line 347 of file cluster.c.

◆ 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.

◆ send_cluster_message()

gboolean send_cluster_message ( const crm_node_t node,
enum crm_ais_msg_types  service,
const xmlNode *  data,
gboolean  ordered 
)
Deprecated:
Do not use

Definition at line 516 of file cluster.c.

◆ set_uuid()

void set_uuid ( xmlNode *  xml,
const char *  attr,
crm_node_t node 
)
Deprecated:
Use crm_xml_add(xml, attr, pcmk__cluster_node_uuid(node)) instead

Definition at line 471 of file cluster.c.