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" 134 int (*connect) (
stonith_t *st,
const char *name,
int *stonith_fd);
152 int (*remove_device)(
153 stonith_t *st,
int options,
const char *name);
163 int (*register_device)(
176 stonith_t *st,
int options,
const char *node,
int level);
187 int (*register_level)(
199 const char *device,
const char *
namespace,
char **output,
int timeout);
211 int (*list_agents)(
stonith_t *stonith,
int call_options,
const char *
namespace,
220 int (*list)(
stonith_t *st,
int options,
const char *
id,
char **list_output,
int timeout);
228 int (*monitor)(
stonith_t *st,
int options,
const char *
id,
int timeout);
236 int (*status)(
stonith_t *st,
int options,
const char *
id,
const char *port,
int timeout);
247 int (*query)(
stonith_t *st,
int options,
const char *node,
265 int (*fence)(
stonith_t *st,
int options,
const char *node,
const char *action,
266 int timeout,
int tolerance);
274 int (*confirm)(
stonith_t *st,
int options,
const char *node);
286 int (*register_notification)(
289 int (*remove_notification)(
stonith_t *st,
const char *event);
310 const char *callback_name,
316 int (*remove_callback)(
stonith_t *st,
int call_id,
bool all_callbacks);
335 const char *node,
const char *pattern,
336 const char *attr,
const char *
value,
int level);
356 const char *node,
const char *pattern,
357 const char *attr,
const char *
value,
436 # define STONITH_LIBRARY "libstonithd.so.2" 439 stonith_api_kick_helper(
uint32_t nodeid,
int timeout,
bool off)
441 static void *st_library = NULL;
442 static int (*st_kick_fn) (
int nodeid,
const char *
uname,
int timeout,
bool off) = NULL;
444 if (st_library == NULL) {
447 if (st_library && st_kick_fn == NULL) {
448 st_kick_fn = dlsym(st_library,
"stonith_api_kick");
450 if (st_kick_fn == NULL) {
458 return (*st_kick_fn) (nodeid, NULL, timeout, off);
462 stonith_api_time_helper(
uint32_t nodeid,
bool in_progress)
464 static void *st_library = NULL;
465 static time_t(*st_time_fn) (
int nodeid,
const char *
uname,
bool in_progress) = NULL;
467 if (st_library == NULL) {
470 if (st_library && st_time_fn == NULL) {
471 st_time_fn = dlsym(st_library,
"stonith_api_time");
473 if (st_time_fn == NULL) {
477 return (*st_time_fn) (nodeid, NULL, in_progress);
struct stonith_history_s * next
const char * get_stonith_provider(const char *agent, const char *provider)
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
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
struct stonith_event_s stonith_event_t
time_t stonith_api_time(uint32_t nodeid, const char *uname, bool in_progress)