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"
153 stonith_t *st,
int options,
const char *name);
176 stonith_t *st,
int options,
const char *node,
int level);
199 const char *device,
const char *
namespace,
char **output,
int timeout);
220 int (*
list)(
stonith_t *st,
int options,
const char *
id,
char **list_output,
int timeout);
266 int timeout,
int tolerance);
310 const char *callback_name,
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);
int(* query)(stonith_t *st, int options, const char *node, stonith_key_value_t **devices, int timeout)
Retrieve a list of registered stonith devices.
struct stonith_history_s * next
int(* register_notification)(stonith_t *st, const char *event, void(*notify)(stonith_t *st, stonith_event_t *e))
int(* register_level_full)(stonith_t *st, int options, const char *node, const char *pattern, const char *attr, const char *value, int level, stonith_key_value_t *device_list)
Register fencing level for specific node, node regex or attribute.
const char * get_stonith_provider(const char *agent, const char *provider)
struct stonith_api_operations_s stonith_api_operations_t
int(* metadata)(stonith_t *st, int options, const char *device, const char *namespace, char **output, int timeout)
Get the metadata documentation for a resource.
struct stonith_key_value_s stonith_key_value_t
int stonith_api_kick(uint32_t nodeid, const char *uname, int timeout, bool off)
int(* history)(stonith_t *st, int options, const char *node, stonith_history_t **output, int timeout)
Retrieve a list of fencing operations that have occurred for a specific node.
int(* register_level)(stonith_t *st, int options, const char *node, int level, stonith_key_value_t *device_list)
Register a fencing level containing the fencing devices to be used at that level for a specific node...
struct stonith_history_s stonith_history_t
struct stonith_key_value_s * next
int(* monitor)(stonith_t *st, int options, const char *id, int timeout)
Check to see if a local stonith device is reachable.
int(* free)(stonith_t *st)
Destroy the stonith api structure.
int(* list)(stonith_t *st, int options, const char *id, char **list_output, int timeout)
Retrieve string listing hosts and port assignments from a local stonith device.
int(* confirm)(stonith_t *st, int options, const char *node)
Manually confirm that a node is down.
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)
int(* remove_callback)(stonith_t *st, int call_id, bool all_callbacks)
Remove a registered callback for a given call id.
struct stonith_callback_data_s stonith_callback_data_t
int(* register_callback)(stonith_t *st, int call_id, int timeout, int options, void *userdata, const char *callback_name, void(*callback)(stonith_t *st, stonith_callback_data_t *data))
Register a callback to receive the result of an async call id.
int(* status)(stonith_t *st, int options, const char *id, const char *port, int timeout)
Check to see if a local stonith device's port is reachable.
int(* remove_level)(stonith_t *st, int options, const char *node, int level)
Remove a fencing level for a specific node.
void stonith_key_value_freeall(stonith_key_value_t *kvp, int keys, int values)
void stonith_dump_pending_callbacks(stonith_t *st)
int(* remove_level_full)(stonith_t *st, int options, const char *node, const char *pattern, const char *attr, const char *value, int level)
Remove fencing level for specific node, node regex or attribute.
void stonith_api_delete(stonith_t *st)
int(* fence)(stonith_t *st, int options, const char *node, const char *action, int timeout, int tolerance)
Issue a fencing action against a node.
stonith_api_operations_t * cmds
int(* connect)(stonith_t *st, const char *name, int *stonith_fd)
Connect to the local stonith daemon.
int(* remove_device)(stonith_t *st, int options, const char *name)
Remove a registered stonith device with the local stonith daemon.
struct stonith_event_s stonith_event_t
int(* disconnect)(stonith_t *st)
Disconnect from the local stonith daemon.
time_t stonith_api_time(uint32_t nodeid, const char *uname, bool in_progress)
int(* register_device)(stonith_t *st, int options, const char *id, const char *namespace, const char *agent, stonith_key_value_t *params)
Register a stonith device with the local stonith daemon.
int(* list_agents)(stonith_t *stonith, int call_options, const char *namespace, stonith_key_value_t **devices, int timeout)
Retrieve a list of installed stonith agents.
int(* remove_notification)(stonith_t *st, const char *event)