dhodovsk / source-git / pacemaker

Forked from source-git/pacemaker 3 years ago
Clone

Blame daemons/controld/controld_timers.h

rpm-build 3ee90c
/*
rpm-build 3ee90c
 * Copyright 2004-2019 the Pacemaker project contributors
rpm-build 3ee90c
 *
rpm-build 3ee90c
 * The version control history for this file may have further details.
rpm-build 3ee90c
 *
rpm-build 3ee90c
 * This source code is licensed under the GNU Lesser General Public License
rpm-build 3ee90c
 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
rpm-build 3ee90c
 */
rpm-build 3ee90c
rpm-build 3ee90c
#ifndef CONTROLD_TIMERS__H
rpm-build 3ee90c
#  define CONTROLD_TIMERS__H
rpm-build 3ee90c
rpm-build 3ee90c
#  include <stdbool.h>              // bool
rpm-build 3ee90c
#  include <glib.h>                 // gboolean, gpointer, guint
rpm-build 3ee90c
#  include <controld_fsa.h>         // crmd_fsa_input
rpm-build 3ee90c
rpm-build 3ee90c
typedef struct fsa_timer_s {
rpm-build 3ee90c
    guint source_id;                        // Timer source ID
rpm-build 3ee90c
    guint period_ms;                        // Timer period
rpm-build 3ee90c
    enum crmd_fsa_input fsa_input;          // Input to register if timer pops
rpm-build 3ee90c
    gboolean (*callback) (gpointer data);   // What do if timer pops
rpm-build 3ee90c
    bool log_error;                         // Timer popping indicates error
rpm-build 3ee90c
    int counter;                            // For detecting loops
rpm-build 3ee90c
} fsa_timer_t;
rpm-build 3ee90c
rpm-build 3ee90c
extern fsa_timer_t *election_trigger;
rpm-build 3ee90c
extern fsa_timer_t *shutdown_escalation_timer;
rpm-build 3ee90c
extern fsa_timer_t *transition_timer;
rpm-build 3ee90c
extern fsa_timer_t *integration_timer;
rpm-build 3ee90c
extern fsa_timer_t *finalization_timer;
rpm-build 3ee90c
extern fsa_timer_t *wait_timer;
rpm-build 3ee90c
extern fsa_timer_t *recheck_timer;
rpm-build 3ee90c
rpm-build 3ee90c
extern guint recheck_interval_ms;
rpm-build 3ee90c
extern time_t recheck_by;
rpm-build 3ee90c
rpm-build 3ee90c
bool controld_init_fsa_timers(void);
rpm-build 3ee90c
void controld_free_fsa_timers(void);
rpm-build 3ee90c
gboolean controld_stop_timer(fsa_timer_t *timer);
rpm-build 3ee90c
void controld_start_timer(fsa_timer_t *timer);
rpm-build 3ee90c
void controld_start_recheck_timer(void);
rpm-build 3ee90c
gboolean is_timer_started(fsa_timer_t *timer);
rpm-build 3ee90c
rpm-build 3ee90c
const char *get_timer_desc(fsa_timer_t * timer);
rpm-build 3ee90c
rpm-build 3ee90c
#endif