pacemaker  2.0.2-debe490
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.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 crm_remote_header_v0 __attribute__ ((packed))
 
int crm_remote_send (crm_remote_t *remote, xmlNode *msg)
 
xmlNode * crm_remote_parse_buffer (crm_remote_t *remote)
 
int crm_remote_ready (crm_remote_t *remote, int total_timeout)
 
gboolean crm_remote_recv (crm_remote_t *remote, int total_timeout, int *disconnected)
 
int crm_remote_tcp_connect_async (const char *host, int port, int timeout, int *timer_id, void *userdata, void(*callback)(void *userdata, int sock))
 
int crm_remote_tcp_connect (const char *host, int port)
 
void crm_sockaddr2str (void *sa, char *s)
 Convert an IP address (IPv4 or IPv6) to a string for logging. More...
 
int crm_remote_accept (int ssock)
 
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 60 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 64 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 70 of file remote.c.

#define ENDIAN_LOCAL   0xBADADBBD

Definition at line 82 of file remote.c.

#define REMOTE_MSG_VERSION   1

Definition at line 81 of file remote.c.

Function Documentation

struct crm_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 1180 of file remote.c.

int crm_remote_accept ( int  ssock)

Definition at line 1125 of file remote.c.

xmlNode* crm_remote_parse_buffer ( crm_remote_t remote)

Definition at line 530 of file remote.c.

int crm_remote_ready ( crm_remote_t remote,
int  total_timeout 
)

Definition at line 602 of file remote.c.

gboolean crm_remote_recv ( crm_remote_t remote,
int  total_timeout,
int *  disconnected 
)

Definition at line 764 of file remote.c.

int crm_remote_send ( crm_remote_t remote,
xmlNode *  msg 
)

Definition at line 481 of file remote.c.

int crm_remote_tcp_connect ( const char *  host,
int  port 
)

Definition at line 1090 of file remote.c.

int crm_remote_tcp_connect_async ( const char *  host,
int  port,
int  timeout,
int *  timer_id,
void *  userdata,
void(*)(void *userdata, int sock)  callback 
)

Definition at line 1006 of file remote.c.

void crm_sockaddr2str ( void *  sa,
char *  s 
)

Convert an IP address (IPv4 or IPv6) to a string for logging.

Parameters
[in]saSocket address for IP
[out]sStorage for at least INET6_ADDRSTRLEN bytes
Note
sa The socket address can be a pointer to struct sockaddr_in (IPv4), struct sockaddr_in6 (IPv6) or struct sockaddr_storage (either), as long as its sa_family member is set correctly.

Definition at line 1106 of file remote.c.

Variable Documentation

struct tcp_async_cb_data __attribute__
uint32_t endian

Definition at line 145 of file remote.c.

uint64_t flags

Definition at line 148 of file remote.c.

uint64_t id

Definition at line 147 of file remote.c.

uint32_t payload_compressed

Definition at line 151 of file remote.c.

uint32_t payload_offset

Definition at line 150 of file remote.c.

uint32_t payload_uncompressed

Definition at line 152 of file remote.c.

uint32_t size_total

Definition at line 149 of file remote.c.

uint32_t version

Definition at line 146 of file remote.c.