pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
lrmd.h File Reference

Resource agent executor. More...

#include <stdbool.h>
#include <glib.h>
#include <crm_config.h>
#include <crm/services.h>
Include dependency graph for lrmd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lrmd_key_value_s
struct  lrmd_event_data_s
struct  lrmd_rsc_info_s
struct  lrmd_op_info_s
struct  lrmd_list_s
struct  lrmd_api_operations_s
struct  lrmd_s


#define ALT_REMOTE_KEY_LOCATION   "/etc/corosync/authkey"
#define DEFAULT_REMOTE_PORT   3121
#define F_LRMD_OPERATION   "lrmd_op"
#define F_LRMD_CLIENTNAME   "lrmd_clientname"
#define F_LRMD_IS_IPC_PROVIDER   "lrmd_is_ipc_provider"
#define F_LRMD_CLIENTID   "lrmd_clientid"
#define F_LRMD_PROTOCOL_VERSION   "lrmd_protocol_version"
#define F_LRMD_REMOTE_MSG_TYPE   "lrmd_remote_msg_type"
#define F_LRMD_REMOTE_MSG_ID   "lrmd_remote_msg_id"
#define F_LRMD_CALLBACK_TOKEN   "lrmd_async_id"
#define F_LRMD_CALLID   "lrmd_callid"
#define F_LRMD_CALLOPTS   "lrmd_callopt"
#define F_LRMD_CALLDATA   "lrmd_calldata"
#define F_LRMD_RC   "lrmd_rc"
#define F_LRMD_EXEC_RC   "lrmd_exec_rc"
#define F_LRMD_OP_STATUS   "lrmd_exec_op_status"
#define F_LRMD_TIMEOUT   "lrmd_timeout"
#define F_LRMD_WATCHDOG   "lrmd_watchdog"
#define F_LRMD_CLASS   "lrmd_class"
#define F_LRMD_PROVIDER   "lrmd_provider"
#define F_LRMD_TYPE   "lrmd_type"
#define F_LRMD_ORIGIN   "lrmd_origin"
#define F_LRMD_RSC_RUN_TIME   "lrmd_run_time"
#define F_LRMD_RSC_RCCHANGE_TIME   "lrmd_rcchange_time"
#define F_LRMD_RSC_EXEC_TIME   "lrmd_exec_time"
#define F_LRMD_RSC_QUEUE_TIME   "lrmd_queue_time"
#define F_LRMD_RSC_ID   "lrmd_rsc_id"
#define F_LRMD_RSC_ACTION   "lrmd_rsc_action"
#define F_LRMD_RSC_USERDATA_STR   "lrmd_rsc_userdata_str"
#define F_LRMD_RSC_OUTPUT   "lrmd_rsc_output"
#define F_LRMD_RSC_EXIT_REASON   "lrmd_rsc_exit_reason"
#define F_LRMD_RSC_START_DELAY   "lrmd_rsc_start_delay"
#define F_LRMD_RSC_INTERVAL   "lrmd_rsc_interval"
#define F_LRMD_RSC_DELETED   "lrmd_rsc_deleted"
#define F_LRMD_RSC   "lrmd_rsc"
#define F_LRMD_ALERT_ID   "lrmd_alert_id"
#define F_LRMD_ALERT_PATH   "lrmd_alert_path"
#define F_LRMD_ALERT   "lrmd_alert"
#define LRMD_OP_RSC_REG   "lrmd_rsc_register"
#define LRMD_OP_RSC_EXEC   "lrmd_rsc_exec"
#define LRMD_OP_RSC_CANCEL   "lrmd_rsc_cancel"
#define LRMD_OP_RSC_UNREG   "lrmd_rsc_unregister"
#define LRMD_OP_RSC_INFO   "lrmd_rsc_info"
#define LRMD_OP_RSC_METADATA   "lrmd_rsc_metadata"
#define LRMD_OP_POKE   "lrmd_rsc_poke"
#define LRMD_OP_NEW_CLIENT   "lrmd_rsc_new_client"
#define LRMD_OP_CHECK   "lrmd_check"
#define LRMD_OP_ALERT_EXEC   "lrmd_alert_exec"
#define LRMD_OP_GET_RECURRING   "lrmd_get_recurring"
#define LRMD_IPC_OP_NEW   "new"
#define LRMD_IPC_OP_DESTROY   "destroy"
#define LRMD_IPC_OP_EVENT   "event"
#define LRMD_IPC_OP_REQUEST   "request"
#define LRMD_IPC_OP_RESPONSE   "response"
#define LRMD_IPC_OP_SHUTDOWN_REQ   "shutdown_req"
#define LRMD_IPC_OP_SHUTDOWN_ACK   "shutdown_ack"
#define LRMD_IPC_OP_SHUTDOWN_NACK   "shutdown_nack"
#define F_LRMD_IPC_OP   "lrmd_ipc_op"
#define F_LRMD_IPC_IPC_SERVER   "lrmd_ipc_server"
#define F_LRMD_IPC_SESSION   "lrmd_ipc_session"
#define F_LRMD_IPC_CLIENT   "lrmd_ipc_client"
#define F_LRMD_IPC_USER   "lrmd_ipc_user"
#define F_LRMD_IPC_MSG   "lrmd_ipc_msg"
#define F_LRMD_IPC_MSG_ID   "lrmd_ipc_msg_id"
#define F_LRMD_IPC_MSG_FLAGS   "lrmd_ipc_msg_flags"
#define T_LRMD   "lrmd"
#define T_LRMD_REPLY   "lrmd_reply"
#define T_LRMD_NOTIFY   "lrmd_notify"
#define T_LRMD_IPC_PROXY   "lrmd_ipc_proxy"
#define T_LRMD_RSC_OP   "lrmd_rsc_op"


