pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
Data Structures | Macros | Typedefs | Enumerations | Functions
stonith-ng.h File Reference

Fencing aka. STONITH. More...

#include <dlfcn.h>
#include <errno.h>
#include <stdbool.h>
#include <stdint.h>
#include <time.h>
Include dependency graph for stonith-ng.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stonith_key_value_s
 
struct  stonith_history_s
 
struct  stonith_event_s
 
struct  stonith_callback_data_s
 
struct  stonith_api_operations_s
 
struct  stonith_s
 

Macros

#define STONITH_LIBRARY   "libstonithd.so.26"
 
#define T_STONITH_NOTIFY_DISCONNECT   "st_notify_disconnect"
 
#define T_STONITH_NOTIFY_FENCE   "st_notify_fence"
 
#define T_STONITH_NOTIFY_HISTORY   "st_notify_history"
 
#define T_STONITH_NOTIFY_HISTORY_SYNCED   "st_notify_history_synced"
 

Typedefs

typedef struct stonith_key_value_s stonith_key_value_t
 
typedef struct stonith_history_s stonith_history_t
 
typedef struct stonith_s stonith_t
 
typedef struct stonith_event_s stonith_event_t
 
typedef struct stonith_callback_data_s stonith_callback_data_t
 
typedef struct stonith_api_operations_s stonith_api_operations_t
 
typedef int(* st_api_kick_fn) (int nodeid, const char *uname, int timeout, bool off)
 
typedef time_t(* st_api_time_fn) (int nodeid, const char *uname, bool in_progress)
 

Enumerations

enum  stonith_state { stonith_connected_command, stonith_connected_query, stonith_disconnected }
 
enum  stonith_call_options {
  st_opt_none = 0, st_opt_verbose = (1 << 0), st_opt_allow_self_fencing = (1 << 1), st_opt_allow_suicide = st_opt_allow_self_fencing,
  st_opt_manual_ack = (1 << 3), st_opt_discard_reply = (1 << 4), st_opt_topology = (1 << 6), st_opt_scope_local = (1 << 8),
  st_opt_cs_nodeid = (1 << 9), st_opt_sync_call = (1 << 12), st_opt_timeout_updates = (1 << 13), st_opt_report_only_success = (1 << 14),
  st_opt_cleanup = (1 << 19), st_opt_broadcast = (1 << 20)
}
 Flags that can be set in call options for API requests. More...
 
enum  op_state {
  st_query, st_exec, st_done, st_duplicate,
  st_failed
}
 
enum  stonith_namespace {
  st_namespace_invalid, st_namespace_any, st_namespace_internal, st_namespace_rhcs,
  st_namespace_lha
}
 

Functions

enum stonith_namespace stonith_text2namespace (const char *namespace_s)
 Get agent namespace by name. More...
 
const char * stonith_namespace2text (enum stonith_namespace st_namespace)
 Get agent namespace name. More...
 
enum stonith_namespace stonith_get_namespace (const char *agent, const char *namespace_s)
 Determine namespace of a fence agent. More...
 
stonith_tstonith_api_new (void)
 
void stonith_api_delete (stonith_t *st)
 
void stonith_dump_pending_callbacks (stonith_t *st)
 
bool stonith_dispatch (stonith_t *st)
 
stonith_key_value_tstonith_key_value_add (stonith_key_value_t *kvp, const char *key, const char *value)
 
void stonith_key_value_freeall (stonith_key_value_t *kvp, int keys, int values)
 
void stonith_history_free (stonith_history_t *history)
 
int stonith_api_connect_retry (stonith_t *st, const char *name, int max_attempts)
 Make a blocking connection attempt to the fencer. More...
 
const char * stonith_op_state_str (enum op_state state)
 Return string equivalent of an operation state value. More...
 
int stonith_api_kick (uint32_t nodeid, const char *uname, int timeout, bool off)
 
time_t stonith_api_time (uint32_t nodeid, const char *uname, bool in_progress)
 
bool stonith_agent_exists (const char *agent, int timeout)
 
const char * stonith_action_str (const char *action)
 Turn fence action into a more readable string. More...
 
const char * get_stonith_provider (const char *agent, const char *provider)
 

Detailed Description

Fencing aka. STONITH.

Definition in file stonith-ng.h.

Macro Definition Documentation

◆ STONITH_LIBRARY

#define STONITH_LIBRARY   "libstonithd.so.26"

Definition at line 654 of file stonith-ng.h.

◆ T_STONITH_NOTIFY_DISCONNECT

#define T_STONITH_NOTIFY_DISCONNECT   "st_notify_disconnect"
Deprecated:
Do not use

Definition at line 726 of file stonith-ng.h.

◆ T_STONITH_NOTIFY_FENCE

#define T_STONITH_NOTIFY_FENCE   "st_notify_fence"
Deprecated:
Do not use

Definition at line 729 of file stonith-ng.h.

◆ T_STONITH_NOTIFY_HISTORY

#define T_STONITH_NOTIFY_HISTORY   "st_notify_history"
Deprecated:
Do not use

Definition at line 732 of file stonith-ng.h.

◆ T_STONITH_NOTIFY_HISTORY_SYNCED

#define T_STONITH_NOTIFY_HISTORY_SYNCED   "st_notify_history_synced"
Deprecated:
Do not use

Definition at line 735 of file stonith-ng.h.

Typedef Documentation

◆ st_api_kick_fn

typedef int(* st_api_kick_fn) (int nodeid, const char *uname, int timeout, bool off)

Definition at line 656 of file stonith-ng.h.

◆ st_api_time_fn

typedef time_t(* st_api_time_fn) (int nodeid, const char *uname, bool in_progress)

Definition at line 657 of file stonith-ng.h.

