This source file includes following definitions.
- pcmk__is_pacemaker_remote_node
- pcmk__is_remote_node
- pcmk__is_guest_or_bundle_node
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_REMOTE_INTERNAL__H
11 #define PCMK__CRM_COMMON_REMOTE_INTERNAL__H
12
13 #include <stdio.h>
14 #include <stdbool.h>
15 #include <libxml/tree.h>
16
17 #include <crm/common/ipc_internal.h>
18 #include <crm/common/nodes_internal.h>
19 #include <crm/common/resources_internal.h>
20 #include <crm/common/scheduler_types.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26
27
28 typedef struct pcmk__remote_s pcmk__remote_t;
29
30 int pcmk__remote_send_xml(pcmk__remote_t *remote, const xmlNode *msg);
31 int pcmk__remote_ready(const pcmk__remote_t *remote, int timeout_ms);
32 int pcmk__read_available_remote_data(pcmk__remote_t *remote);
33 int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms);
34 xmlNode *pcmk__remote_message_xml(pcmk__remote_t *remote);
35 int pcmk__connect_remote(const char *host, int port, int timeout_ms,
36 int *timer_id, int *sock_fd, void *userdata,
37 void (*callback) (void *userdata, int rc, int sock));
38 int pcmk__accept_remote_connection(int ssock, int *csock);
39 void pcmk__sockaddr2str(const void *sa, char *s);
40
41
42
43
44
45
46
47
48
49 static inline bool
50 pcmk__is_pacemaker_remote_node(const pcmk_node_t *node)
51 {
52 return (node != NULL)
53 && (node->priv->variant == pcmk__node_variant_remote);
54 }
55
56
57
58
59
60
61
62
63
64 static inline bool
65 pcmk__is_remote_node(const pcmk_node_t *node)
66 {
67 return pcmk__is_pacemaker_remote_node(node)
68 && ((node->priv->remote == NULL)
69 || (node->priv->remote->priv->launcher == NULL));
70 }
71
72
73
74
75
76
77
78
79
80 static inline bool
81 pcmk__is_guest_or_bundle_node(const pcmk_node_t *node)
82 {
83 return pcmk__is_pacemaker_remote_node(node)
84 && (node->priv->remote != NULL)
85 && (node->priv->remote->priv->launcher != NULL);
86 }
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92 #endif