pacemaker  2.0.5-ba59be712
Scalable High-Availability cluster resource manager
lrmd_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2020 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 LRMD_INTERNAL__H
11 #define LRMD_INTERNAL__H
12 
13 #include <stdint.h> // uint32_t
14 #include <glib.h> // GList, GHashTable, gpointer
15 #include <libxml/tree.h> // xmlNode
16 #include <crm/common/ipc.h> // crm_ipc_t
17 #include <crm/common/mainloop.h> // mainloop_io_t, ipc_client_callbacks
18 #include <crm/common/remote_internal.h> // pcmk__remote_t
19 #include <crm/lrmd.h> // lrmd_t, lrmd_event_data_t
20 
21 int lrmd_send_attribute_alert(lrmd_t *lrmd, GList *alert_list,
22  const char *node, uint32_t nodeid,
23  const char *attr_name, const char *attr_value);
24 int lrmd_send_node_alert(lrmd_t *lrmd, GList *alert_list,
25  const char *node, uint32_t nodeid, const char *state);
26 int lrmd_send_fencing_alert(lrmd_t *lrmd, GList *alert_list,
27  const char *target, const char *task,
28  const char *desc, int op_rc);
29 int lrmd_send_resource_alert(lrmd_t *lrmd, GList *alert_list,
30  const char *node, lrmd_event_data_t *op);
31 
32 int lrmd_tls_send_msg(pcmk__remote_t *session, xmlNode *msg, uint32_t id,
33  const char *msg_type);
34 
35 /* Shared functions for IPC proxy back end */
36 
37 typedef struct remote_proxy_s {
38  char *node_name;
39  char *session_id;
40 
41  gboolean is_local;
42 
45  uint32_t last_request_id;
47 
49 
51  struct ipc_client_callbacks *proxy_callbacks,
52  const char *node_name, const char *session_id,
53  const char *channel);
54 
55 int remote_proxy_check(lrmd_t *lrmd, GHashTable *hash);
56 void remote_proxy_cb(lrmd_t *lrmd, const char *node_name, xmlNode *msg);
59 
60 int remote_proxy_dispatch(const char *buffer, ssize_t length,
61  gpointer userdata);
62 void remote_proxy_disconnected(gpointer data);
63 void remote_proxy_free(gpointer data);
64 
65 void remote_proxy_relay_event(remote_proxy_t *proxy, xmlNode *msg);
66 void remote_proxy_relay_response(remote_proxy_t *proxy, xmlNode *msg,
67  int msg_id);
68 
69 #endif
int lrmd_tls_send_msg(pcmk__remote_t *session, xmlNode *msg, uint32_t id, const char *msg_type)
int remote_proxy_check(lrmd_t *lrmd, GHashTable *hash)
Definition: lrmd_client.c:925
int lrmd_send_resource_alert(lrmd_t *lrmd, GList *alert_list, const char *node, lrmd_event_data_t *op)
Definition: lrmd_alerts.c:345
void remote_proxy_disconnected(gpointer data)
Definition: proxy_common.c:148
uint32_t last_request_id
Definition: lrmd_internal.h:45
struct mainloop_io_s mainloop_io_t
Definition: mainloop.h:32
void remote_proxy_relay_event(remote_proxy_t *proxy, xmlNode *msg)
Definition: proxy_common.c:69
Resource agent executor.
int remote_proxy_dispatch(const char *buffer, ssize_t length, gpointer userdata)
Definition: proxy_common.c:119
Wrappers for and extensions to glib mainloop.
int lrmd_send_node_alert(lrmd_t *lrmd, GList *alert_list, const char *node, uint32_t nodeid, const char *state)
Definition: lrmd_alerts.c:275
struct crm_ipc_s crm_ipc_t
Definition: ipc.h:162
int lrmd_send_attribute_alert(lrmd_t *lrmd, GList *alert_list, const char *node, uint32_t nodeid, const char *attr_name, const char *attr_value)
Definition: lrmd_alerts.c:237
struct remote_proxy_s remote_proxy_t
void remote_proxy_cb(lrmd_t *lrmd, const char *node_name, xmlNode *msg)
Definition: proxy_common.c:206
remote_proxy_t * remote_proxy_new(lrmd_t *lrmd, struct ipc_client_callbacks *proxy_callbacks, const char *node_name, const char *session_id, const char *channel)
Definition: proxy_common.c:166
crm_ipc_t * ipc
Definition: lrmd_internal.h:43
const char * target
Definition: pcmk_fence.c:29
void remote_proxy_nack_shutdown(lrmd_t *lrmd)
We're not going to shutdown as response to a remote proxy shutdown request.
Definition: proxy_common.c:60
mainloop_io_t * source
Definition: lrmd_internal.h:44
void remote_proxy_free(gpointer data)
Definition: proxy_common.c:108
char data[0]
Definition: internal.h:90
void remote_proxy_relay_response(remote_proxy_t *proxy, xmlNode *msg, int msg_id)
Definition: proxy_common.c:82
Definition: lrmd.h:532
IPC interface to Pacemaker daemons.
void remote_proxy_ack_shutdown(lrmd_t *lrmd)
Send an acknowledgment of a remote proxy shutdown request.
Definition: proxy_common.c:45
int lrmd_send_fencing_alert(lrmd_t *lrmd, GList *alert_list, const char *target, const char *task, const char *desc, int op_rc)
Definition: lrmd_alerts.c:310
gboolean is_local
Definition: lrmd_internal.h:41