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