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 <stdbool.h>
14
15 #include <crm/common/nodes.h>
16 #include <crm/common/scheduler_types.h>
17
18
19
20 typedef struct pcmk__remote_s pcmk__remote_t;
21
22 int pcmk__remote_send_xml(pcmk__remote_t *remote, const xmlNode *msg);
23 int pcmk__remote_ready(const pcmk__remote_t *remote, int timeout_ms);
24 int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms);
25 xmlNode *pcmk__remote_message_xml(pcmk__remote_t *remote);
26 int pcmk__connect_remote(const char *host, int port, int timeout_ms,
27 int *timer_id, int *sock_fd, void *userdata,
28 void (*callback) (void *userdata, int rc, int sock));
29 int pcmk__accept_remote_connection(int ssock, int *csock);
30 void pcmk__sockaddr2str(const void *sa, char *s);
31
32
33
34
35
36
37
38
39
40 static inline bool
41 pcmk__is_pacemaker_remote_node(const pcmk_node_t *node)
42 {
43 return (node != NULL) && (node->details->type == pcmk_node_variant_remote);
44 }
45
46
47
48
49
50
51
52
53
54 static inline bool
55 pcmk__is_remote_node(const pcmk_node_t *node)
56 {
57 return pcmk__is_pacemaker_remote_node(node)
58 && ((node->details->remote_rsc == NULL)
59 || (node->details->remote_rsc->container == NULL));
60 }
61
62
63
64
65
66
67
68
69
70 static inline bool
71 pcmk__is_guest_or_bundle_node(const pcmk_node_t *node)
72 {
73 return pcmk__is_pacemaker_remote_node(node)
74 && (node->details->remote_rsc != NULL)
75 && (node->details->remote_rsc->container != NULL);
76 }
77
78 #ifdef HAVE_GNUTLS_GNUTLS_H
79 #include <gnutls/gnutls.h>
80
81 gnutls_session_t *pcmk__new_tls_session(int csock, unsigned int conn_type,
82 gnutls_credentials_type_t cred_type,
83 void *credentials);
84 int pcmk__init_tls_dh(gnutls_dh_params_t *dh_params);
85 int pcmk__read_handshake_data(const pcmk__client_t *client);
86
87
88
89
90
91
92
93
94
95
96
97
98
99 int pcmk__tls_client_handshake(pcmk__remote_t *remote, int timeout_sec,
100 int *gnutls_rc);
101
102 #endif
103 #endif