26 # define STONITH_NG__H 32 # include <libxml/tree.h> 34 # define T_STONITH_NOTIFY_DISCONNECT "st_notify_disconnect" 35 # define T_STONITH_NOTIFY_FENCE "st_notify_fence" 133 int (*connect) (
stonith_t *st,
const char *name,
int *stonith_fd);
151 int (*remove_device)(
152 stonith_t *st,
int options,
const char *name);
162 int (*register_device)(
175 stonith_t *st,
int options,
const char *node,
int level);
186 int (*register_level)(
198 const char *device,
const char *
namespace,
char **output,
int timeout);
210 int (*list_agents)(
stonith_t *stonith,
int call_options,
const char *
namespace,
219 int (*list)(
stonith_t *st,
int options,
const char *
id,
char **list_output,
int timeout);
227 int (*monitor)(
stonith_t *st,
int options,
const char *
id,
int timeout);
235 int (*status)(
stonith_t *st,
int options,
const char *
id,
const char *port,
int timeout);
246 int (*query)(
stonith_t *st,
int options,
const char *node,
264 int (*fence)(
stonith_t *st,
int options,
const char *node,
const char *action,
265 int timeout,
int tolerance);
273 int (*confirm)(
stonith_t *st,
int options,
const char *node);
285 int (*register_notification)(
288 int (*remove_notification)(
stonith_t *st,
const char *event);
309 const char *callback_name,
315 int (*remove_callback)(
stonith_t *st,
int call_id,
bool all_callbacks);
334 const char *node,
const char *pattern,
335 const char *attr,
const char *
value,
int level);
355 const char *node,
const char *pattern,
356 const char *attr,
const char *
value,
435 # define STONITH_LIBRARY "libstonithd.so.2" 438 stonith_api_kick_helper(
uint32_t nodeid,
int timeout,
bool off)
440 static void *st_library = NULL;
441 static int (*st_kick_fn) (
int nodeid,
const char *
uname,
int timeout,
bool off) = NULL;
443 if (st_library == NULL) {
446 if (st_library && st_kick_fn == NULL) {
447 st_kick_fn = dlsym(st_library,
"stonith_api_kick");
449 if (st_kick_fn == NULL) {
453 return (*st_kick_fn) (nodeid, NULL, timeout, off);
457 stonith_api_time_helper(
uint32_t nodeid,
bool in_progress)
459 static void *st_library = NULL;
460 static time_t(*st_time_fn) (
int nodeid,
const char *
uname,
bool in_progress) = NULL;
462 if (st_library == NULL) {
465 if (st_library && st_time_fn == NULL) {
466 st_time_fn = dlsym(st_library,
"stonith_api_time");
468 if (st_time_fn == NULL) {
472 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)