pacemaker  2.1.5-b7adf64e51
Scalable High-Availability cluster resource manager
Macros | Typedefs | Enumerations | Functions
internal.h File Reference
#include <glib.h>
#include <crm/common/ipc.h>
#include <crm/common/xml.h>
#include <crm/common/output_internal.h>
#include <crm/stonith-ng.h>
Include dependency graph for internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define stonith__set_device_flags(device_flags, device_id, flags_to_set)
 
#define stonith__set_call_options(st_call_opts, call_for, flags_to_set)
 
#define stonith__clear_call_options(st_call_opts, call_for, flags_to_clear)
 
#define ST_LEVEL_MAX   10
 
#define F_STONITH_CLIENTID   "st_clientid"
 
#define F_STONITH_CALLOPTS   "st_callopt"
 
#define F_STONITH_CALLID   "st_callid"
 
#define F_STONITH_CALLDATA   "st_calldata"
 
#define F_STONITH_OPERATION   "st_op"
 
#define F_STONITH_TARGET   "st_target"
 
#define F_STONITH_REMOTE_OP_ID   "st_remote_op"
 
#define F_STONITH_REMOTE_OP_ID_RELAY   "st_remote_op_relay"
 
#define F_STONITH_RC   "st_rc"
 
#define F_STONITH_OUTPUT   "st_output"
 
#define F_STONITH_TIMEOUT   "st_timeout"
 
#define F_STONITH_TOLERANCE   "st_tolerance"
 
#define F_STONITH_DELAY   "st_delay"
 
#define F_STONITH_ACTION_TIMEOUT   "st_action_timeout"
 
#define F_STONITH_ACTION_DISALLOWED   "st_action_disallowed"
 
#define F_STONITH_DELAY_MAX   "st_delay_max"
 
#define F_STONITH_DELAY_BASE   "st_delay_base"
 
#define F_STONITH_DEVICE_VERIFIED   "st_monitor_verified"
 
#define F_STONITH_DEVICE_REQUIRED   "st_required"
 
#define F_STONITH_AVAILABLE_DEVICES   "st-available-devices"
 
#define F_STONITH_CALLBACK_TOKEN   "st_async_id"
 
#define F_STONITH_CLIENTNAME   "st_clientname"
 
#define F_STONITH_CLIENTNODE   "st_clientnode"
 
#define F_STONITH_NOTIFY_ACTIVATE   "st_notify_activate"
 
#define F_STONITH_NOTIFY_DEACTIVATE   "st_notify_deactivate"
 
#define F_STONITH_DELEGATE   "st_delegate"
 
#define F_STONITH_DEVICE_SUPPORT_FLAGS   "st_device_support_flags"
 
#define F_STONITH_ORIGIN   "st_origin"
 
#define F_STONITH_HISTORY_LIST   "st_history"
 
#define F_STONITH_DATE   "st_date"
 
#define F_STONITH_DATE_NSEC   "st_date_nsec"
 
#define F_STONITH_STATE   "st_state"
 
#define F_STONITH_ACTIVE   "st_active"
 
#define F_STONITH_DIFFERENTIAL   "st_differential"
 
#define F_STONITH_DEVICE   "st_device_id"
 
#define F_STONITH_ACTION   "st_device_action"
 
#define F_STONITH_MERGED   "st_op_merged"
 
#define T_STONITH_NG   "stonith-ng"
 
#define T_STONITH_REPLY   "st-reply"
 
#define T_STONITH_TIMEOUT_VALUE   "st-async-timeout-value"
 
#define T_STONITH_NOTIFY   "st_notify"
 
#define STONITH_ATTR_ACTION_OP   "action"
 
#define STONITH_OP_EXEC   "st_execute"
 
#define STONITH_OP_TIMEOUT_UPDATE   "st_timeout_update"
 
#define STONITH_OP_QUERY   "st_query"
 
#define STONITH_OP_FENCE   "st_fence"
 
#define STONITH_OP_RELAY   "st_relay"
 
#define STONITH_OP_DEVICE_ADD   "st_device_register"
 
#define STONITH_OP_DEVICE_DEL   "st_device_remove"
 
