1
2
3
4
5
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
32 #define ATTRD_RE_CLEAR_ALL \
33 "^(" CRM_FAIL_COUNT_PREFIX "|" CRM_LAST_FAILURE_PREFIX ")-"
34
35
36
37
38
39
40
41 #define ATTRD_RE_CLEAR_ONE ATTRD_RE_CLEAR_ALL "%s(#.+_[0-9]+)?$"
42
43
44
45
46
47
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
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