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" 90 const char *namespace_s);
152 int (*connect) (
stonith_t *st,
const char *name,
int *stonith_fd);
170 int (*remove_device)(
171 stonith_t *st,
int options,
const char *name);
181 int (*register_device)(
194 stonith_t *st,
int options,
const char *node,
int level);
205 int (*register_level)(
217 const char *device,
const char *
namespace,
char **output,
int timeout);
229 int (*list_agents)(
stonith_t *stonith,
int call_options,
const char *
namespace,
238 int (*list)(
stonith_t *st,
int options,
const char *
id,
char **list_output,
int timeout);
246 int (*monitor)(
stonith_t *st,
int options,
const char *
id,
int timeout);
254 int (*status)(
stonith_t *st,
int options,
const char *
id,
const char *port,
int timeout);
265 int (*query)(
stonith_t *st,
int options,
const char *node,
283 int (*fence)(
stonith_t *st,
int options,
const char *node,
const char *action,
284 int timeout,
int tolerance);
292 int (*confirm)(
stonith_t *st,
int options,
const char *node);
304 int (*register_notification)(
307 int (*remove_notification)(
stonith_t *st,
const char *event);
328 const char *callback_name,
334 int (*remove_callback)(
stonith_t *st,
int call_id,
bool all_callbacks);
353 const char *node,
const char *pattern,
354 const char *attr,
const char *
value,
int level);
374 const char *node,
const char *pattern,
375 const char *attr,
const char *
value,
396 int (*validate)(
stonith_t *st,
int call_options,
const char *rsc_id,
397 const char *namespace_s,
const char *agent,
399 char **error_output);
480 # define STONITH_LIBRARY "libstonithd.so.2" 483 stonith_api_kick_helper(
uint32_t nodeid,
int timeout,
bool off)
485 static void *st_library = NULL;
486 static int (*st_kick_fn) (
int nodeid,
const char *
uname,
int timeout,
bool off) = NULL;
488 if (st_library == NULL) {
491 if (st_library && st_kick_fn == NULL) {
492 st_kick_fn = dlsym(st_library,
"stonith_api_kick");
494 if (st_kick_fn == NULL) {
502 return (*st_kick_fn) (nodeid, NULL, timeout, off);
506 stonith_api_time_helper(
uint32_t nodeid,
bool in_progress)
508 static void *st_library = NULL;
509 static time_t(*st_time_fn) (
int nodeid,
const char *
uname,
bool in_progress) = NULL;
511 if (st_library == NULL) {
514 if (st_library && st_time_fn == NULL) {
515 st_time_fn = dlsym(st_library,
"stonith_api_time");
517 if (st_time_fn == NULL) {
521 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)
const char * stonith_namespace2text(enum stonith_namespace namespace)
Get agent namespace name.
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.