pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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/ipcs_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 (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 (void *sa, char *s)
 
int pcmk__accept_remote_connection (int ssock, int *csock)
 
int crm_default_remote_port ()
 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

#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.

#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.

#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.

#define ENDIAN_LOCAL   0xBADADBBD

Definition at line 70 of file remote.c.

#define REMOTE_MSG_VERSION   1

Definition at line 69 of file remote.c.

Function Documentation

struct remote_header_v0 __attribute__ ( (packed)  )
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 1262 of file remote.c.

int pcmk__accept_remote_connection ( int  ssock,
int *  csock 
)

Definition at line 1207 of file remote.c.

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 1076 of file remote.c.

int pcmk__read_remote_message ( pcmk__remote_t remote,
int  timeout_ms 
)

Definition at line 804 of file remote.c.

xmlNode* pcmk__remote_message_xml ( pcmk__remote_t remote)

Definition at line 553 of file remote.c.

int pcmk__remote_ready ( pcmk__remote_t remote,
int  timeout_ms 
)

Definition at line 646 of file remote.c.

int pcmk__remote_send_xml ( pcmk__remote_t remote,
xmlNode *  msg 
)

Definition at line 501 of file remote.c.

void pcmk__sockaddr2str ( void *  sa,
char *  s 
)

Definition at line 1179 of file remote.c.

Variable Documentation

struct tcp_async_cb_data __attribute__
uint32_t endian

Definition at line 146 of file remote.c.

uint64_t flags

Definition at line 149 of file remote.c.

uint64_t id

Definition at line 148 of file remote.c.

uint32_t payload_compressed

Definition at line 152 of file remote.c.

uint32_t payload_offset

Definition at line 151 of file remote.c.

uint32_t payload_uncompressed

Definition at line 153 of file remote.c.

uint32_t size_total

Definition at line 150 of file remote.c.

uint32_t version

Definition at line 147 of file remote.c.