pacemaker  1.1.14-70404b0
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros | Typedefs | Functions
lrmd_client.c File Reference
#include <crm_internal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <glib.h>
#include <dirent.h>
#include <crm/crm.h>
#include <crm/lrmd.h>
#include <crm/services.h>
#include <crm/common/mainloop.h>
#include <crm/common/ipcs.h>
#include <crm/msg_xml.h>
#include <crm/stonith-ng.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <netdb.h>
Include dependency graph for lrmd_client.c:

Go to the source code of this file.

Macros

#define MAX_TLS_RECV_WAIT   10000
 
#define lsb_metadata_template
 
#define LSB_INITSCRIPT_INFOBEGIN_TAG   "### BEGIN INIT INFO"
 
#define LSB_INITSCRIPT_INFOEND_TAG   "### END INIT INFO"
 
#define PROVIDES   "# Provides:"
 
#define REQ_START   "# Required-Start:"
 
#define REQ_STOP   "# Required-Stop:"
 
#define SHLD_START   "# Should-Start:"
 
#define SHLD_STOP   "# Should-Stop:"
 
#define DFLT_START   "# Default-Start:"
 
#define DFLT_STOP   "# Default-Stop:"
 
#define SHORT_DSCR   "# Short-Description:"
 
#define DESCRIPTION   "# Description:"
 
#define lsb_meta_helper_free_value(m)
 

Typedefs

typedef struct lrmd_private_s lrmd_private_t
 

Functions

 CRM_TRACE_INIT_DATA (lrmd)
 
int lrmd_internal_proxy_send (lrmd_t *lrmd, xmlNode *msg)
 
void lrmd_internal_set_proxy_callback (lrmd_t *lrmd, void *userdata, void(*callback)(lrmd_t *lrmd, void *userdata, xmlNode *msg))
 
void lrmd_list_freeall (lrmd_list_t *head)
 
lrmd_key_value_tlrmd_key_value_add (lrmd_key_value_t *head, const char *key, const char *value)
 
void lrmd_key_value_freeall (lrmd_key_value_t *head)
 
lrmd_event_data_tlrmd_copy_event (lrmd_event_data_t *event)
 
void lrmd_free_event (lrmd_event_data_t *event)
 
int lrmd_poll (lrmd_t *lrmd, int timeout)
 Poll for a specified timeout period to determine if a message is ready for dispatch. More...
 
bool lrmd_dispatch (lrmd_t *lrmd)
 Use after lrmd_poll returns 1 to read and dispatch a message. More...
 
lrmd_rsc_info_tlrmd_copy_rsc_info (lrmd_rsc_info_t *rsc_info)
 
void lrmd_free_rsc_info (lrmd_rsc_info_t *rsc_info)
 
lrmd_tlrmd_api_new (void)
 Create a new local lrmd connection. More...
 
lrmd_tlrmd_remote_api_new (const char *nodename, const char *server, int port)
 Create a new remote lrmd connection using tls backend. More...
 
void lrmd_api_delete (lrmd_t *lrmd)
 Destroy lrmd object. More...
 

Macro Definition Documentation

#define DESCRIPTION   "# Description:"

Definition at line 1608 of file lrmd_client.c.

#define DFLT_START   "# Default-Start:"

Definition at line 1605 of file lrmd_client.c.

#define DFLT_STOP   "# Default-Stop:"

Definition at line 1606 of file lrmd_client.c.

#define LSB_INITSCRIPT_INFOBEGIN_TAG   "### BEGIN INIT INFO"

Definition at line 1598 of file lrmd_client.c.

#define LSB_INITSCRIPT_INFOEND_TAG   "### END INIT INFO"

Definition at line 1599 of file lrmd_client.c.

#define lsb_meta_helper_free_value (   m)
Value:
do { \
if ((m) != NULL) { \
xmlFree(m); \
(m) = NULL; \
} \
} while(0)

Definition at line 1610 of file lrmd_client.c.

