pacemaker  2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
cib_native.c
Go to the documentation of this file.
1 /*
2  * Copyright 2004 International Business Machines
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 #ifndef _GNU_SOURCE
11 # define _GNU_SOURCE
12 #endif
13 
14 #include <errno.h>
15 #include <crm_internal.h>
16 #include <unistd.h>
17 #include <stdlib.h>
18 #include <stdio.h>
19 #include <stdarg.h>
20 #include <string.h>
21 
22 #include <glib.h>
23 
24 #include <crm/crm.h>
25 #include <crm/cib/internal.h>
26 
27 #include <crm/msg_xml.h>
28 #include <crm/common/mainloop.h>
29 
30 typedef struct cib_native_opaque_s {
31  char *token;
32  crm_ipc_t *ipc;
33  void (*dnotify_fn) (gpointer user_data);
34  mainloop_io_t *source;
35 
37 
38 int cib_native_perform_op(cib_t * cib, const char *op, const char *host, const char *section,
39  xmlNode * data, xmlNode ** output_data, int call_options);
40 
41 int cib_native_perform_op_delegate(cib_t * cib, const char *op, const char *host,
42  const char *section, xmlNode * data, xmlNode ** output_data,
43  int call_options, const char *user_name);
44 
45 int cib_native_free(cib_t * cib);
46 int cib_native_signoff(cib_t * cib);
47 int cib_native_signon(cib_t * cib, const char *name, enum cib_conn_type type);
48 int cib_native_signon_raw(cib_t * cib, const char *name, enum cib_conn_type type, int *event_fd);
49 
50 bool cib_native_dispatch(cib_t * cib);
51 
52 int cib_native_set_connection_dnotify(cib_t * cib, void (*dnotify) (gpointer user_data));
53 
54 cib_t *
56 {
57  cib_native_opaque_t *native = NULL;
58  cib_t *cib = cib_new_variant();
59 
60  native = calloc(1, sizeof(cib_native_opaque_t));
61 
62  cib->variant = cib_native;
63  cib->variant_opaque = native;
64 
65  native->ipc = NULL;
66  native->source = NULL;
67  native->dnotify_fn = NULL;
68 
69  /* assign variant specific ops */
74  cib->cmds->free = cib_native_free;
75 
78 
79  return cib;
80 }
81 
82 int
83 cib_native_signon(cib_t * cib, const char *name, enum cib_conn_type type)
84 {
85  return cib_native_signon_raw(cib, name, type, NULL);
86 }
87 
88 static int
89 cib_native_dispatch_internal(const char *buffer, ssize_t length, gpointer userdata)
90 {
91  const char *type = NULL;
92  xmlNode *msg = NULL;
93 
94  cib_t *cib = userdata;
95 
96  crm_trace("dispatching %p", userdata);
97 
98  if (cib == NULL) {
99  crm_err("No CIB!");
100  return 0;
101  }
102 
103  msg = string2xml(buffer);
104 
105  if (msg == NULL) {
106  crm_warn("Received a NULL message from the CIB manager");
107  return 0;
108  }
109 
110  /* do callbacks */
111  type = crm_element_value(msg, F_TYPE);
112  crm_trace("Activating %s callbacks...", type);
113  crm_log_xml_explicit(msg, "cib-reply");
114 
115  if (safe_str_eq(type, T_CIB)) {
116  cib_native_callback(cib, msg, 0, 0);
117 
118  } else if (safe_str_eq(type, T_CIB_NOTIFY)) {
119  g_list_foreach(cib->notify_list, cib_native_notify, msg);
120 
121  } else {
122  crm_err("Unknown message type: %s", type);
123  }
124 
125  free_xml(msg);
126  return 0;
127 }
128 
129 bool
131 {
132  gboolean stay_connected = TRUE;
133  cib_native_opaque_t *native;
134 
135  if (cib == NULL) {
136  crm_err("No CIB!");
137  return FALSE;
138  }
139 
140  crm_trace("dispatching %p", cib);
141  native = cib->variant_opaque;
142  while (crm_ipc_ready(native->ipc)) {
143 
144  if (crm_ipc_read(native->ipc) > 0) {
145  const char *msg = crm_ipc_buffer(native->ipc);
146 
147  cib_native_dispatch_internal(msg, strlen(msg), cib);
148  }
149 
150  if (crm_ipc_connected(native->ipc) == FALSE) {
151  crm_err("Connection closed");
152  stay_connected = FALSE;
153  }
154  }
155 
156  return stay_connected;
157 }
158 
159 static void
160 cib_native_destroy(void *userdata)
161 {
162  cib_t *cib = userdata;
163  cib_native_opaque_t *native = cib->variant_opaque;
164 
165  crm_trace("destroying %p", userdata);
166  cib->state = cib_disconnected;
167  native->source = NULL;
168  native->ipc = NULL;
169 
170  if (native->dnotify_fn) {
171  native->dnotify_fn(userdata);
172  }
173 }
174 
175 int
176 cib_native_signon_raw(cib_t * cib, const char *name, enum cib_conn_type type, int *async_fd)
177 {
178  int rc = pcmk_ok;
179  const char *channel = NULL;
180  cib_native_opaque_t *native = cib->variant_opaque;
181 
182  static struct ipc_client_callbacks cib_callbacks = {
183  .dispatch = cib_native_dispatch_internal,
184  .destroy = cib_native_destroy
185  };
186 
188 
189  if (type == cib_command) {
191  channel = CIB_CHANNEL_RW;
192 
193  } else if (type == cib_command_nonblocking) {
195  channel = CIB_CHANNEL_SHM;
196 
197  } else if (type == cib_query) {
198  cib->state = cib_connected_query;
199  channel = CIB_CHANNEL_RO;
200 
201  } else {
202  return -ENOTCONN;
203  }
204 
205  crm_trace("Connecting %s channel", channel);
206 
207  if (async_fd != NULL) {
208  native->ipc = crm_ipc_new(channel, 0);
209 
210  if (native->ipc && crm_ipc_connect(native->ipc)) {
211  *async_fd = crm_ipc_get_fd(native->ipc);
212 
213  } else if (native->ipc) {
214  crm_perror(LOG_ERR, "Connection to cluster information base failed");
215  rc = -ENOTCONN;
216  }
217 
218  } else {
219  native->source =
220  mainloop_add_ipc_client(channel, G_PRIORITY_HIGH, 512 * 1024 /* 512k */ , cib,
221  &cib_callbacks);
222  native->ipc = mainloop_get_ipc_client(native->source);
223  }
224 
225  if (rc != pcmk_ok || native->ipc == NULL || crm_ipc_connected(native->ipc) == FALSE) {
226  crm_debug("Connection unsuccessful (%d %p)", rc, native->ipc);
227  rc = -ENOTCONN;
228  }
229 
230  if (rc == pcmk_ok) {
231  xmlNode *reply = NULL;
232  xmlNode *hello = create_xml_node(NULL, "cib_command");
233 
234  crm_xml_add(hello, F_TYPE, T_CIB);
236  crm_xml_add(hello, F_CIB_CLIENTNAME, name);
238 
239  if (crm_ipc_send(native->ipc, hello, crm_ipc_client_response, -1, &reply) > 0) {
240  const char *msg_type = crm_element_value(reply, F_CIB_OPERATION);
241 
242  rc = pcmk_ok;
243  crm_log_xml_trace(reply, "reg-reply");
244 
245  if (safe_str_neq(msg_type, CRM_OP_REGISTER)) {
246  crm_err("Invalid registration message: %s", msg_type);
247  rc = -EPROTO;
248 
249  } else {
250  native->token = crm_element_value_copy(reply, F_CIB_CLIENTID);
251  if (native->token == NULL) {
252  rc = -EPROTO;
253  }
254  }
255  free_xml(reply);
256 
257  } else {
258  rc = -ECOMM;
259  }
260 
261  free_xml(hello);
262  }
263 
264  if (rc == pcmk_ok) {
265  crm_debug("Connection to CIB manager successful");
266  return pcmk_ok;
267  }
268 
269  crm_debug("Connection to CIB manager failed: %s", pcmk_strerror(rc));
270  cib_native_signoff(cib);
271  return rc;
272 }
273 
274 int
276 {
277  cib_native_opaque_t *native = cib->variant_opaque;
278 
279  crm_debug("Disconnecting from the CIB manager");
280 
281  if (native->source != NULL) {
282  /* Attached to mainloop */
283  mainloop_del_ipc_client(native->source);
284  native->source = NULL;
285  native->ipc = NULL;
286 
287  } else if (native->ipc) {
288  /* Not attached to mainloop */
289  crm_ipc_t *ipc = native->ipc;
290 
291  native->ipc = NULL;
292  crm_ipc_close(ipc);
293  crm_ipc_destroy(ipc);
294  }
295 
296  cib->state = cib_disconnected;
297  cib->type = cib_no_connection;
298 
299  return pcmk_ok;
300 }
301 
302 int
304 {
305  int rc = pcmk_ok;
306 
307  if (cib->state != cib_disconnected) {
308  rc = cib_native_signoff(cib);
309  }
310 
311  if (cib->state == cib_disconnected) {
312  cib_native_opaque_t *native = cib->variant_opaque;
313 
314  free(native->token);
315  free(cib->variant_opaque);
316  free(cib->cmds);
317  free(cib);
318  }
319 
320  return rc;
321 }
322 
323 int
324 cib_native_perform_op(cib_t * cib, const char *op, const char *host, const char *section,
325  xmlNode * data, xmlNode ** output_data, int call_options)
326 {
327  return cib_native_perform_op_delegate(cib, op, host, section,
328  data, output_data, call_options, NULL);
329 }
330 
331 int
332 cib_native_perform_op_delegate(cib_t * cib, const char *op, const char *host, const char *section,
333  xmlNode * data, xmlNode ** output_data, int call_options,
334  const char *user_name)
335 {
336  int rc = pcmk_ok;
337  int reply_id = 0;
338  enum crm_ipc_flags ipc_flags = crm_ipc_flags_none;
339 
340  xmlNode *op_msg = NULL;
341  xmlNode *op_reply = NULL;
342 
343  cib_native_opaque_t *native = cib->variant_opaque;
344 
345  if (cib->state == cib_disconnected) {
346  return -ENOTCONN;
347  }
348 
349  if (output_data != NULL) {
350  *output_data = NULL;
351  }
352 
353  if (op == NULL) {
354  crm_err("No operation specified");
355  return -EINVAL;
356  }
357 
358  if (call_options & cib_sync_call) {
359  ipc_flags |= crm_ipc_client_response;
360  }
361 
362  cib->call_id++;
363  /* prevent call_id from being negative (or zero) and conflicting
364  * with the cib_errors enum
365  * use 2 because we use it as (cib->call_id - 1) below
366  */
367  if (cib->call_id < 1) {
368  cib->call_id = 1;
369  }
370 
371  CRM_CHECK(native->token != NULL,;
372  );
373  op_msg =
374  cib_create_op(cib->call_id, native->token, op, host, section, data, call_options,
375  user_name);
376  if (op_msg == NULL) {
377  return -EPROTO;
378  }
379 
380  crm_trace("Sending %s message to the CIB manager (timeout=%ds)", op, cib->call_timeout);
381  rc = crm_ipc_send(native->ipc, op_msg, ipc_flags, cib->call_timeout * 1000, &op_reply);
382  free_xml(op_msg);
383 
384  if (rc < 0) {
385  crm_err("Couldn't perform %s operation (timeout=%ds): %s (%d)", op,
386  cib->call_timeout, pcmk_strerror(rc), rc);
387  rc = -ECOMM;
388  goto done;
389  }
390 
391  crm_log_xml_trace(op_reply, "Reply");
392 
393  if (!(call_options & cib_sync_call)) {
394  crm_trace("Async call, returning %d", cib->call_id);
395  CRM_CHECK(cib->call_id != 0, return -ENOMSG);
396  free_xml(op_reply);
397  return cib->call_id;
398  }
399 
400  rc = pcmk_ok;
401  crm_element_value_int(op_reply, F_CIB_CALLID, &reply_id);
402  if (reply_id == cib->call_id) {
403  xmlNode *tmp = get_message_xml(op_reply, F_CIB_CALLDATA);
404 
405  crm_trace("Synchronous reply %d received", reply_id);
406  if (crm_element_value_int(op_reply, F_CIB_RC, &rc) != 0) {
407  rc = -EPROTO;
408  }
409 
410  if (output_data == NULL || (call_options & cib_discard_reply)) {
411  crm_trace("Discarding reply");
412 
413  } else if (tmp != NULL) {
414  *output_data = copy_xml(tmp);
415  }
416 
417  } else if (reply_id <= 0) {
418  crm_err("Received bad reply: No id set");
419  crm_log_xml_err(op_reply, "Bad reply");
420  rc = -ENOMSG;
421  goto done;
422 
423  } else {
424  crm_err("Received bad reply: %d (wanted %d)", reply_id, cib->call_id);
425  crm_log_xml_err(op_reply, "Old reply");
426  rc = -ENOMSG;
427  goto done;
428  }
429 
430  if (op_reply == NULL && cib->state == cib_disconnected) {
431  rc = -ENOTCONN;
432 
433  } else if (rc == pcmk_ok && op_reply == NULL) {
434  rc = -ETIME;
435  }
436 
437  switch (rc) {
438  case pcmk_ok:
439  case -EPERM:
440  break;
441 
442  /* This is an internal value that clients do not and should not care about */
443  case -pcmk_err_diff_resync:
444  rc = pcmk_ok;
445  break;
446 
447  /* These indicate internal problems */
448  case -EPROTO:
449  case -ENOMSG:
450  crm_err("Call failed: %s", pcmk_strerror(rc));
451  if (op_reply) {
452  crm_log_xml_err(op_reply, "Invalid reply");
453  }
454  break;
455 
456  default:
457  if (safe_str_neq(op, CIB_OP_QUERY)) {
458  crm_warn("Call failed: %s", pcmk_strerror(rc));
459  }
460  }
461 
462  done:
463  if (crm_ipc_connected(native->ipc) == FALSE) {
464  crm_err("The CIB manager disconnected");
465  cib->state = cib_disconnected;
466  }
467 
468  free_xml(op_reply);
469  return rc;
470 }
471 
472 int
473 cib_native_set_connection_dnotify(cib_t * cib, void (*dnotify) (gpointer user_data))
474 {
475  cib_native_opaque_t *native = NULL;
476 
477  if (cib == NULL) {
478  crm_err("No CIB!");
479  return FALSE;
480  }
481 
482  native = cib->variant_opaque;
483  native->dnotify_fn = dnotify;
484 
485  return pcmk_ok;
486 }
487 
488 int
489 cib_native_register_notification(cib_t * cib, const char *callback, int enabled)
490 {
491  int rc = pcmk_ok;
492  xmlNode *notify_msg = create_xml_node(NULL, "cib-callback");
493  cib_native_opaque_t *native = cib->variant_opaque;
494 
495  if (cib->state != cib_disconnected) {
497  crm_xml_add(notify_msg, F_CIB_NOTIFY_TYPE, callback);
498  crm_xml_add_int(notify_msg, F_CIB_NOTIFY_ACTIVATE, enabled);
499  rc = crm_ipc_send(native->ipc, notify_msg, crm_ipc_client_response,
500  1000 * cib->call_timeout, NULL);
501  if (rc <= 0) {
502  crm_trace("Notification not registered: %d", rc);
503  rc = -ECOMM;
504  }
505  }
506 
507  free_xml(notify_msg);
508  return rc;
509 }
F_CIB_CALLID
#define F_CIB_CALLID
Definition: internal.h:34
cib_s::call_timeout
int call_timeout
Definition: cib_types.h:140
crm_ipc_connect
bool crm_ipc_connect(crm_ipc_t *client)
Establish an IPC connection to a Pacemaker component.
Definition: ipc.c:956
cib_no_connection
Definition: cib_types.h:45
cib_connected_query
Definition: cib_types.h:38
cib_native_set_connection_dnotify
int cib_native_set_connection_dnotify(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition: cib_native.c:473
cib_s::cmds
cib_api_operations_t * cmds
Definition: cib_types.h:147
msg_xml.h
cib_native_signon_raw
int cib_native_signon_raw(cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
Definition: cib_native.c:176
cib_api_operations_s::signoff
int(* signoff)(cib_t *cib)
Definition: cib_types.h:76
cib_native_free
int cib_native_free(cib_t *cib)
Definition: cib_native.c:303
cib_api_operations_s::free
int(* free)(cib_t *cib)
Definition: cib_types.h:77
data
char data[0]
Definition: internal.h:90
cib_conn_type
cib_conn_type
Definition: cib_types.h:42
crm_element_value_int
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
Definition: nvpair.c:555
crm_ipc_close
void crm_ipc_close(crm_ipc_t *client)
Definition: ipc.c:1024
cib_query
Definition: cib_types.h:44
mainloop_get_ipc_client
crm_ipc_t * mainloop_get_ipc_client(mainloop_io_t *client)
Definition: mainloop.c:932
create_xml_node
xmlNode * create_xml_node(xmlNode *parent, const char *name)
Definition: xml.c:1970
cib_native_signon
int cib_native_signon(cib_t *cib, const char *name, enum cib_conn_type type)
Definition: cib_native.c:83
pcmk_strerror
const char * pcmk_strerror(int rc)
Definition: results.c:188
cib_native_notify
void cib_native_notify(gpointer data, gpointer user_data)
Definition: cib_utils.c:581
CRM_CHECK
#define CRM_CHECK(expr, failure_action)
Definition: logging.h:157
copy_xml
xmlNode * copy_xml(xmlNode *src_node)
Definition: xml.c:2136
cib_api_operations_s::register_notification
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition: cib_types.h:119
cib_native_dispatch
bool cib_native_dispatch(cib_t *cib)
Definition: cib_native.c:130
crm_ipc_ready
int crm_ipc_ready(crm_ipc_t *client)
Check whether an IPC connection is ready to be read.
Definition: ipc.c:1108
type
enum crm_ais_msg_types type
Definition: internal.h:83
crm_err
#define crm_err(fmt, args...)
Definition: logging.h:241
crm_ipc_send
int crm_ipc_send(crm_ipc_t *client, xmlNode *message, enum crm_ipc_flags flags, int32_t ms_timeout, xmlNode **reply)
Definition: ipc.c:1321
crm_trace
#define crm_trace(fmt, args...)
Definition: logging.h:247
safe_str_eq
#define safe_str_eq(a, b)
Definition: util.h:61
cib_native_signoff
int cib_native_signoff(cib_t *cib)
Definition: cib_native.c:275
cib_sync_call
Definition: cib_types.h:61
crm_warn
#define crm_warn(fmt, args...)
Definition: logging.h:242
CIB_CHANNEL_RO
#define CIB_CHANNEL_RO
Definition: internal.h:69
crm_ipc_flags
crm_ipc_flags
Definition: ipc.h:39
free_xml
void free_xml(xmlNode *child)
Definition: xml.c:2130
F_CIB_CLIENTNAME
#define F_CIB_CLIENTNAME
Definition: internal.h:52
crm_ipc_buffer
const char * crm_ipc_buffer(crm_ipc_t *client)
Definition: ipc.c:1218
crm_ipc_destroy
void crm_ipc_destroy(crm_ipc_t *client)
Definition: ipc.c:1039
crm_ipc_flags_none
Definition: ipc.h:41
cib_new_variant
cib_t * cib_new_variant(void)
Definition: cib_client.c:343
crm_ipc_get_fd
int crm_ipc_get_fd(crm_ipc_t *client)
Definition: ipc.c:1062
internal.h
mainloop.h
Wrappers for and extensions to glib mainloop.
F_CIB_RC
#define F_CIB_RC
Definition: internal.h:40
CRM_OP_REGISTER
#define CRM_OP_REGISTER
Definition: crm.h:142
cib_native_perform_op_delegate
int cib_native_perform_op_delegate(cib_t *cib, const char *op, const char *host, const char *section, xmlNode *data, xmlNode **output_data, int call_options, const char *user_name)
Definition: cib_native.c:332
cib_s::variant_opaque
void * variant_opaque
Definition: cib_types.h:141
cib_connected_command
Definition: cib_types.h:37
ECOMM
#define ECOMM
Definition: portability.h:138
crm_log_xml_explicit
#define crm_log_xml_explicit(xml, text)
Definition: logging.h:257
crm_ipc_connected
bool crm_ipc_connected(crm_ipc_t *client)
Definition: ipc.c:1076
T_CIB
#define T_CIB
Definition: internal.h:61
crm_ipc_new
crm_ipc_t * crm_ipc_new(const char *name, size_t max_size)
Definition: ipc.c:926
F_CIB_NOTIFY_ACTIVATE
#define F_CIB_NOTIFY_ACTIVATE
Definition: internal.h:54
crm_debug
#define crm_debug(fmt, args...)
Definition: logging.h:246
cib_create_op
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
CIB_OP_QUERY
#define CIB_OP_QUERY
Definition: internal.h:22
string2xml
xmlNode * string2xml(const char *input)
Definition: xml.c:2174
cib_s::notify_list
GList * notify_list
Definition: cib_types.h:144
cib_native_new
cib_t * cib_native_new(void)
Definition: cib_native.c:55
pcmk_err_diff_resync
#define pcmk_err_diff_resync
Definition: results.h:66
ipc_client_callbacks
Definition: mainloop.h:74
cib_command_nonblocking
Definition: cib_types.h:46
cib_native_perform_op
int cib_native_perform_op(cib_t *cib, const char *op, const char *host, const char *section, xmlNode *data, xmlNode **output_data, int call_options)
Definition: cib_native.c:324
get_message_xml
xmlNode * get_message_xml(xmlNode *msg, const char *field)
Definition: xml.c:2610
crm_log_xml_trace
#define crm_log_xml_trace(xml, text)
Definition: logging.h:255
crm_xml_add
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:313
MAX_IPC_DELAY
#define MAX_IPC_DELAY
Definition: crm.h:78
cib_s::delegate_fn
void * delegate_fn
Definition: cib_types.h:142
cib_s::variant
enum cib_variant variant
Definition: cib_types.h:137
crm_element_value
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
Definition: nvpair.c:519
F_CIB_OPERATION
#define F_CIB_OPERATION
Definition: internal.h:36
T_CIB_NOTIFY
#define T_CIB_NOTIFY
Definition: internal.h:62
cib_api_operations_s::signon_raw
int(* signon_raw)(cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
Definition: cib_types.h:74
cib_api_operations_s::set_connection_dnotify
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition: cib_types.h:87
cib_native_register_notification
int cib_native_register_notification(cib_t *cib, const char *callback, int enabled)
Definition: cib_native.c:489
cib_disconnected
Definition: cib_types.h:39
F_CIB_CALLDATA
#define F_CIB_CALLDATA
Definition: internal.h:35
crm_perror
#define crm_perror(level, fmt, args...)
Log a system error message.
Definition: logging.h:219
host
AIS_Host host
Definition: internal.h:84
F_CIB_NOTIFY_TYPE
#define F_CIB_NOTIFY_TYPE
Definition: internal.h:53
safe_str_neq
gboolean safe_str_neq(const char *a, const char *b)
Definition: strings.c:161
cib_s::call_id
int call_id
Definition: cib_types.h:139
mainloop_io_t
struct mainloop_io_s mainloop_io_t
Definition: mainloop.h:32
mainloop_del_ipc_client
void mainloop_del_ipc_client(mainloop_io_t *client)
Definition: mainloop.c:926
crm_log_xml_err
#define crm_log_xml_err(xml, text)
Definition: logging.h:250
crm_xml_add_int
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:421
F_TYPE
#define F_TYPE
Definition: msg_xml.h:30
ETIME
#define ETIME
Definition: portability.h:162
CIB_CHANNEL_RW
#define CIB_CHANNEL_RW
Definition: internal.h:70
F_CIB_CALLOPTS
#define F_CIB_CALLOPTS
Definition: internal.h:33
cib_native
Definition: cib_types.h:30
cib_native_opaque_t
struct cib_native_opaque_s cib_native_opaque_t
cib_s::type
enum cib_conn_type type
Definition: cib_types.h:136
crm_element_value_copy
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
Definition: nvpair.c:709
cib_s
Definition: cib_types.h:134
cib_s::state
enum cib_state state
Definition: cib_types.h:135
F_CIB_CLIENTID
#define F_CIB_CLIENTID
Definition: internal.h:32
ipc_client_callbacks::dispatch
int(* dispatch)(const char *buffer, ssize_t length, gpointer userdata)
Definition: mainloop.h:75
cib_api_operations_s::signon
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition: cib_types.h:73
cib_native_callback
void cib_native_callback(cib_t *cib, xmlNode *msg, int call_id, int rc)
Definition: cib_utils.c:534
crm_ipc_client_response
Definition: ipc.h:46
CIB_CHANNEL_SHM
#define CIB_CHANNEL_SHM
Definition: internal.h:71
crm_ipc_t
struct crm_ipc_s crm_ipc_t
Definition: ipc.h:58
mainloop_add_ipc_client
mainloop_io_t * mainloop_add_ipc_client(const char *name, int priority, size_t max_size, void *userdata, struct ipc_client_callbacks *callbacks)
Definition: mainloop.c:898
cib_discard_reply
Definition: cib_types.h:55
crm_internal.h
crm.h
A dumping ground.
cib_command
Definition: cib_types.h:43
pcmk_ok
#define pcmk_ok
Definition: results.h:57
crm_ipc_read
long crm_ipc_read(crm_ipc_t *client)
Definition: ipc.c:1171