#define STONITH_OP_FENCE_HISTORY   "st_fence_history"
 
#define STONITH_OP_LEVEL_ADD   "st_level_add"
 
#define STONITH_OP_LEVEL_DEL   "st_level_remove"
 
#define STONITH_WATCHDOG_AGENT   "fence_watchdog"
 
#define STONITH_WATCHDOG_AGENT_INTERNAL   "#watchdog"
 
#define STONITH_WATCHDOG_ID   "watchdog"
 

Typedefs

typedef struct stonith_action_s stonith_action_t
 

Enumerations

enum  st_device_flags {
  st_device_supports_none = (0 << 0), st_device_supports_list = (1 << 0), st_device_supports_status = (1 << 1), st_device_supports_reboot = (1 << 2),
  st_device_supports_parameter_plug = (1 << 3), st_device_supports_parameter_port = (1 << 4), st_device_supports_on = (1 << 5)
}
 

Functions

stonith_action_tstonith__action_create (const char *agent, const char *action_name, const char *target, uint32_t target_nodeid, int timeout_sec, GHashTable *device_args, GHashTable *port_map, const char *host_arg)
 
void stonith__destroy_action (stonith_action_t *action)
 
pcmk__action_result_tstonith__action_result (stonith_action_t *action)
 
int stonith__result2rc (const pcmk__action_result_t *result)
 
void stonith__xe_set_result (xmlNode *xml, const pcmk__action_result_t *result)
 
void stonith__xe_get_result (xmlNode *xml, pcmk__action_result_t *result)
 
xmlNode * stonith__find_xe_with_result (xmlNode *xml)
 
int stonith__execute_async (stonith_action_t *action, void *userdata, void(*done)(int pid, const pcmk__action_result_t *result, void *user_data), void(*fork_cb)(int pid, void *user_data))
 
int stonith__metadata_async (const char *agent, int timeout_sec, void(*callback)(int pid, const pcmk__action_result_t *result, void *user_data), void *user_data)
 
xmlNode * create_level_registration_xml (const char *node, const char *pattern, const char *attr, const char *value, int level, const stonith_key_value_t *device_list)
 
xmlNode * create_device_registration_xml (const char *id, enum stonith_namespace namespace, const char *agent, const stonith_key_value_t *params, const char *rsc_provides)
 
void stonith__register_messages (pcmk__output_t *out)
 
GList * stonith__parse_targets (const char *hosts)
 
const char * stonith__later_succeeded (stonith_history_t *event, stonith_history_t *top_history)
 
stonith_history_tstonith__sort_history (stonith_history_t *history)
 
void stonith__device_parameter_flags (uint32_t *device_flags, const char *device_name, xmlNode *metadata)
 
stonith_history_tstonith__first_matching_event (stonith_history_t *history, bool(*matching_fn)(stonith_history_t *, void *), void *user_data)
 
bool stonith__event_state_pending (stonith_history_t *history, void *user_data)
 
bool stonith__event_state_eq (stonith_history_t *history, void *user_data)
 
bool stonith__event_state_neq (stonith_history_t *history, void *user_data)
 
int stonith__legacy2status (int rc)
 
int stonith__exit_status (stonith_callback_data_t *data)
 
int stonith__execution_status (stonith_callback_data_t *data)
 
const char * stonith__exit_reason (stonith_callback_data_t *data)
 
int stonith__event_exit_status (stonith_event_t *event)
 
int stonith__event_execution_status (stonith_event_t *event)
 
const char * stonith__event_exit_reason (stonith_event_t *event)
 
char * stonith__event_description (stonith_event_t *event)
 
gchar * stonith__history_description (stonith_history_t *event, bool full_history, const char *later_succeeded, uint32_t show_opts)
 
gboolean stonith__watchdog_fencing_enabled_for_node (const char *node)
 
gboolean stonith__watchdog_fencing_enabled_for_node_api (stonith_t *st, const char *node)
 

Macro Definition Documentation

◆ F_STONITH_ACTION

#define F_STONITH_ACTION   "st_device_action"

Definition at line 154 of file internal.h.

