pacemaker 3.0.1-16e74fc4da
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 <stdio.h> // NULL
14#include <stdbool.h> // bool
15#include <libxml/tree.h> // xmlNode
16
17#include <crm/common/ipc_internal.h> // pcmk__client_t
18#include <crm/common/nodes_internal.h> // pcmk__node_variant_remote, etc.
19#include <crm/common/resources_internal.h> // struct pcmk__remote_private
20#include <crm/common/scheduler_types.h> // pcmk_node_t
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26// internal functions from remote.c
27
29
30int pcmk__remote_send_xml(pcmk__remote_t *remote, const xmlNode *msg);
31int pcmk__remote_ready(const pcmk__remote_t *remote, int timeout_ms);
33int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms);
35int 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));
38int pcmk__accept_remote_connection(int ssock, int *csock);
39void pcmk__sockaddr2str(const void *sa, char *s);
40
49static inline bool
50pcmk__is_pacemaker_remote_node(const pcmk_node_t *node)
51{
52 return (node != NULL)
54}
55
64static inline bool
65pcmk__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
80static inline bool
81pcmk__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 // PCMK__CRM_COMMON_REMOTE_INTERNAL__H
int pcmk__remote_ready(const pcmk__remote_t *remote, int timeout_ms)
Definition remote.c:382
int pcmk__read_available_remote_data(pcmk__remote_t *remote)
Definition remote.c:434
int pcmk__remote_send_xml(pcmk__remote_t *remote, const xmlNode *msg)
Definition remote.c:239
int pcmk__accept_remote_connection(int ssock, int *csock)
Definition remote.c:940
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:805
void pcmk__sockaddr2str(const void *sa, char *s)
Definition remote.c:911
xmlNode * pcmk__remote_message_xml(pcmk__remote_t *remote)
Definition remote.c:292
int pcmk__read_remote_message(pcmk__remote_t *remote, int timeout_ms)
Definition remote.c:527
pcmk__cpg_host_t host
Definition cpg.c:4
@ pcmk__node_variant_remote
Type aliases needed to define scheduler objects.
enum pcmk__node_variant variant
pcmk_resource_t * remote
pcmk__resource_private_t * priv
Definition resources.h:61
pcmk__node_private_t * priv
Definition nodes.h:85