pacemaker  2.0.5-ba59be712
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 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"
 
#define STONITH_LIBRARY   "libstonithd.so.26"
 

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 = 0x00000000, st_opt_verbose = 0x00000001, st_opt_allow_suicide = 0x00000002, st_opt_manual_ack = 0x00000008,
  st_opt_discard_reply = 0x00000010, st_opt_topology = 0x00000040, st_opt_scope_local = 0x00000100, st_opt_cs_nodeid = 0x00000200,
  st_opt_sync_call = 0x00001000, st_opt_timeout_updates = 0x00002000, st_opt_report_only_success = 0x00004000, st_opt_cleanup = 0x000080000,
  st_opt_broadcast = 0x000100000
}
 
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...
 
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 stonith action into a more readable string. More...
 
const char * get_stonith_provider (const char *agent, const char *provider)
 Deprecated (use stonith_get_namespace() instead) More...
 

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 495 of file stonith-ng.h.

◆ T_STONITH_NOTIFY_DISCONNECT

#define T_STONITH_NOTIFY_DISCONNECT   "st_notify_disconnect"

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

◆ T_STONITH_NOTIFY_FENCE

#define T_STONITH_NOTIFY_FENCE   "st_notify_fence"

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

◆ T_STONITH_NOTIFY_HISTORY

#define T_STONITH_NOTIFY_HISTORY   "st_notify_history"

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

◆ T_STONITH_NOTIFY_HISTORY_SYNCED

#define T_STONITH_NOTIFY_HISTORY_SYNCED   "st_notify_history_synced"

Definition at line 32 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 497 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 498 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 109 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 65 of file stonith-ng.h.

◆ stonith_call_options

Enumerator
st_opt_none 
st_opt_verbose 
st_opt_allow_suicide 
st_opt_manual_ack 
st_opt_discard_reply 
st_opt_topology 
st_opt_scope_local 
st_opt_cs_nodeid 
st_opt_sync_call 
st_opt_timeout_updates 

Allow the timeout period for a callback to be adjusted based on the time the server reports the operation will take.

st_opt_report_only_success 

Only report back if operation is a success in callback

st_opt_cleanup 
st_opt_broadcast 

Definition at line 41 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 75 of file stonith-ng.h.

◆ stonith_state

Enumerator
stonith_connected_command 
stonith_connected_query 
stonith_disconnected 

Definition at line 35 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)

Deprecated:
Use stonith_get_namespace() instead

Definition at line 2654 of file st_client.c.

◆ stonith_action_str()

const char* stonith_action_str ( const char *  action)

Turn stonith action into a more readable string.

Parameters
actionStonith action

Definition at line 2392 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 2361 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 2186 of file st_client.c.

◆ stonith_api_delete()

void stonith_api_delete ( stonith_t st)

Definition at line 2018 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 2255 of file st_client.c.

◆ stonith_api_new()

stonith_t* stonith_api_new ( void  )

Definition at line 2107 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 2297 of file st_client.c.

◆ stonith_dispatch()

bool stonith_dispatch ( stonith_t st)

Definition at line 1960 of file st_client.c.

◆ stonith_dump_pending_callbacks()

void stonith_dump_pending_callbacks ( stonith_t st)

Definition at line 1709 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 177 of file st_client.c.

◆ stonith_history_free()

void stonith_history_free ( stonith_history_t history)

Definition at line 1165 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 2207 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 2234 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 156 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 130 of file st_client.c.