root/attrd/attrd_common.h

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

INCLUDED FROM


   1 /*
   2  * Copyright (C) 2017 Andrew Beekhof <andrew@beekhof.net>
   3  *
   4  * This source code is licensed under the GNU General Public License version 2
   5  * or later (GPLv2+) WITHOUT ANY WARRANTY.
   6  */
   7 
   8 #ifndef PCMK_ATTRD_COMMON__H
   9 #  define PCMK_ATTRD_COMMON__H
  10 
  11 #include <regex.h>
  12 #include <glib.h>
  13 #include <crm/crm.h>
  14 #include <crm/cib/internal.h>
  15 
  16 void attrd_init_mainloop(void);
  17 void attrd_run_mainloop(void);
  18 gboolean attrd_mainloop_running(void);
  19 void attrd_quit_mainloop(void);
  20 
  21 gboolean attrd_shutting_down(void);
  22 void attrd_shutdown(int nsig);
  23 void attrd_init_ipc(qb_ipcs_service_t **ipcs,
  24                     qb_ipcs_msg_process_fn dispatch_fn);
  25 
  26 void attrd_cib_disconnect(void);
  27 
  28 gboolean attrd_value_needs_expansion(const char *value);
  29 int attrd_expand_value(const char *value, const char *old_value);
  30 
  31 /* regular expression to clear failures of all resources */
  32 #define ATTRD_RE_CLEAR_ALL \
  33     "^(" CRM_FAIL_COUNT_PREFIX "|" CRM_LAST_FAILURE_PREFIX ")-"
  34 
  35 /* regular expression to clear failure of all operations for one resource
  36  * (format takes resource name)
  37  *
  38  * @COMPAT attributes set < 1.1.17:
  39  * also match older attributes that do not have the operation part
  40  */
  41 #define ATTRD_RE_CLEAR_ONE ATTRD_RE_CLEAR_ALL "%s(#.+_[0-9]+)?$"
  42 
  43 /* regular expression to clear failure of one operation for one resource
  44  * (format takes resource name, operation name, and interval)
  45  *
  46  * @COMPAT attributes set < 1.1.17:
  47  * also match older attributes that do not have the operation part
  48  */
  49 #define ATTRD_RE_CLEAR_OP ATTRD_RE_CLEAR_ALL "%s(#%s_%d)?$"
  50 
  51 int attrd_failure_regex(regex_t *regex, const char *rsc, const char *op,
  52                         int interval);
  53 
  54 extern cib_t *the_cib;
  55 
  56 /* Alerts */
  57 
  58 extern lrmd_t *the_lrmd;
  59 extern crm_trigger_t *attrd_config_read;
  60 
  61 void attrd_lrmd_disconnect(void);
  62 gboolean attrd_read_options(gpointer user_data);
  63 void attrd_cib_updated_cb(const char *event, xmlNode *msg);
  64 void attrd_enable_alerts(const char *script, const char *target);
  65 int attrd_send_attribute_alert(const char *node, int nodeid,
  66                                const char *attr, const char *value);
  67 #endif /* PCMK_ATTRD_COMMON__H */

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