typedef struct lrmd_s lrmd_t
typedef struct lrmd_key_value_s lrmd_key_value_t
typedef struct lrmd_event_data_s lrmd_event_data_t
typedef struct lrmd_rsc_info_s lrmd_rsc_info_t
typedef struct lrmd_op_info_s lrmd_op_info_t
typedef void(* lrmd_event_callback )(lrmd_event_data_t *event)
typedef struct lrmd_list_s lrmd_list_t
typedef struct


enum  lrmd_call_options { lrmd_opt_none = 0x00000000, lrmd_opt_notify_orig_only = 0x00000002, lrmd_opt_drop_recurring = 0x00000003, lrmd_opt_notify_changes_only = 0x00000004 }
enum  lrmd_callback_event {
  lrmd_event_register, lrmd_event_unregister, lrmd_event_exec_complete, lrmd_event_disconnect,
  lrmd_event_connect, lrmd_event_poke, lrmd_event_new_client


lrmd_tlrmd_api_new (void)
 Create a new connection to the local executor. More...
lrmd_tlrmd_remote_api_new (const char *nodename, const char *server, int port)
 Create a new TLS connection to a remote executor. More...
bool lrmd_dispatch (lrmd_t *lrmd)
 Use after lrmd_poll returns 1 to read and dispatch a message. More...
int lrmd_poll (lrmd_t *lrmd, int timeout)
 Poll for a specified timeout period to determine if a message is ready for dispatch. More...
void lrmd_api_delete (lrmd_t *lrmd)
 Destroy executor connection object. More...
lrmd_key_value_tlrmd_key_value_add (lrmd_key_value_t *kvp, const char *key, const char *value)
lrmd_event_data_tlrmd_new_event (const char *rsc_id, const char *task, guint interval_ms)
lrmd_event_data_tlrmd_copy_event (lrmd_event_data_t *event)
void lrmd_free_event (lrmd_event_data_t *event)
lrmd_rsc_info_tlrmd_new_rsc_info (const char *rsc_id, const char *standard, const char *provider, const char *type)
lrmd_rsc_info_tlrmd_copy_rsc_info (lrmd_rsc_info_t *rsc_info)
void lrmd_free_rsc_info (lrmd_rsc_info_t *rsc_info)
void lrmd_free_op_info (lrmd_op_info_t *op_info)
void lrmd_list_freeall (lrmd_list_t *head)
void lrmd_key_value_freeall (lrmd_key_value_t *head)

Detailed Description

Resource agent executor.

Definition in file lrmd.h.

Macro Definition Documentation

#define ALT_REMOTE_KEY_LOCATION   "/etc/corosync/authkey"

Definition at line 49 of file lrmd.h.


Definition at line 48 of file lrmd.h.

#define DEFAULT_REMOTE_PORT   3121

Definition at line 50 of file lrmd.h.


Definition at line 51 of file lrmd.h.

#define F_LRMD_ALERT   "lrmd_alert"

Definition at line 91 of file lrmd.h.

#define F_LRMD_ALERT_ID   "lrmd_alert_id"

Definition at line 89 of file lrmd.h.

#define F_LRMD_ALERT_PATH   "lrmd_alert_path"

Definition at line 90 of file lrmd.h.

#define F_LRMD_CALLBACK_TOKEN   "lrmd_async_id"

Definition at line 60 of file lrmd.h.

#define F_LRMD_CALLDATA   "lrmd_calldata"

Definition at line 63 of file lrmd.h.

#define F_LRMD_CALLID   "lrmd_callid"

Definition at line 61 of file lrmd.h.

#define F_LRMD_CALLOPTS   "lrmd_callopt"

Definition at line 62 of file lrmd.h.

#define F_LRMD_CLASS   "lrmd_class"

Definition at line 69 of file lrmd.h.

#define F_LRMD_CLIENTID   "lrmd_clientid"

Definition at line 56 of file lrmd.h.

#define F_LRMD_CLIENTNAME   "lrmd_clientname"

Definition at line 54 of file lrmd.h.

#define F_LRMD_EXEC_RC   "lrmd_exec_rc"

Definition at line 65 of file lrmd.h.

#define F_LRMD_IPC_CLIENT   "lrmd_ipc_client"

Definition at line 117 of file lrmd.h.

#define F_LRMD_IPC_IPC_SERVER   "lrmd_ipc_server"

Definition at line 115 of file lrmd.h.

#define F_LRMD_IPC_MSG   "lrmd_ipc_msg"

Definition at line 119 of file lrmd.h.

#define F_LRMD_IPC_MSG_FLAGS   "lrmd_ipc_msg_flags"

Definition at line 121 of file lrmd.h.

#define F_LRMD_IPC_MSG_ID   "lrmd_ipc_msg_id"

Definition at line 120 of file lrmd.h.

#define F_LRMD_IPC_OP   "lrmd_ipc_op"

Definition at line 114 of file lrmd.h.

#define F_LRMD_IPC_SESSION   "lrmd_ipc_session"

Definition at line 116 of file lrmd.h.

#define F_LRMD_IPC_USER   "lrmd_ipc_user"

Definition at line 118 of file lrmd.h.

#define F_LRMD_IS_IPC_PROVIDER   "lrmd_is_ipc_provider"

Definition at line 55 of file lrmd.h.

#define F_LRMD_OP_STATUS   "lrmd_exec_op_status"

Definition at line 66 of file lrmd.h.

#define F_LRMD_OPERATION   "lrmd_op"

Definition at line 53 of file lrmd.h.

#define F_LRMD_ORIGIN   "lrmd_origin"

Definition at line 72 of file lrmd.h.

#define F_LRMD_PROTOCOL_VERSION   "lrmd_protocol_version"

Definition at line 57 of file lrmd.h.

#define F_LRMD_PROVIDER   "lrmd_provider"

Definition at line 70 of file lrmd.h.

#define F_LRMD_RC   "lrmd_rc"

Definition at line 64 of file lrmd.h.

#define F_LRMD_REMOTE_MSG_ID   "lrmd_remote_msg_id"

Definition at line 59 of file lrmd.h.

#define F_LRMD_REMOTE_MSG_TYPE   "lrmd_remote_msg_type"

Definition at line 58 of file lrmd.h.

#define F_LRMD_RSC   "lrmd_rsc"

Definition at line 87 of file lrmd.h.

#define F_LRMD_RSC_ACTION   "lrmd_rsc_action"

Definition at line 80 of file lrmd.h.

#define F_LRMD_RSC_DELETED   "lrmd_rsc_deleted"

Definition at line 86 of file lrmd.h.

#define F_LRMD_RSC_EXEC_TIME   "lrmd_exec_time"

Definition at line 76 of file lrmd.h.

#define F_LRMD_RSC_EXIT_REASON   "lrmd_rsc_exit_reason"

Definition at line 83 of file lrmd.h.

#define F_LRMD_RSC_ID   "lrmd_rsc_id"

Definition at line 79 of file lrmd.h.

#define F_LRMD_RSC_INTERVAL   "lrmd_rsc_interval"

Definition at line 85 of file lrmd.h.

#define F_LRMD_RSC_OUTPUT   "lrmd_rsc_output"

Definition at line 82 of file lrmd.h.

#define F_LRMD_RSC_QUEUE_TIME   "lrmd_queue_time"

Definition at line 77 of file lrmd.h.

#define F_LRMD_RSC_RCCHANGE_TIME   "lrmd_rcchange_time"

Definition at line 75 of file lrmd.h.

#define F_LRMD_RSC_RUN_TIME   "lrmd_run_time"

Definition at line 74 of file lrmd.h.

#define F_LRMD_RSC_START_DELAY   "lrmd_rsc_start_delay"

Definition at line 84 of file lrmd.h.

#define F_LRMD_RSC_USERDATA_STR   "lrmd_rsc_userdata_str"

Definition at line 81 of file lrmd.h.

#define F_LRMD_TIMEOUT   "lrmd_timeout"

Definition at line 67 of file lrmd.h.

#define F_LRMD_TYPE   "lrmd_type"

Definition at line 71 of file lrmd.h.

#define F_LRMD_WATCHDOG   "lrmd_watchdog"

Definition at line 68 of file lrmd.h.

#define LRMD_IPC_OP_DESTROY   "destroy"

Definition at line 106 of file lrmd.h.

#define LRMD_IPC_OP_EVENT   "event"

Definition at line 107 of file lrmd.h.

#define LRMD_IPC_OP_NEW   "new"

Definition at line 105 of file lrmd.h.

#define LRMD_IPC_OP_REQUEST   "request"

Definition at line 108 of file lrmd.h.

#define LRMD_IPC_OP_RESPONSE   "response"

Definition at line 109 of file lrmd.h.

#define LRMD_IPC_OP_SHUTDOWN_ACK   "shutdown_ack"

Definition at line 111 of file lrmd.h.

#define LRMD_IPC_OP_SHUTDOWN_NACK   "shutdown_nack"

Definition at line 112 of file lrmd.h.

#define LRMD_IPC_OP_SHUTDOWN_REQ   "shutdown_req"

Definition at line 110 of file lrmd.h.


Definition at line 45 of file lrmd.h.

#define LRMD_OP_ALERT_EXEC   "lrmd_alert_exec"

Definition at line 102 of file lrmd.h.

#define LRMD_OP_CHECK   "lrmd_check"

Definition at line 101 of file lrmd.h.

#define LRMD_OP_GET_RECURRING   "lrmd_get_recurring"

Definition at line 103 of file lrmd.h.

#define LRMD_OP_NEW_CLIENT   "lrmd_rsc_new_client"

Definition at line 100 of file lrmd.h.

#define LRMD_OP_POKE   "lrmd_rsc_poke"

Definition at line 99 of file lrmd.h.

#define LRMD_OP_RSC_CANCEL   "lrmd_rsc_cancel"

Definition at line 95 of file lrmd.h.

#define LRMD_OP_RSC_EXEC   "lrmd_rsc_exec"

Definition at line 94 of file lrmd.h.

#define LRMD_OP_RSC_INFO   "lrmd_rsc_info"

Definition at line 97 of file lrmd.h.

#define LRMD_OP_RSC_METADATA   "lrmd_rsc_metadata"

Definition at line 98 of file lrmd.h.

#define LRMD_OP_RSC_REG   "lrmd_rsc_register"

Definition at line 93 of file lrmd.h.

#define LRMD_OP_RSC_UNREG   "lrmd_rsc_unregister"

Definition at line 96 of file lrmd.h.


Definition at line 37 of file lrmd.h.

#define T_LRMD   "lrmd"

Definition at line 123 of file lrmd.h.

#define T_LRMD_IPC_PROXY   "lrmd_ipc_proxy"

Definition at line 126 of file lrmd.h.

#define T_LRMD_NOTIFY   "lrmd_notify"

Definition at line 125 of file lrmd.h.

#define T_LRMD_REPLY   "lrmd_reply"

Definition at line 124 of file lrmd.h.

#define T_LRMD_RSC_OP   "lrmd_rsc_op"

Definition at line 127 of file lrmd.h.

Typedef Documentation

typedef void(* lrmd_event_callback)(lrmd_event_data_t *event)

Definition at line 276 of file lrmd.h.

typedef struct lrmd_list_s lrmd_list_t
typedef struct lrmd_s lrmd_t

Definition at line 27 of file lrmd.h.

Enumeration Type Documentation


Only notify the client originating a exec() the results


Drop recurring operations initiated by a client when client disconnects. This call_option is only valid when registering a resource. When used remotely with the pacemaker_remote daemon, this option means that recurring operations will be dropped once all the remote connections disconnect.


Send notifications for recurring operations only when the result changes

Definition at line 172 of file lrmd.h.


Definition at line 186 of file lrmd.h.

Function Documentation

void lrmd_api_delete ( lrmd_t lrmd)

Destroy executor connection object.

Definition at line 2082 of file lrmd_client.c.

lrmd_t* lrmd_api_new ( void  )

Create a new connection to the local executor.

Definition at line 2019 of file lrmd_client.c.

lrmd_event_data_t* lrmd_copy_event ( lrmd_event_data_t event)

Definition at line 211 of file lrmd_client.c.

lrmd_rsc_info_t* lrmd_copy_rsc_info ( lrmd_rsc_info_t rsc_info)

Definition at line 1565 of file lrmd_client.c.

bool lrmd_dispatch ( lrmd_t lrmd)

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

[in,out]lrmdExecutor connection object
TRUE if connection is still up, FALSE if disconnected

Definition at line 467 of file lrmd_client.c.

void lrmd_free_event ( lrmd_event_data_t event)

Definition at line 234 of file lrmd_client.c.

void lrmd_free_op_info ( lrmd_op_info_t op_info)

Definition at line 1622 of file lrmd_client.c.

void lrmd_free_rsc_info ( lrmd_rsc_info_t rsc_info)

Definition at line 1572 of file lrmd_client.c.

lrmd_key_value_t* lrmd_key_value_add ( lrmd_key_value_t kvp,
const char *  key,
const char *  value 

Definition at line 144 of file lrmd_client.c.

void lrmd_key_value_freeall ( lrmd_key_value_t head)

Definition at line 167 of file lrmd_client.c.

void lrmd_list_freeall ( lrmd_list_t head)

Definition at line 129 of file lrmd_client.c.

lrmd_event_data_t* lrmd_new_event ( const char *  rsc_id,
const char *  task,
guint  interval_ms 

Create a new lrmd_event_data_t object

[in]rsc_idID of resource involved in event
[in]taskAction name
[in]interval_msAction interval
Newly allocated and initialized lrmd_event_data_t
This functions asserts on memory errors, so the return value is guaranteed to be non-NULL. The caller is responsible for freeing the result with lrmd_free_event().

Definition at line 193 of file lrmd_client.c.

lrmd_rsc_info_t* lrmd_new_rsc_info ( const char *  rsc_id,
const char *  standard,
const char *  provider,
const char *  type 

Definition at line 1539 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 433 of file lrmd_client.c.

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

Create a new TLS connection to a remote executor.

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

Definition at line 2055 of file lrmd_client.c.