#include <crm_internal.h>
#include <bzlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <crm/common/ipc.h>
#include <crm/cluster/internal.h>
#include <crm/common/mainloop.h>
#include <sys/utsname.h>
#include <qb/qbipc_common.h>
#include <qb/qbipcc.h>
#include <qb/qbutil.h>
#include <corosync/corodefs.h>
#include <corosync/corotypes.h>
#include <corosync/hdb.h>
#include <corosync/cpg.h>
#include <crm/msg_xml.h>
#include <crm/common/ipc_internal.h>
#include "crmcluster_private.h"
Go to the source code of this file.
|
struct pcmk__cpg_host_s | __attribute__ ((packed)) |
|
struct qb_ipc_response_header header | __attribute__ ((aligned(8))) |
|
void | cluster_disconnect_cpg (crm_cluster_t *cluster) |
| Disconnect from Corosync CPG. More...
|
|
uint32_t | get_local_nodeid (cpg_handle_t handle) |
| Get the local Corosync node ID (via CPG) More...
|
|
char * | pcmk_message_common_cs (cpg_handle_t handle, uint32_t nodeid, uint32_t pid, void *content, uint32_t *kind, const char **from) |
| Extract text data from a Corosync CPG message. More...
|
|
void | pcmk_cpg_membership (cpg_handle_t handle, const struct cpg_name *groupName, const struct cpg_address *member_list, size_t member_list_entries, const struct cpg_address *left_list, size_t left_list_entries, const struct cpg_address *joined_list, size_t joined_list_entries) |
| Handle a CPG configuration change event. More...
|
|
gboolean | cluster_connect_cpg (crm_cluster_t *cluster) |
| Connect to Corosync CPG. More...
|
|
bool | pcmk__cpg_send_xml (const xmlNode *msg, const crm_node_t *node, enum crm_ais_msg_types dest) |
|
gboolean | send_cluster_text (enum crm_ais_msg_class msg_class, const char *data, gboolean local, const crm_node_t *node, enum crm_ais_msg_types dest) |
|
enum crm_ais_msg_types | text2msg_type (const char *text) |
| Get the message type equivalent of a string. More...
|
|
◆ cs_repeat
#define cs_repeat |
( |
|
rc, |
|
|
|
counter, |
|
|
|
max, |
|
|
|
code |
|
) |
| |
Value:do { \
rc = code; \
if ((rc == CS_ERR_TRY_AGAIN) || (rc == CS_ERR_QUEUE_FULL)) { \
counter++; \
crm_debug("Retrying operation after %ds", counter); \
sleep(counter); \
} else { \
break; \
} \
} while (counter < max)
Definition at line 78 of file cpg.c.
◆ CS_SEND_MAX
◆ msg_data_len
Definition at line 76 of file cpg.c.
◆ pcmk__cpg_host_t
Definition at line 55 of file cpg.c.
◆ pcmk__cpg_msg_t
Definition at line 72 of file cpg.c.
◆ __attribute__() [1/2]
struct pcmk__cpg_host_s __attribute__ |
( |
(packed) |
| ) |
|
◆ __attribute__() [2/2]
struct qb_ipc_response_header header __attribute__::__attribute__ |
( |
(aligned(8)) |
| ) |
|
◆ cluster_connect_cpg()
Connect to Corosync CPG.
- Parameters
-
[in,out] | cluster | Cluster object |
- Returns
- TRUE on success, otherwise FALSE
Definition at line 785 of file cpg.c.
◆ cluster_disconnect_cpg()
Disconnect from Corosync CPG.
- Parameters
-
[in,out] | cluster | Cluster to disconnect |
Definition at line 95 of file cpg.c.
◆ get_local_nodeid()
uint32_t get_local_nodeid |
( |
cpg_handle_t |
handle | ) |
|
Get the local Corosync node ID (via CPG)
- Parameters
-
[in] | handle | CPG connection to use (or 0 to use new connection) |
- Returns
- Corosync ID of local node (or 0 if not known)
Definition at line 117 of file cpg.c.
◆ pcmk__cpg_send_xml()
◆ pcmk_cpg_membership()
void pcmk_cpg_membership |
( |
cpg_handle_t |
handle, |
|
|
const struct cpg_name * |
groupName, |
|
|
const struct cpg_address * |
member_list, |
|
|
size_t |
member_list_entries, |
|
|
const struct cpg_address * |
left_list, |
|
|
size_t |
left_list_entries, |
|
|
const struct cpg_address * |
joined_list, |
|
|
size_t |
joined_list_entries |
|
) |
| |
Handle a CPG configuration change event.
- Parameters
-
[in] | handle | CPG connection |
[in] | cpg_name | CPG group name |
[in] | member_list | List of current CPG members |
[in] | member_list_entries | Number of entries in member_list |
[in] | left_list | List of CPG members that left |
[in] | left_list_entries | Number of entries in left_list |
[in] | joined_list | List of CPG members that joined |
[in] | joined_list_entries | Number of entries in joined_list |
Definition at line 687 of file cpg.c.
◆ pcmk_message_common_cs()
char* pcmk_message_common_cs |
( |
cpg_handle_t |
handle, |
|
|
uint32_t |
nodeid, |
|
|
uint32_t |
pid, |
|
|
void * |
content, |
|
|
uint32_t * |
kind, |
|
|
const char ** |
from |
|
) |
| |
Extract text data from a Corosync CPG message.
- Parameters
-
[in] | handle | CPG connection (to get local node ID if not known) |
[in] | nodeid | Corosync ID of node that sent message |
[in] | pid | Process ID of message sender (for logging only) |
[in,out] | content | CPG message |
[out] | kind | If not NULL, will be set to CPG header ID (which should be an enum crm_ais_msg_class value, currently always crm_class_cluster) |
[out] | from | If not NULL, will be set to sender uname (valid for the lifetime of content ) |
- Returns
- Newly allocated string with message data
- Note
- It is the caller's responsibility to free the return value with free().
Definition at line 441 of file cpg.c.
◆ send_cluster_text()
◆ text2msg_type()
Get the message type equivalent of a string.
- Parameters
-
[in] | text | String of message type |
- Returns
- Message type equivalent of
text
Definition at line 1055 of file cpg.c.
◆ compressed_size
Definition at line 53 of file cpg.c.
◆ data
Definition at line 55 of file cpg.c.
◆ host
Definition at line 49 of file cpg.c.
◆ id
Definition at line 45 of file cpg.c.
◆ is_compressed
Definition at line 47 of file cpg.c.
◆ local
Definition at line 47 of file cpg.c.
◆ pid
Definition at line 46 of file cpg.c.
◆ sender
Definition at line 50 of file cpg.c.
◆ size
Definition at line 49 of file cpg.c.
◆ type
Definition at line 48 of file cpg.c.
◆ uname
Definition at line 50 of file cpg.c.