root/crmd/tengine.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
   3  *
   4  * This program is free software; you can redistribute it and/or
   5  * modify it under the terms of the GNU Lesser General Public
   6  * License as published by the Free Software Foundation; either
   7  * version 2 of the License, or (at your option) any later version.
   8  *
   9  * This software is distributed in the hope that it will be useful,
  10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12  * General Public License for more details.
  13  *
  14  * You should have received a copy of the GNU Lesser General Public
  15  * License along with this library; if not, write to the Free Software
  16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  17  */
  18 #ifndef TENGINE__H
  19 #  define TENGINE__H
  20 
  21 #  include <crm/transition.h>
  22 #  include <crm/common/mainloop.h>
  23 #  include <crm/stonith-ng.h>
  24 #  include <crm/services.h>
  25 extern stonith_t *stonith_api;
  26 extern void send_stonith_update(crm_action_t * stonith_action, const char *target,
  27                                 const char *uuid);
  28 
  29 /* stonith cleanup list */
  30 void add_stonith_cleanup(const char *target);
  31 void remove_stonith_cleanup(const char *target);
  32 void purge_stonith_cleanup(void);
  33 void execute_stonith_cleanup(void);
  34 
  35 /* tengine */
  36 extern crm_action_t *match_down_event(const char *target, bool quiet);
  37 extern crm_action_t *get_cancel_action(const char *id, const char *node);
  38 
  39 extern gboolean cib_action_update(crm_action_t * action, int status, int op_rc);
  40 extern gboolean fail_incompletable_actions(crm_graph_t * graph, const char *down_node);
  41 extern gboolean process_graph_event(xmlNode * event, const char *event_node);
  42 
  43 /* utils */
  44 extern crm_action_t *get_action(int id, gboolean confirmed);
  45 extern gboolean start_global_timer(crm_action_timer_t * timer, int timeout);
  46 extern gboolean stop_te_timer(crm_action_timer_t * timer);
  47 extern const char *get_rsc_state(const char *task, enum op_status status);
  48 
  49 /* unpack */
  50 extern gboolean process_te_message(xmlNode * msg, xmlNode * xml_data);
  51 
  52 extern crm_graph_t *transition_graph;
  53 extern crm_trigger_t *transition_trigger;
  54 
  55 extern char *te_uuid;
  56 
  57 extern void notify_crmd(crm_graph_t * graph);
  58 
  59 #  include <te_callbacks.h>
  60 
  61 extern void trigger_graph_processing(const char *fn, int line);
  62 extern void abort_transition_graph(int abort_priority, enum transition_action abort_action,
  63                                    const char *abort_text, xmlNode * reason, const char *fn,
  64                                    int line);
  65 
  66 #  define trigger_graph()       trigger_graph_processing(__FUNCTION__, __LINE__)
  67 #  define abort_transition(pri, action, text, reason)                   \
  68         abort_transition_graph(pri, action, text, reason,__FUNCTION__,__LINE__);
  69 
  70 extern gboolean te_connect_stonith(gpointer user_data);
  71 
  72 extern crm_trigger_t *transition_trigger;
  73 extern crm_trigger_t *stonith_reconnect;
  74 
  75 extern char *failed_stop_offset;
  76 extern char *failed_start_offset;
  77 extern int active_timeout;
  78 extern int stonith_op_active;
  79 
  80 void te_action_confirmed(crm_action_t * action);
  81 void te_reset_job_counts(void);
  82 
  83 #endif

/* [previous][next][first][last][top][bottom][index][help] */