This source file includes following definitions.
- crm_get_cluster_proc
- pcmk__cs_err_str
1
2
3
4
5
6
7
8
9
10 #ifndef CRM_CLUSTER_INTERNAL__H
11 # define CRM_CLUSTER_INTERNAL__H
12
13 # include <stdint.h>
14 # include <crm/cluster.h>
15
16
17 enum crm_proc_flag {
18 crm_proc_none = 0x00000001,
19
20
21 crm_proc_cpg = 0x04000000,
22
23
24 crm_proc_execd = 0x00000010,
25 crm_proc_based = 0x00000100,
26 crm_proc_controld = 0x00000200,
27 crm_proc_attrd = 0x00001000,
28 crm_proc_schedulerd = 0x00010000,
29 crm_proc_fenced = 0x00100000,
30 };
31
32
33
34
35
36
37
38
39 static inline uint32_t
40 crm_get_cluster_proc(void)
41 {
42 switch (get_cluster_type()) {
43 case pcmk_cluster_corosync:
44 return crm_proc_cpg;
45
46 default:
47 break;
48 }
49 return crm_proc_none;
50 }
51
52
53
54
55
56
57
58
59
60 static inline const char *
61 pcmk__cs_err_str(int error)
62 {
63 # if SUPPORT_COROSYNC
64 switch (error) {
65 case CS_OK: return "OK";
66 case CS_ERR_LIBRARY: return "Library error";
67 case CS_ERR_VERSION: return "Version error";
68 case CS_ERR_INIT: return "Initialization error";
69 case CS_ERR_TIMEOUT: return "Timeout";
70 case CS_ERR_TRY_AGAIN: return "Try again";
71 case CS_ERR_INVALID_PARAM: return "Invalid parameter";
72 case CS_ERR_NO_MEMORY: return "No memory";
73 case CS_ERR_BAD_HANDLE: return "Bad handle";
74 case CS_ERR_BUSY: return "Busy";
75 case CS_ERR_ACCESS: return "Access error";
76 case CS_ERR_NOT_EXIST: return "Doesn't exist";
77 case CS_ERR_NAME_TOO_LONG: return "Name too long";
78 case CS_ERR_EXIST: return "Exists";
79 case CS_ERR_NO_SPACE: return "No space";
80 case CS_ERR_INTERRUPT: return "Interrupt";
81 case CS_ERR_NAME_NOT_FOUND: return "Name not found";
82 case CS_ERR_NO_RESOURCES: return "No resources";
83 case CS_ERR_NOT_SUPPORTED: return "Not supported";
84 case CS_ERR_BAD_OPERATION: return "Bad operation";
85 case CS_ERR_FAILED_OPERATION: return "Failed operation";
86 case CS_ERR_MESSAGE_ERROR: return "Message error";
87 case CS_ERR_QUEUE_FULL: return "Queue full";
88 case CS_ERR_QUEUE_NOT_AVAILABLE: return "Queue not available";
89 case CS_ERR_BAD_FLAGS: return "Bad flags";
90 case CS_ERR_TOO_BIG: return "Too big";
91 case CS_ERR_NO_SECTIONS: return "No sections";
92 }
93 # endif
94 return "Corosync error";
95 }
96
97 # if SUPPORT_COROSYNC
98
99 #if 0
100
101
102
103
104 #define pcmk__init_cmap(handle) cmap_initialize_map((handle), CMAP_MAP_ICMAP)
105 #else
106 #define pcmk__init_cmap(handle) cmap_initialize(handle)
107 #endif
108
109 char *pcmk__corosync_cluster_name(void);
110 bool pcmk__corosync_add_nodes(xmlNode *xml_parent);
111 # endif
112
113 crm_node_t *crm_update_peer_proc(const char *source, crm_node_t * peer,
114 uint32_t flag, const char *status);
115 crm_node_t *pcmk__update_peer_state(const char *source, crm_node_t *node,
116 const char *state, uint64_t membership);
117
118 void pcmk__update_peer_expected(const char *source, crm_node_t *node,
119 const char *expected);
120 void pcmk__reap_unseen_nodes(uint64_t ring_id);
121
122 void pcmk__corosync_quorum_connect(gboolean (*dispatch)(unsigned long long,
123 gboolean),
124 void (*destroy) (gpointer));
125 crm_node_t *pcmk__search_node_caches(unsigned int id, const char *uname,
126 uint32_t flags);
127 crm_node_t *pcmk__search_cluster_node_cache(unsigned int id, const char *uname);
128
129 void pcmk__refresh_node_caches_from_cib(xmlNode *cib);
130 crm_node_t *pcmk__search_known_node_cache(unsigned int id, const char *uname,
131 uint32_t flags);
132
133 #endif