◆ stonith_api_operations_t

◆ stonith_callback_data_t

◆ stonith_event_t

◆ stonith_history_t

◆ stonith_key_value_t

◆ stonith_t

typedef struct stonith_s stonith_t

Definition at line 142 of file stonith-ng.h.

Enumeration Type Documentation

◆ op_state

enum op_state

Order matters here, do not change values

Enumerator
st_query 
st_exec 
st_done 
st_duplicate 
st_failed 

Definition at line 96 of file stonith-ng.h.

◆ stonith_call_options

Flags that can be set in call options for API requests.

Enumerator
st_opt_none 

No options.

st_opt_verbose 
Deprecated:
Unused
st_opt_allow_self_fencing 

The fencing target is allowed to execute the request.

st_opt_allow_suicide 
Deprecated:
Use st_opt_allow_self_fencing instead
st_opt_manual_ack 
st_opt_discard_reply 

Do not return any reply from server.

st_opt_topology 
st_opt_scope_local 
Deprecated:
Unused
st_opt_cs_nodeid 

Interpret target as node cluster layer ID instead of name.

st_opt_sync_call 

Wait for request to be completed before returning.

st_opt_timeout_updates 

Request that server send an update with optimal callback timeout.

st_opt_report_only_success 

Invoke callback only if request succeeded.

st_opt_cleanup 

For a fence history request, request that the history be cleared.

st_opt_broadcast 

For a fence history request, broadcast the request to all nodes.

Definition at line 43 of file stonith-ng.h.

◆ stonith_namespace

Enumerator
st_namespace_invalid 
st_namespace_any 
st_namespace_internal 
st_namespace_rhcs 
st_namespace_lha 

Definition at line 106 of file stonith-ng.h.

◆ stonith_state

Enumerator
stonith_connected_command 
stonith_connected_query 
stonith_disconnected 

Definition at line 36 of file stonith-ng.h.

Function Documentation

◆ get_stonith_provider()

const char * get_stonith_provider ( const char *  agent,
const char *  provider 
)
Deprecated:
Use stonith_get_namespace() instead

Definition at line 2714 of file st_client.c.

◆ stonith_action_str()

const char* stonith_action_str ( const char *  action)

Turn fence action into a more readable string.

Parameters
[in]actionFence action

Definition at line 2114 of file st_client.c.

◆ stonith_agent_exists()

bool stonith_agent_exists ( const char *  agent,
int  timeout 
)

Does the given agent describe a stonith resource that can exist?

Parameters
[in]agentWhat is the name of the agent?
[in]timeoutTimeout to use when querying. If 0 is given, use a default of 120.
Returns
A boolean

Definition at line 2083 of file st_client.c.

◆ stonith_api_connect_retry()

int stonith_api_connect_retry ( stonith_t st,
const char *  name,
int  max_attempts 
)

Make a blocking connection attempt to the fencer.

Parameters
[in,out]stFencer API object
[in]nameClient name to use with fencer
[in]max_attemptsReturn error if this many attempts fail
Returns
pcmk_ok on success, result of last attempt otherwise

Definition at line 1912 of file st_client.c.

◆ stonith_api_delete()

void stonith_api_delete ( stonith_t st)

Definition at line 1727 of file st_client.c.

◆ stonith_api_kick()

int stonith_api_kick ( uint32_t  nodeid,
const char *  uname,
int  timeout,
bool  off 
)

Definition at line 1977 of file st_client.c.

◆ stonith_api_new()

stonith_t* stonith_api_new ( void  )

Definition at line 1834 of file st_client.c.

◆ stonith_api_time()

time_t stonith_api_time ( uint32_t  nodeid,
const char *  uname,
bool  in_progress 
)

Definition at line 2019 of file st_client.c.

◆ stonith_dispatch()

bool stonith_dispatch ( stonith_t st)

Definition at line 1667 of file st_client.c.

◆ stonith_dump_pending_callbacks()

void stonith_dump_pending_callbacks ( stonith_t st)

Definition at line 1368 of file st_client.c.

◆ stonith_get_namespace()

enum stonith_namespace stonith_get_namespace ( const char *  agent,
const char *  namespace_s 
)

Determine namespace of a fence agent.

Parameters
[in]agentFence agent type
[in]namespace_sName of agent namespace as string, if known
Returns
Namespace of specified agent, as enum value

Definition at line 151 of file st_client.c.

◆ stonith_history_free()

void stonith_history_free ( stonith_history_t history)

Definition at line 762 of file st_client.c.

◆ stonith_key_value_add()

stonith_key_value_t* stonith_key_value_add ( stonith_key_value_t kvp,
const char *  key,
const char *  value 
)

Definition at line 1933 of file st_client.c.

◆ stonith_key_value_freeall()

void stonith_key_value_freeall ( stonith_key_value_t kvp,
int  keys,
int  values 
)

Definition at line 1956 of file st_client.c.

◆ stonith_namespace2text()

const char* stonith_namespace2text ( enum stonith_namespace  st_namespace)

Get agent namespace name.

Parameters
[in]namespaceNamespace as enum value
Returns
Namespace name as string

Definition at line 130 of file st_client.c.

◆ stonith_op_state_str()

const char* stonith_op_state_str ( enum op_state  state)

Return string equivalent of an operation state value.

Parameters
[in]stateFencing operation state value
Returns
Human-friendly string equivalent of state

Definition at line 2360 of file st_client.c.

◆ stonith_text2namespace()

enum stonith_namespace stonith_text2namespace ( const char *  namespace_s)

Get agent namespace by name.

Parameters
[in]namespace_sName of namespace as string
Returns
Namespace as enum value

Definition at line 104 of file st_client.c.