◆ F_STONITH_ACTION_DISALLOWED

#define F_STONITH_ACTION_DISALLOWED   "st_action_disallowed"

Host in query result is not allowed to run this action

Definition at line 122 of file internal.h.

◆ F_STONITH_ACTION_TIMEOUT

#define F_STONITH_ACTION_TIMEOUT   "st_action_timeout"

Action specific timeout period returned in query of fencing devices.

Definition at line 120 of file internal.h.

◆ F_STONITH_ACTIVE

#define F_STONITH_ACTIVE   "st_active"

Definition at line 150 of file internal.h.

◆ F_STONITH_AVAILABLE_DEVICES

#define F_STONITH_AVAILABLE_DEVICES   "st-available-devices"

number of available devices in query result

Definition at line 133 of file internal.h.

◆ F_STONITH_CALLBACK_TOKEN

#define F_STONITH_CALLBACK_TOKEN   "st_async_id"

Definition at line 134 of file internal.h.

◆ F_STONITH_CALLDATA

#define F_STONITH_CALLDATA   "st_calldata"

Definition at line 108 of file internal.h.

◆ F_STONITH_CALLID

#define F_STONITH_CALLID   "st_callid"

Definition at line 107 of file internal.h.

◆ F_STONITH_CALLOPTS

#define F_STONITH_CALLOPTS   "st_callopt"

Definition at line 106 of file internal.h.

◆ F_STONITH_CLIENTID

#define F_STONITH_CLIENTID   "st_clientid"

Definition at line 105 of file internal.h.

◆ F_STONITH_CLIENTNAME

#define F_STONITH_CLIENTNAME   "st_clientname"

Definition at line 135 of file internal.h.

◆ F_STONITH_CLIENTNODE

#define F_STONITH_CLIENTNODE   "st_clientnode"

Definition at line 136 of file internal.h.

◆ F_STONITH_DATE

#define F_STONITH_DATE   "st_date"

Definition at line 147 of file internal.h.

◆ F_STONITH_DATE_NSEC

#define F_STONITH_DATE_NSEC   "st_date_nsec"

Definition at line 148 of file internal.h.

◆ F_STONITH_DELAY

#define F_STONITH_DELAY   "st_delay"

Definition at line 118 of file internal.h.

◆ F_STONITH_DELAY_BASE

#define F_STONITH_DELAY_BASE   "st_delay_base"

Base delay used for a fencing delay

Definition at line 126 of file internal.h.

◆ F_STONITH_DELAY_MAX

#define F_STONITH_DELAY_MAX   "st_delay_max"

Maximum of random fencing delay for a device

Definition at line 124 of file internal.h.

◆ F_STONITH_DELEGATE

#define F_STONITH_DELEGATE   "st_delegate"

Definition at line 139 of file internal.h.

◆ F_STONITH_DEVICE

#define F_STONITH_DEVICE   "st_device_id"

Definition at line 153 of file internal.h.

◆ F_STONITH_DEVICE_REQUIRED

#define F_STONITH_DEVICE_REQUIRED   "st_required"

device is required for this action

Definition at line 131 of file internal.h.

◆ F_STONITH_DEVICE_SUPPORT_FLAGS

#define F_STONITH_DEVICE_SUPPORT_FLAGS   "st_device_support_flags"

Definition at line 140 of file internal.h.

◆ F_STONITH_DEVICE_VERIFIED

#define F_STONITH_DEVICE_VERIFIED   "st_monitor_verified"

Has this device been verified using a monitor type operation (monitor, list, status)

Definition at line 129 of file internal.h.

◆ F_STONITH_DIFFERENTIAL

#define F_STONITH_DIFFERENTIAL   "st_differential"

Definition at line 151 of file internal.h.

◆ F_STONITH_HISTORY_LIST

#define F_STONITH_HISTORY_LIST   "st_history"

Definition at line 146 of file internal.h.

◆ F_STONITH_MERGED

#define F_STONITH_MERGED   "st_op_merged"

Definition at line 155 of file internal.h.

◆ F_STONITH_NOTIFY_ACTIVATE

