root/daemons/controld/controld_messages.h

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

INCLUDED FROM


   1 /*
   2  * Copyright 2004-2022 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 XML_CRM_MESSAGES__H
  11 #  define XML_CRM_MESSAGES__H
  12 
  13 #  include <crm/crm.h>
  14 #  include <crm/common/ipc_internal.h>
  15 #  include <crm/common/xml.h>
  16 #  include <crm/cluster/internal.h>
  17 #  include <controld_fsa.h>
  18 
  19 typedef struct ha_msg_input_s {
  20     xmlNode *msg;
  21     xmlNode *xml;
  22 
  23 } ha_msg_input_t;
  24 
  25 extern ha_msg_input_t *new_ha_msg_input(xmlNode * orig);
  26 extern void delete_ha_msg_input(ha_msg_input_t * orig);
  27 
  28 extern void *fsa_typed_data_adv(fsa_data_t * fsa_data, enum fsa_data_type a_type,
  29                                 const char *caller);
  30 
  31 #  define fsa_typed_data(x) fsa_typed_data_adv(msg_data, x, __func__)
  32 
  33 extern void register_fsa_error_adv(enum crmd_fsa_cause cause, enum crmd_fsa_input input,
  34                                    fsa_data_t * cur_data, void *new_data, const char *raised_from);
  35 
  36 #define register_fsa_error(cause, input, new_data)  \
  37     register_fsa_error_adv(cause, input, msg_data, new_data, __func__)
  38 
  39 extern int register_fsa_input_adv(enum crmd_fsa_cause cause, enum crmd_fsa_input input,
  40                                   void *data, uint64_t with_actions,
  41                                   gboolean prepend, const char *raised_from);
  42 
  43 extern void fsa_dump_queue(int log_level);
  44 extern void route_message(enum crmd_fsa_cause cause, xmlNode * input);
  45 
  46 #  define crmd_fsa_stall(suppress) do {                                 \
  47     if(suppress == FALSE && msg_data != NULL) {                         \
  48         register_fsa_input_adv(                                         \
  49             ((fsa_data_t*)msg_data)->fsa_cause, I_WAIT_FOR_EVENT,       \
  50             ((fsa_data_t*)msg_data)->data, action, TRUE, __func__);     \
  51     } else {                                                            \
  52         register_fsa_input_adv(                                         \
  53             C_FSA_INTERNAL, I_WAIT_FOR_EVENT,                           \
  54             NULL, action, TRUE, __func__);                              \
  55     }                                                                   \
  56     } while(0)
  57 
  58 #define register_fsa_input(cause, input, data)          \
  59     register_fsa_input_adv(cause, input, data, A_NOTHING, FALSE, __func__)
  60 
  61 #define register_fsa_input_before(cause, input, data)   \
  62     register_fsa_input_adv(cause, input, data, A_NOTHING, TRUE, __func__)
  63 
  64 #define register_fsa_input_later(cause, input, data)    \
  65     register_fsa_input_adv(cause, input, data, A_NOTHING, FALSE, __func__)
  66 
  67 void delete_fsa_input(fsa_data_t * fsa_data);
  68 
  69 fsa_data_t *get_message(void);
  70 
  71 extern gboolean relay_message(xmlNode * relay_message, gboolean originated_locally);
  72 
  73 gboolean crmd_is_proxy_session(const char *session);
  74 void crmd_proxy_send(const char *session, xmlNode *msg);
  75 
  76 bool controld_authorize_ipc_message(const xmlNode *client_msg,
  77                                     pcmk__client_t *curr_client,
  78                                     const char *proxy_session);
  79 
  80 extern gboolean send_request(xmlNode * msg, char **msg_reference);
  81 
  82 extern ha_msg_input_t *copy_ha_msg_input(ha_msg_input_t * orig);
  83 
  84 void send_remote_state_message(const char *node_name, gboolean node_up);
  85 
  86 #endif

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