1
2
3
4
5
6
7
8
9
10 #ifndef CONTROLD_TIMERS__H
11 # define CONTROLD_TIMERS__H
12
13 # include <stdbool.h>
14 # include <glib.h>
15 # include <controld_fsa.h>
16
17 typedef struct fsa_timer_s {
18 guint source_id;
19 guint period_ms;
20 enum crmd_fsa_input fsa_input;
21 gboolean (*callback) (gpointer data);
22 bool log_error;
23 int counter;
24 } fsa_timer_t;
25
26 extern fsa_timer_t *election_trigger;
27 extern fsa_timer_t *shutdown_escalation_timer;
28 extern fsa_timer_t *transition_timer;
29 extern fsa_timer_t *integration_timer;
30 extern fsa_timer_t *finalization_timer;
31 extern fsa_timer_t *wait_timer;
32 extern fsa_timer_t *recheck_timer;
33
34 extern guint recheck_interval_ms;
35 extern time_t recheck_by;
36
37 bool controld_init_fsa_timers(void);
38 void controld_free_fsa_timers(void);
39 gboolean controld_stop_timer(fsa_timer_t *timer);
40 void controld_start_timer(fsa_timer_t *timer);
41 void controld_start_recheck_timer(void);
42 gboolean is_timer_started(fsa_timer_t *timer);
43
44 const char *get_timer_desc(fsa_timer_t * timer);
45
46 #endif