#define F_STONITH_NOTIFY_ACTIVATE   "st_notify_activate"

Definition at line 137 of file internal.h.

◆ F_STONITH_NOTIFY_DEACTIVATE

#define F_STONITH_NOTIFY_DEACTIVATE   "st_notify_deactivate"

Definition at line 138 of file internal.h.

◆ F_STONITH_OPERATION

#define F_STONITH_OPERATION   "st_op"

Definition at line 109 of file internal.h.

◆ F_STONITH_ORIGIN

#define F_STONITH_ORIGIN   "st_origin"

The node initiating the stonith operation. If an operation is relayed, this is the last node the operation lands on. When in standalone mode, origin is the client's id that originated the operation.

Definition at line 145 of file internal.h.

◆ F_STONITH_OUTPUT

#define F_STONITH_OUTPUT   "st_output"

Definition at line 114 of file internal.h.

◆ F_STONITH_RC

#define F_STONITH_RC   "st_rc"

Definition at line 113 of file internal.h.

◆ F_STONITH_REMOTE_OP_ID

#define F_STONITH_REMOTE_OP_ID   "st_remote_op"

Definition at line 111 of file internal.h.

◆ F_STONITH_REMOTE_OP_ID_RELAY

#define F_STONITH_REMOTE_OP_ID_RELAY   "st_remote_op_relay"

Definition at line 112 of file internal.h.

◆ F_STONITH_STATE

#define F_STONITH_STATE   "st_state"

Definition at line 149 of file internal.h.

◆ F_STONITH_TARGET

#define F_STONITH_TARGET   "st_target"

Definition at line 110 of file internal.h.

◆ F_STONITH_TIMEOUT

#define F_STONITH_TIMEOUT   "st_timeout"

Timeout period per a device execution

Definition at line 116 of file internal.h.

◆ F_STONITH_TOLERANCE

#define F_STONITH_TOLERANCE   "st_tolerance"

Definition at line 117 of file internal.h.

◆ ST_LEVEL_MAX

#define ST_LEVEL_MAX   10

Definition at line 103 of file internal.h.

◆ stonith__clear_call_options

#define stonith__clear_call_options (   st_call_opts,
  call_for,
  flags_to_clear 
)
Value:
do { \
st_call_opts = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \
"Fencer call", (call_for), \
(st_call_opts), (flags_to_clear), \
#flags_to_clear); \
} while (0)
#define LOG_TRACE
Definition: logging.h:37

Definition at line 43 of file internal.h.

◆ stonith__set_call_options

#define stonith__set_call_options (   st_call_opts,
  call_for,
  flags_to_set 
)
Value:
do { \
st_call_opts = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
"Fencer call", (call_for), \
(st_call_opts), (flags_to_set), \
#flags_to_set); \
} while (0)
#define LOG_TRACE
Definition: logging.h:37

Definition at line 36 of file internal.h.

◆ stonith__set_device_flags

#define stonith__set_device_flags (   device_flags,
  device_id,
  flags_to_set 
)
Value:
do { \
device_flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
"Fence device", device_id, \
(device_flags), (flags_to_set), \
#flags_to_set); \
} while (0)
#define LOG_TRACE
Definition: logging.h:37

Definition at line 29 of file internal.h.

◆ STONITH_ATTR_ACTION_OP

#define STONITH_ATTR_ACTION_OP   "action"

Definition at line 165 of file internal.h.

◆ STONITH_OP_DEVICE_ADD

#define STONITH_OP_DEVICE_ADD   "st_device_register"

Definition at line 172 of file internal.h.

◆ STONITH_OP_DEVICE_DEL

#define STONITH_OP_DEVICE_DEL   "st_device_remove"

Definition at line 173 of file internal.h.

◆ STONITH_OP_EXEC

#define STONITH_OP_EXEC   "st_execute"

Definition at line 167 of file internal.h.

◆ STONITH_OP_FENCE

#define STONITH_OP_FENCE   "st_fence"

Definition at line 170 of file internal.h.

◆ STONITH_OP_FENCE_HISTORY

#define STONITH_OP_FENCE_HISTORY   "st_fence_history"

