26 # define STONITH_NG__H 33 # include <libxml/tree.h> 35 # define T_STONITH_NOTIFY_DISCONNECT "st_notify_disconnect" 36 # define T_STONITH_NOTIFY_FENCE "st_notify_fence" 37 # define T_STONITH_NOTIFY_HISTORY "st_notify_history" 38 # define T_STONITH_NOTIFY_HISTORY_SYNCED "st_notify_history_synced" 96 const char *namespace_s);
158 int (*connect) (
stonith_t *st,
const char *name,
int *stonith_fd);
176 int (*remove_device)(
177 stonith_t *st,
int options,
const char *name);
187 int (*register_device)(
200 stonith_t *st,
int options,
const char *node,
int level);
211 int (*register_level)(
223 const char *device,
const char *
namespace,
char **output,
int timeout);
235 int (*list_agents)(
stonith_t *stonith,
int call_options,
const char *
namespace,
244 int (*list)(
stonith_t *st,
int options,
const char *
id,
char **list_output,
int timeout);
252 int (*monitor)(
stonith_t *st,
int options,
const char *
id,
int timeout);
260 int (*status)(
stonith_t *st,
int options,
const char *
id,
const char *port,
int timeout);
271 int (*query)(
stonith_t *st,
int options,
const char *node,
289 int (*fence)(
stonith_t *st,
int options,
const char *node,
const char *action,
290 int timeout,
int tolerance);
298 int (*confirm)(
stonith_t *st,
int options,
const char *node);
310 int (*register_notification)(
313 int (*remove_notification)(
stonith_t *st,
const char *event);
334 const char *callback_name,
340 int (*remove_callback)(
stonith_t *st,
int call_id,
bool all_callbacks);
359 const char *node,
const char *pattern,
360 const char *attr,
const char *
value,
int level);
380 const char *node,
const char *pattern,
381 const char *attr,
const char *
value,
402 int (*validate)(
stonith_t *st,
int call_options,
const char *rsc_id,
403 const char *namespace_s,
const char *agent,
405 char **error_output);
424 int (*fence_with_delay)(
stonith_t *st,
int options,
const char *node,
const char *action,
425 int timeout,
int tolerance,
int delay);
506 # define STONITH_LIBRARY "libstonithd.so.2" 509 stonith_api_kick_helper(
uint32_t nodeid,
int timeout,
bool off)
511 static void *st_library = NULL;
512 static int (*st_kick_fn) (
int nodeid,
const char *
uname,
int timeout,
bool off) = NULL;
514 if (st_library == NULL) {
517 if (st_library && st_kick_fn == NULL) {
518 st_kick_fn = dlsym(st_library,
"stonith_api_kick");
520 if (st_kick_fn == NULL) {
528 return (*st_kick_fn) (nodeid, NULL, timeout, off);
532 stonith_api_time_helper(
uint32_t nodeid,
bool in_progress)
534 static void *st_library = NULL;
535 static time_t(*st_time_fn) (
int nodeid,
const char *
uname,
bool in_progress) = NULL;
537 if (st_library == NULL) {
540 if (st_library && st_time_fn == NULL) {
541 st_time_fn = dlsym(st_library,
"stonith_api_time");
543 if (st_time_fn == NULL) {
547 return (*st_time_fn) (nodeid, NULL, in_progress);
struct stonith_history_s * next
const char * get_stonith_provider(const char *agent, const char *provider)
Deprecated (use stonith_get_namespace() instead)
struct stonith_api_operations_s stonith_api_operations_t
struct stonith_key_value_s stonith_key_value_t
int stonith_api_kick(uint32_t nodeid, const char *uname, int timeout, bool off)
struct stonith_history_s stonith_history_t
enum stonith_namespace stonith_get_namespace(const char *agent, const char *namespace_s)
Determine namespace of a fence agent.
struct stonith_key_value_s * next
bool stonith_dispatch(stonith_t *st)
stonith_t * stonith_api_new(void)
stonith_key_value_t * stonith_key_value_add(stonith_key_value_t *kvp, const char *key, const char *value)
struct stonith_callback_data_s stonith_callback_data_t
void stonith_key_value_freeall(stonith_key_value_t *kvp, int keys, int values)
void stonith_dump_pending_callbacks(stonith_t *st)
void stonith_api_delete(stonith_t *st)
stonith_api_operations_t * cmds
void stonith_history_free(stonith_history_t *history)
struct stonith_event_s stonith_event_t
time_t stonith_api_time(uint32_t nodeid, const char *uname, bool in_progress)
enum stonith_namespace stonith_text2namespace(const char *namespace_s)
Get agent namespace by name.
const char * stonith_namespace2text(enum stonith_namespace st_namespace)
Get agent namespace name.