This source file includes following definitions.
- ra_param_flag2text
1
2
3
4
5
6
7
8
9
10 #ifndef CRMD_METADATA_H
11 #define CRMD_METADATA_H
12
13 #include <stdint.h>
14 #include <glib.h>
15 #include "controld_lrm.h"
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 enum ra_flags_e {
32 ra_supports_legacy_reload = (1 << 0),
33 ra_supports_reload_agent = (1 << 1),
34 };
35
36 enum ra_param_flags_e {
37 ra_param_unique = (1 << 0),
38 ra_param_private = (1 << 1),
39 ra_param_reloadable = (1 << 2),
40 };
41
42
43 enum controld_metadata_source_e {
44 controld_metadata_from_cache = (1 << 0),
45 controld_metadata_from_agent = (1 << 1),
46 };
47
48 struct ra_param_s {
49 char *rap_name;
50 uint32_t rap_flags;
51 };
52
53 struct ra_metadata_s {
54 char *ra_version;
55 GList *ra_params;
56 uint32_t ra_flags;
57 };
58
59 #define controld_set_ra_flags(ra_md, ra_key, flags_to_set) do { \
60 (ra_md)->ra_flags = pcmk__set_flags_as(__func__, __LINE__, \
61 LOG_TRACE, "Resource agent", ra_key, \
62 (ra_md)->ra_flags, (flags_to_set), #flags_to_set); \
63 } while (0)
64
65 #define controld_set_ra_param_flags(ra_param, flags_to_set) do { \
66 (ra_param)->rap_flags = pcmk__set_flags_as(__func__, __LINE__, \
67 LOG_TRACE, "Resource agent parameter", (ra_param)->rap_name, \
68 (ra_param)->rap_flags, (flags_to_set), #flags_to_set); \
69 } while (0)
70
71 GHashTable *metadata_cache_new(void);
72 void metadata_cache_free(GHashTable *mdc);
73 void metadata_cache_reset(GHashTable *mdc);
74 void metadata_cache_fini(void);
75
76 struct ra_metadata_s *metadata_cache_update(GHashTable *mdc,
77 lrmd_rsc_info_t *rsc,
78 const char *metadata_str);
79 struct ra_metadata_s *controld_get_rsc_metadata(lrm_state_t *lrm_state,
80 lrmd_rsc_info_t *rsc,
81 uint32_t source);
82
83 static inline const char *
84 ra_param_flag2text(enum ra_param_flags_e flag)
85 {
86 switch (flag) {
87 case ra_param_reloadable:
88 return "reloadable";
89 case ra_param_unique:
90 return "unique";
91 case ra_param_private:
92 return "private";
93 default:
94 return "unknown";
95 }
96 }
97
98 #endif