Definition at line 174 of file internal.h.

◆ STONITH_OP_LEVEL_ADD

#define STONITH_OP_LEVEL_ADD   "st_level_add"

Definition at line 175 of file internal.h.

◆ STONITH_OP_LEVEL_DEL

#define STONITH_OP_LEVEL_DEL   "st_level_remove"

Definition at line 176 of file internal.h.

◆ STONITH_OP_QUERY

#define STONITH_OP_QUERY   "st_query"

Definition at line 169 of file internal.h.

◆ STONITH_OP_RELAY

#define STONITH_OP_RELAY   "st_relay"

Definition at line 171 of file internal.h.

◆ STONITH_OP_TIMEOUT_UPDATE

#define STONITH_OP_TIMEOUT_UPDATE   "st_timeout_update"

Definition at line 168 of file internal.h.

◆ STONITH_WATCHDOG_AGENT

#define STONITH_WATCHDOG_AGENT   "fence_watchdog"

Definition at line 178 of file internal.h.

◆ STONITH_WATCHDOG_AGENT_INTERNAL

#define STONITH_WATCHDOG_AGENT_INTERNAL   "#watchdog"

Definition at line 180 of file internal.h.

◆ STONITH_WATCHDOG_ID

#define STONITH_WATCHDOG_ID   "watchdog"

Definition at line 181 of file internal.h.

◆ T_STONITH_NG

#define T_STONITH_NG   "stonith-ng"

Definition at line 157 of file internal.h.

◆ T_STONITH_NOTIFY

#define T_STONITH_NOTIFY   "st_notify"

Definition at line 163 of file internal.h.

◆ T_STONITH_REPLY

#define T_STONITH_REPLY   "st-reply"

Definition at line 158 of file internal.h.

◆ T_STONITH_TIMEOUT_VALUE

#define T_STONITH_TIMEOUT_VALUE   "st-async-timeout-value"

For async operations, an event from the server containing the total amount of time the server is allowing for the operation to take place is returned to the client.

Definition at line 162 of file internal.h.

Typedef Documentation

◆ stonith_action_t

typedef struct stonith_action_s stonith_action_t

Definition at line 51 of file internal.h.

Enumeration Type Documentation

◆ st_device_flags

Enumerator
st_device_supports_none 
st_device_supports_list 
st_device_supports_status 
st_device_supports_reboot 
st_device_supports_parameter_plug 
st_device_supports_parameter_port 
st_device_supports_on 

Definition at line 19 of file internal.h.

Function Documentation

◆ create_device_registration_xml()

xmlNode* create_device_registration_xml ( const char *  id,
enum stonith_namespace  namespace,
const char *  agent,
const stonith_key_value_t params,
const char *  rsc_provides 
)

Definition at line 293 of file st_client.c.

◆ create_level_registration_xml()

xmlNode* create_level_registration_xml ( const char *  node,
const char *  pattern,
const char *  attr,
const char *  value,
int  level,
const stonith_key_value_t device_list 
)

Definition at line 415 of file st_client.c.

◆ stonith__action_create()

stonith_action_t* stonith__action_create ( const char *  agent,
const char *  action_name,
const char *  target,
uint32_t  target_nodeid,
int  timeout_sec,
GHashTable *  device_args,
GHashTable *  port_map,
const char *  host_arg 
)

Definition at line 265 of file st_actions.c.

◆ stonith__action_result()

pcmk__action_result_t* stonith__action_result ( stonith_action_t action)

Definition at line 242 of file st_actions.c.

◆ stonith__destroy_action()

void stonith__destroy_action ( stonith_action_t action)

Definition at line 217 of file st_actions.c.

◆ stonith__device_parameter_flags()

void stonith__device_parameter_flags ( uint32_t *  device_flags,
const char *  device_name,
xmlNode *  metadata 
)

Definition at line 2386 of file st_client.c.

◆ stonith__event_description()

char* stonith__event_description ( stonith_event_t event)

Definition at line 2629 of file st_client.c.

◆ stonith__event_execution_status()

int stonith__event_execution_status ( stonith_event_t event)

