pacemaker  2.1.0-7c3f660
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 <crm/fencing/compat.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...
 
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 stonith action into a more readable string. More...
 

Detailed Description

Fencing aka. STONITH.

Definition in file stonith-ng.h.

Macro Definition Documentation

#define STONITH_LIBRARY   "libstonithd.so.26"

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

#define T_STONITH_NOTIFY_DISCONNECT   "st_notify_disconnect"

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

#define T_STONITH_NOTIFY_FENCE   "st_notify_fence"

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

#define T_STONITH_NOTIFY_HISTORY   "st_notify_history"

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

#define T_STONITH_NOTIFY_HISTORY_SYNCED   "st_notify_history_synced"

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

Typedef Documentation

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

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

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

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

typedef struct stonith_s stonith_t

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

Enumeration Type Documentation

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.

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.

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.

Enumerator
stonith_connected_command 
stonith_connected_query 
stonith_disconnected 

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

Function Documentation

const char* stonith_action_str ( const char *  action)

Turn stonith action into a more readable string.

Parameters
actionStonith action

Definition at line 2381 of file st_client.c.

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 2350 of file st_client.c.

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 2175 of file st_client.c.

void stonith_api_delete ( stonith_t st)

Definition at line 2011 of file st_client.c.

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

Definition at line 2244 of file st_client.c.

stonith_t* stonith_api_new ( void  )

Definition at line 2097 of file st_client.c.

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

Definition at line 2286 of file st_client.c.

bool stonith_dispatch ( stonith_t st)

Definition at line 1953 of file st_client.c.

void stonith_dump_pending_callbacks ( stonith_t st)

Definition at line 1702 of file st_client.c.

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 178 of file st_client.c.

void stonith_history_free ( stonith_history_t history)

Definition at line 1158 of file st_client.c.

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

Definition at line 2196 of file st_client.c.

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

Definition at line 2223 of file st_client.c.

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 157 of file st_client.c.

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 2612 of file st_client.c.

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 131 of file st_client.c.