1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef PENGINE__H
19 # define PENGINE__H
20
21 typedef struct rsc_to_node_s rsc_to_node_t;
22 typedef struct rsc_colocation_s rsc_colocation_t;
23 typedef struct rsc_ticket_s rsc_ticket_t;
24 typedef struct lrm_agent_s lrm_agent_t;
25 typedef struct order_constraint_s order_constraint_t;
26
27 # include <glib.h>
28 # include <crm/crm.h>
29 # include <crm/common/iso8601.h>
30 # include <crm/pengine/rules.h>
31 # include <crm/pengine/common.h>
32 # include <crm/pengine/status.h>
33
34 # include <crm/pengine/complex.h>
35
36 enum pe_stop_fail {
37 pesf_block,
38 pesf_stonith,
39 pesf_ignore
40 };
41
42 enum pe_weights {
43 pe_weights_none = 0x0,
44 pe_weights_init = 0x1,
45 pe_weights_forward = 0x4,
46 pe_weights_positive = 0x8,
47 pe_weights_rollback = 0x10,
48 };
49
50 struct rsc_colocation_s {
51 const char *id;
52 const char *node_attribute;
53 resource_t *rsc_lh;
54 resource_t *rsc_rh;
55
56 int role_lh;
57 int role_rh;
58
59 int score;
60 };
61
62 enum loss_ticket_policy_e {
63 loss_ticket_stop,
64 loss_ticket_demote,
65 loss_ticket_fence,
66 loss_ticket_freeze
67 };
68
69 struct rsc_ticket_s {
70 const char *id;
71 resource_t *rsc_lh;
72 ticket_t *ticket;
73 enum loss_ticket_policy_e loss_policy;
74
75 int role_lh;
76 };
77
78 struct rsc_to_node_s {
79 char *id;
80 resource_t *rsc_lh;
81
82 enum rsc_role_e role_filter;
83 enum pe_discover_e discover_mode;
84 GListPtr node_list_rh;
85 };
86
87 struct order_constraint_s {
88 int id;
89 enum pe_ordering type;
90
91 void *lh_opaque;
92 resource_t *lh_rsc;
93 action_t *lh_action;
94 char *lh_action_task;
95
96 void *rh_opaque;
97 resource_t *rh_rsc;
98 action_t *rh_action;
99 char *rh_action_task;
100
101
102
103
104 };
105
106 extern gboolean stage0(pe_working_set_t * data_set);
107 extern gboolean probe_resources(pe_working_set_t * data_set);
108 extern gboolean stage2(pe_working_set_t * data_set);
109 extern gboolean stage3(pe_working_set_t * data_set);
110 extern gboolean stage4(pe_working_set_t * data_set);
111 extern gboolean stage5(pe_working_set_t * data_set);
112 extern gboolean stage6(pe_working_set_t * data_set);
113 extern gboolean stage7(pe_working_set_t * data_set);
114 extern gboolean stage8(pe_working_set_t * data_set);
115
116 extern gboolean summary(GListPtr resources);
117
118 extern gboolean unpack_constraints(xmlNode * xml_constraints, pe_working_set_t * data_set);
119
120 extern gboolean update_action_states(GListPtr actions);
121
122 extern gboolean shutdown_constraints(node_t * node, action_t * shutdown_op,
123 pe_working_set_t * data_set);
124
125 extern gboolean stonith_constraints(node_t * node, action_t * stonith_op,
126 pe_working_set_t * data_set);
127
128 extern int custom_action_order(resource_t * lh_rsc, char *lh_task, action_t * lh_action,
129 resource_t * rh_rsc, char *rh_task, action_t * rh_action,
130 enum pe_ordering type, pe_working_set_t * data_set);
131
132 extern int new_rsc_order(resource_t * lh_rsc, const char *lh_task,
133 resource_t * rh_rsc, const char *rh_task,
134 enum pe_ordering type, pe_working_set_t * data_set);
135
136 # define order_start_start(rsc1,rsc2, type) \
137 new_rsc_order(rsc1, CRMD_ACTION_START, rsc2, CRMD_ACTION_START, type, data_set)
138 # define order_stop_stop(rsc1, rsc2, type) \
139 new_rsc_order(rsc1, CRMD_ACTION_STOP, rsc2, CRMD_ACTION_STOP, type, data_set)
140
141 extern void graph_element_from_action(action_t * action, pe_working_set_t * data_set);
142 extern void add_maintenance_update(pe_working_set_t *data_set);
143
144 extern gboolean show_scores;
145 extern int scores_log_level;
146 extern gboolean show_utilization;
147 extern int utilization_log_level;
148 extern const char *transition_idle_timeout;
149
150 #endif