Definition at line 2587 of file st_client.c.

◆ stonith__event_exit_reason()

const char* stonith__event_exit_reason ( stonith_event_t event)

Definition at line 2607 of file st_client.c.

◆ stonith__event_exit_status()

int stonith__event_exit_status ( stonith_event_t event)

Definition at line 2567 of file st_client.c.

◆ stonith__event_state_eq()

bool stonith__event_state_eq ( stonith_history_t history,
void *  user_data 
)

Definition at line 2374 of file st_client.c.

◆ stonith__event_state_neq()

bool stonith__event_state_neq ( stonith_history_t history,
void *  user_data 
)

Definition at line 2380 of file st_client.c.

◆ stonith__event_state_pending()

bool stonith__event_state_pending ( stonith_history_t history,
void *  user_data 
)

Definition at line 2368 of file st_client.c.

◆ stonith__execute_async()

int stonith__execute_async ( stonith_action_t action,
void *  userdata,
void(*)(int pid, const pcmk__action_result_t *result, void *user_data)  done,
void(*)(int pid, void *user_data)  fork_cb 
)

Definition at line 671 of file st_actions.c.

◆ stonith__execution_status()

int stonith__execution_status ( stonith_callback_data_t data)

Definition at line 2533 of file st_client.c.

◆ stonith__exit_reason()

const char* stonith__exit_reason ( stonith_callback_data_t data)

Definition at line 2550 of file st_client.c.

◆ stonith__exit_status()

int stonith__exit_status ( stonith_callback_data_t data)

Definition at line 2516 of file st_client.c.

◆ stonith__find_xe_with_result()

xmlNode* stonith__find_xe_with_result ( xmlNode *  xml)

Definition at line 473 of file st_actions.c.

◆ stonith__first_matching_event()

stonith_history_t* stonith__first_matching_event ( stonith_history_t history,
bool(*)(stonith_history_t *, void *)  matching_fn,
void *  user_data 
)

Definition at line 2354 of file st_client.c.

◆ stonith__history_description()

gchar* stonith__history_description ( stonith_history_t event,
bool  full_history,
const char *  later_succeeded,
uint32_t  show_opts 
)

Definition at line 74 of file st_output.c.

◆ stonith__later_succeeded()

const char* stonith__later_succeeded ( stonith_history_t event,
stonith_history_t top_history 
)

Definition at line 2248 of file st_client.c.

◆ stonith__legacy2status()

int stonith__legacy2status ( int  rc)

Definition at line 404 of file st_actions.c.

◆ stonith__metadata_async()

int stonith__metadata_async ( const char *  agent,
int  timeout_sec,
void(*)(int pid, const pcmk__action_result_t *result, void *user_data)  callback,
void *  user_data 
)

Definition at line 2446 of file st_client.c.

◆ stonith__parse_targets()

GList* stonith__parse_targets ( const char *  hosts)

Definition at line 2204 of file st_client.c.

◆ stonith__register_messages()

void stonith__register_messages ( pcmk__output_t out)

Definition at line 578 of file st_output.c.

◆ stonith__result2rc()

int stonith__result2rc ( const pcmk__action_result_t result)

Definition at line 330 of file st_actions.c.

◆ stonith__sort_history()

stonith_history_t* stonith__sort_history ( stonith_history_t history)

Definition at line 2287 of file st_client.c.

◆ stonith__watchdog_fencing_enabled_for_node()

gboolean stonith__watchdog_fencing_enabled_for_node ( const char *  node)

Definition at line 231 of file st_client.c.

◆ stonith__watchdog_fencing_enabled_for_node_api()

gboolean stonith__watchdog_fencing_enabled_for_node_api ( stonith_t st,
const char *  node 
)

Definition at line 172 of file st_client.c.

◆ stonith__xe_get_result()

void stonith__xe_get_result ( xmlNode *  xml,
pcmk__action_result_t result 
)

Definition at line 494 of file st_actions.c.

◆ stonith__xe_set_result()

void stonith__xe_set_result ( xmlNode *  xml,
const pcmk__action_result_t result 
)

Definition at line 434 of file st_actions.c.