41 #define LRMD_PROTOCOL_VERSION "1.1"
49 #define LRMD_MIN_PROTOCOL_VERSION "1.0"
52 #define DEFAULT_REMOTE_KEY_LOCATION "/etc/pacemaker/authkey"
53 #define ALT_REMOTE_KEY_LOCATION "/etc/corosync/authkey"
54 #define DEFAULT_REMOTE_PORT 3121
55 #define DEFAULT_REMOTE_USERNAME "lrmd"
57 #define F_LRMD_OPERATION "lrmd_op"
58 #define F_LRMD_CLIENTNAME "lrmd_clientname"
59 #define F_LRMD_IS_IPC_PROVIDER "lrmd_is_ipc_provider"
60 #define F_LRMD_CLIENTID "lrmd_clientid"
61 #define F_LRMD_PROTOCOL_VERSION "lrmd_protocol_version"
62 #define F_LRMD_REMOTE_MSG_TYPE "lrmd_remote_msg_type"
63 #define F_LRMD_REMOTE_MSG_ID "lrmd_remote_msg_id"
64 #define F_LRMD_CALLBACK_TOKEN "lrmd_async_id"
65 #define F_LRMD_CALLID "lrmd_callid"
66 #define F_LRMD_CANCEL_CALLID "lrmd_cancel_callid"
67 #define F_LRMD_CALLOPTS "lrmd_callopt"
68 #define F_LRMD_CALLDATA "lrmd_calldata"
69 #define F_LRMD_RC "lrmd_rc"
70 #define F_LRMD_EXEC_RC "lrmd_exec_rc"
71 #define F_LRMD_OP_STATUS "lrmd_exec_op_status"
72 #define F_LRMD_TIMEOUT "lrmd_timeout"
73 #define F_LRMD_WATCHDOG "lrmd_watchdog"
74 #define F_LRMD_CLASS "lrmd_class"
75 #define F_LRMD_PROVIDER "lrmd_provider"
76 #define F_LRMD_TYPE "lrmd_type"
77 #define F_LRMD_ORIGIN "lrmd_origin"
79 #define F_LRMD_RSC_RUN_TIME "lrmd_run_time"
80 #define F_LRMD_RSC_RCCHANGE_TIME "lrmd_rcchange_time"
81 #define F_LRMD_RSC_EXEC_TIME "lrmd_exec_time"
82 #define F_LRMD_RSC_QUEUE_TIME "lrmd_queue_time"
84 #define F_LRMD_RSC_ID "lrmd_rsc_id"
85 #define F_LRMD_RSC_ACTION "lrmd_rsc_action"
86 #define F_LRMD_RSC_USERDATA_STR "lrmd_rsc_userdata_str"
87 #define F_LRMD_RSC_OUTPUT "lrmd_rsc_output"
88 #define F_LRMD_RSC_EXIT_REASON "lrmd_rsc_exit_reason"
89 #define F_LRMD_RSC_START_DELAY "lrmd_rsc_start_delay"
90 #define F_LRMD_RSC_INTERVAL "lrmd_rsc_interval"
91 #define F_LRMD_RSC_METADATA "lrmd_rsc_metadata_res"
92 #define F_LRMD_RSC_DELETED "lrmd_rsc_deleted"
93 #define F_LRMD_RSC "lrmd_rsc"
95 #define F_LRMD_ALERT_ID "lrmd_alert_id"
96 #define F_LRMD_ALERT_PATH "lrmd_alert_path"
97 #define F_LRMD_ALERT "lrmd_alert"
99 #define LRMD_OP_RSC_CHK_REG "lrmd_rsc_check_register"
100 #define LRMD_OP_RSC_REG "lrmd_rsc_register"
101 #define LRMD_OP_RSC_EXEC "lrmd_rsc_exec"
102 #define LRMD_OP_RSC_CANCEL "lrmd_rsc_cancel"
103 #define LRMD_OP_RSC_UNREG "lrmd_rsc_unregister"
104 #define LRMD_OP_RSC_INFO "lrmd_rsc_info"
105 #define LRMD_OP_RSC_METADATA "lrmd_rsc_metadata"
106 #define LRMD_OP_POKE "lrmd_rsc_poke"
107 #define LRMD_OP_NEW_CLIENT "lrmd_rsc_new_client"
108 #define LRMD_OP_CHECK "lrmd_check"
109 #define LRMD_OP_ALERT_EXEC "lrmd_alert_exec"
111 #define LRMD_IPC_OP_NEW "new"
112 #define LRMD_IPC_OP_DESTROY "destroy"
113 #define LRMD_IPC_OP_EVENT "event"
114 #define LRMD_IPC_OP_REQUEST "request"
115 #define LRMD_IPC_OP_RESPONSE "response"
116 #define LRMD_IPC_OP_SHUTDOWN_REQ "shutdown_req"
117 #define LRMD_IPC_OP_SHUTDOWN_ACK "shutdown_ack"
118 #define LRMD_IPC_OP_SHUTDOWN_NACK "shutdown_nack"
120 #define F_LRMD_IPC_OP "lrmd_ipc_op"
121 #define F_LRMD_IPC_IPC_SERVER "lrmd_ipc_server"
122 #define F_LRMD_IPC_SESSION "lrmd_ipc_session"
123 #define F_LRMD_IPC_CLIENT "lrmd_ipc_client"
124 #define F_LRMD_IPC_PROXY_NODE "lrmd_ipc_proxy_node"
125 #define F_LRMD_IPC_USER "lrmd_ipc_user"
126 #define F_LRMD_IPC_MSG "lrmd_ipc_msg"
127 #define F_LRMD_IPC_MSG_ID "lrmd_ipc_msg_id"
128 #define F_LRMD_IPC_MSG_FLAGS "lrmd_ipc_msg_flags"
130 #define T_LRMD "lrmd"
131 #define T_LRMD_REPLY "lrmd_reply"
132 #define T_LRMD_NOTIFY "lrmd_notify"
133 #define T_LRMD_IPC_PROXY "lrmd_ipc_proxy"
384 int (*
exec) (
lrmd_t * lrmd,
const char *rsc_id,
const char *action,
const char *userdata,
413 int (*
cancel) (
lrmd_t * lrmd,
const char *rsc_id,
const char *action,
int interval);
440 const char *provider,
453 const char *provider);
493 const char *alert_path,
int timeout,
503 static inline const char *
512 return "exec_complete";
struct lrmd_rsc_info_s lrmd_rsc_info_t
int(* cancel)(lrmd_t *lrmd, const char *rsc_id, const char *action, int interval)
Cancel a recurring command.
int(* exec)(lrmd_t *lrmd, const char *rsc_id, const char *action, const char *userdata, int interval, int timeout, int start_delay, enum lrmd_call_options options, lrmd_key_value_t *params)
Issue a command on a resource.
int(* poke_connection)(lrmd_t *lrmd)
Poke lrmd connection to verify it is still capable of serving requests.
void(* set_callback)(lrmd_t *lrmd, lrmd_event_callback callback)
Sets the callback to receive lrmd events on.
int(* is_connected)(lrmd_t *lrmd)
Is connected to lrmd daemon?
void lrmd_list_freeall(lrmd_list_t *head)
void lrmd_free_event(lrmd_event_data_t *event)
void(* lrmd_event_callback)(lrmd_event_data_t *event)
struct lrmd_event_data_s lrmd_event_data_t
lrmd_t * lrmd_remote_api_new(const char *nodename, const char *server, int port)
Create a new remote lrmd connection using tls backend.
int(* exec_alert)(lrmd_t *lrmd, const char *alert_id, const char *alert_path, int timeout, lrmd_key_value_t *params)
Execute an alert agent.
int(* disconnect)(lrmd_t *lrmd)
Disconnect from the lrmd.
struct lrmd_api_operations_s lrmd_api_operations_t
int(* list_ocf_providers)(lrmd_t *lrmd, const char *agent, lrmd_list_t **providers)
Retrieve a list of resource agent providers.
lrmd_rsc_info_t * lrmd_copy_rsc_info(lrmd_rsc_info_t *rsc_info)
int(* get_metadata)(lrmd_t *lrmd, const char *class, const char *provider, const char *agent, char **output, enum lrmd_call_options options)
Get resource metadata for a specified resource agent.
struct lrmd_list_s * next
lrmd_t * lrmd_api_new(void)
Create a new local lrmd connection.
bool lrmd_dispatch(lrmd_t *lrmd)
Use after lrmd_poll returns 1 to read and dispatch a message.
lrmd_key_value_t * lrmd_key_value_add(lrmd_key_value_t *kvp, const char *key, const char *value)
struct lrmd_key_value_s * next
int(* connect_async)(lrmd_t *lrmd, const char *client_name, int timeout)
Establish an connection to lrmd, don't block while connecting.
void lrmd_key_value_freeall(lrmd_key_value_t *head)
struct lrmd_key_value_s lrmd_key_value_t
int(* connect)(lrmd_t *lrmd, const char *client_name, int *fd)
Connect from the lrmd.
const char * remote_nodename
lrmd_api_operations_t * cmds
enum lrmd_callback_event type
int(* list_agents)(lrmd_t *lrmd, lrmd_list_t **agents, const char *class, const char *provider)
Retrieve a list of installed resource agents.
int(* unregister_rsc)(lrmd_t *lrmd, const char *rsc_id, enum lrmd_call_options options)
Unregister a resource from the lrmd.
lrmd_event_data_t * lrmd_copy_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.
struct lrmd_list_s lrmd_list_t
void lrmd_free_rsc_info(lrmd_rsc_info_t *rsc_info)
void lrmd_api_delete(lrmd_t *lrmd)
Destroy lrmd object.
int(* register_rsc)(lrmd_t *lrmd, const char *rsc_id, const char *class, const char *provider, const char *agent, enum lrmd_call_options options)
Register a resource with the lrmd.
int(* list_standards)(lrmd_t *lrmd, lrmd_list_t **standards)
Retrieve a list of standards supported by this machine/installation.
enum crm_ais_msg_types type