root/daemons/controld/controld_utils.h

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

INCLUDED FROM


   1 /*
   2  * Copyright 2004-2025 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef CRMD_UTILS__H
  11 #define CRMD_UTILS__H
  12 
  13 #include <stdint.h>                 // UINT32_C(), uint32_t
  14 
  15 #include <glib.h>                   // gboolean
  16 #include <libxml/tree.h>            // xmlNode
  17 
  18 #include <crm/crm.h>
  19 #include <crm/cluster.h>            // enum controld_join_phase
  20 #include <crm/cluster/internal.h>   // pcmk__node_status_t
  21 #include <crm/common/xml.h>
  22 
  23 #  define FAKE_TE_ID    "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  24 
  25 //! Flags determining how the controller updates node information in the CIB
  26 enum controld_node_update_flags {
  27     //! This flag has no effect
  28     controld_node_update_none     = UINT32_C(0),
  29 
  30     //! Skip loading the node list from the cluster layer
  31     controld_node_update_quick    = (UINT32_C(1) << 0),
  32 
  33     //! Update \c PCMK__XA_IN_CCM with the time the node became a cluster member
  34     controld_node_update_cluster  = (UINT32_C(1) << 1),
  35 
  36     //! Update \c PCMK_XA_CRMD with the time the node joined the CPG
  37     controld_node_update_peer     = (UINT32_C(1) << 2),
  38 
  39     //! Update \c PCMK__XA_JOIN with the node's join state
  40     controld_node_update_join     = (UINT32_C(1) << 3),
  41 
  42     //! Update \c PCMK_XA_EXPECTED with the node's expected join state
  43     controld_node_update_expected = (UINT32_C(1) << 4),
  44 
  45     //! Convenience alias to update all of the attributes mentioned above
  46     controld_node_update_all      = controld_node_update_cluster
  47                                     |controld_node_update_peer
  48                                     |controld_node_update_join
  49                                     |controld_node_update_expected,
  50 };
  51 
  52 crm_exit_t crmd_exit(crm_exit_t exit_code);
  53 _Noreturn void crmd_fast_exit(crm_exit_t exit_code);
  54 void controld_shutdown_schedulerd_ipc(void);
  55 void controld_stop_sched_timer(void);
  56 void controld_free_sched_timer(void);
  57 void controld_expect_sched_reply(char *ref);
  58 
  59 void fsa_dump_actions(uint64_t action, const char *text);
  60 void fsa_dump_inputs(int log_level, const char *text, long long input_register);
  61 
  62 gboolean update_dc(xmlNode * msg);
  63 void crm_update_peer_join(const char *source, pcmk__node_status_t *node,
  64                           enum controld_join_phase phase);
  65 xmlNode *create_node_state_update(pcmk__node_status_t *node, uint32_t flags,
  66                                   xmlNode *parent, const char *source);
  67 void populate_cib_nodes(uint32_t flags, const char *source);
  68 void crm_update_quorum(gboolean quorum, gboolean force_update);
  69 void controld_close_attrd_ipc(void);
  70 void update_attrd(const char *host, const char *name, const char *value, const char *user_name, gboolean is_remote_node);
  71 void update_attrd_list(GList *attrs, uint32_t opts);
  72 void update_attrd_remote_node_removed(const char *host, const char *user_name);
  73 void update_attrd_clear_failures(const char *host, const char *rsc,
  74                                  const char *op, const char *interval_spec,
  75                                  gboolean is_remote_node);
  76 
  77 int crmd_join_phase_count(enum controld_join_phase phase);
  78 void crmd_join_phase_log(int level);
  79 
  80 void crmd_peer_down(pcmk__node_status_t *peer, bool full);
  81 
  82 bool feature_set_compatible(const char *dc_version, const char *join_version);
  83 bool controld_is_local_node(const char *name);
  84 pcmk__node_status_t *controld_get_local_node_status(void);
  85 const char *get_node_id(xmlNode *lrm_rsc_op);
  86 
  87 #endif

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