pacemaker 2.1.8-2.1.8~rc1
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
cib_remote.c
Go to the documentation of this file.
1/*
2 * Copyright 2008-2024 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#include <crm_internal.h>
11
12#include <unistd.h>
13#include <stdlib.h>
14#include <stdio.h>
15#include <stdarg.h>
16#include <string.h>
17#include <netdb.h>
18#include <termios.h>
19#include <sys/socket.h>
20
21#include <glib.h>
22
23#include <crm/crm.h>
24#include <crm/cib/internal.h>
26#include <crm/common/mainloop.h>
27#include <crm/common/xml.h>
30
31#ifdef HAVE_GNUTLS_GNUTLS_H
32
33# include <gnutls/gnutls.h>
34
35# define TLS_HANDSHAKE_TIMEOUT_MS 5000
36
37static gnutls_anon_client_credentials_t anon_cred_c;
38static gboolean remote_gnutls_credentials_init = FALSE;
39
40#endif // HAVE_GNUTLS_GNUTLS_H
41
42#include <arpa/inet.h>
43
44typedef struct cib_remote_opaque_s {
45 int port;
46 char *server;
47 char *user;
48 char *passwd;
49 gboolean encrypted;
50 pcmk__remote_t command;
51 pcmk__remote_t callback;
52 pcmk__output_t *out;
54
55static int
56cib_remote_perform_op(cib_t *cib, const char *op, const char *host,
57 const char *section, xmlNode *data,
58 xmlNode **output_data, int call_options,
59 const char *user_name)
60{
61 int rc;
62 int remaining_time = 0;
63 time_t start_time;
64
65 xmlNode *op_msg = NULL;
66 xmlNode *op_reply = NULL;
67
68 cib_remote_opaque_t *private = cib->variant_opaque;
69
70 if (cib->state == cib_disconnected) {
71 return -ENOTCONN;
72 }
73
74 if (output_data != NULL) {
75 *output_data = NULL;
76 }
77
78 if (op == NULL) {
79 crm_err("No operation specified");
80 return -EINVAL;
81 }
82
83 rc = cib__create_op(cib, op, host, section, data, call_options, user_name,
84 NULL, &op_msg);
85 if (rc != pcmk_ok) {
86 return rc;
87 }
88
89 if (pcmk_is_set(call_options, cib_transaction)) {
90 rc = cib__extend_transaction(cib, op_msg);
91 free_xml(op_msg);
92 return rc;
93 }
94
95 crm_trace("Sending %s message to the CIB manager", op);
96 if (!(call_options & cib_sync_call)) {
97 pcmk__remote_send_xml(&private->callback, op_msg);
98 } else {
99 pcmk__remote_send_xml(&private->command, op_msg);
100 }
101 free_xml(op_msg);
102
103 if ((call_options & cib_discard_reply)) {
104 crm_trace("Discarding reply");
105 return pcmk_ok;
106
107 } else if (!(call_options & cib_sync_call)) {
108 return cib->call_id;
109 }
110
111 crm_trace("Waiting for a synchronous reply");
112
113 start_time = time(NULL);
114 remaining_time = cib->call_timeout ? cib->call_timeout : 60;
115
116 rc = pcmk_rc_ok;
117 while (remaining_time > 0 && (rc != ENOTCONN)) {
118 int reply_id = -1;
119 int msg_id = cib->call_id;
120
121 rc = pcmk__read_remote_message(&private->command,
122 remaining_time * 1000);
123 op_reply = pcmk__remote_message_xml(&private->command);
124
125 if (!op_reply) {
126 break;
127 }
128
129 crm_element_value_int(op_reply, PCMK__XA_CIB_CALLID, &reply_id);
130
131 if (reply_id == msg_id) {
132 break;
133
134 } else if (reply_id < msg_id) {
135 crm_debug("Received old reply: %d (wanted %d)", reply_id, msg_id);
136 crm_log_xml_trace(op_reply, "Old reply");
137
138 } else if ((reply_id - 10000) > msg_id) {
139 /* wrap-around case */
140 crm_debug("Received old reply: %d (wanted %d)", reply_id, msg_id);
141 crm_log_xml_trace(op_reply, "Old reply");
142 } else {
143 crm_err("Received a __future__ reply:" " %d (wanted %d)", reply_id, msg_id);
144 }
145
146 free_xml(op_reply);
147 op_reply = NULL;
148
149 /* wasn't the right reply, try and read some more */
150 remaining_time = time(NULL) - start_time;
151 }
152
153 /* if(IPC_ISRCONN(native->command_channel) == FALSE) { */
154 /* crm_err("The CIB manager disconnected: %d", */
155 /* native->command_channel->ch_status); */
156 /* cib->state = cib_disconnected; */
157 /* } */
158
159 if (rc == ENOTCONN) {
160 crm_err("Disconnected while waiting for reply.");
161 return -ENOTCONN;
162 } else if (op_reply == NULL) {
163 crm_err("No reply message - empty");
164 return -ENOMSG;
165 }
166
167 crm_trace("Synchronous reply received");
168
169 /* Start processing the reply... */
170 if (crm_element_value_int(op_reply, PCMK__XA_CIB_RC, &rc) != 0) {
171 rc = -EPROTO;
172 }
173
174 if (rc == -pcmk_err_diff_resync) {
175 /* This is an internal value that clients do not and should not care about */
176 rc = pcmk_ok;
177 }
178
179 if (rc == pcmk_ok || rc == -EPERM) {
180 crm_log_xml_debug(op_reply, "passed");
181
182 } else {
183/* } else if(rc == -ETIME) { */
184 crm_err("Call failed: %s", pcmk_strerror(rc));
185 crm_log_xml_warn(op_reply, "failed");
186 }
187
188 if (output_data == NULL) {
189 /* do nothing more */
190
191 } else if (!(call_options & cib_discard_reply)) {
192 xmlNode *wrapper = pcmk__xe_first_child(op_reply, PCMK__XE_CIB_CALLDATA,
193 NULL, NULL);
194 xmlNode *tmp = pcmk__xe_first_child(wrapper, NULL, NULL, NULL);
195
196 if (tmp == NULL) {
197 crm_trace("No output in reply to \"%s\" command %d", op, cib->call_id - 1);
198 } else {
199 *output_data = pcmk__xml_copy(NULL, tmp);
200 }
201 }
202
203 free_xml(op_reply);
204
205 return rc;
206}
207
208static int
209cib_remote_callback_dispatch(gpointer user_data)
210{
211 int rc;
212 cib_t *cib = user_data;
213 cib_remote_opaque_t *private = cib->variant_opaque;
214
215 xmlNode *msg = NULL;
216
217 crm_info("Message on callback channel");
218
219 rc = pcmk__read_remote_message(&private->callback, -1);
220
221 msg = pcmk__remote_message_xml(&private->callback);
222 while (msg) {
223 const char *type = crm_element_value(msg, PCMK__XA_T);
224
225 crm_trace("Activating %s callbacks...", type);
226
227 if (pcmk__str_eq(type, PCMK__VALUE_CIB, pcmk__str_none)) {
228 cib_native_callback(cib, msg, 0, 0);
229
230 } else if (pcmk__str_eq(type, PCMK__VALUE_CIB_NOTIFY, pcmk__str_none)) {
231 g_list_foreach(cib->notify_list, cib_native_notify, msg);
232
233 } else {
234 crm_err("Unknown message type: %s", type);
235 }
236
237 free_xml(msg);
238 msg = pcmk__remote_message_xml(&private->callback);
239 }
240
241 if (rc == ENOTCONN) {
242 return -1;
243 }
244
245 return 0;
246}
247
248static int
249cib_remote_command_dispatch(gpointer user_data)
250{
251 int rc;
252 cib_t *cib = user_data;
253 cib_remote_opaque_t *private = cib->variant_opaque;
254
255 rc = pcmk__read_remote_message(&private->command, -1);
256
257 free(private->command.buffer);
258 private->command.buffer = NULL;
259 crm_err("received late reply for remote cib connection, discarding");
260
261 if (rc == ENOTCONN) {
262 return -1;
263 }
264 return 0;
265}
266
267static int
268cib_tls_close(cib_t *cib)
269{
270 cib_remote_opaque_t *private = cib->variant_opaque;
271
272#ifdef HAVE_GNUTLS_GNUTLS_H
273 if (private->encrypted) {
274 if (private->command.tls_session) {
275 gnutls_bye(*(private->command.tls_session), GNUTLS_SHUT_RDWR);
276 gnutls_deinit(*(private->command.tls_session));
277 gnutls_free(private->command.tls_session);
278 }
279
280 if (private->callback.tls_session) {
281 gnutls_bye(*(private->callback.tls_session), GNUTLS_SHUT_RDWR);
282 gnutls_deinit(*(private->callback.tls_session));
283 gnutls_free(private->callback.tls_session);
284 }
285 private->command.tls_session = NULL;
286 private->callback.tls_session = NULL;
287 if (remote_gnutls_credentials_init) {
288 gnutls_anon_free_client_credentials(anon_cred_c);
289 gnutls_global_deinit();
290 remote_gnutls_credentials_init = FALSE;
291 }
292 }
293#endif
294
295 if (private->command.tcp_socket) {
296 shutdown(private->command.tcp_socket, SHUT_RDWR); /* no more receptions */
297 close(private->command.tcp_socket);
298 }
299 if (private->callback.tcp_socket) {
300 shutdown(private->callback.tcp_socket, SHUT_RDWR); /* no more receptions */
301 close(private->callback.tcp_socket);
302 }
303 private->command.tcp_socket = 0;
304 private->callback.tcp_socket = 0;
305
306 free(private->command.buffer);
307 free(private->callback.buffer);
308 private->command.buffer = NULL;
309 private->callback.buffer = NULL;
310
311 return 0;
312}
313
314static void
315cib_remote_connection_destroy(gpointer user_data)
316{
317 crm_err("Connection destroyed");
318#ifdef HAVE_GNUTLS_GNUTLS_H
319 cib_tls_close(user_data);
320#endif
321}
322
323static int
324cib_tls_signon(cib_t *cib, pcmk__remote_t *connection, gboolean event_channel)
325{
326 cib_remote_opaque_t *private = cib->variant_opaque;
327 int rc;
328
329 xmlNode *answer = NULL;
330 xmlNode *login = NULL;
331
332 static struct mainloop_fd_callbacks cib_fd_callbacks = { 0, };
333
334 cib_fd_callbacks.dispatch =
335 event_channel ? cib_remote_callback_dispatch : cib_remote_command_dispatch;
336 cib_fd_callbacks.destroy = cib_remote_connection_destroy;
337
338 connection->tcp_socket = -1;
339#ifdef HAVE_GNUTLS_GNUTLS_H
340 connection->tls_session = NULL;
341#endif
342 rc = pcmk__connect_remote(private->server, private->port, 0, NULL,
343 &(connection->tcp_socket), NULL, NULL);
344 if (rc != pcmk_rc_ok) {
345 crm_info("Remote connection to %s:%d failed: %s " CRM_XS " rc=%d",
346 private->server, private->port, pcmk_rc_str(rc), rc);
347 return -ENOTCONN;
348 }
349
350 if (private->encrypted) {
351 /* initialize GnuTls lib */
352#ifdef HAVE_GNUTLS_GNUTLS_H
353 if (remote_gnutls_credentials_init == FALSE) {
354 crm_gnutls_global_init();
355 gnutls_anon_allocate_client_credentials(&anon_cred_c);
356 remote_gnutls_credentials_init = TRUE;
357 }
358
359 /* bind the socket to GnuTls lib */
360 connection->tls_session = pcmk__new_tls_session(connection->tcp_socket,
361 GNUTLS_CLIENT,
362 GNUTLS_CRD_ANON,
363 anon_cred_c);
364 if (connection->tls_session == NULL) {
365 cib_tls_close(cib);
366 return -1;
367 }
368
369 if (pcmk__tls_client_handshake(connection, TLS_HANDSHAKE_TIMEOUT_MS)
370 != pcmk_rc_ok) {
371 crm_err("Session creation for %s:%d failed", private->server, private->port);
372
373 gnutls_deinit(*connection->tls_session);
374 gnutls_free(connection->tls_session);
375 connection->tls_session = NULL;
376 cib_tls_close(cib);
377 return -1;
378 }
379#else
380 return -EPROTONOSUPPORT;
381#endif
382 }
383
384 /* login to server */
386 crm_xml_add(login, PCMK_XA_OP, "authenticate");
387 crm_xml_add(login, PCMK_XA_USER, private->user);
388 crm_xml_add(login, PCMK__XA_PASSWORD, private->passwd);
390
391 pcmk__remote_send_xml(connection, login);
392 free_xml(login);
393
394 rc = pcmk_ok;
395 if (pcmk__read_remote_message(connection, -1) == ENOTCONN) {
396 rc = -ENOTCONN;
397 }
398
399 answer = pcmk__remote_message_xml(connection);
400
401 crm_log_xml_trace(answer, "Reply");
402 if (answer == NULL) {
403 rc = -EPROTO;
404
405 } else {
406 /* grab the token */
407 const char *msg_type = crm_element_value(answer, PCMK__XA_CIB_OP);
408 const char *tmp_ticket = crm_element_value(answer,
410
411 if (!pcmk__str_eq(msg_type, CRM_OP_REGISTER, pcmk__str_casei)) {
412 crm_err("Invalid registration message: %s", msg_type);
413 rc = -EPROTO;
414
415 } else if (tmp_ticket == NULL) {
416 rc = -EPROTO;
417
418 } else {
419 connection->token = strdup(tmp_ticket);
420 }
421 }
422 free_xml(answer);
423 answer = NULL;
424
425 if (rc != 0) {
426 cib_tls_close(cib);
427 return rc;
428 }
429
430 crm_trace("remote client connection established");
431 connection->source = mainloop_add_fd("cib-remote", G_PRIORITY_HIGH,
432 connection->tcp_socket, cib,
433 &cib_fd_callbacks);
434 return rc;
435}
436
437static int
438cib_remote_signon(cib_t *cib, const char *name, enum cib_conn_type type)
439{
440 int rc = pcmk_ok;
441 cib_remote_opaque_t *private = cib->variant_opaque;
442 xmlNode *hello = NULL;
443
444 if (private->passwd == NULL) {
445 if (private->out == NULL) {
446 /* If no pcmk__output_t is set, just assume that a text prompt
447 * is good enough.
448 */
449 pcmk__text_prompt("Password", false, &(private->passwd));
450 } else {
451 private->out->prompt("Password", false, &(private->passwd));
452 }
453 }
454
455 if (private->server == NULL || private->user == NULL) {
456 rc = -EINVAL;
457 }
458
459 if (rc == pcmk_ok) {
460 rc = cib_tls_signon(cib, &(private->command), FALSE);
461 }
462
463 if (rc == pcmk_ok) {
464 rc = cib_tls_signon(cib, &(private->callback), TRUE);
465 }
466
467 if (rc == pcmk_ok) {
468 rc = cib__create_op(cib, CRM_OP_REGISTER, NULL, NULL, NULL, cib_none,
469 NULL, name, &hello);
470 }
471
472 if (rc == pcmk_ok) {
473 rc = pcmk__remote_send_xml(&private->command, hello);
474 rc = pcmk_rc2legacy(rc);
475 free_xml(hello);
476 }
477
478 if (rc == pcmk_ok) {
479 crm_info("Opened connection to %s:%d for %s",
480 private->server, private->port, name);
482 cib->type = cib_command;
483
484 } else {
485 crm_info("Connection to %s:%d for %s failed: %s\n",
486 private->server, private->port, name, pcmk_strerror(rc));
487 }
488
489 return rc;
490}
491
492static int
493cib_remote_signoff(cib_t *cib)
494{
495 int rc = pcmk_ok;
496
497 crm_debug("Disconnecting from the CIB manager");
498#ifdef HAVE_GNUTLS_GNUTLS_H
499 cib_tls_close(cib);
500#endif
501
502 cib->cmds->end_transaction(cib, false, cib_none);
503 cib->state = cib_disconnected;
504 cib->type = cib_no_connection;
505
506 return rc;
507}
508
509static int
510cib_remote_free(cib_t *cib)
511{
512 int rc = pcmk_ok;
513
514 crm_warn("Freeing CIB");
515 if (cib->state != cib_disconnected) {
516 rc = cib_remote_signoff(cib);
517 if (rc == pcmk_ok) {
518 cib_remote_opaque_t *private = cib->variant_opaque;
519
520 free(private->server);
521 free(private->user);
522 free(private->passwd);
523 free(cib->cmds);
524 free(cib->user);
525 free(private);
526 free(cib);
527 }
528 }
529
530 return rc;
531}
532
533static int
534cib_remote_inputfd(cib_t * cib)
535{
536 cib_remote_opaque_t *private = cib->variant_opaque;
537
538 return private->callback.tcp_socket;
539}
540
541static int
542cib_remote_register_notification(cib_t * cib, const char *callback, int enabled)
543{
544 xmlNode *notify_msg = pcmk__xe_create(NULL, PCMK__XE_CIB_COMMAND);
545 cib_remote_opaque_t *private = cib->variant_opaque;
546
548 crm_xml_add(notify_msg, PCMK__XA_CIB_NOTIFY_TYPE, callback);
549 crm_xml_add_int(notify_msg, PCMK__XA_CIB_NOTIFY_ACTIVATE, enabled);
550 pcmk__remote_send_xml(&private->callback, notify_msg);
551 free_xml(notify_msg);
552 return pcmk_ok;
553}
554
555static int
556cib_remote_set_connection_dnotify(cib_t * cib, void (*dnotify) (gpointer user_data))
557{
558 return -EPROTONOSUPPORT;
559}
560
578static int
579cib_remote_client_id(const cib_t *cib, const char **async_id,
580 const char **sync_id)
581{
582 cib_remote_opaque_t *private = cib->variant_opaque;
583
584 if (async_id != NULL) {
585 // private->callback is the channel for async requests
586 *async_id = private->callback.token;
587 }
588 if (sync_id != NULL) {
589 // private->command is the channel for sync requests
590 *sync_id = private->command.token;
591 }
592 return pcmk_ok;
593}
594
595cib_t *
596cib_remote_new(const char *server, const char *user, const char *passwd, int port,
597 gboolean encrypted)
598{
599 cib_remote_opaque_t *private = NULL;
600 cib_t *cib = cib_new_variant();
601
602 if (cib == NULL) {
603 return NULL;
604 }
605
606 private = calloc(1, sizeof(cib_remote_opaque_t));
607
608 if (private == NULL) {
609 free(cib);
610 return NULL;
611 }
612
613 cib->variant = cib_remote;
614 cib->variant_opaque = private;
615
616 private->server = pcmk__str_copy(server);
617 private->user = pcmk__str_copy(user);
618 private->passwd = pcmk__str_copy(passwd);
619 private->port = port;
620 private->encrypted = encrypted;
621
622 /* assign variant specific ops */
623 cib->delegate_fn = cib_remote_perform_op;
624 cib->cmds->signon = cib_remote_signon;
625 cib->cmds->signoff = cib_remote_signoff;
626 cib->cmds->free = cib_remote_free;
627 cib->cmds->inputfd = cib_remote_inputfd; // Deprecated method
628
629 cib->cmds->register_notification = cib_remote_register_notification;
630 cib->cmds->set_connection_dnotify = cib_remote_set_connection_dnotify;
631
632 cib->cmds->client_id = cib_remote_client_id;
633
634 return cib;
635}
636
637void
639{
640 cib_remote_opaque_t *private;
641
642 if (cib->variant != cib_remote) {
643 return;
644 }
645
646 private = cib->variant_opaque;
647 private->out = out;
648}
int cib__extend_transaction(cib_t *cib, xmlNode *request)
Definition cib_utils.c:743
void cib_native_callback(cib_t *cib, xmlNode *msg, int call_id, int rc)
Definition cib_utils.c:771
cib_t * cib_new_variant(void)
Definition cib_client.c:676
int cib__create_op(cib_t *cib, const char *op, const char *host, const char *section, xmlNode *data, int call_options, const char *user_name, const char *client_name, xmlNode **op_msg)
Definition cib_utils.c:660
void cib_native_notify(gpointer data, gpointer user_data)
Definition cib_utils.c:823
const char * name
Definition cib.c:26
cib_t * cib_remote_new(const char *server, const char *user, const char *passwd, int port, gboolean encrypted)
Definition cib_remote.c:596
struct cib_remote_opaque_s cib_remote_opaque_t
void cib__set_output(cib_t *cib, pcmk__output_t *out)
Definition cib_remote.c:638
cib_conn_type
Definition cib_types.h:50
@ cib_no_connection
Definition cib_types.h:56
@ cib_command
Definition cib_types.h:51
@ cib_none
Definition cib_types.h:61
@ cib_transaction
Process request when the client commits the active transaction.
Definition cib_types.h:108
@ cib_sync_call
Definition cib_types.h:133
@ cib_discard_reply
Definition cib_types.h:66
@ cib_remote
Definition cib_types.h:32
@ cib_connected_command
Definition cib_types.h:42
@ cib_disconnected
Definition cib_types.h:47
int pcmk__remote_send_xml(pcmk__remote_t *remote, const xmlNode *msg)
Definition remote.c:492
int pcmk__connect_remote(const char *host, int port, int timeout_ms, int *timer_id, int *sock_fd, void *userdata, void(*callback)(void *userdata, int rc, int sock))
Definition remote.c:1070
xmlNode * pcmk__remote_message_xml(pcmk__remote_t *remote)
Definition remote.c:545
int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms)
Definition remote.c:798
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition util.h:100
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
A dumping ground.
#define CRM_OP_REGISTER
Definition crm.h:129
#define crm_info(fmt, args...)
Definition logging.h:397
#define crm_warn(fmt, args...)
Definition logging.h:392
#define CRM_XS
Definition logging.h:56
#define crm_log_xml_debug(xml, text)
Definition logging.h:409
#define crm_debug(fmt, args...)
Definition logging.h:400
#define crm_err(fmt, args...)
Definition logging.h:389
#define crm_log_xml_trace(xml, text)
Definition logging.h:410
#define crm_log_xml_warn(xml, text)
Definition logging.h:406
#define crm_trace(fmt, args...)
Definition logging.h:402
Wrappers for and extensions to glib mainloop.
mainloop_io_t * mainloop_add_fd(const char *name, int priority, int fd, void *userdata, struct mainloop_fd_callbacks *callbacks)
Definition mainloop.c:958
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
Definition nvpair.c:446
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
Definition nvpair.c:482
const char * crm_xml_add_int(xmlNode *node, const char *name, int value)
Create an XML attribute with specified name and integer value.
Definition nvpair.c:348
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
Definition nvpair.c:301
#define PCMK__VALUE_PASSWORD
#define PCMK__VALUE_CIB
#define PCMK__VALUE_CIB_NOTIFY
Formatted output for pacemaker tools.
void void void void void pcmk__text_prompt(const char *prompt, bool echo, char **dest)
const char * pcmk_strerror(int rc)
Definition results.c:149
const char * pcmk_rc_str(int rc)
Get a user-friendly description of a return code.
Definition results.c:501
@ pcmk_rc_ok
Definition results.h:162
#define pcmk_ok
Definition results.h:69
int pcmk_rc2legacy(int rc)
Definition results.c:546
#define pcmk_err_diff_resync
Definition results.h:83
@ pcmk__str_none
@ pcmk__str_casei
#define pcmk__str_copy(str)
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition cib_types.h:185
int(* inputfd)(cib_t *cib)
Definition cib_types.h:189
int(* signoff)(cib_t *cib)
Definition cib_types.h:166
int(* end_transaction)(cib_t *cib, bool commit, int call_options)
End and optionally commit this client's CIB transaction.
Definition cib_types.h:362
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition cib_types.h:159
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:299
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition cib_types.h:248
int(* free)(cib_t *cib)
Definition cib_types.h:168
enum cib_conn_type type
Definition cib_types.h:384
enum cib_state state
Definition cib_types.h:382
GList * notify_list
Definition cib_types.h:392
void * variant_opaque
Definition cib_types.h:389
void * delegate_fn
Definition cib_types.h:390
cib_api_operations_t * cmds
Definition cib_types.h:399
int call_timeout
Definition cib_types.h:388
enum cib_variant variant
Definition cib_types.h:385
char * user
Definition cib_types.h:403
int call_id
Definition cib_types.h:387
int(* dispatch)(gpointer userdata)
Dispatch function for mainloop file descriptor with data ready.
Definition mainloop.h:148
void(* destroy)(gpointer userdata)
Destroy function for mainloop file descriptor client data.
Definition mainloop.h:155
This structure contains everything that makes up a single output formatter.
mainloop_io_t * source
Wrappers for and extensions to libxml2.
void free_xml(xmlNode *child)
Definition xml.c:867
xmlNode * pcmk__xml_copy(xmlNode *parent, xmlNode *src)
Definition xml.c:883
xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
Definition xml.c:440
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
Definition xml.c:720
#define PCMK_XA_USER
Definition xml_names.h:434
#define PCMK_XA_OP
Definition xml_names.h:342
#define PCMK__XA_HIDDEN
#define PCMK__XA_CIB_NOTIFY_ACTIVATE
#define PCMK__XA_CIB_OP
#define PCMK__XA_CIB_NOTIFY_TYPE
#define PCMK__XA_CIB_CALLID
#define PCMK__XA_CIB_CLIENTID
#define PCMK__XA_PASSWORD
#define PCMK__XE_CIB_COMMAND
#define PCMK__XA_CIB_RC
#define PCMK__XA_T
#define PCMK__XE_CIB_CALLDATA