pacemaker  1.1.16-94ff4df
Scalable High-Availability cluster resource manager
Data Structures | Macros | Typedefs | Functions
st_client.c File Reference
#include <crm_internal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <glib.h>
#include <dirent.h>
#include <libgen.h>
#include <crm/crm.h>
#include <crm/stonith-ng.h>
#include <crm/fencing/internal.h>
#include <crm/msg_xml.h>
#include <crm/common/xml.h>
#include <crm/common/mainloop.h>
Include dependency graph for st_client.c:

Go to the source code of this file.

Data Structures

struct  timer_rec_s
 

Macros

#define FAILURE_MAX_RETRIES   2
 
#define READ_MAX   500
 
#define api_log_open()   openlog("stonith-api", LOG_CONS | LOG_NDELAY | LOG_PID, LOG_DAEMON)
 
#define api_log(level, fmt, args...)   syslog(level, "%s: "fmt, __FUNCTION__, 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)
 
bool stonith_dispatch (stonith_t *st)
 
int stonith_dispatch_internal (const char *buffer, ssize_t length, gpointer userdata)
 
void stonith_perform_callback (stonith_t *stonith, xmlNode *msg, int call_id, int rc)
 
xmlNode * stonith_create_op (int call_id, const char *token, const char *op, xmlNode *data, int call_options)
 
int stonith_send_command (stonith_t *stonith, const char *op, xmlNode *data, xmlNode **output_data, int call_options, int timeout)
 
xmlNode * create_device_registration_xml (const char *id, const char *namespace, const char *agent, 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, stonith_key_value_t *device_list)
 
stonith_action_tstonith_action_create (const char *agent, const char *_action, const char *victim, uint32_t victim_nodeid, int timeout, GHashTable *device_args, GHashTable *port_map)
 
GPid stonith_action_execute_async (stonith_action_t *action, void *userdata, void(*done)(GPid pid, int rc, const char *output, gpointer user_data))
 
int stonith_action_execute (stonith_action_t *action, int *agent_result, char **output)
 
gboolean is_redhat_agent (const char *agent)
 
const char * get_stonith_provider (const char *agent, const char *provider)
 
void stonith_dump_pending_callbacks (stonith_t *stonith)
 
void stonith_api_delete (stonith_t *stonith)
 
stonith_tstonith_api_new (void)
 
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)
 
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)
 

Macro Definition Documentation

§ api_log

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

Definition at line 2563 of file st_client.c.

§ api_log_open

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

Definition at line 2562 of file st_client.c.

§ FAILURE_MAX_RETRIES

#define FAILURE_MAX_RETRIES   2

Definition at line 689 of file st_client.c.

§ READ_MAX

#define READ_MAX   500

Definition at line 725 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 123 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,
const char *  namespace,
const char *  agent,
stonith_key_value_t params,
const char *  rsc_provides 
)

Definition at line 205 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,
stonith_key_value_t device_list 
)

Definition at line 319 of file st_client.c.

§ CRM_TRACE_INIT_DATA()

CRM_TRACE_INIT_DATA ( stonith  )

§ get_stonith_provider()

const char* get_stonith_provider ( const char *  agent,
const char *  provider 
)

Definition at line 1613 of file st_client.c.

§ is_redhat_agent()

gboolean is_redhat_agent ( const char *  agent)

Definition at line 1598 of file st_client.c.

§ stonith_action_create()

stonith_action_t* stonith_action_create ( const char *  agent,
const char *  _action,
const char *  victim,
uint32_t  victim_nodeid,
int  timeout,
GHashTable *  device_args,
GHashTable *  port_map 
)

Definition at line 691 of file st_client.c.

§ stonith_action_execute()

int stonith_action_execute ( stonith_action_t action,
int *  agent_result,
char **  output 
)

Definition at line 1094 of file st_client.c.

§ stonith_action_execute_async()

GPid stonith_action_execute_async ( stonith_action_t action,
void *  userdata,
void(*)(GPid pid, int rc, const char *output, gpointer user_data)  done 
)

Definition at line 1073 of file st_client.c.

§ stonith_api_delete()

void stonith_api_delete ( stonith_t stonith)

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

§ stonith_api_new()

stonith_t* stonith_api_new ( void  )

Definition at line 2466 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 2615 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 1684 of file st_client.c.

§ stonith_dispatch()

bool stonith_dispatch ( stonith_t st)

Definition at line 2354 of file st_client.c.

§ stonith_dispatch_internal()

int stonith_dispatch_internal ( const char *  buffer,
ssize_t  length,
gpointer  userdata 
)

Definition at line 2380 of file st_client.c.

§ stonith_dump_pending_callbacks()

void stonith_dump_pending_callbacks ( stonith_t stonith)

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

§ stonith_key_value_freeall()

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

Definition at line 2545 of file st_client.c.

§ stonith_perform_callback()

void stonith_perform_callback ( stonith_t stonith,
xmlNode *  msg,
int  call_id,
int  rc 
)

Definition at line 2085 of file st_client.c.

§ stonith_send_command()

int stonith_send_command ( stonith_t stonith,
const char *  op,
xmlNode *  data,
xmlNode **  output_data,
int  call_options,
int  timeout 
)

Definition at line 2244 of file st_client.c.