pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
cluster.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2025 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#ifndef PCMK__CRM_CLUSTER__H
11#define PCMK__CRM_CLUSTER__H
12
13#include <glib.h> // gpointer
14
15#if SUPPORT_COROSYNC
16#include <corosync/cpg.h> // cpg_callbacks_t, etc.
17#endif
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
25
26// Implementation of pcmk_cluster_t
27// @COMPAT Make contents internal when we can break API backward compatibility
31 /* @COMPAT Once all members are moved to pcmk__cluster_private_t, we can
32 * make that the pcmk_cluster_t implementation and drop this struct
33 * altogether, leaving pcmk_cluster_t as an opaque public type.
34 */
37
38 // NOTE: sbd (as of at least 1.5.2) uses this
40 void (*destroy) (gpointer);
41
42#if SUPPORT_COROSYNC
43 // NOTE: sbd (as of at least 1.5.2) uses this
48 cpg_callbacks_t cpg;
49#endif // SUPPORT_COROSYNC
50};
52
55
58
61
62int pcmk_cluster_set_destroy_fn(pcmk_cluster_t *cluster, void (*fn)(gpointer));
63#if SUPPORT_COROSYNC
64int pcmk_cpg_set_deliver_fn(pcmk_cluster_t *cluster, cpg_deliver_fn_t fn);
65int pcmk_cpg_set_confchg_fn(pcmk_cluster_t *cluster, cpg_confchg_fn_t fn);
66#endif // SUPPORT_COROSYNC
67
74
76const char *pcmk_cluster_layer_text(enum pcmk_cluster_layer layer);
77
78#ifdef __cplusplus
79}
80#endif
81
82#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
83#include <crm/cluster/compat.h>
84#endif
85
86#endif // PCMK__CRM_CLUSTER__H
void pcmk_cluster_free(pcmk_cluster_t *cluster)
Free a pcmk_cluster_t object and its dynamically allocated members.
Definition cluster.c:163
pcmk_cluster_t * pcmk_cluster_new(void)
Allocate a new pcmk_cluster_t object.
Definition cluster.c:148
int pcmk_cluster_connect(pcmk_cluster_t *cluster)
Definition cluster.c:81
int pcmk_cluster_set_destroy_fn(pcmk_cluster_t *cluster, void(*fn)(gpointer))
Set the destroy function for a cluster object.
Definition cluster.c:184
int pcmk_cluster_disconnect(pcmk_cluster_t *cluster)
Disconnect from the cluster layer.
Definition cluster.c:116
const char * pcmk_cluster_layer_text(enum pcmk_cluster_layer layer)
Get a log-friendly string equivalent of a cluster layer.
Definition cluster.c:357
enum pcmk_cluster_layer pcmk_get_cluster_layer(void)
Get and validate the local cluster layer.
Definition cluster.c:384
pcmk_cluster_layer
Types of cluster layer.
Definition cluster.h:69
@ pcmk_cluster_layer_invalid
Invalid cluster layer.
Definition cluster.h:71
@ pcmk_cluster_layer_corosync
Corosync Cluster Engine.
Definition cluster.h:72
@ pcmk_cluster_layer_unknown
Unknown cluster layer.
Definition cluster.h:70
Deprecated Pacemaker cluster API.
int pcmk_cpg_set_deliver_fn(pcmk_cluster_t *cluster, cpg_deliver_fn_t fn)
Set the CPG deliver callback function for a cluster object.
Definition cpg.c:744
int pcmk_cpg_set_confchg_fn(pcmk_cluster_t *cluster, cpg_confchg_fn_t fn)
Set the CPG config change callback function for a cluster object.
Definition cpg.c:762
Implementation of pcmk__cluster_private_t.
Definition internal.h:89
pcmk__cluster_private_t * priv
Definition cluster.h:36
void(* destroy)(gpointer)
Definition cluster.h:40