pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cib_remote.c
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2020 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>
25 #include <crm/msg_xml.h>
27 #include <crm/common/mainloop.h>
29 
30 #ifdef HAVE_GNUTLS_GNUTLS_H
31 # undef KEYFILE
32 # include <gnutls/gnutls.h>
33 gnutls_anon_client_credentials_t anon_cred_c;
34 
35 # define DEFAULT_CLIENT_HANDSHAKE_TIMEOUT 5000 /* 5 seconds */
36 
37 const int kx_prio[] = {
38  GNUTLS_KX_ANON_DH,
39  0
40 };
41 
42 static gboolean remote_gnutls_credentials_init = FALSE;
43 #else
44 typedef void gnutls_session_t;
45 #endif
46 
47 #include <arpa/inet.h>
48 #ifndef ON_BSD
49 # include <sgtty.h>
50 #endif
51 
52 #define DH_BITS 1024
53 
54 typedef struct cib_remote_opaque_s {
55  int flags;
56  int socket;
57  int port;
58  char *server;
59  char *user;
60  char *passwd;
61  gboolean encrypted;
62  pcmk__remote_t command;
63  pcmk__remote_t callback;
64 
66 
67 void cib_remote_connection_destroy(gpointer user_data);
68 int cib_remote_callback_dispatch(gpointer user_data);
69 int cib_remote_command_dispatch(gpointer user_data);
70 int cib_remote_signon(cib_t * cib, const char *name, enum cib_conn_type type);
71 int cib_remote_signoff(cib_t * cib);
72 int cib_remote_free(cib_t * cib);
73 
74 int cib_remote_perform_op(cib_t * cib, const char *op, const char *host, const char *section,
75  xmlNode * data, xmlNode ** output_data, int call_options,
76  const char *name);
77 
78 static int
79 cib_remote_inputfd(cib_t * cib)
80 {
81  cib_remote_opaque_t *private = cib->variant_opaque;
82 
83  return private->callback.tcp_socket;
84 }
85 
86 static int
87 cib_remote_set_connection_dnotify(cib_t * cib, void (*dnotify) (gpointer user_data))
88 {
89  return -EPROTONOSUPPORT;
90 }
91 
92 static int
93 cib_remote_register_notification(cib_t * cib, const char *callback, int enabled)
94 {
95  xmlNode *notify_msg = create_xml_node(NULL, "cib_command");
96  cib_remote_opaque_t *private = cib->variant_opaque;
97 
99  crm_xml_add(notify_msg, F_CIB_NOTIFY_TYPE, callback);
100  crm_xml_add_int(notify_msg, F_CIB_NOTIFY_ACTIVATE, enabled);
101  pcmk__remote_send_xml(&private->callback, notify_msg);
102  free_xml(notify_msg);
103  return pcmk_ok;
104 }
105 
106 cib_t *
107 cib_remote_new(const char *server, const char *user, const char *passwd, int port,
108  gboolean encrypted)
109 {
110  cib_remote_opaque_t *private = NULL;
111  cib_t *cib = cib_new_variant();
112 
113  private = calloc(1, sizeof(cib_remote_opaque_t));
114 
115  cib->variant = cib_remote;
116  cib->variant_opaque = private;
117 
118  if (server) {
119  private->server = strdup(server);
120  }
121 
122  if (user) {
123  private->user = strdup(user);
124  }
125 
126  if (passwd) {
127  private->passwd = strdup(passwd);
128  }
129 
130  private->port = port;
131  private->encrypted = encrypted;
132 
133  /* assign variant specific ops */
135  cib->cmds->signon = cib_remote_signon;
137  cib->cmds->free = cib_remote_free;
138  cib->cmds->inputfd = cib_remote_inputfd;
139 
140  cib->cmds->register_notification = cib_remote_register_notification;
141  cib->cmds->set_connection_dnotify = cib_remote_set_connection_dnotify;
142 
143  return cib;
144 }
145 
146 static int
147 cib_tls_close(cib_t * cib)
148 {
149  cib_remote_opaque_t *private = cib->variant_opaque;
150 
151 #ifdef HAVE_GNUTLS_GNUTLS_H
152  if (private->encrypted) {
153  if (private->command.tls_session) {
154  gnutls_bye(*(private->command.tls_session), GNUTLS_SHUT_RDWR);
155  gnutls_deinit(*(private->command.tls_session));
156  gnutls_free(private->command.tls_session);
157  }
158 
159  if (private->callback.tls_session) {
160  gnutls_bye(*(private->callback.tls_session), GNUTLS_SHUT_RDWR);
161  gnutls_deinit(*(private->callback.tls_session));
162  gnutls_free(private->callback.tls_session);
163  }
164  private->command.tls_session = NULL;
165  private->callback.tls_session = NULL;
166  if (remote_gnutls_credentials_init) {
167  gnutls_anon_free_client_credentials(anon_cred_c);
168  gnutls_global_deinit();
169  remote_gnutls_credentials_init = FALSE;
170  }
171  }
172 #endif
173 
174  if (private->command.tcp_socket) {
175  shutdown(private->command.tcp_socket, SHUT_RDWR); /* no more receptions */
176  close(private->command.tcp_socket);
177  }
178  if (private->callback.tcp_socket) {
179  shutdown(private->callback.tcp_socket, SHUT_RDWR); /* no more receptions */
180  close(private->callback.tcp_socket);
181  }
182  private->command.tcp_socket = 0;
183  private->callback.tcp_socket = 0;
184 
185  free(private->command.buffer);
186  free(private->callback.buffer);
187  private->command.buffer = NULL;
188  private->callback.buffer = NULL;
189 
190  return 0;
191 }
192 
193 static inline int
194 cib__tls_client_handshake(pcmk__remote_t *remote)
195 {
196  return pcmk__tls_client_handshake(remote, DEFAULT_CLIENT_HANDSHAKE_TIMEOUT);
197 }
198 
199 static int
200 cib_tls_signon(cib_t *cib, pcmk__remote_t *connection, gboolean event_channel)
201 {
202  cib_remote_opaque_t *private = cib->variant_opaque;
203  int rc;
204 
205  xmlNode *answer = NULL;
206  xmlNode *login = NULL;
207 
208  static struct mainloop_fd_callbacks cib_fd_callbacks = { 0, };
209 
210  cib_fd_callbacks.dispatch =
212  cib_fd_callbacks.destroy = cib_remote_connection_destroy;
213 
214  connection->tcp_socket = -1;
215 #ifdef HAVE_GNUTLS_GNUTLS_H
216  connection->tls_session = NULL;
217 #endif
218  rc = pcmk__connect_remote(private->server, private->port, 0, NULL,
219  &(connection->tcp_socket), NULL, NULL);
220  if (rc != pcmk_rc_ok) {
221  crm_info("Remote connection to %s:%d failed: %s " CRM_XS " rc=%d",
222  private->server, private->port, pcmk_rc_str(rc), rc);
223  return -ENOTCONN;
224  }
225 
226  if (private->encrypted) {
227  /* initialize GnuTls lib */
228 #ifdef HAVE_GNUTLS_GNUTLS_H
229  if (remote_gnutls_credentials_init == FALSE) {
230  crm_gnutls_global_init();
231  gnutls_anon_allocate_client_credentials(&anon_cred_c);
232  remote_gnutls_credentials_init = TRUE;
233  }
234 
235  /* bind the socket to GnuTls lib */
236  connection->tls_session = pcmk__new_tls_session(connection->tcp_socket,
237  GNUTLS_CLIENT,
238  GNUTLS_CRD_ANON,
239  anon_cred_c);
240  if (connection->tls_session == NULL) {
241  cib_tls_close(cib);
242  return -1;
243  }
244 
245  if (cib__tls_client_handshake(connection) != pcmk_rc_ok) {
246  crm_err("Session creation for %s:%d failed", private->server, private->port);
247 
248  gnutls_deinit(*connection->tls_session);
249  gnutls_free(connection->tls_session);
250  connection->tls_session = NULL;
251  cib_tls_close(cib);
252  return -1;
253  }
254 #else
255  return -EPROTONOSUPPORT;
256 #endif
257  }
258 
259  /* login to server */
260  login = create_xml_node(NULL, "cib_command");
261  crm_xml_add(login, "op", "authenticate");
262  crm_xml_add(login, "user", private->user);
263  crm_xml_add(login, "password", private->passwd);
264  crm_xml_add(login, "hidden", "password");
265 
266  pcmk__remote_send_xml(connection, login);
267  free_xml(login);
268 
269  rc = pcmk_ok;
270  if (pcmk__read_remote_message(connection, -1) == ENOTCONN) {
271  rc = -ENOTCONN;
272  }
273 
274  answer = pcmk__remote_message_xml(connection);
275 
276  crm_log_xml_trace(answer, "Reply");
277  if (answer == NULL) {
278  rc = -EPROTO;
279 
280  } else {
281  /* grab the token */
282  const char *msg_type = crm_element_value(answer, F_CIB_OPERATION);
283  const char *tmp_ticket = crm_element_value(answer, F_CIB_CLIENTID);
284 
285  if (safe_str_neq(msg_type, CRM_OP_REGISTER)) {
286  crm_err("Invalid registration message: %s", msg_type);
287  rc = -EPROTO;
288 
289  } else if (tmp_ticket == NULL) {
290  rc = -EPROTO;
291 
292  } else {
293  connection->token = strdup(tmp_ticket);
294  }
295  }
296  free_xml(answer);
297  answer = NULL;
298 
299  if (rc != 0) {
300  cib_tls_close(cib);
301  return rc;
302  }
303 
304  crm_trace("remote client connection established");
305  connection->source = mainloop_add_fd("cib-remote", G_PRIORITY_HIGH,
306  connection->tcp_socket, cib,
307  &cib_fd_callbacks);
308  return rc;
309 }
310 
311 void
312 cib_remote_connection_destroy(gpointer user_data)
313 {
314  crm_err("Connection destroyed");
315 #ifdef HAVE_GNUTLS_GNUTLS_H
316  cib_tls_close(user_data);
317 #endif
318  return;
319 }
320 
321 int
322 cib_remote_command_dispatch(gpointer user_data)
323 {
324  int rc;
325  cib_t *cib = user_data;
326  cib_remote_opaque_t *private = cib->variant_opaque;
327 
328  rc = pcmk__read_remote_message(&private->command, -1);
329 
330  free(private->command.buffer);
331  private->command.buffer = NULL;
332  crm_err("received late reply for remote cib connection, discarding");
333 
334  if (rc == ENOTCONN) {
335  return -1;
336  }
337  return 0;
338 }
339 
340 int
341 cib_remote_callback_dispatch(gpointer user_data)
342 {
343  int rc;
344  cib_t *cib = user_data;
345  cib_remote_opaque_t *private = cib->variant_opaque;
346 
347  xmlNode *msg = NULL;
348 
349  crm_info("Message on callback channel");
350 
351  rc = pcmk__read_remote_message(&private->callback, -1);
352 
353  msg = pcmk__remote_message_xml(&private->callback);
354  while (msg) {
355  const char *type = crm_element_value(msg, F_TYPE);
356 
357  crm_trace("Activating %s callbacks...", type);
358 
359  if (safe_str_eq(type, T_CIB)) {
360  cib_native_callback(cib, msg, 0, 0);
361 
362  } else if (safe_str_eq(type, T_CIB_NOTIFY)) {
363  g_list_foreach(cib->notify_list, cib_native_notify, msg);
364 
365  } else {
366  crm_err("Unknown message type: %s", type);
367  }
368 
369  free_xml(msg);
370  msg = pcmk__remote_message_xml(&private->callback);
371  }
372 
373  if (rc == ENOTCONN) {
374  return -1;
375  }
376 
377  return 0;
378 }
379 
380 int
381 cib_remote_signon(cib_t * cib, const char *name, enum cib_conn_type type)
382 {
383  int rc = pcmk_ok;
384  cib_remote_opaque_t *private = cib->variant_opaque;
385 
386  if (private->passwd == NULL) {
387  struct termios settings;
388 
389  rc = tcgetattr(0, &settings);
390  if(rc == 0) {
391  settings.c_lflag &= ~ECHO;
392  rc = tcsetattr(0, TCSANOW, &settings);
393  }
394 
395  if(rc == 0) {
396  fprintf(stderr, "Password: ");
397  private->passwd = calloc(1, 1024);
398  rc = scanf("%1023s", private->passwd);
399  fprintf(stderr, "\n");
400  }
401 
402  if (rc < 1) {
403  private->passwd = NULL;
404  }
405 
406  settings.c_lflag |= ECHO;
407  rc = tcsetattr(0, TCSANOW, &settings);
408  }
409 
410  if (private->server == NULL || private->user == NULL) {
411  rc = -EINVAL;
412  }
413 
414  if (rc == pcmk_ok) {
415  rc = cib_tls_signon(cib, &(private->command), FALSE);
416  }
417 
418  if (rc == pcmk_ok) {
419  rc = cib_tls_signon(cib, &(private->callback), TRUE);
420  }
421 
422  if (rc == pcmk_ok) {
423  xmlNode *hello =
424  cib_create_op(0, private->callback.token, CRM_OP_REGISTER, NULL, NULL, NULL, 0, NULL);
425  crm_xml_add(hello, F_CIB_CLIENTNAME, name);
426  pcmk__remote_send_xml(&private->command, hello);
427  free_xml(hello);
428  }
429 
430  if (rc == pcmk_ok) {
431  crm_info("Opened connection to %s:%d for %s",
432  private->server, private->port, name);
434  cib->type = cib_command;
435 
436  } else {
437  crm_info("Connection to %s:%d for %s failed: %s\n",
438  private->server, private->port, name, pcmk_strerror(rc));
439  }
440 
441  return rc;
442 }
443 
444 int
446 {
447  int rc = pcmk_ok;
448 
449  /* cib_remote_opaque_t *private = cib->variant_opaque; */
450 
451  crm_debug("Disconnecting from the CIB manager");
452 #ifdef HAVE_GNUTLS_GNUTLS_H
453  cib_tls_close(cib);
454 #endif
455 
456  cib->state = cib_disconnected;
457  cib->type = cib_no_connection;
458 
459  return rc;
460 }
461 
462 int
464 {
465  int rc = pcmk_ok;
466 
467  crm_warn("Freeing CIB");
468  if (cib->state != cib_disconnected) {
469  rc = cib_remote_signoff(cib);
470  if (rc == pcmk_ok) {
471  cib_remote_opaque_t *private = cib->variant_opaque;
472 
473  free(private->server);
474  free(private->user);
475  free(private->passwd);
476  free(cib->cmds);
477  free(private);
478  free(cib);
479  }
480  }
481 
482  return rc;
483 }
484 
485 int
486 cib_remote_perform_op(cib_t * cib, const char *op, const char *host, const char *section,
487  xmlNode * data, xmlNode ** output_data, int call_options, const char *name)
488 {
489  int rc;
490  int remaining_time = 0;
491  time_t start_time;
492 
493  xmlNode *op_msg = NULL;
494  xmlNode *op_reply = NULL;
495 
496  cib_remote_opaque_t *private = cib->variant_opaque;
497 
498  if (cib->state == cib_disconnected) {
499  return -ENOTCONN;
500  }
501 
502  if (output_data != NULL) {
503  *output_data = NULL;
504  }
505 
506  if (op == NULL) {
507  crm_err("No operation specified");
508  return -EINVAL;
509  }
510 
511  cib->call_id++;
512  /* prevent call_id from being negative (or zero) and conflicting
513  * with the cib_errors enum
514  * use 2 because we use it as (cib->call_id - 1) below
515  */
516  if (cib->call_id < 1) {
517  cib->call_id = 1;
518  }
519 
520  op_msg =
521  cib_create_op(cib->call_id, private->callback.token, op, host, section, data, call_options,
522  NULL);
523  if (op_msg == NULL) {
524  return -EPROTO;
525  }
526 
527  crm_trace("Sending %s message to the CIB manager", op);
528  if (!(call_options & cib_sync_call)) {
529  pcmk__remote_send_xml(&private->callback, op_msg);
530  } else {
531  pcmk__remote_send_xml(&private->command, op_msg);
532  }
533  free_xml(op_msg);
534 
535  if ((call_options & cib_discard_reply)) {
536  crm_trace("Discarding reply");
537  return pcmk_ok;
538 
539  } else if (!(call_options & cib_sync_call)) {
540  return cib->call_id;
541  }
542 
543  crm_trace("Waiting for a synchronous reply");
544 
545  start_time = time(NULL);
546  remaining_time = cib->call_timeout ? cib->call_timeout : 60;
547 
548  rc = pcmk_rc_ok;
549  while (remaining_time > 0 && (rc != ENOTCONN)) {
550  int reply_id = -1;
551  int msg_id = cib->call_id;
552 
553  rc = pcmk__read_remote_message(&private->command,
554  remaining_time * 1000);
555  op_reply = pcmk__remote_message_xml(&private->command);
556 
557  if (!op_reply) {
558  break;
559  }
560 
561  crm_element_value_int(op_reply, F_CIB_CALLID, &reply_id);
562 
563  if (reply_id == msg_id) {
564  break;
565 
566  } else if (reply_id < msg_id) {
567  crm_debug("Received old reply: %d (wanted %d)", reply_id, msg_id);
568  crm_log_xml_trace(op_reply, "Old reply");
569 
570  } else if ((reply_id - 10000) > msg_id) {
571  /* wrap-around case */
572  crm_debug("Received old reply: %d (wanted %d)", reply_id, msg_id);
573  crm_log_xml_trace(op_reply, "Old reply");
574  } else {
575  crm_err("Received a __future__ reply:" " %d (wanted %d)", reply_id, msg_id);
576  }
577 
578  free_xml(op_reply);
579  op_reply = NULL;
580 
581  /* wasn't the right reply, try and read some more */
582  remaining_time = time(NULL) - start_time;
583  }
584 
585  /* if(IPC_ISRCONN(native->command_channel) == FALSE) { */
586  /* crm_err("The CIB manager disconnected: %d", */
587  /* native->command_channel->ch_status); */
588  /* cib->state = cib_disconnected; */
589  /* } */
590 
591  if (rc == ENOTCONN) {
592  crm_err("Disconnected while waiting for reply.");
593  return -ENOTCONN;
594  } else if (op_reply == NULL) {
595  crm_err("No reply message - empty");
596  return -ENOMSG;
597  }
598 
599  crm_trace("Synchronous reply received");
600 
601  /* Start processing the reply... */
602  if (crm_element_value_int(op_reply, F_CIB_RC, &rc) != 0) {
603  rc = -EPROTO;
604  }
605 
606  if (rc == -pcmk_err_diff_resync) {
607  /* This is an internal value that clients do not and should not care about */
608  rc = pcmk_ok;
609  }
610 
611  if (rc == pcmk_ok || rc == -EPERM) {
612  crm_log_xml_debug(op_reply, "passed");
613 
614  } else {
615 /* } else if(rc == -ETIME) { */
616  crm_err("Call failed: %s", pcmk_strerror(rc));
617  crm_log_xml_warn(op_reply, "failed");
618  }
619 
620  if (output_data == NULL) {
621  /* do nothing more */
622 
623  } else if (!(call_options & cib_discard_reply)) {
624  xmlNode *tmp = get_message_xml(op_reply, F_CIB_CALLDATA);
625 
626  if (tmp == NULL) {
627  crm_trace("No output in reply to \"%s\" command %d", op, cib->call_id - 1);
628  } else {
629  *output_data = copy_xml(tmp);
630  }
631  }
632 
633  free_xml(op_reply);
634 
635  return rc;
636 }
int pcmk__remote_send_xml(pcmk__remote_t *remote, xmlNode *msg)
Definition: remote.c:501
A dumping ground.
#define F_TYPE
Definition: msg_xml.h:30
xmlNode * get_message_xml(xmlNode *msg, const char *field)
Definition: xml.c:2619
const char * pcmk_strerror(int rc)
Definition: results.c:55
gboolean safe_str_neq(const char *a, const char *b)
Definition: strings.c:263
mainloop_io_t * mainloop_add_fd(const char *name, int priority, int fd, void *userdata, struct mainloop_fd_callbacks *callbacks)
Definition: mainloop.c:881
cib_t * cib_remote_new(const char *server, const char *user, const char *passwd, int port, gboolean encrypted)
Definition: cib_remote.c:107
void cib_remote_connection_destroy(gpointer user_data)
Definition: cib_remote.c:312
int call_timeout
Definition: cib_types.h:140
int(* free)(cib_t *cib)
Definition: cib_types.h:77
int cib_remote_command_dispatch(gpointer user_data)
Definition: cib_remote.c:322
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:424
int(* inputfd)(cib_t *cib)
Definition: cib_types.h:89
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:316
int(* dispatch)(gpointer userdata)
Definition: mainloop.h:115
AIS_Host host
Definition: internal.h:84
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition: cib_types.h:87
const char * pcmk_rc_str(int rc)
Get a user-friendly description of a return code.
Definition: results.c:413
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
Definition: nvpair.c:558
Wrappers for and extensions to glib mainloop.
#define CRM_OP_REGISTER
Definition: crm.h:142
#define F_CIB_NOTIFY_ACTIVATE
Definition: internal.h:54
xmlNode * cib_create_op(int call_id, const char *token, const char *op, const char *host, const char *section, xmlNode *data, int call_options, const char *user_name)
Definition: cib_utils.c:499
void cib_native_notify(gpointer data, gpointer user_data)
Definition: cib_utils.c:581
xmlNode * copy_xml(xmlNode *src_node)
Definition: xml.c:2142
cib_t * cib_new_variant(void)
Definition: cib_client.c:345
#define crm_warn(fmt, args...)
Definition: logging.h:364
int rc
Definition: pcmk_fence.c:34
cib_api_operations_t * cmds
Definition: cib_types.h:147
#define crm_debug(fmt, args...)
Definition: logging.h:368
int cib_remote_callback_dispatch(gpointer user_data)
Definition: cib_remote.c:341
#define F_CIB_RC
Definition: internal.h:40
cib_conn_type
Definition: cib_types.h:42
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
Definition: nvpair.c:522
void(* destroy)(gpointer userdata)
Definition: mainloop.h:116
#define F_CIB_OPERATION
Definition: internal.h:36
void gnutls_session_t
Definition: cib_remote.c:44
#define F_CIB_CLIENTNAME
Definition: internal.h:52
#define crm_trace(fmt, args...)
Definition: logging.h:369
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition: cib_types.h:119
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:1076
#define crm_log_xml_debug(xml, text)
Definition: logging.h:376
struct cib_remote_opaque_s cib_remote_opaque_t
xmlNode * create_xml_node(xmlNode *parent, const char *name)
Definition: xml.c:1976
#define crm_log_xml_warn(xml, text)
Definition: logging.h:373
int cib_remote_free(cib_t *cib)
Definition: cib_remote.c:463
void free_xml(xmlNode *child)
Definition: xml.c:2136
#define T_CIB
Definition: internal.h:61
void * variant_opaque
Definition: cib_types.h:141
mainloop_io_t * source
Definition: ipcs_internal.h:44
#define F_CIB_NOTIFY_TYPE
Definition: internal.h:53
#define T_CIB_NOTIFY
Definition: internal.h:62
#define CRM_XS
Definition: logging.h:54
#define pcmk_err_diff_resync
Definition: results.h:76
#define F_CIB_CALLDATA
Definition: internal.h:35
#define crm_err(fmt, args...)
Definition: logging.h:363
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition: cib_types.h:73
char data[0]
Definition: internal.h:90
enum cib_variant variant
Definition: cib_types.h:137
#define pcmk_ok
Definition: results.h:67
void cib_native_callback(cib_t *cib, xmlNode *msg, int call_id, int rc)
Definition: cib_utils.c:534
int call_id
Definition: cib_types.h:139
#define F_CIB_CLIENTID
Definition: internal.h:32
#define crm_log_xml_trace(xml, text)
Definition: logging.h:377
#define F_CIB_CALLID
Definition: internal.h:34
int(* signoff)(cib_t *cib)
Definition: cib_types.h:76
int cib_remote_perform_op(cib_t *cib, const char *op, const char *host, const char *section, xmlNode *data, xmlNode **output_data, int call_options, const char *name)
Definition: cib_remote.c:486
int cib_remote_signoff(cib_t *cib)
Definition: cib_remote.c:445
int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms)
Definition: remote.c:804
#define safe_str_eq(a, b)
Definition: util.h:65
enum cib_conn_type type
Definition: cib_types.h:136
char * name
Definition: pcmk_fence.c:30
enum cib_state state
Definition: cib_types.h:135
GList * notify_list
Definition: cib_types.h:144
#define crm_info(fmt, args...)
Definition: logging.h:366
uint64_t flags
Definition: remote.c:149
xmlNode * pcmk__remote_message_xml(pcmk__remote_t *remote)
Definition: remote.c:553
void * delegate_fn
Definition: cib_types.h:142
enum crm_ais_msg_types type
Definition: internal.h:83
int cib_remote_signon(cib_t *cib, const char *name, enum cib_conn_type type)
Definition: cib_remote.c:381