pacemaker  2.1.5-b7adf64e51
Scalable High-Availability cluster resource manager
Macros | Functions | Variables
remote.c File Reference
#include <crm_internal.h>
#include <crm/crm.h>
#include <sys/param.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <stdlib.h>
#include <errno.h>
#include <inttypes.h>
#include <glib.h>
#include <bzlib.h>
#include <crm/common/ipc_internal.h>
#include <crm/common/xml.h>
#include <crm/common/mainloop.h>
#include <crm/common/remote_internal.h>
Include dependency graph for remote.c:

Go to the source code of this file.

Macros

#define __swab16(x)
 
#define __swab32(x)
 
#define __swab64(x)
 
#define REMOTE_MSG_VERSION   1
 
#define ENDIAN_LOCAL   0xBADADBBD
 

Functions

struct remote_header_v0 __attribute__ ((packed))
 
int pcmk__remote_send_xml (pcmk__remote_t *remote, xmlNode *msg)
 
xmlNode * pcmk__remote_message_xml (pcmk__remote_t *remote)
 
int pcmk__remote_ready (const pcmk__remote_t *remote, int timeout_ms)
 
int pcmk__read_remote_message (pcmk__remote_t *remote, int timeout_ms)
 
int pcmk__connect_remote (const char *host, int port, int timeout, int *timer_id, int *sock_fd, void *userdata, void(*callback)(void *userdata, int rc, int sock))
 
void pcmk__sockaddr2str (const void *sa, char *s)
 
int pcmk__accept_remote_connection (int ssock, int *csock)
 
int crm_default_remote_port (void)
 Get the default remote connection TCP port on this host. More...
 

Variables

uint32_t endian
 
uint32_t version
 
uint64_t id
 
uint64_t flags
 
uint32_t size_total
 
uint32_t payload_offset
 
uint32_t payload_compressed
 
uint32_t payload_uncompressed
 
struct tcp_async_cb_data __attribute__
 

Macro Definition Documentation

◆ __swab16

#define __swab16 (   x)
Value:
((uint16_t)( \
(((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
(((uint16_t)(x) & (uint16_t)0xff00U) >> 8)))

Definition at line 48 of file remote.c.

◆ __swab32

#define __swab32 (   x)
Value:
((uint32_t)( \
(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
(((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))

Definition at line 52 of file remote.c.

◆ __swab64

#define __swab64 (   x)
Value:
((uint64_t)( \
(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56)))

Definition at line 58 of file remote.c.

◆ ENDIAN_LOCAL

#define ENDIAN_LOCAL   0xBADADBBD

Definition at line 70 of file remote.c.

◆ REMOTE_MSG_VERSION

#define REMOTE_MSG_VERSION   1

Definition at line 69 of file remote.c.

Function Documentation

◆ __attribute__()

struct remote_header_v0 __attribute__ ( (packed)  )

◆ crm_default_remote_port()

int crm_default_remote_port ( void  )

Get the default remote connection TCP port on this host.

Returns
Remote connection TCP port number

Definition at line 1250 of file remote.c.

◆ pcmk__accept_remote_connection()

int pcmk__accept_remote_connection ( int  ssock,
int *  csock 
)

Definition at line 1195 of file remote.c.

◆ pcmk__connect_remote()

int pcmk__connect_remote ( const char *  host,
int  port,
int  timeout,
int *  timer_id,
int *  sock_fd,
void *  userdata,
void(*)(void *userdata, int rc, int sock)  callback 
)

Definition at line 1063 of file remote.c.

◆ pcmk__read_remote_message()

int pcmk__read_remote_message ( pcmk__remote_t remote,
int  timeout_ms 
)

Definition at line 791 of file remote.c.

◆ pcmk__remote_message_xml()

xmlNode* pcmk__remote_message_xml ( pcmk__remote_t remote)

Definition at line 540 of file remote.c.

◆ pcmk__remote_ready()

int pcmk__remote_ready ( const pcmk__remote_t remote,
int  timeout_ms 
)

Definition at line 633 of file remote.c.

◆ pcmk__remote_send_xml()

int pcmk__remote_send_xml ( pcmk__remote_t remote,
xmlNode *  msg 
)

Definition at line 488 of file remote.c.

◆ pcmk__sockaddr2str()

void pcmk__sockaddr2str ( const void *  sa,
char *  s 
)

Definition at line 1166 of file remote.c.

Variable Documentation

◆ __attribute__

struct tcp_async_cb_data __attribute__

◆ endian

uint32_t endian

Definition at line 212 of file remote.c.

◆ flags

uint64_t flags

Definition at line 215 of file remote.c.

◆ id

uint64_t id

Definition at line 214 of file remote.c.

◆ payload_compressed

uint32_t payload_compressed

Definition at line 218 of file remote.c.

◆ payload_offset

uint32_t payload_offset

Definition at line 217 of file remote.c.

◆ payload_uncompressed

uint32_t payload_uncompressed

Definition at line 219 of file remote.c.

◆ size_total

uint32_t size_total

Definition at line 216 of file remote.c.

◆ version

uint32_t version

Definition at line 213 of file remote.c.