corosync  3.0.4
exec/cfg.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005-2006 MontaVista Software, Inc.
3  * Copyright (c) 2006-2018 Red Hat, Inc.
4  *
5  * All rights reserved.
6  *
7  * Author: Steven Dake (sdake@redhat.com)
8  *
9  * This software licensed under BSD license, the text of which follows:
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met:
13  *
14  * - Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  * - Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  * - Neither the name of the MontaVista Software, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived from this
21  * software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33  * THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #include <config.h>
37 
38 #include <sys/types.h>
39 #include <sys/uio.h>
40 #include <sys/socket.h>
41 #include <sys/un.h>
42 #include <netinet/in.h>
43 #include <arpa/inet.h>
44 #include <unistd.h>
45 #include <fcntl.h>
46 #include <stdlib.h>
47 #include <stdio.h>
48 #include <limits.h>
49 #include <errno.h>
50 #include <string.h>
51 #include <assert.h>
52 
53 #include <corosync/corotypes.h>
54 #include <qb/qbipc_common.h>
55 #include <corosync/cfg.h>
56 #include <qb/qblist.h>
57 #include <corosync/mar_gen.h>
58 #include <corosync/totem/totemip.h>
59 #include <corosync/totem/totem.h>
60 #include <corosync/ipc_cfg.h>
61 #include <corosync/logsys.h>
62 #include <corosync/coroapi.h>
63 #include <corosync/icmap.h>
64 #include <corosync/corodefs.h>
65 
66 #include "service.h"
67 #include "main.h"
68 
69 LOGSYS_DECLARE_SUBSYS ("CFG");
70 
76 };
77 
78 #define DEFAULT_SHUTDOWN_TIMEOUT 5
79 
80 static struct qb_list_head trackers_list;
81 
82 /*
83  * Variables controlling a requested shutdown
84  */
85 static corosync_timer_handle_t shutdown_timer;
86 static struct cfg_info *shutdown_con;
87 static uint32_t shutdown_flags;
88 static int shutdown_yes;
89 static int shutdown_no;
90 static int shutdown_expected;
91 
92 struct cfg_info
93 {
94  struct qb_list_head list;
95  void *conn;
96  void *tracker_conn;
98 };
99 
100 static void cfg_confchg_fn (
101  enum totem_configuration_type configuration_type,
102  const unsigned int *member_list, size_t member_list_entries,
103  const unsigned int *left_list, size_t left_list_entries,
104  const unsigned int *joined_list, size_t joined_list_entries,
105  const struct memb_ring_id *ring_id);
106 
107 static char *cfg_exec_init_fn (struct corosync_api_v1 *corosync_api_v1);
108 
109 static struct corosync_api_v1 *api;
110 
111 static int cfg_lib_init_fn (void *conn);
112 
113 static int cfg_lib_exit_fn (void *conn);
114 
115 static void message_handler_req_exec_cfg_ringreenable (
116  const void *message,
117  unsigned int nodeid);
118 
119 static void message_handler_req_exec_cfg_killnode (
120  const void *message,
121  unsigned int nodeid);
122 
123 static void message_handler_req_exec_cfg_shutdown (
124  const void *message,
125  unsigned int nodeid);
126 
127 static void message_handler_req_exec_cfg_reload_config (
128  const void *message,
129  unsigned int nodeid);
130 
131 static void exec_cfg_killnode_endian_convert (void *msg);
132 
133 static void message_handler_req_lib_cfg_ringstatusget (
134  void *conn,
135  const void *msg);
136 
137 static void message_handler_req_lib_cfg_ringreenable (
138  void *conn,
139  const void *msg);
140 
141 static void message_handler_req_lib_cfg_killnode (
142  void *conn,
143  const void *msg);
144 
145 static void message_handler_req_lib_cfg_tryshutdown (
146  void *conn,
147  const void *msg);
148 
149 static void message_handler_req_lib_cfg_replytoshutdown (
150  void *conn,
151  const void *msg);
152 
153 static void message_handler_req_lib_cfg_get_node_addrs (
154  void *conn,
155  const void *msg);
156 
157 static void message_handler_req_lib_cfg_local_get (
158  void *conn,
159  const void *msg);
160 
161 static void message_handler_req_lib_cfg_reload_config (
162  void *conn,
163  const void *msg);
164 
165 static void message_handler_req_lib_cfg_reopen_log_files (
166  void *conn,
167  const void *msg);
168 
169 /*
170  * Service Handler Definition
171  */
172 static struct corosync_lib_handler cfg_lib_engine[] =
173 {
174  { /* 0 */
175  .lib_handler_fn = message_handler_req_lib_cfg_ringstatusget,
176  .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
177  },
178  { /* 1 */
179  .lib_handler_fn = message_handler_req_lib_cfg_ringreenable,
180  .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
181  },
182  { /* 2 */
183  .lib_handler_fn = message_handler_req_lib_cfg_killnode,
184  .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
185  },
186  { /* 3 */
187  .lib_handler_fn = message_handler_req_lib_cfg_tryshutdown,
188  .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
189  },
190  { /* 4 */
191  .lib_handler_fn = message_handler_req_lib_cfg_replytoshutdown,
192  .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
193  },
194  { /* 5 */
195  .lib_handler_fn = message_handler_req_lib_cfg_get_node_addrs,
196  .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED
197  },
198  { /* 6 */
199  .lib_handler_fn = message_handler_req_lib_cfg_local_get,
200  .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED
201  },
202  { /* 7 */
203  .lib_handler_fn = message_handler_req_lib_cfg_reload_config,
204  .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED
205  },
206  { /* 8 */
207  .lib_handler_fn = message_handler_req_lib_cfg_reopen_log_files,
208  .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED
209  }
210 };
211 
212 static struct corosync_exec_handler cfg_exec_engine[] =
213 {
214  { /* 0 */
215  .exec_handler_fn = message_handler_req_exec_cfg_ringreenable,
216  },
217  { /* 1 */
218  .exec_handler_fn = message_handler_req_exec_cfg_killnode,
219  .exec_endian_convert_fn = exec_cfg_killnode_endian_convert
220  },
221  { /* 2 */
222  .exec_handler_fn = message_handler_req_exec_cfg_shutdown,
223  },
224  { /* 3 */
225  .exec_handler_fn = message_handler_req_exec_cfg_reload_config,
226  }
227 };
228 
229 /*
230  * Exports the interface for the service
231  */
233  .name = "corosync configuration service",
234  .id = CFG_SERVICE,
235  .priority = 1,
236  .private_data_size = sizeof(struct cfg_info),
237  .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED,
238  .allow_inquorate = CS_LIB_ALLOW_INQUORATE,
239  .lib_init_fn = cfg_lib_init_fn,
240  .lib_exit_fn = cfg_lib_exit_fn,
241  .lib_engine = cfg_lib_engine,
242  .lib_engine_count = sizeof (cfg_lib_engine) / sizeof (struct corosync_lib_handler),
243  .exec_init_fn = cfg_exec_init_fn,
244  .exec_engine = cfg_exec_engine,
245  .exec_engine_count = sizeof (cfg_exec_engine) / sizeof (struct corosync_exec_handler),
246  .confchg_fn = cfg_confchg_fn
247 };
248 
250 {
251  return (&cfg_service_engine);
252 }
253 
255  struct qb_ipc_request_header header __attribute__((aligned(8)));
256  mar_message_source_t source __attribute__((aligned(8)));
257 };
258 
260  struct qb_ipc_request_header header __attribute__((aligned(8)));
261  mar_message_source_t source __attribute__((aligned(8)));
262 };
263 
265  struct qb_ipc_request_header header __attribute__((aligned(8)));
266  mar_uint32_t nodeid __attribute__((aligned(8)));
267  mar_name_t reason __attribute__((aligned(8)));
268 };
269 
271  struct qb_ipc_request_header header __attribute__((aligned(8)));
272 };
273 
274 /* IMPL */
275 
276 static char *cfg_exec_init_fn (
277  struct corosync_api_v1 *corosync_api_v1)
278 {
279  api = corosync_api_v1;
280 
281  qb_list_init(&trackers_list);
282  return (NULL);
283 }
284 
285 static void cfg_confchg_fn (
286  enum totem_configuration_type configuration_type,
287  const unsigned int *member_list, size_t member_list_entries,
288  const unsigned int *left_list, size_t left_list_entries,
289  const unsigned int *joined_list, size_t joined_list_entries,
290  const struct memb_ring_id *ring_id)
291 {
292 }
293 
294 /*
295  * Tell other nodes we are shutting down
296  */
297 static int send_shutdown(void)
298 {
299  struct req_exec_cfg_shutdown req_exec_cfg_shutdown;
300  struct iovec iovec;
301 
302  ENTER();
303  req_exec_cfg_shutdown.header.size =
304  sizeof (struct req_exec_cfg_shutdown);
305  req_exec_cfg_shutdown.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
307 
308  iovec.iov_base = (char *)&req_exec_cfg_shutdown;
309  iovec.iov_len = sizeof (struct req_exec_cfg_shutdown);
310 
311  assert (api->totem_mcast (&iovec, 1, TOTEM_SAFE) == 0);
312 
313  LEAVE();
314  return 0;
315 }
316 
317 static void send_test_shutdown(void *only_conn, void *exclude_conn, int status)
318 {
319  struct res_lib_cfg_testshutdown res_lib_cfg_testshutdown;
320  struct qb_list_head *iter;
321 
322  ENTER();
323  res_lib_cfg_testshutdown.header.size = sizeof(struct res_lib_cfg_testshutdown);
324  res_lib_cfg_testshutdown.header.id = MESSAGE_RES_CFG_TESTSHUTDOWN;
325  res_lib_cfg_testshutdown.header.error = status;
326  res_lib_cfg_testshutdown.flags = shutdown_flags;
327 
328  if (only_conn) {
329  TRACE1("sending testshutdown to only %p", only_conn);
330  api->ipc_dispatch_send(only_conn, &res_lib_cfg_testshutdown,
331  sizeof(res_lib_cfg_testshutdown));
332  } else {
333  qb_list_for_each(iter, &trackers_list) {
334  struct cfg_info *ci = qb_list_entry(iter, struct cfg_info, list);
335 
336  if (ci->conn != exclude_conn) {
337  TRACE1("sending testshutdown to %p", ci->tracker_conn);
338  api->ipc_dispatch_send(ci->tracker_conn, &res_lib_cfg_testshutdown,
339  sizeof(res_lib_cfg_testshutdown));
340  }
341  }
342  }
343  LEAVE();
344 }
345 
346 static void check_shutdown_status(void)
347 {
348  ENTER();
349 
350  /*
351  * Shutdown client might have gone away
352  */
353  if (!shutdown_con) {
354  LEAVE();
355  return;
356  }
357 
358  /*
359  * All replies safely gathered in ?
360  */
361  if (shutdown_yes + shutdown_no >= shutdown_expected) {
362  struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
363 
364  api->timer_delete(shutdown_timer);
365 
366  if (shutdown_yes >= shutdown_expected ||
367  shutdown_flags == CFG_SHUTDOWN_FLAG_REGARDLESS) {
368  TRACE1("shutdown confirmed");
369 
370  res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
371  res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
372  res_lib_cfg_tryshutdown.header.error = CS_OK;
373 
374  /*
375  * Tell originator that shutdown was confirmed
376  */
377  api->ipc_response_send(shutdown_con->conn, &res_lib_cfg_tryshutdown,
378  sizeof(res_lib_cfg_tryshutdown));
379  shutdown_con = NULL;
380 
381  /*
382  * Tell other nodes we are going down
383  */
384  send_shutdown();
385 
386  }
387  else {
388 
389  TRACE1("shutdown cancelled");
390  res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
391  res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
392  res_lib_cfg_tryshutdown.header.error = CS_ERR_BUSY;
393 
394  /*
395  * Tell originator that shutdown was cancelled
396  */
397  api->ipc_response_send(shutdown_con->conn, &res_lib_cfg_tryshutdown,
398  sizeof(res_lib_cfg_tryshutdown));
399  shutdown_con = NULL;
400  }
401 
402  log_printf(LOGSYS_LEVEL_DEBUG, "shutdown decision is: (yes count: %d, no count: %d) flags=%x",
403  shutdown_yes, shutdown_no, shutdown_flags);
404  }
405  LEAVE();
406 }
407 
408 
409 /*
410  * Not all nodes responded to the shutdown (in time)
411  */
412 static void shutdown_timer_fn(void *arg)
413 {
414  ENTER();
415 
416  /*
417  * Mark undecideds as "NO"
418  */
419  shutdown_no = shutdown_expected;
420  check_shutdown_status();
421 
422  send_test_shutdown(NULL, NULL, CS_ERR_TIMEOUT);
423  LEAVE();
424 }
425 
426 static void remove_ci_from_shutdown(struct cfg_info *ci)
427 {
428  ENTER();
429 
430  /*
431  * If the controlling shutdown process has quit, then cancel the
432  * shutdown session
433  */
434  if (ci == shutdown_con) {
435  shutdown_con = NULL;
436  api->timer_delete(shutdown_timer);
437  }
438 
439  if (!qb_list_empty(&ci->list)) {
440  qb_list_del(&ci->list);
441  qb_list_init(&ci->list);
442 
443  /*
444  * Remove our option
445  */
446  if (shutdown_con) {
448  shutdown_yes--;
450  shutdown_no--;
451  }
452 
453  /*
454  * If we are leaving, then that's an implicit YES to shutdown
455  */
457  shutdown_yes++;
458 
459  check_shutdown_status();
460  }
461  LEAVE();
462 }
463 
464 
465 int cfg_lib_exit_fn (void *conn)
466 {
467  struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
468 
469  ENTER();
470  remove_ci_from_shutdown(ci);
471  LEAVE();
472  return (0);
473 }
474 
475 static int cfg_lib_init_fn (void *conn)
476 {
477  struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
478 
479  ENTER();
480  qb_list_init(&ci->list);
481  LEAVE();
482 
483  return (0);
484 }
485 
486 /*
487  * Executive message handlers
488  */
489 static void message_handler_req_exec_cfg_ringreenable (
490  const void *message,
491  unsigned int nodeid)
492 {
493  ENTER();
494 
495  LEAVE();
496 }
497 
498 static void exec_cfg_killnode_endian_convert (void *msg)
499 {
501  (struct req_exec_cfg_killnode *)msg;
502  ENTER();
503 
504  swab_mar_name_t(&req_exec_cfg_killnode->reason);
505  LEAVE();
506 }
507 
508 
509 static void message_handler_req_exec_cfg_killnode (
510  const void *message,
511  unsigned int nodeid)
512 {
513  const struct req_exec_cfg_killnode *req_exec_cfg_killnode = message;
514  cs_name_t reason;
515 
516  ENTER();
517  log_printf(LOGSYS_LEVEL_DEBUG, "request to kill node " CS_PRI_NODE_ID " (us=" CS_PRI_NODE_ID ")",
518  req_exec_cfg_killnode->nodeid, api->totem_nodeid_get());
519  if (req_exec_cfg_killnode->nodeid == api->totem_nodeid_get()) {
520  marshall_from_mar_name_t(&reason, &req_exec_cfg_killnode->reason);
521  log_printf(LOGSYS_LEVEL_NOTICE, "Killed by node " CS_PRI_NODE_ID " : %s",
522  nodeid, reason.value);
524  }
525  LEAVE();
526 }
527 
528 /*
529  * Self shutdown
530  */
531 static void message_handler_req_exec_cfg_shutdown (
532  const void *message,
533  unsigned int nodeid)
534 {
535  ENTER();
536 
537  log_printf(LOGSYS_LEVEL_NOTICE, "Node " CS_PRI_NODE_ID " was shut down by sysadmin", nodeid);
538  if (nodeid == api->totem_nodeid_get()) {
539  api->shutdown_request();
540  }
541  LEAVE();
542 }
543 
544 /* strcmp replacement that can handle NULLs */
545 static int nullcheck_strcmp(const char* left, const char *right)
546 {
547  if (!left && right)
548  return -1;
549  if (left && !right)
550  return 1;
551 
552  if (!left && !right)
553  return 0;
554 
555  return strcmp(left, right);
556 }
557 
558 /*
559  * If a key has changed value in the new file, then warn the user and remove it from the temp_map
560  */
561 static void delete_and_notify_if_changed(icmap_map_t temp_map, const char *key_name)
562 {
563  if (!(icmap_key_value_eq(temp_map, key_name, icmap_get_global_map(), key_name))) {
564  if (icmap_delete_r(temp_map, key_name) == CS_OK) {
565  log_printf(LOGSYS_LEVEL_NOTICE, "Modified entry '%s' in corosync.conf cannot be changed at run-time", key_name);
566  }
567  }
568 }
569 /*
570  * Remove any keys from the new config file that in the new corosync.conf but that
571  * cannot be changed at run time. A log message will be issued for each
572  * entry that the user wants to change but they cannot.
573  *
574  * Add more here as needed.
575  */
576 static void remove_ro_entries(icmap_map_t temp_map)
577 {
578  delete_and_notify_if_changed(temp_map, "totem.secauth");
579  delete_and_notify_if_changed(temp_map, "totem.crypto_hash");
580  delete_and_notify_if_changed(temp_map, "totem.crypto_cipher");
581  delete_and_notify_if_changed(temp_map, "totem.keyfile");
582  delete_and_notify_if_changed(temp_map, "totem.key");
583  delete_and_notify_if_changed(temp_map, "totem.version");
584  delete_and_notify_if_changed(temp_map, "totem.threads");
585  delete_and_notify_if_changed(temp_map, "totem.ip_version");
586  delete_and_notify_if_changed(temp_map, "totem.rrp_mode");
587  delete_and_notify_if_changed(temp_map, "totem.netmtu");
588  delete_and_notify_if_changed(temp_map, "totem.interface.ringnumber");
589  delete_and_notify_if_changed(temp_map, "totem.interface.bindnetaddr");
590  delete_and_notify_if_changed(temp_map, "totem.interface.mcastaddr");
591  delete_and_notify_if_changed(temp_map, "totem.interface.broadcast");
592  delete_and_notify_if_changed(temp_map, "totem.interface.mcastport");
593  delete_and_notify_if_changed(temp_map, "totem.interface.ttl");
594  delete_and_notify_if_changed(temp_map, "totem.vsftype");
595  delete_and_notify_if_changed(temp_map, "totem.transport");
596  delete_and_notify_if_changed(temp_map, "totem.cluster_name");
597  delete_and_notify_if_changed(temp_map, "quorum.provider");
598  delete_and_notify_if_changed(temp_map, "system.move_to_root_cgroup");
599  delete_and_notify_if_changed(temp_map, "system.sched_rr");
600  delete_and_notify_if_changed(temp_map, "system.priority");
601  delete_and_notify_if_changed(temp_map, "system.qb_ipc_type");
602  delete_and_notify_if_changed(temp_map, "system.state_dir");
603 }
604 
605 /*
606  * Remove entries that exist in the global map, but not in the temp_map, this will
607  * cause delete notifications to be sent to any listeners.
608  *
609  * NOTE: This routine depends entirely on the keys returned by the iterators
610  * being in alpha-sorted order.
611  */
612 static void remove_deleted_entries(icmap_map_t temp_map, const char *prefix)
613 {
614  icmap_iter_t old_iter;
615  icmap_iter_t new_iter;
616  const char *old_key, *new_key;
617  int ret;
618 
619  old_iter = icmap_iter_init(prefix);
620  new_iter = icmap_iter_init_r(temp_map, prefix);
621 
622  old_key = icmap_iter_next(old_iter, NULL, NULL);
623  new_key = icmap_iter_next(new_iter, NULL, NULL);
624 
625  while (old_key || new_key) {
626  ret = nullcheck_strcmp(old_key, new_key);
627  if ((ret < 0 && old_key) || !new_key) {
628  /*
629  * new_key is greater, a line (or more) has been deleted
630  * Continue until old is >= new
631  */
632  do {
633  /* Remove it from icmap & send notifications */
634  icmap_delete(old_key);
635 
636  old_key = icmap_iter_next(old_iter, NULL, NULL);
637  ret = nullcheck_strcmp(old_key, new_key);
638  } while (ret < 0 && old_key);
639  }
640  else if ((ret > 0 && new_key) || !old_key) {
641  /*
642  * old_key is greater, a line (or more) has been added
643  * Continue until new is >= old
644  *
645  * we don't need to do anything special with this like tell
646  * icmap. That will happen when we copy the values over
647  */
648  do {
649  new_key = icmap_iter_next(new_iter, NULL, NULL);
650  ret = nullcheck_strcmp(old_key, new_key);
651  } while (ret > 0 && new_key);
652  }
653  if (ret == 0) {
654  new_key = icmap_iter_next(new_iter, NULL, NULL);
655  old_key = icmap_iter_next(old_iter, NULL, NULL);
656  }
657  }
658  icmap_iter_finalize(new_iter);
659  icmap_iter_finalize(old_iter);
660 }
661 
662 /*
663  * Reload configuration file
664  */
665 static void message_handler_req_exec_cfg_reload_config (
666  const void *message,
667  unsigned int nodeid)
668 {
670  struct res_lib_cfg_reload_config res_lib_cfg_reload_config;
671  icmap_map_t temp_map;
672  const char *error_string;
673  int res = CS_OK;
674 
675  ENTER();
676 
677  log_printf(LOGSYS_LEVEL_NOTICE, "Config reload requested by node " CS_PRI_NODE_ID, nodeid);
678 
679  /*
680  * Set up a new hashtable as a staging area.
681  */
682  if ((res = icmap_init_r(&temp_map)) != CS_OK) {
683  log_printf(LOGSYS_LEVEL_ERROR, "Unable to create temporary icmap. config file reload cancelled\n");
684  goto reload_fini;
685  }
686 
687  /*
688  * Load new config into the temporary map
689  */
690  res = coroparse_configparse(temp_map, &error_string);
691  if (res == -1) {
692  log_printf (LOGSYS_LEVEL_ERROR, "Unable to reload config file: %s", error_string);
693  res = CS_ERR_LIBRARY;
694  goto reload_return;
695  }
696 
697  /* Tell interested listeners that we have started a reload */
698  icmap_set_uint8("config.reload_in_progress", 1);
699 
700  /* Detect deleted entries and remove them from the main icmap hashtable */
701  remove_deleted_entries(temp_map, "logging.");
702  remove_deleted_entries(temp_map, "totem.");
703  remove_deleted_entries(temp_map, "nodelist.");
704  remove_deleted_entries(temp_map, "quorum.");
705  remove_deleted_entries(temp_map, "uidgid.config.");
706  remove_deleted_entries(temp_map, "nozzle.");
707 
708  /* Remove entries that cannot be changed */
709  remove_ro_entries(temp_map);
710 
711  /*
712  * Copy new keys into live config.
713  * If this fails we will have a partially loaded config because some keys (above) might
714  * have been reset to defaults - I'm not sure what to do here, we might have to quit.
715  */
716  if ( (res = icmap_copy_map(icmap_get_global_map(), temp_map)) != CS_OK) {
717  log_printf (LOGSYS_LEVEL_ERROR, "Error making new config live. cmap database may be inconsistent\n");
718  }
719 
720  /* All done - let clients know */
721  icmap_set_uint8("config.reload_in_progress", 0);
722 
723 reload_fini:
724  /* Finished with the temporary storage */
725  icmap_fini_r(temp_map);
726 
727 reload_return:
728  /* All done, return result to the caller if it was on this system */
729  if (nodeid == api->totem_nodeid_get()) {
730  res_lib_cfg_reload_config.header.size = sizeof(res_lib_cfg_reload_config);
731  res_lib_cfg_reload_config.header.id = MESSAGE_RES_CFG_RELOAD_CONFIG;
732  res_lib_cfg_reload_config.header.error = res;
733  api->ipc_response_send(req_exec_cfg_reload_config->source.conn,
734  &res_lib_cfg_reload_config,
735  sizeof(res_lib_cfg_reload_config));
736  api->ipc_refcnt_dec(req_exec_cfg_reload_config->source.conn);;
737  }
738 
739  LEAVE();
740 }
741 
742 /*
743  * Library Interface Implementation
744  */
745 static void message_handler_req_lib_cfg_ringstatusget (
746  void *conn,
747  const void *msg)
748 {
749  struct res_lib_cfg_ringstatusget res_lib_cfg_ringstatusget;
750  struct totem_ip_address interfaces[INTERFACE_MAX];
751  unsigned int iface_count;
752  char **status;
753  const char *totem_ip_string;
754  char ifname[CFG_INTERFACE_NAME_MAX_LEN];
755  unsigned int iface_ids[INTERFACE_MAX];
756  unsigned int i;
757  cs_error_t res = CS_OK;
758 
759  ENTER();
760 
761  res_lib_cfg_ringstatusget.header.id = MESSAGE_RES_CFG_RINGSTATUSGET;
762  res_lib_cfg_ringstatusget.header.size = sizeof (struct res_lib_cfg_ringstatusget);
763 
764  api->totem_ifaces_get (
765  api->totem_nodeid_get(),
766  iface_ids,
767  interfaces,
769  &status,
770  &iface_count);
771 
772  assert(iface_count <= CFG_MAX_INTERFACES);
773 
774  res_lib_cfg_ringstatusget.interface_count = iface_count;
775 
776  for (i = 0; i < iface_count; i++) {
777  totem_ip_string
778  = (const char *)api->totem_ip_print (&interfaces[i]);
779 
780  if (!totem_ip_string) {
781  totem_ip_string="";
782  }
783 
784  /* Allow for i/f number at the start */
785  if (strlen(totem_ip_string) >= CFG_INTERFACE_NAME_MAX_LEN-3) {
786  log_printf(LOGSYS_LEVEL_ERROR, "String representation of interface %u is too long", i);
787  res = CS_ERR_NAME_TOO_LONG;
788  goto send_response;
789  }
790  snprintf(ifname, sizeof(ifname), "%d %s", iface_ids[i], totem_ip_string);
791 
792  if (strlen(status[i]) >= CFG_INTERFACE_STATUS_MAX_LEN) {
793  log_printf(LOGSYS_LEVEL_ERROR, "Status string for interface %u is too long", i);
794  res = CS_ERR_NAME_TOO_LONG;
795  goto send_response;
796  }
797 
798  strcpy ((char *)&res_lib_cfg_ringstatusget.interface_status[i],
799  status[i]);
800  strcpy ((char *)&res_lib_cfg_ringstatusget.interface_name[i],
801  ifname);
802  }
803 
804 send_response:
805  res_lib_cfg_ringstatusget.header.error = res;
806  api->ipc_response_send (
807  conn,
808  &res_lib_cfg_ringstatusget,
809  sizeof (struct res_lib_cfg_ringstatusget));
810 
811  LEAVE();
812 }
813 
814 static void message_handler_req_lib_cfg_ringreenable (
815  void *conn,
816  const void *msg)
817 {
818  struct res_lib_cfg_ringreenable res_lib_cfg_ringreenable;
819  ENTER();
820 
821  res_lib_cfg_ringreenable.header.id = MESSAGE_RES_CFG_RINGREENABLE;
822  res_lib_cfg_ringreenable.header.size = sizeof (struct res_lib_cfg_ringreenable);
823  res_lib_cfg_ringreenable.header.error = CS_ERR_NOT_SUPPORTED;
824  api->ipc_response_send (
825  conn, &res_lib_cfg_ringreenable,
826  sizeof (struct res_lib_cfg_ringreenable));
827 
828  LEAVE();
829 }
830 
831 static void message_handler_req_lib_cfg_killnode (
832  void *conn,
833  const void *msg)
834 {
835  const struct req_lib_cfg_killnode *req_lib_cfg_killnode = msg;
836  struct res_lib_cfg_killnode res_lib_cfg_killnode;
837  struct req_exec_cfg_killnode req_exec_cfg_killnode;
838  struct iovec iovec;
839 
840  ENTER();
841  req_exec_cfg_killnode.header.size =
842  sizeof (struct req_exec_cfg_killnode);
843  req_exec_cfg_killnode.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
845  req_exec_cfg_killnode.nodeid = req_lib_cfg_killnode->nodeid;
846  marshall_to_mar_name_t(&req_exec_cfg_killnode.reason, &req_lib_cfg_killnode->reason);
847 
848  iovec.iov_base = (char *)&req_exec_cfg_killnode;
849  iovec.iov_len = sizeof (struct req_exec_cfg_killnode);
850 
851  (void)api->totem_mcast (&iovec, 1, TOTEM_SAFE);
852 
853  res_lib_cfg_killnode.header.size = sizeof(struct res_lib_cfg_killnode);
854  res_lib_cfg_killnode.header.id = MESSAGE_RES_CFG_KILLNODE;
855  res_lib_cfg_killnode.header.error = CS_OK;
856 
857  api->ipc_response_send(conn, &res_lib_cfg_killnode,
858  sizeof(res_lib_cfg_killnode));
859 
860  LEAVE();
861 }
862 
863 
864 static void message_handler_req_lib_cfg_tryshutdown (
865  void *conn,
866  const void *msg)
867 {
868  struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
870  struct qb_list_head *iter;
871 
872  ENTER();
873 
874  if (req_lib_cfg_tryshutdown->flags == CFG_SHUTDOWN_FLAG_IMMEDIATE) {
875  struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
876 
877  /*
878  * Tell other nodes
879  */
880  send_shutdown();
881 
882  res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
883  res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
884  res_lib_cfg_tryshutdown.header.error = CS_OK;
885  api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
886  sizeof(res_lib_cfg_tryshutdown));
887 
888  LEAVE();
889  return;
890  }
891 
892  /*
893  * Shutdown in progress, return an error
894  */
895  if (shutdown_con) {
896  struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
897 
898  res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
899  res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
900  res_lib_cfg_tryshutdown.header.error = CS_ERR_EXIST;
901 
902  api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
903  sizeof(res_lib_cfg_tryshutdown));
904 
905 
906  LEAVE();
907 
908  return;
909  }
910 
911  ci->conn = conn;
912  shutdown_con = (struct cfg_info *)api->ipc_private_data_get (conn);
913  shutdown_flags = req_lib_cfg_tryshutdown->flags;
914  shutdown_yes = 0;
915  shutdown_no = 0;
916 
917  /*
918  * Count the number of listeners
919  */
920  shutdown_expected = 0;
921 
922  qb_list_for_each(iter, &trackers_list) {
923  struct cfg_info *testci = qb_list_entry(iter, struct cfg_info, list);
924  /*
925  * It is assumed that we will allow shutdown
926  */
927  if (testci != ci) {
929  shutdown_expected++;
930  }
931  }
932 
933  /*
934  * If no-one is listening for events then we can just go down now
935  */
936  if (shutdown_expected == 0) {
937  struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
938 
939  res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown);
940  res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN;
941  res_lib_cfg_tryshutdown.header.error = CS_OK;
942 
943  /*
944  * Tell originator that shutdown was confirmed
945  */
946  api->ipc_response_send(conn, &res_lib_cfg_tryshutdown,
947  sizeof(res_lib_cfg_tryshutdown));
948 
949  send_shutdown();
950  LEAVE();
951  return;
952  }
953  else {
954  unsigned int shutdown_timeout = DEFAULT_SHUTDOWN_TIMEOUT;
955 
956  /*
957  * Look for a shutdown timeout in configuration map
958  */
959  icmap_get_uint32("cfg.shutdown_timeout", &shutdown_timeout);
960 
961  /*
962  * Start the timer. If we don't get a full set of replies before this goes
963  * off we'll cancel the shutdown
964  */
965  api->timer_add_duration((unsigned long long)shutdown_timeout*1000000000, NULL,
966  shutdown_timer_fn, &shutdown_timer);
967 
968  /*
969  * Tell the users we would like to shut down
970  */
971  send_test_shutdown(NULL, conn, CS_OK);
972  }
973 
974  /*
975  * We don't sent a reply to the caller here.
976  * We send it when we know if we can shut down or not
977  */
978 
979  LEAVE();
980 }
981 
982 static void message_handler_req_lib_cfg_replytoshutdown (
983  void *conn,
984  const void *msg)
985 {
986  struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
988  struct res_lib_cfg_replytoshutdown res_lib_cfg_replytoshutdown;
989  int status = CS_OK;
990 
991  ENTER();
992  if (!shutdown_con) {
993  status = CS_ERR_ACCESS;
994  goto exit_fn;
995  }
996 
997  if (req_lib_cfg_replytoshutdown->response) {
998  shutdown_yes++;
1000  }
1001  else {
1002  shutdown_no++;
1004  }
1005  check_shutdown_status();
1006 
1007 exit_fn:
1008  res_lib_cfg_replytoshutdown.header.error = status;
1009  res_lib_cfg_replytoshutdown.header.id = MESSAGE_RES_CFG_REPLYTOSHUTDOWN;
1010  res_lib_cfg_replytoshutdown.header.size = sizeof(res_lib_cfg_replytoshutdown);
1011 
1012  api->ipc_response_send(conn, &res_lib_cfg_replytoshutdown,
1013  sizeof(res_lib_cfg_replytoshutdown));
1014 
1015  LEAVE();
1016 }
1017 
1018 static void message_handler_req_lib_cfg_get_node_addrs (void *conn,
1019  const void *msg)
1020 {
1021  struct totem_ip_address node_ifs[INTERFACE_MAX];
1022  unsigned int iface_ids[INTERFACE_MAX];
1023  char buf[PIPE_BUF];
1024  char **status;
1025  unsigned int num_interfaces = 0;
1026  struct sockaddr_storage *ss;
1027  int ret = CS_OK;
1028  int i;
1029  int live_addrs = 0;
1031  struct res_lib_cfg_get_node_addrs *res_lib_cfg_get_node_addrs = (struct res_lib_cfg_get_node_addrs *)buf;
1032  unsigned int nodeid = req_lib_cfg_get_node_addrs->nodeid;
1033  char *addr_buf;
1034 
1035  if (nodeid == 0)
1036  nodeid = api->totem_nodeid_get();
1037 
1038  if (api->totem_ifaces_get(nodeid, iface_ids, node_ifs, INTERFACE_MAX, &status, &num_interfaces)) {
1039  ret = CS_ERR_EXIST;
1040  num_interfaces = 0;
1041  }
1042 
1043  res_lib_cfg_get_node_addrs->header.size = sizeof(struct res_lib_cfg_get_node_addrs) + (num_interfaces * TOTEMIP_ADDRLEN);
1044  res_lib_cfg_get_node_addrs->header.id = MESSAGE_RES_CFG_GET_NODE_ADDRS;
1045  res_lib_cfg_get_node_addrs->header.error = ret;
1046  if (num_interfaces) {
1047  res_lib_cfg_get_node_addrs->family = node_ifs[0].family;
1048  for (i = 0, addr_buf = (char *)res_lib_cfg_get_node_addrs->addrs;
1049  i < num_interfaces; i++) {
1050  ss = (struct sockaddr_storage *)&node_ifs[i].addr;
1051  if (ss->ss_family) {
1052  memcpy(addr_buf, node_ifs[i].addr, TOTEMIP_ADDRLEN);
1053  live_addrs++;
1054  addr_buf += TOTEMIP_ADDRLEN;
1055  }
1056  }
1057  res_lib_cfg_get_node_addrs->num_addrs = live_addrs;
1058  } else {
1059  res_lib_cfg_get_node_addrs->header.error = CS_ERR_NOT_EXIST;
1060  }
1061  api->ipc_response_send(conn, res_lib_cfg_get_node_addrs, res_lib_cfg_get_node_addrs->header.size);
1062 }
1063 
1064 static void message_handler_req_lib_cfg_local_get (void *conn, const void *msg)
1065 {
1066  struct res_lib_cfg_local_get res_lib_cfg_local_get;
1067 
1068  res_lib_cfg_local_get.header.size = sizeof(res_lib_cfg_local_get);
1069  res_lib_cfg_local_get.header.id = MESSAGE_RES_CFG_LOCAL_GET;
1070  res_lib_cfg_local_get.header.error = CS_OK;
1071  res_lib_cfg_local_get.local_nodeid = api->totem_nodeid_get ();
1072 
1073  api->ipc_response_send(conn, &res_lib_cfg_local_get,
1074  sizeof(res_lib_cfg_local_get));
1075 }
1076 
1077 static void message_handler_req_lib_cfg_reload_config (void *conn, const void *msg)
1078 {
1079  struct req_exec_cfg_reload_config req_exec_cfg_reload_config;
1080  struct iovec iovec;
1081 
1082  ENTER();
1083 
1084  req_exec_cfg_reload_config.header.size =
1085  sizeof (struct req_exec_cfg_reload_config);
1086  req_exec_cfg_reload_config.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
1088  api->ipc_source_set (&req_exec_cfg_reload_config.source, conn);
1089  api->ipc_refcnt_inc(conn);
1090 
1091  iovec.iov_base = (char *)&req_exec_cfg_reload_config;
1092  iovec.iov_len = sizeof (struct req_exec_cfg_reload_config);
1093 
1094  assert (api->totem_mcast (&iovec, 1, TOTEM_SAFE) == 0);
1095 
1096  LEAVE();
1097 }
1098 
1099 static void message_handler_req_lib_cfg_reopen_log_files (void *conn, const void *msg)
1100 {
1101  struct res_lib_cfg_reopen_log_files res_lib_cfg_reopen_log_files;
1102  cs_error_t res;
1103 
1104  ENTER();
1105 
1106  log_printf(LOGSYS_LEVEL_DEBUG, "Reopening logging files\n");
1107 
1108  res = logsys_reopen_log_files();
1109 
1110  res_lib_cfg_reopen_log_files.header.size = sizeof(res_lib_cfg_reopen_log_files);
1111  res_lib_cfg_reopen_log_files.header.id = MESSAGE_RES_CFG_REOPEN_LOG_FILES;
1112  res_lib_cfg_reopen_log_files.header.error = res;
1113  api->ipc_response_send(conn,
1114  &res_lib_cfg_reopen_log_files,
1115  sizeof(res_lib_cfg_reopen_log_files));
1116 
1117  LEAVE();
1118 }
void *(* ipc_private_data_get)(void *conn)
Definition: coroapi.h:256
const char * name
Definition: coroapi.h:491
unsigned short family
Definition: coroapi.h:113
The res_lib_cfg_reopen_log_files struct.
Definition: ipc_cfg.h:230
void(* timer_delete)(corosync_timer_handle_t timer_handle)
Definition: coroapi.h:241
int(* timer_add_duration)(unsigned long long nanoseconds_in_future, void *data, void(*timer_nf)(void *data), corosync_timer_handle_t *handle)
Definition: coroapi.h:229
const char * icmap_iter_next(icmap_iter_t iter, size_t *value_len, icmap_value_types_t *type)
Return next item in iterator iter.
Definition: icmap.c:1095
#define CFG_INTERFACE_STATUS_MAX_LEN
Definition: ipc_cfg.h:43
struct qb_list_head list
Definition: exec/cfg.c:94
cs_error_t icmap_copy_map(icmap_map_t dst_map, const icmap_map_t src_map)
Copy content of src_map icmap to dst_map icmap.
Definition: icmap.c:1298
The res_lib_cfg_replytoshutdown struct.
Definition: ipc_cfg.h:160
The res_lib_cfg_testshutdown struct.
Definition: ipc_cfg.h:167
The totem_ip_address struct.
Definition: coroapi.h:111
The corosync_service_engine struct.
Definition: coroapi.h:490
void icmap_iter_finalize(icmap_iter_t iter)
Finalize iterator.
Definition: icmap.c:1116
void(* shutdown_request)(void)
Definition: coroapi.h:429
cs_error_t logsys_reopen_log_files(void)
Definition: logsys.c:890
uint8_t value[CS_MAX_NAME_LENGTH]
Definition: corotypes.h:67
int coroparse_configparse(icmap_map_t config_map, const char **error_string)
Definition: coroparse.c:258
#define corosync_fatal_error(err)
Definition: coroapi.h:424
int(* ipc_response_send)(void *conn, const void *msg, size_t mlen)
Definition: coroapi.h:258
LOGSYS_DECLARE_SUBSYS("CFG")
#define CS_PRI_NODE_ID
Definition: corotypes.h:59
int icmap_key_value_eq(const icmap_map_t map1, const char *key_name1, const icmap_map_t map2, const char *key_name2)
Compare value of key with name key_name1 in map1 with key with name key_name2 in map2.
Definition: icmap.c:385
totem_configuration_type
The totem_configuration_type enum.
Definition: coroapi.h:132
int(* totem_ifaces_get)(unsigned int nodeid, unsigned int *interface_ids, struct totem_ip_address *interfaces, unsigned int interfaces_size, char ***status, unsigned int *iface_count)
Definition: coroapi.h:282
The res_lib_cfg_get_node_addrs struct.
Definition: ipc_cfg.h:183
The corosync_lib_handler struct.
Definition: coroapi.h:467
unsigned char addr[TOTEMIP_ADDRLEN]
Definition: coroapi.h:77
mar_name_t struct
Definition: mar_gen.h:166
The req_lib_cfg_get_node_addrs struct.
Definition: ipc_cfg.h:175
The corosync_exec_handler struct.
Definition: coroapi.h:475
void icmap_fini_r(const icmap_map_t map)
Finalize local, reentrant icmap.
Definition: icmap.c:238
icmap_map_t icmap_get_global_map(void)
Return global icmap.
Definition: icmap.c:264
int(* totem_mcast)(const struct iovec *iovec, unsigned int iov_len, unsigned int guarantee)
Definition: coroapi.h:279
#define log_printf(level, format, args...)
Definition: logsys.h:323
void(* exec_handler_fn)(const void *msg, unsigned int nodeid)
Definition: coroapi.h:476
void * tracker_conn
Definition: exec/cfg.c:96
#define SERVICE_ID_MAKE(a, b)
Definition: coroapi.h:458
#define INTERFACE_MAX
Definition: coroapi.h:88
The res_lib_cfg_local_get struct.
Definition: ipc_cfg.h:201
The res_lib_cfg_killnode struct.
Definition: ipc_cfg.h:130
#define TOTEM_SAFE
Definition: coroapi.h:103
unsigned int num_addrs
Definition: ipc_cfg.h:186
unsigned int flags
Definition: ipc_cfg.h:169
The req_lib_cfg_tryshutdown struct.
Definition: ipc_cfg.h:137
unsigned int(* totem_nodeid_get)(void)
Definition: coroapi.h:275
void(* ipc_refcnt_dec)(void *conn)
Definition: coroapi.h:270
The res_lib_cfg_ringreenable struct.
Definition: ipc_cfg.h:114
#define LOGSYS_LEVEL_ERROR
Definition: logsys.h:72
#define TRACE1(format, args...)
Definition: logsys.h:326
#define CFG_INTERFACE_NAME_MAX_LEN
Definition: ipc_cfg.h:42
cs_error_t icmap_delete(const char *key_name)
Delete key from map.
Definition: icmap.c:653
cs_error_t
The cs_error_t enum.
Definition: corotypes.h:97
#define LOGSYS_LEVEL_DEBUG
Definition: logsys.h:76
The corosync_api_v1 struct.
Definition: coroapi.h:225
typedef __attribute__
The req_lib_cfg_replytoshutdown struct.
Definition: ipc_cfg.h:152
The res_lib_cfg_tryshutdown struct.
Definition: ipc_cfg.h:145
cs_error_t icmap_get_uint32(const char *key_name, uint32_t *u32)
Definition: icmap.c:892
#define DEFAULT_SHUTDOWN_TIMEOUT
Definition: exec/cfg.c:78
#define TOTEMIP_ADDRLEN
Definition: coroapi.h:86
#define CFG_MAX_INTERFACES
Definition: ipc_cfg.h:48
const char *(* totem_ip_print)(const struct totem_ip_address *addr)
Definition: coroapi.h:292
#define ENTER
Definition: logsys.h:324
uint32_t mar_uint32_t
Definition: mar_gen.h:53
cfg_message_req_types
Definition: exec/cfg.c:71
The memb_ring_id struct.
Definition: coroapi.h:122
unsigned int flags
Definition: ipc_cfg.h:139
cs_error_t icmap_delete_r(const icmap_map_t map, const char *key_name)
icmap_delete_r
Definition: icmap.c:633
The res_lib_cfg_ringstatusget struct.
Definition: ipc_cfg.h:97
cs_error_t icmap_init_r(icmap_map_t *result)
Initialize additional (local, reentrant) icmap_map.
Definition: icmap.c:188
qb_loop_timer_handle corosync_timer_handle_t
corosync_timer_handle_t
Definition: coroapi.h:74
void * conn
Definition: exec/cfg.c:95
struct corosync_service_engine cfg_service_engine
Definition: exec/cfg.c:232
The res_lib_cfg_reload_config struct.
Definition: ipc_cfg.h:216
#define LOGSYS_LEVEL_NOTICE
Definition: logsys.h:74
cs_error_t icmap_set_uint8(const char *key_name, uint8_t value)
Definition: icmap.c:573
void(* lib_handler_fn)(void *conn, const void *msg)
Definition: coroapi.h:468
struct corosync_service_engine * cfg_get_service_engine_ver0(void)
Definition: exec/cfg.c:249
int(* ipc_dispatch_send)(void *conn, const void *msg, size_t mlen)
Definition: coroapi.h:263
unsigned int nodeid
Definition: coroapi.h:75
icmap_iter_t icmap_iter_init_r(const icmap_map_t map, const char *prefix)
icmap_iter_init_r
Definition: icmap.c:1084
icmap_iter_t icmap_iter_init(const char *prefix)
Initialize iterator with given prefix.
Definition: icmap.c:1089
struct memb_ring_id ring_id
Definition: totemsrp.c:264
void(* ipc_source_set)(mar_message_source_t *source, void *conn)
Definition: coroapi.h:252
The req_lib_cfg_killnode struct.
Definition: ipc_cfg.h:121
#define LEAVE
Definition: logsys.h:325
qb_map_iter_t * icmap_iter_t
Itterator type.
Definition: icmap.h:123
The cs_name_t struct.
Definition: corotypes.h:65
enum cfg_info::@6 shutdown_reply
The mar_message_source_t struct.
Definition: coroapi.h:50
void(* ipc_refcnt_inc)(void *conn)
Definition: coroapi.h:268