pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
st_client.c File Reference
#include <crm_internal.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <inttypes.h>
#include <sys/types.h>
#include <glib.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <crm/crm.h>
#include <crm/stonith-ng.h>
#include <crm/fencing/internal.h>
#include <crm/common/xml.h>
#include <crm/common/mainloop.h>
#include "fencing_private.h"
Include dependency graph for st_client.c:

Go to the source code of this file.

Data Structures

struct  timer_rec_s
 

Macros

#define api_log_open()
 
#define api_log(level, fmt, args...)
 

Typedefs

typedef struct stonith_private_s stonith_private_t
 
typedef struct stonith_notify_client_s stonith_notify_client_t
 
typedef struct stonith_callback_client_s stonith_callback_client_t
 
typedef int(* stonith_op_t) (const char *, int, const char *, xmlNode *, xmlNode *, xmlNode *, xmlNode **, xmlNode **)
 

Functions

 CRM_TRACE_INIT_DATA (stonith)
 
xmlNode * stonith_create_op (int call_id, const char *token, const char *op, xmlNode *data, int call_options)
 
gboolean stonith__watchdog_fencing_enabled_for_node_api (stonith_t *st, const char *node)
 
gboolean stonith__watchdog_fencing_enabled_for_node (const char *node)
 
xmlNode * create_device_registration_xml (const char *id, enum stonith_namespace standard, const char *agent, const stonith_key_value_t *params, const char *rsc_provides)
 
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)
 
void stonith__history_free (stonith_history_t *head)
 
int stonith__api_dispatch (stonith_t *stonith_api)
 
int stonith__validate (stonith_t *st, int call_options, const char *rsc_id, const char *agent, GHashTable *params, int timeout_sec, char **output, char **error_output)
 
stonith_tstonith__api_new (void)
 
void stonith__api_free (stonith_t *stonith_api)
 
int stonith__api_connect_retry (stonith_t *stonith_api, const char *name, int max_attempts)
 
stonith_key_value_tstonith__key_value_add (stonith_key_value_t *head, const char *key, const char *value)
 
void stonith__key_value_freeall (stonith_key_value_t *head, bool keys, bool values)
 
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 *name)
 
GList * stonith__parse_targets (const char *target_spec)
 
const char * stonith__later_succeeded (const stonith_history_t *event, const stonith_history_t *top_history)
 
stonith_history_tstonith__sort_history (stonith_history_t *history)
 
const char * stonith__op_state_text (enum op_state state)
 
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)
 
const char * stonith__default_host_arg (xmlNode *metadata)
 
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)
 
int stonith__exit_status (const stonith_callback_data_t *data)
 
int stonith__execution_status (const stonith_callback_data_t *data)
 
const char * stonith__exit_reason (const stonith_callback_data_t *data)
 
int stonith__event_exit_status (const stonith_event_t *event)
 
int stonith__event_execution_status (const stonith_event_t *event)
 
const char * stonith__event_exit_reason (const stonith_event_t *event)
 
char * stonith__event_description (const stonith_event_t *event)
 
stonith_tstonith_api_new (void)
 
void stonith_api_delete (stonith_t *stonith)
 
void stonith_dump_pending_callbacks (stonith_t *stonith)
 
bool stonith_dispatch (stonith_t *stonith_api)
 
stonith_key_value_tstonith_key_value_add (stonith_key_value_t *head, const char *key, const char *value)
 
void stonith_key_value_freeall (stonith_key_value_t *head, int keys, int values)
 
void stonith_history_free (stonith_history_t *head)
 
int stonith_api_connect_retry (stonith_t *st, const char *name, int max_attempts)
 
const char * stonith_op_state_str (enum op_state state)
 
bool stonith_agent_exists (const char *agent, int timeout)
 
const char * stonith_action_str (const char *action)
 
enum stonith_namespace stonith_text2namespace (const char *namespace_s)
 
const char * stonith_namespace2text (enum stonith_namespace st_namespace)
 
