pacemaker 2.1.6-6fdc9deea29
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
cib_types.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2023 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_CIB_CIB_TYPES__H
11# define PCMK__CRM_CIB_CIB_TYPES__H
12
13# include <glib.h> // gboolean, GList
14# include <libxml/tree.h> // xmlNode
15# include <crm/common/ipc.h>
16# include <crm/common/xml.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
33
34#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
37#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
38};
39
45
52
55 cib_verbose = (1 << 0),
56 cib_xpath = (1 << 1),
57 cib_multiple = (1 << 2),
58 cib_can_create = (1 << 3),
60 cib_no_children = (1 << 5),
62 cib_mixed_update = (1 << 7),
63 cib_scope_local = (1 << 8),
64 cib_dryrun = (1 << 9),
65 cib_sync_call = (1 << 12),
66 cib_no_mtime = (1 << 13),
67 cib_zero_copy = (1 << 14),
68 cib_inhibit_notify = (1 << 16),
69
70#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
73#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
74
76 cib_inhibit_bcast = (1 << 24),
77
78 cib_force_diff = (1 << 28),
79};
80
81typedef struct cib_s cib_t;
82
83typedef struct cib_api_operations_s {
84 int (*signon) (cib_t *cib, const char *name, enum cib_conn_type type);
85 int (*signon_raw) (cib_t *cib, const char *name, enum cib_conn_type type,
86 int *event_fd);
87 int (*signoff) (cib_t *cib);
88 int (*free) (cib_t *cib);
89 int (*set_op_callback) (cib_t *cib, void (*callback) (const xmlNode *msg,
90 int callid, int rc,
91 xmlNode *output));
92 int (*add_notify_callback) (cib_t *cib, const char *event,
93 void (*callback) (const char *event,
94 xmlNode *msg));
95 int (*del_notify_callback) (cib_t *cib, const char *event,
96 void (*callback) (const char *event,
97 xmlNode *msg));
99 void (*dnotify) (gpointer user_data));
100 int (*inputfd) (cib_t *cib);
101 int (*noop) (cib_t *cib, int call_options);
102 int (*ping) (cib_t *cib, xmlNode **output_data, int call_options);
103 int (*query) (cib_t *cib, const char *section, xmlNode **output_data,
104 int call_options);
105 int (*query_from) (cib_t *cib, const char *host, const char *section,
106 xmlNode **output_data, int call_options);
107
109 int (*is_master) (cib_t *cib);
110
112 int (*set_master) (cib_t *cib, int call_options);
113
115 int (*set_slave) (cib_t *cib, int call_options);
116
118 int (*set_slave_all) (cib_t *cib, int call_options);
119
120 int (*sync) (cib_t *cib, const char *section, int call_options);
121 int (*sync_from) (cib_t *cib, const char *host, const char *section,
122 int call_options);
123 int (*upgrade) (cib_t *cib, int call_options);
124 int (*bump_epoch) (cib_t *cib, int call_options);
125 int (*create) (cib_t *cib, const char *section, xmlNode *data,
126 int call_options);
127 int (*modify) (cib_t *cib, const char *section, xmlNode *data,
128 int call_options);
129
131 int (*update) (cib_t *cib, const char *section, xmlNode *data,
132 int call_options);
133
134 int (*replace) (cib_t *cib, const char *section, xmlNode *data,
135 int call_options);
136 int (*remove) (cib_t *cib, const char *section, xmlNode *data,
137 int call_options);
138 int (*erase) (cib_t *cib, xmlNode **output_data, int call_options);
139
141 int (*delete_absolute) (cib_t *cib, const char *section, xmlNode *data,
142 int call_options);
143
144 int (*quit) (cib_t *cib, int call_options);
145 int (*register_notification) (cib_t *cib, const char *callback,
146 int enabled);
147 gboolean (*register_callback) (cib_t *cib, int call_id, int timeout,
148 gboolean only_success, void *user_data,
149 const char *callback_name,
150 void (*callback) (xmlNode*, int, int,
151 xmlNode*, void *));
152 gboolean (*register_callback_full)(cib_t *cib, int call_id, int timeout,
153 gboolean only_success, void *user_data,
154 const char *callback_name,
155 void (*callback)(xmlNode *, int, int,
156 xmlNode *, void *),
157 void (*free_func)(void *));
158
167 int (*set_primary)(cib_t *cib, int call_options);
168
177 int (*set_secondary)(cib_t *cib, int call_options);
178
199 int (*client_id)(const cib_t *cib, const char **async_id,
200 const char **sync_id);
202
203struct cib_s {
207
212
214 void (*op_callback) (const xmlNode *msg, int call_id, int rc,
215 xmlNode *output);
217};
218
219#ifdef __cplusplus
220}
221#endif
222
223#endif // PCMK__CRM_CIB_CIB_TYPES__H
const char * name
Definition cib.c:24
cib_conn_type
Definition cib_types.h:46
@ cib_query
Definition cib_types.h:48
@ cib_no_connection
Definition cib_types.h:49
@ cib_command
Definition cib_types.h:47
@ cib_command_nonblocking
Definition cib_types.h:50
cib_call_options
Definition cib_types.h:53
@ cib_no_children
Definition cib_types.h:60
@ cib_scope_local
Definition cib_types.h:63
@ cib_none
Definition cib_types.h:54
@ cib_inhibit_notify
Definition cib_types.h:68
@ cib_force_diff
Definition cib_types.h:78
@ cib_xpath
Definition cib_types.h:56
@ cib_sync_call
Definition cib_types.h:65
@ cib_dryrun
Definition cib_types.h:64
@ cib_mixed_update
Definition cib_types.h:62
@ cib_verbose
Prefer stderr to logs.
Definition cib_types.h:55
@ cib_discard_reply
Definition cib_types.h:59
@ cib_no_mtime
Definition cib_types.h:66
@ cib_zero_copy
Definition cib_types.h:67
@ cib_can_create
Definition cib_types.h:58
@ cib_multiple
Definition cib_types.h:57
@ cib_inhibit_bcast
Definition cib_types.h:76
@ cib_xpath_address
Definition cib_types.h:61
@ cib_quorum_override
Definition cib_types.h:72
struct cib_api_operations_s cib_api_operations_t
cib_variant
Definition cib_types.h:28
@ cib_native
Definition cib_types.h:30
@ cib_undefined
Definition cib_types.h:29
@ cib_remote
Definition cib_types.h:32
@ cib_database
Definition cib_types.h:36
@ cib_file
Definition cib_types.h:31
cib_state
Definition cib_types.h:40
@ cib_connected_command
Definition cib_types.h:41
@ cib_connected_query
Definition cib_types.h:42
@ cib_disconnected
Definition cib_types.h:43
pcmk__cpg_host_t host
Definition cpg.c:4
enum crm_ais_msg_types type
Definition cpg.c:3
char data[0]
Definition cpg.c:10
IPC interface to Pacemaker daemons.
unsigned int timeout
Definition pcmk_fence.c:32
int(* quit)(cib_t *cib, int call_options)
Definition cib_types.h:144
int(* upgrade)(cib_t *cib, int call_options)
Definition cib_types.h:123
int(* create)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:125
int(* set_master)(cib_t *cib, int call_options)
Definition cib_types.h:112
int(* noop)(cib_t *cib, int call_options)
Definition cib_types.h:101
int(* delete_absolute)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:141
int(* erase)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:138
int(* del_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:95
int(* add_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:92
int(* bump_epoch)(cib_t *cib, int call_options)
Definition cib_types.h:124
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition cib_types.h:98
int(* is_master)(cib_t *cib)
Definition cib_types.h:109
int(* set_slave_all)(cib_t *cib, int call_options)
Definition cib_types.h:118
int(* inputfd)(cib_t *cib)
Definition cib_types.h:100
int(* remove)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:136
int(* set_primary)(cib_t *cib, int call_options)
Set the local CIB manager as the cluster's primary instance.
Definition cib_types.h:167
int(* set_slave)(cib_t *cib, int call_options)
Definition cib_types.h:115
int(* query_from)(cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:105
int(* update)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:131
int(* signoff)(cib_t *cib)
Definition cib_types.h:87
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition cib_types.h:84
int(* query)(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:103
int(* set_secondary)(cib_t *cib, int call_options)
Set the local CIB manager as a secondary instance.
Definition cib_types.h:177
int(* set_op_callback)(cib_t *cib, void(*callback)(const xmlNode *msg, int callid, int rc, xmlNode *output))
Definition cib_types.h:89
int(* sync_from)(cib_t *cib, const char *host, const char *section, int call_options)
Definition cib_types.h:121
gboolean(* register_callback)(cib_t *cib, int call_id, int timeout, gboolean only_success, void *user_data, const char *callback_name, void(*callback)(xmlNode *, int, int, xmlNode *, void *))
Definition cib_types.h:147
int(* ping)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:102
int(* client_id)(const cib_t *cib, const char **async_id, const char **sync_id)
Get the given CIB connection's unique client identifier(s)
Definition cib_types.h:199
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition cib_types.h:145
int(* replace)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:134
int(* sync)(cib_t *cib, const char *section, int call_options)
Definition cib_types.h:120
int(* signon_raw)(cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
Definition cib_types.h:85
int(* free)(cib_t *cib)
Definition cib_types.h:88
int(* modify)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:127
gboolean(* register_callback_full)(cib_t *cib, int call_id, int timeout, gboolean only_success, void *user_data, const char *callback_name, void(*callback)(xmlNode *, int, int, xmlNode *, void *), void(*free_func)(void *))
Definition cib_types.h:152
enum cib_conn_type type
Definition cib_types.h:205
enum cib_state state
Definition cib_types.h:204
GList * notify_list
Definition cib_types.h:213
void * variant_opaque
Definition cib_types.h:210
void * delegate_fn
Definition cib_types.h:211
cib_api_operations_t * cmds
Definition cib_types.h:216
int call_timeout
Definition cib_types.h:209
enum cib_variant variant
Definition cib_types.h:206
int call_id
Definition cib_types.h:208
void(* op_callback)(const xmlNode *msg, int call_id, int rc, xmlNode *output)
Definition cib_types.h:214
Wrappers for and extensions to libxml2.