#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...
|
|
gboolean | pcmk__cpg_send_xml (xmlNode *msg, 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, 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...
|
|
#define cs_repeat |
( |
|
rc, |
|
|
|
counter, |
|
|
|
max, |
|
|
|
code |
|
) |
| |
Value:
if ((
rc == CS_ERR_TRY_AGAIN) || (
rc == CS_ERR_QUEUE_FULL)) { \
crm_debug(
"Retrying operation after %ds", counter); \
sleep(counter); \
} else { \
break; \
} \
} while (counter < max)
#define crm_debug(fmt, args...)
Definition at line 78 of file cpg.c.
Definition at line 76 of file cpg.c.
Definition at line 55 of file cpg.c.
Definition at line 72 of file cpg.c.
struct pcmk__cpg_host_s __attribute__ |
( |
(packed) |
| ) |
|
struct qb_ipc_response_header header __attribute__::__attribute__ |
( |
(aligned(8)) |
| ) |
|
Connect to Corosync CPG.
- Parameters
-
[in] | cluster | Cluster object |
- Returns
- TRUE on success, otherwise FALSE
Definition at line 771 of file cpg.c.
Disconnect from Corosync CPG.
- Parameters
-
Definition at line 95 of file cpg.c.
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.
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 629 of file cpg.c.
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 yet known) |
[in] | nodeid | Corosync ID of node that sent message |
[in] | pid | Process ID of message sender (for logging only) |
[in] | 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 444 of file cpg.c.
Get the message type equivalent of a string.
- Parameters
-
[in] | text | String of message type |
- Returns
- Message type equivalent of
text
Definition at line 1038 of file cpg.c.
Definition at line 53 of file cpg.c.
Definition at line 55 of file cpg.c.
Definition at line 49 of file cpg.c.
Definition at line 45 of file cpg.c.
Definition at line 47 of file cpg.c.
Definition at line 47 of file cpg.c.
Definition at line 46 of file cpg.c.
Definition at line 50 of file cpg.c.
Definition at line 49 of file cpg.c.
Definition at line 48 of file cpg.c.
Definition at line 50 of file cpg.c.