root/cib/callbacks.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. cib_config_lookup

   1 /*
   2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
   3  *
   4  * This program is free software; you can redistribute it and/or
   5  * modify it under the terms of the GNU Lesser General Public
   6  * License as published by the Free Software Foundation; either
   7  * version 2 of the License, or (at your option) any later version.
   8  *
   9  * This software is distributed in the hope that it will be useful,
  10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12  * General Public License for more details.
  13  *
  14  * You should have received a copy of the GNU Lesser General Public
  15  * License along with this library; if not, write to the Free Software
  16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  17  */
  18 
  19 #include <stdio.h>
  20 #include <sys/types.h>
  21 #include <unistd.h>
  22 #include <glib.h>
  23 
  24 #include <crm/crm.h>
  25 #include <crm/cib.h>
  26 #include <crm/common/xml.h>
  27 #include <crm/cluster.h>
  28 #include <crm/common/ipcs.h>
  29 #include <crm/common/mainloop.h>
  30 #ifdef HAVE_GNUTLS_GNUTLS_H
  31 #  undef KEYFILE
  32 #  include <gnutls/gnutls.h>
  33 #endif
  34 
  35 extern gboolean cib_is_master;
  36 extern GHashTable *peer_hash;
  37 extern GHashTable *config_hash;
  38 
  39 /* *INDENT-OFF* */
  40 enum cib_notifications
  41 {
  42     cib_notify_pre     = 0x0001,
  43     cib_notify_post    = 0x0002,
  44     cib_notify_replace = 0x0004,
  45     cib_notify_confirm = 0x0008,
  46     cib_notify_diff    = 0x0010,
  47 
  48     /* not a notification, but uses the same IPC bitmask */
  49     cib_is_daemon      = 0x1000, /* whether client is another cluster daemon */
  50 };
  51 /* *INDENT-ON* */
  52 
  53 typedef struct cib_operation_s {
  54     const char *operation;
  55     gboolean modifies_cib;
  56     gboolean needs_privileges;
  57     gboolean needs_quorum;
  58     int (*prepare) (xmlNode *, xmlNode **, const char **);
  59     int (*cleanup) (int, xmlNode **, xmlNode **);
  60     int (*fn) (const char *, int, const char *, xmlNode *,
  61                xmlNode *, xmlNode *, xmlNode **, xmlNode **);
  62 } cib_operation_t;
  63 
  64 extern struct qb_ipcs_service_handlers ipc_ro_callbacks;
  65 extern struct qb_ipcs_service_handlers ipc_rw_callbacks;
  66 extern qb_ipcs_service_t *ipcs_ro;
  67 extern qb_ipcs_service_t *ipcs_rw;
  68 extern qb_ipcs_service_t *ipcs_shm;
  69 
  70 extern void cib_peer_callback(xmlNode * msg, void *private_data);
  71 extern void cib_client_status_callback(const char *node, const char *client,
  72                                        const char *status, void *private);
  73 extern void cib_common_callback_worker(uint32_t id, uint32_t flags, xmlNode * op_request,
  74                                        crm_client_t * cib_client, gboolean privileged);
  75 
  76 void cib_shutdown(int nsig);
  77 void initiate_exit(void);
  78 void terminate_cib(const char *caller, int fast);
  79 
  80 extern gboolean cib_legacy_mode(void);
  81 
  82 #if SUPPORT_HEARTBEAT
  83 extern void cib_ha_peer_callback(HA_Message * msg, void *private_data);
  84 extern int cib_ccm_dispatch(gpointer user_data);
  85 extern void cib_ccm_msg_callback(oc_ed_t event, void *cookie, size_t size, const void *data);
  86 #endif
  87 
  88 static inline const char *
  89 cib_config_lookup(const char *opt)
     /* [previous][next][first][last][top][bottom][index][help] */
  90 {
  91     return g_hash_table_lookup(config_hash, opt);
  92 }

/* [previous][next][first][last][top][bottom][index][help] */