enum stonith_namespace stonith_get_namespace (const char *agent, const char *namespace_s)
 

Macro Definition Documentation

◆ api_log

#define api_log ( level,
fmt,
args... )
Value:
syslog(level, "%s: "fmt, __func__, args)

Definition at line 2050 of file st_client.c.

◆ api_log_open

#define api_log_open ( )
Value:
openlog("stonith-api", LOG_CONS | LOG_NDELAY | LOG_PID, LOG_DAEMON)

Definition at line 2049 of file st_client.c.

Typedef Documentation

◆ stonith_callback_client_t

typedef struct stonith_callback_client_s stonith_callback_client_t

◆ stonith_notify_client_t

typedef struct stonith_notify_client_s stonith_notify_client_t

◆ stonith_op_t

typedef int(* stonith_op_t) (const char *, int, const char *, xmlNode *, xmlNode *, xmlNode *, xmlNode **, xmlNode **)

Definition at line 85 of file st_client.c.

◆ stonith_private_t

typedef struct stonith_private_s stonith_private_t

Function Documentation

◆ create_device_registration_xml()

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

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

◆ CRM_TRACE_INIT_DATA()

CRM_TRACE_INIT_DATA ( stonith )

◆ stonith__agent_exists()

bool stonith__agent_exists ( const char * name)

Definition at line 2168 of file st_client.c.

◆ stonith__api_connect_retry()

int stonith__api_connect_retry ( stonith_t * stonith_api,
const char * name,
int max_attempts )

Definition at line 1958 of file st_client.c.

◆ stonith__api_dispatch()

int stonith__api_dispatch ( stonith_t * stonith_api)

Definition at line 1677 of file st_client.c.

◆ stonith__api_free()

void stonith__api_free ( stonith_t * stonith_api)

Definition at line 1939 of file st_client.c.

◆ stonith__api_new()

stonith_t * stonith__api_new ( void )

Definition at line 1866 of file st_client.c.

◆ stonith__default_host_arg()

const char * stonith__default_host_arg ( xmlNode * metadata)

Definition at line 2529 of file st_client.c.

◆ stonith__event_description()

char * stonith__event_description ( const stonith_event_t * event)

Definition at line 2746 of file st_client.c.

◆ stonith__event_execution_status()

int stonith__event_execution_status ( const stonith_event_t * event)

Definition at line 2704 of file st_client.c.

◆ stonith__event_exit_reason()

const char * stonith__event_exit_reason ( const stonith_event_t * event)

Definition at line 2724 of file st_client.c.

◆ stonith__event_exit_status()

int stonith__event_exit_status ( const stonith_event_t * event)

Definition at line 2684 of file st_client.c.

◆ stonith__event_state_eq()

bool stonith__event_state_eq ( stonith_history_t * history,
void * user_data )

Definition at line 2482 of file st_client.c.

◆ stonith__event_state_neq()

bool stonith__event_state_neq ( stonith_history_t * history,
void * user_data )

Definition at line 2488 of file st_client.c.

◆ stonith__event_state_pending()

bool stonith__event_state_pending ( stonith_history_t * history,
void * user_data )

Definition at line 2476 of file st_client.c.

◆ stonith__execution_status()

int stonith__execution_status ( const stonith_callback_data_t * data)

Definition at line 2650 of file st_client.c.

◆ stonith__exit_reason()

const char * stonith__exit_reason ( const stonith_callback_data_t * data)

Definition at line 2667 of file st_client.c.

◆ stonith__exit_status()

int stonith__exit_status ( const stonith_callback_data_t * data)

Definition at line 2633 of file st_client.c.

◆ stonith__first_matching_event()

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

Definition at line 2462 of file st_client.c.

◆ stonith__history_free()

void stonith__history_free ( stonith_history_t * head)

Definition at line 776 of file st_client.c.

◆ stonith__key_value_add()

stonith_key_value_t * stonith__key_value_add ( stonith_key_value_t * head,
const char * key,
const char * value )

Definition at line 1995 of file st_client.c.