#define lsb_metadata_template
Value:
"<?xml version='1.0'?>\n" \
"<!DOCTYPE resource-agent SYSTEM 'ra-api-1.dtd'>\n" \
"<resource-agent name='%s' version='0.1'>\n" \
" <version>1.0</version>\n" \
" <longdesc lang='en'>\n" \
" %s\n" \
" </longdesc>\n" \
" <shortdesc lang='en'>%s</shortdesc>\n" \
" <parameters>\n" \
" </parameters>\n" \
" <actions>\n" \
" <action name='meta-data' timeout='5' />\n" \
" <action name='start' timeout='15' />\n" \
" <action name='stop' timeout='15' />\n" \
" <action name='status' timeout='15' />\n" \
" <action name='restart' timeout='15' />\n" \
" <action name='force-reload' timeout='15' />\n" \
" <action name='monitor' timeout='15' interval='15' />\n" \
" </actions>\n" \
" <special tag='LSB'>\n" \
" <Provides>%s</Provides>\n" \
" <Required-Start>%s</Required-Start>\n" \
" <Required-Stop>%s</Required-Stop>\n" \
" <Should-Start>%s</Should-Start>\n" \
" <Should-Stop>%s</Should-Stop>\n" \
" <Default-Start>%s</Default-Start>\n" \
" <Default-Stop>%s</Default-Stop>\n" \
" </special>\n" \
"</resource-agent>\n"

Definition at line 1567 of file lrmd_client.c.

#define MAX_TLS_RECV_WAIT   10000

Definition at line 55 of file lrmd_client.c.

#define PROVIDES   "# Provides:"

Definition at line 1600 of file lrmd_client.c.

#define REQ_START   "# Required-Start:"

Definition at line 1601 of file lrmd_client.c.

#define REQ_STOP   "# Required-Stop:"

Definition at line 1602 of file lrmd_client.c.

#define SHLD_START   "# Should-Start:"

Definition at line 1603 of file lrmd_client.c.

#define SHLD_STOP   "# Should-Stop:"

Definition at line 1604 of file lrmd_client.c.

#define SHORT_DSCR   "# Short-Description:"

Definition at line 1607 of file lrmd_client.c.

Typedef Documentation

typedef struct lrmd_private_s lrmd_private_t

Function Documentation

CRM_TRACE_INIT_DATA ( lrmd  )
void lrmd_api_delete ( lrmd_t lrmd)

Destroy lrmd object.

Definition at line 2182 of file lrmd_client.c.

lrmd_t* lrmd_api_new ( void  )

Create a new local lrmd connection.

Definition at line 2120 of file lrmd_client.c.

lrmd_event_data_t* lrmd_copy_event ( lrmd_event_data_t event)

Definition at line 195 of file lrmd_client.c.

lrmd_rsc_info_t* lrmd_copy_rsc_info ( lrmd_rsc_info_t rsc_info)

Definition at line 1439 of file lrmd_client.c.

bool lrmd_dispatch ( lrmd_t lrmd)

Use after lrmd_poll returns 1 to read and dispatch a message.

Parameters
[in,out]lrmdlrmd connection object
Returns
TRUE if connection is still up, FALSE if disconnected

Definition at line 441 of file lrmd_client.c.

void lrmd_free_event ( lrmd_event_data_t event)

Definition at line 226 of file lrmd_client.c.

void lrmd_free_rsc_info ( lrmd_rsc_info_t rsc_info)

Definition at line 1456 of file lrmd_client.c.

int lrmd_internal_proxy_send ( lrmd_t lrmd,
xmlNode *  msg 
)

Definition at line 1540 of file lrmd_client.c.

void lrmd_internal_set_proxy_callback ( lrmd_t lrmd,
void *  userdata,
void(*)(lrmd_t *lrmd, void *userdata, xmlNode *msg)  callback 
)

Definition at line 1520 of file lrmd_client.c.

lrmd_key_value_t* lrmd_key_value_add ( lrmd_key_value_t head,
const char *  key,
const char *  value 
)

Definition at line 152 of file lrmd_client.c.

void lrmd_key_value_freeall ( lrmd_key_value_t head)

Definition at line 175 of file lrmd_client.c.

void lrmd_list_freeall ( lrmd_list_t head)

Definition at line 137 of file lrmd_client.c.

int lrmd_poll ( lrmd_t lrmd,
int  timeout 
)

Poll for a specified timeout period to determine if a message is ready for dispatch.

Return values
1msg is ready
0timeout occurred
negativeerror code

Definition at line 416 of file lrmd_client.c.

lrmd_t* lrmd_remote_api_new ( const char *  nodename,
const char *  server,
int  port 
)

Create a new remote lrmd connection using tls backend.

Parameters
nodenamename of remote node identified with this connection
servername of server to connect to
portport number to connect to
Note
nodename and server may be the same value.

Definition at line 2153 of file lrmd_client.c.