pacemaker 2.1.8-2.1.8
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
remote_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2024 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 PCMK__CRM_COMMON_REMOTE_INTERNAL__H
11#define PCMK__CRM_COMMON_REMOTE_INTERNAL__H
12
13#include <stdbool.h> // bool
14
15#include <crm/common/nodes.h> // pcmk_node_variant_remote
16#include <crm/common/scheduler_types.h> // pcmk_node_t
17
18// internal functions from remote.c
19
21
22int pcmk__remote_send_xml(pcmk__remote_t *remote, const xmlNode *msg);
23int pcmk__remote_ready(const pcmk__remote_t *remote, int timeout_ms);
24int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms);
26int 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));
29int pcmk__accept_remote_connection(int ssock, int *csock);
30void pcmk__sockaddr2str(const void *sa, char *s);
31
40static inline bool
41pcmk__is_pacemaker_remote_node(const pcmk_node_t *node)
42{
43 return (node != NULL) && (node->details->type == pcmk_node_variant_remote);
44}
45
54static inline bool
55pcmk__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
70static inline bool
71pcmk__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
81gnutls_session_t *pcmk__new_tls_session(int csock, unsigned int conn_type,
82 gnutls_credentials_type_t cred_type,
83 void *credentials);
84int pcmk__init_tls_dh(gnutls_dh_params_t *dh_params);
85int pcmk__read_handshake_data(const pcmk__client_t *client);
86
99int pcmk__tls_client_handshake(pcmk__remote_t *remote, int timeout_sec,
100 int *gnutls_rc);
101
102#endif // HAVE_GNUTLS_GNUTLS_H
103#endif // PCMK__CRM_COMMON_REMOTE_INTERNAL__H
int pcmk__remote_ready(const pcmk__remote_t *remote, int timeout_ms)
Definition remote.c:649
int pcmk__remote_send_xml(pcmk__remote_t *remote, const xmlNode *msg)
Definition remote.c:501
int pcmk__accept_remote_connection(int ssock, int *csock)
Definition remote.c:1214
int pcmk__connect_remote(const char *host, int port, int timeout_ms, int *timer_id, int *sock_fd, void *userdata, void(*callback)(void *userdata, int rc, int sock))
Definition remote.c:1079
void pcmk__sockaddr2str(const void *sa, char *s)
Definition remote.c:1185
xmlNode * pcmk__remote_message_xml(pcmk__remote_t *remote)
Definition remote.c:554
int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms)
Definition remote.c:807
pcmk__cpg_host_t host
Definition cpg.c:4
Scheduler API for nodes.
@ pcmk_node_variant_remote
Definition nodes.h:40
Type aliases needed to define scheduler objects.
struct pe_node_shared_s * details
Definition nodes.h:167
pcmk_resource_t * remote_rsc
Definition nodes.h:135
enum node_type type
Definition nodes.h:74
pcmk_resource_t * container
Definition resources.h:476