◆ stonith__key_value_freeall()

void stonith__key_value_freeall ( stonith_key_value_t * head,
bool keys,
bool values )

Definition at line 2033 of file st_client.c.

◆ stonith__later_succeeded()

const char * stonith__later_succeeded ( const stonith_history_t * event,
const stonith_history_t * top_history )

Definition at line 2347 of file st_client.c.

◆ stonith__metadata_async()

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 )

Definition at line 2562 of file st_client.c.

◆ stonith__op_state_text()

const char * stonith__op_state_text ( enum op_state state)

Definition at line 2442 of file st_client.c.

◆ stonith__parse_targets()

GList * stonith__parse_targets ( const char * target_spec)

Definition at line 2300 of file st_client.c.

◆ stonith__sort_history()

stonith_history_t * stonith__sort_history ( stonith_history_t * history)

Definition at line 2387 of file st_client.c.

◆ stonith__validate()

int stonith__validate ( stonith_t * st,
int call_options,
const char * rsc_id,
const char * agent,
GHashTable * params,
int timeout_sec,
char ** output,
char ** error_output )

Definition at line 1742 of file st_client.c.

◆ stonith__watchdog_fencing_enabled_for_node()

gboolean stonith__watchdog_fencing_enabled_for_node ( const char * node)

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

◆ stonith_action_str()

const char * stonith_action_str ( const char * action)
Deprecated
Do not use

Definition at line 2909 of file st_client.c.

◆ stonith_agent_exists()

bool stonith_agent_exists ( const char * agent,
int timeout )
Deprecated
Do not use

Definition at line 2901 of file st_client.c.

◆ stonith_api_connect_retry()

int stonith_api_connect_retry ( stonith_t * st,
const char * name,
int max_attempts )
Deprecated
Do not use

Definition at line 2885 of file st_client.c.

◆ stonith_api_delete()

void stonith_api_delete ( stonith_t * stonith)
Deprecated
Use appropriate functions in libpacemaker

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

◆ stonith_api_new()

stonith_t * stonith_api_new ( void )
Deprecated
Use appropriate functions in libpacemaker

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

◆ stonith_create_op()

xmlNode * stonith_create_op ( int call_id,
const char * token,
const char * op,
xmlNode * data,
int call_options )

Definition at line 829 of file st_client.c.

◆ stonith_dispatch()

bool stonith_dispatch ( stonith_t * stonith_api)
Deprecated
Do not use

Definition at line 2850 of file st_client.c.

◆ stonith_dump_pending_callbacks()

void stonith_dump_pending_callbacks ( stonith_t * stonith)
Deprecated
Do not use

Definition at line 2836 of file st_client.c.

◆ stonith_get_namespace()

enum stonith_namespace stonith_get_namespace ( const char * agent,
const char * namespace_s )
Deprecated
Do not use

Definition at line 2942 of file st_client.c.

◆ stonith_history_free()

void stonith_history_free ( stonith_history_t * head)
Deprecated
Do not use

Definition at line 2876 of file st_client.c.

◆ stonith_key_value_add()

stonith_key_value_t * stonith_key_value_add ( stonith_key_value_t * head,
const char * key,
const char * value )
Deprecated
Do not use

Definition at line 2859 of file st_client.c.

◆ stonith_key_value_freeall()

void stonith_key_value_freeall ( stonith_key_value_t * head,
int keys,
int values )
Deprecated
Do not use

Definition at line 2868 of file st_client.c.

◆ stonith_namespace2text()

const char * stonith_namespace2text ( enum stonith_namespace st_namespace)
Deprecated
Do not use

Definition at line 2933 of file st_client.c.

◆ stonith_op_state_str()

const char * stonith_op_state_str ( enum op_state state)
Deprecated
Do not use

Definition at line 2893 of file st_client.c.

◆ stonith_text2namespace()

enum stonith_namespace stonith_text2namespace ( const char * namespace_s)
Deprecated
Do not use

Definition at line 2925 of file st_client.c.