pacemaker  2.0.1-9e909a5bdd
Scalable High-Availability cluster resource manager
Data Structures | Macros | Typedefs | Functions | Variables
crm_internal.h File Reference
#include <config.h>
#include <portability.h>
#include <glib.h>
#include <stdbool.h>
#include <libxml/tree.h>
#include <crm/lrmd.h>
#include <crm/common/logging.h>
#include <crm/common/ipcs.h>
#include <crm/common/internal.h>
Include dependency graph for crm_internal.h:

Go to the source code of this file.

Data Structures

struct  crm_option
 
struct  pe_cluster_option_s
 
struct  __attribute__
 
struct  __attribute__
 
struct  remote_proxy_s
 

Macros

#define no_argument   0
 
#define required_argument   1
 
#define pcmk_option_default   0x00000
 
#define pcmk_option_hidden   0x00001
 
#define pcmk_option_paragraph   0x00002
 
#define pcmk_option_example   0x00004
 
#define CRM_OP_FMT   "%s_%s_%u"
 
#define set_bit(word, bit)   word = crm_set_bit(__FUNCTION__, __LINE__, NULL, word, bit)
 
#define clear_bit(word, bit)   word = crm_clear_bit(__FUNCTION__, __LINE__, NULL, word, bit)
 
#define crm_config_err(fmt...)   { crm_config_error = TRUE; crm_err(fmt); }
 
#define crm_config_warn(fmt...)   { crm_config_warning = TRUE; crm_warn(fmt); }
 
#define F_ATTRD_KEY   "attr_key"
 
#define F_ATTRD_ATTRIBUTE   "attr_name"
 
#define F_ATTRD_REGEX   "attr_regex"
 
#define F_ATTRD_TASK   "task"
 
#define F_ATTRD_VALUE   "attr_value"
 
#define F_ATTRD_SET   "attr_set"
 
#define F_ATTRD_IS_REMOTE   "attr_is_remote"
 
#define F_ATTRD_IS_PRIVATE   "attr_is_private"
 
#define F_ATTRD_SECTION   "attr_section"
 
#define F_ATTRD_DAMPEN   "attr_dampening"
 
#define F_ATTRD_HOST   "attr_host"
 
#define F_ATTRD_HOST_ID   "attr_host_id"
 
#define F_ATTRD_USER   "attr_user"
 
#define F_ATTRD_WRITER   "attr_writer"
 
#define F_ATTRD_VERSION   "attr_version"
 
#define F_ATTRD_RESOURCE   "attr_resource"
 
#define F_ATTRD_OPERATION   "attr_clear_operation"
 
#define F_ATTRD_INTERVAL   "attr_clear_interval"
 
#define F_ATTRD_IS_FORCE_WRITE   "attrd_is_force_write"
 
#define ATTRD_OP_PEER_REMOVE   "peer-remove"
 
#define ATTRD_OP_UPDATE   "update"
 
#define ATTRD_OP_UPDATE_BOTH   "update-both"
 
#define ATTRD_OP_UPDATE_DELAY   "update-delay"
 
#define ATTRD_OP_QUERY   "query"
 
#define ATTRD_OP_REFRESH   "refresh"
 
#define ATTRD_OP_FLUSH   "flush"
 
#define ATTRD_OP_SYNC   "sync"
 
#define ATTRD_OP_SYNC_RESPONSE   "sync-response"
 
#define ATTRD_OP_CLEAR_FAILURE   "clear-failure"
 
#define PCMK_ENV_PHYSICAL_HOST   "physical_host"
 

Typedefs

typedef struct pe_cluster_option_s pe_cluster_option
 
typedef struct remote_proxy_s remote_proxy_t
 

Functions

void * find_library_function (void **handle, const char *lib, const char *fn, int fatal)
 
char * uid2username (uid_t uid)
 
const char * crm_acl_get_set_user (xmlNode *request, const char *field, const char *peer_user)
 
void crm_set_options (const char *short_options, const char *usage, struct crm_option *long_options, const char *app_desc)
 
int crm_get_option (int argc, char **argv, int *index)
 
int crm_get_option_long (int argc, char **argv, int *index, const char **longname)
 
crm_exit_t crm_help (char cmd, crm_exit_t exit_code)
 
const char * cluster_option (GHashTable *options, gboolean(*validate)(const char *), const char *name, const char *old_name, const char *def_value)
 
const char * get_cluster_pref (GHashTable *options, pe_cluster_option *option_list, int len, const char *name)
 
void config_metadata (const char *name, const char *version, const char *desc_short, const char *desc_long, pe_cluster_option *option_list, int len)
 
void verify_all_options (GHashTable *options, pe_cluster_option *option_list, int len)
 
gboolean check_time (const char *value)
 
gboolean check_timer (const char *value)
 
gboolean check_boolean (const char *value)
 
gboolean check_number (const char *value)
 
gboolean check_positive_number (const char *value)
 
gboolean check_quorum (const char *value)
 
gboolean check_script (const char *value)
 
gboolean check_utilization (const char *value)
 
long crm_get_sbd_timeout (void)
 
long crm_auto_watchdog_timeout (void)
 
gboolean check_sbd_timeout (const char *value)
 
void crm_args_fini (void)
 
void crm_make_daemon (const char *name, gboolean daemonize, const char *pidfile)
 
char * generate_hash_key (const char *crm_msg_reference, const char *sys)
 
const char * daemon_option (const char *option)
 
void set_daemon_option (const char *option, const char *value)
 
gboolean daemon_option_enabled (const char *daemon, const char *option)
 
void strip_text_nodes (xmlNode *xml)
 
void pcmk_panic (const char *origin)
 
pid_t pcmk_locate_sbd (void)
 
void attrd_ipc_server_init (qb_ipcs_service_t **ipcs, struct qb_ipcs_service_handlers *cb)
 
void stonith_ipc_server_init (qb_ipcs_service_t **ipcs, struct qb_ipcs_service_handlers *cb)
 
qb_ipcs_service_t * crmd_ipc_server_init (struct qb_ipcs_service_handlers *cb)
 
void cib_ipc_servers_init (qb_ipcs_service_t **ipcs_ro, qb_ipcs_service_t **ipcs_rw, qb_ipcs_service_t **ipcs_shm, struct qb_ipcs_service_handlers *ro_cb, struct qb_ipcs_service_handlers *rw_cb)
 
void cib_ipc_servers_destroy (qb_ipcs_service_t *ipcs_ro, qb_ipcs_service_t *ipcs_rw, qb_ipcs_service_t *ipcs_shm)
 
const char * crm_xml_add_last_written (xmlNode *xml_node)
 
void crm_xml_dump (xmlNode *data, int options, char **buffer, int *offset, int *max, int depth)
 
void crm_buffer_add_char (char **buffer, int *offset, int *max, char c)
 
gboolean crm_digest_verify (xmlNode *input, const char *expected)
 
char * crm_compat_realpath (const char *path)
 
remote_proxy_tremote_proxy_new (lrmd_t *lrmd, struct ipc_client_callbacks *proxy_callbacks, const char *node_name, const char *session_id, const char *channel)
 
int remote_proxy_check (lrmd_t *lrmd, GHashTable *hash)
 
void remote_proxy_cb (lrmd_t *lrmd, const char *node_name, xmlNode *msg)
 
void remote_proxy_ack_shutdown (lrmd_t *lrmd)
 Send an acknowledgment of a remote proxy shutdown request. More...
 
void remote_proxy_nack_shutdown (lrmd_t *lrmd)
 We're not going to shutdown as response to a remote proxy shutdown request. More...
 
int remote_proxy_dispatch (const char *buffer, ssize_t length, gpointer userdata)
 
void remote_proxy_disconnected (gpointer data)
 
void remote_proxy_free (gpointer data)
 
void remote_proxy_relay_event (remote_proxy_t *proxy, xmlNode *msg)
 
void remote_proxy_relay_response (remote_proxy_t *proxy, xmlNode *msg, int msg_id)
 

Variables

int node_score_red
 
int node_score_green
 
int node_score_yellow
 

Macro Definition Documentation

◆ ATTRD_OP_CLEAR_FAILURE

#define ATTRD_OP_CLEAR_FAILURE   "clear-failure"

Definition at line 210 of file crm_internal.h.

◆ ATTRD_OP_FLUSH

#define ATTRD_OP_FLUSH   "flush"

Definition at line 207 of file crm_internal.h.

◆ ATTRD_OP_PEER_REMOVE

#define ATTRD_OP_PEER_REMOVE   "peer-remove"

Definition at line 201 of file crm_internal.h.

◆ ATTRD_OP_QUERY

#define ATTRD_OP_QUERY   "query"

Definition at line 205 of file crm_internal.h.

◆ ATTRD_OP_REFRESH

#define ATTRD_OP_REFRESH   "refresh"

Definition at line 206 of file crm_internal.h.

◆ ATTRD_OP_SYNC

#define ATTRD_OP_SYNC   "sync"

Definition at line 208 of file crm_internal.h.

◆ ATTRD_OP_SYNC_RESPONSE

#define ATTRD_OP_SYNC_RESPONSE   "sync-response"

Definition at line 209 of file crm_internal.h.

◆ ATTRD_OP_UPDATE

#define ATTRD_OP_UPDATE   "update"

Definition at line 202 of file crm_internal.h.

◆ ATTRD_OP_UPDATE_BOTH

#define ATTRD_OP_UPDATE_BOTH   "update-both"

Definition at line 203 of file crm_internal.h.

◆ ATTRD_OP_UPDATE_DELAY

#define ATTRD_OP_UPDATE_DELAY   "update-delay"

Definition at line 204 of file crm_internal.h.

◆ clear_bit

#define clear_bit (   word,
  bit 
)    word = crm_clear_bit(__FUNCTION__, __LINE__, NULL, word, bit)

Definition at line 166 of file crm_internal.h.

◆ crm_config_err

#define crm_config_err (   fmt...)    { crm_config_error = TRUE; crm_err(fmt); }

Definition at line 177 of file crm_internal.h.

◆ crm_config_warn

#define crm_config_warn (   fmt...)    { crm_config_warning = TRUE; crm_warn(fmt); }

Definition at line 178 of file crm_internal.h.

◆ CRM_OP_FMT

#define CRM_OP_FMT   "%s_%s_%u"

Definition at line 131 of file crm_internal.h.

◆ F_ATTRD_ATTRIBUTE

#define F_ATTRD_ATTRIBUTE   "attr_name"

Definition at line 181 of file crm_internal.h.

◆ F_ATTRD_DAMPEN

#define F_ATTRD_DAMPEN   "attr_dampening"

Definition at line 189 of file crm_internal.h.

◆ F_ATTRD_HOST

#define F_ATTRD_HOST   "attr_host"

Definition at line 190 of file crm_internal.h.

◆ F_ATTRD_HOST_ID

#define F_ATTRD_HOST_ID   "attr_host_id"

Definition at line 191 of file crm_internal.h.

◆ F_ATTRD_INTERVAL

#define F_ATTRD_INTERVAL   "attr_clear_interval"

Definition at line 197 of file crm_internal.h.

◆ F_ATTRD_IS_FORCE_WRITE

#define F_ATTRD_IS_FORCE_WRITE   "attrd_is_force_write"

Definition at line 198 of file crm_internal.h.

◆ F_ATTRD_IS_PRIVATE

#define F_ATTRD_IS_PRIVATE   "attr_is_private"

Definition at line 187 of file crm_internal.h.

◆ F_ATTRD_IS_REMOTE

#define F_ATTRD_IS_REMOTE   "attr_is_remote"

Definition at line 186 of file crm_internal.h.

◆ F_ATTRD_KEY

#define F_ATTRD_KEY   "attr_key"

Definition at line 180 of file crm_internal.h.

◆ F_ATTRD_OPERATION

#define F_ATTRD_OPERATION   "attr_clear_operation"

Definition at line 196 of file crm_internal.h.

◆ F_ATTRD_REGEX

#define F_ATTRD_REGEX   "attr_regex"

Definition at line 182 of file crm_internal.h.

◆ F_ATTRD_RESOURCE

#define F_ATTRD_RESOURCE   "attr_resource"

Definition at line 195 of file crm_internal.h.

◆ F_ATTRD_SECTION

#define F_ATTRD_SECTION   "attr_section"

Definition at line 188 of file crm_internal.h.

◆ F_ATTRD_SET

#define F_ATTRD_SET   "attr_set"

Definition at line 185 of file crm_internal.h.

◆ F_ATTRD_TASK

#define F_ATTRD_TASK   "task"

Definition at line 183 of file crm_internal.h.

◆ F_ATTRD_USER

#define F_ATTRD_USER   "attr_user"

Definition at line 192 of file crm_internal.h.

◆ F_ATTRD_VALUE

#define F_ATTRD_VALUE   "attr_value"

Definition at line 184 of file crm_internal.h.

◆ F_ATTRD_VERSION

#define F_ATTRD_VERSION   "attr_version"

Definition at line 194 of file crm_internal.h.

◆ F_ATTRD_WRITER

#define F_ATTRD_WRITER   "attr_writer"

Definition at line 193 of file crm_internal.h.

◆ no_argument

#define no_argument   0

Definition at line 50 of file crm_internal.h.

◆ PCMK_ENV_PHYSICAL_HOST

#define PCMK_ENV_PHYSICAL_HOST   "physical_host"

Definition at line 212 of file crm_internal.h.

◆ pcmk_option_default

#define pcmk_option_default   0x00000

Definition at line 54 of file crm_internal.h.

◆ pcmk_option_example

#define pcmk_option_example   0x00004

Definition at line 57 of file crm_internal.h.

◆ pcmk_option_hidden

#define pcmk_option_hidden   0x00001

Definition at line 55 of file crm_internal.h.

◆ pcmk_option_paragraph

#define pcmk_option_paragraph   0x00002

Definition at line 56 of file crm_internal.h.

◆ required_argument

#define required_argument   1

Definition at line 51 of file crm_internal.h.

◆ set_bit

#define set_bit (   word,
  bit 
)    word = crm_set_bit(__FUNCTION__, __LINE__, NULL, word, bit)

Definition at line 165 of file crm_internal.h.

Typedef Documentation

◆ pe_cluster_option

◆ remote_proxy_t

Function Documentation

◆ attrd_ipc_server_init()

void attrd_ipc_server_init ( qb_ipcs_service_t **  ipcs,
struct qb_ipcs_service_handlers *  cb 
)

Definition at line 1017 of file utils.c.

◆ check_boolean()

gboolean check_boolean ( const char *  value)

Definition at line 89 of file utils.c.

◆ check_number()

gboolean check_number ( const char *  value)

Definition at line 100 of file utils.c.

◆ check_positive_number()

gboolean check_positive_number ( const char *  value)

Definition at line 121 of file utils.c.

◆ check_quorum()

gboolean check_quorum ( const char *  value)

Definition at line 130 of file utils.c.

◆ check_sbd_timeout()

gboolean check_sbd_timeout ( const char *  value)

Definition at line 233 of file watchdog.c.

◆ check_script()

gboolean check_script ( const char *  value)

Definition at line 148 of file utils.c.

◆ check_time()

gboolean check_time ( const char *  value)

Definition at line 71 of file utils.c.

◆ check_timer()

gboolean check_timer ( const char *  value)

Definition at line 80 of file utils.c.

◆ check_utilization()

gboolean check_utilization ( const char *  value)

Definition at line 175 of file utils.c.

◆ cib_ipc_servers_destroy()

void cib_ipc_servers_destroy ( qb_ipcs_service_t *  ipcs_ro,
qb_ipcs_service_t *  ipcs_rw,
qb_ipcs_service_t *  ipcs_shm 
)

Definition at line 1001 of file utils.c.

◆ cib_ipc_servers_init()

void cib_ipc_servers_init ( qb_ipcs_service_t **  ipcs_ro,
qb_ipcs_service_t **  ipcs_rw,
qb_ipcs_service_t **  ipcs_shm,
struct qb_ipcs_service_handlers *  ro_cb,
struct qb_ipcs_service_handlers *  rw_cb 
)

Definition at line 984 of file utils.c.

◆ cluster_option()

const char* cluster_option ( GHashTable *  options,
gboolean(*)(const char *)  validate,
const char *  name,
const char *  old_name,
const char *  def_value 
)

Definition at line 261 of file utils.c.

◆ config_metadata()

void config_metadata ( const char *  name,
const char *  version,
const char *  desc_short,
const char *  desc_long,
pe_cluster_option option_list,
int  len 
)

Definition at line 342 of file utils.c.

◆ crm_acl_get_set_user()

const char* crm_acl_get_set_user ( xmlNode *  request,
const char *  field,
const char *  peer_user 
)

◆ crm_args_fini()

void crm_args_fini ( void  )

Definition at line 190 of file utils.c.

◆ crm_auto_watchdog_timeout()

long crm_auto_watchdog_timeout ( void  )

Definition at line 225 of file watchdog.c.

◆ crm_buffer_add_char()

void crm_buffer_add_char ( char **  buffer,
int *  offset,
int *  max,
char  c 
)

Definition at line 3138 of file xml.c.

◆ crm_compat_realpath()

char* crm_compat_realpath ( const char *  path)

Definition at line 40 of file compat.c.

◆ crm_digest_verify()

gboolean crm_digest_verify ( xmlNode *  input,
const char *  expected 
)

Definition at line 226 of file digest.c.

◆ crm_get_option()

int crm_get_option ( int  argc,
char **  argv,
int *  index 
)

Definition at line 858 of file utils.c.

◆ crm_get_option_long()

int crm_get_option_long ( int  argc,
char **  argv,
int *  index,
const char **  longname 
)

Definition at line 864 of file utils.c.

◆ crm_get_sbd_timeout()

long crm_get_sbd_timeout ( void  )

Definition at line 214 of file watchdog.c.

◆ crm_help()

crm_exit_t crm_help ( char  cmd,
crm_exit_t  exit_code 
)

Definition at line 909 of file utils.c.

◆ crm_make_daemon()

void crm_make_daemon ( const char *  name,
gboolean  daemonize,
const char *  pidfile 
)

Definition at line 685 of file utils.c.

◆ crm_set_options()

void crm_set_options ( const char *  short_options,
const char *  usage,
struct crm_option long_options,
const char *  app_desc 
)

Definition at line 817 of file utils.c.

◆ crm_xml_add_last_written()

const char* crm_xml_add_last_written ( xmlNode *  xml_node)

Definition at line 2308 of file xml.c.

◆ crm_xml_dump()

void crm_xml_dump ( xmlNode *  data,
int  options,
char **  buffer,
int *  offset,
int *  max,
int  depth 
)

Definition at line 3035 of file xml.c.

◆ crmd_ipc_server_init()

qb_ipcs_service_t* crmd_ipc_server_init ( struct qb_ipcs_service_handlers *  cb)

Definition at line 1011 of file utils.c.

◆ daemon_option()

const char* daemon_option ( const char *  option)

Definition at line 104 of file logging.c.

◆ daemon_option_enabled()

gboolean daemon_option_enabled ( const char *  daemon,
const char *  option 
)

Definition at line 152 of file logging.c.

◆ find_library_function()

void* find_library_function ( void **  handle,
const char *  lib,
const char *  fn,
int  fatal 
)

◆ generate_hash_key()

char* generate_hash_key ( const char *  crm_msg_reference,
const char *  sys 
)

Definition at line 390 of file utils.c.

◆ get_cluster_pref()

const char* get_cluster_pref ( GHashTable *  options,
pe_cluster_option option_list,
int  len,
const char *  name 
)

Definition at line 323 of file utils.c.

◆ pcmk_locate_sbd()

pid_t pcmk_locate_sbd ( void  )

Definition at line 174 of file watchdog.c.

◆ pcmk_panic()

void pcmk_panic ( const char *  origin)

Definition at line 143 of file watchdog.c.

◆ remote_proxy_ack_shutdown()

void remote_proxy_ack_shutdown ( lrmd_t lrmd)

Send an acknowledgment of a remote proxy shutdown request.

Parameters
[in]lrmdConnection to proxy

Definition at line 42 of file proxy_common.c.

◆ remote_proxy_cb()

void remote_proxy_cb ( lrmd_t lrmd,
const char *  node_name,
xmlNode *  msg 
)

Definition at line 203 of file proxy_common.c.

◆ remote_proxy_check()

int remote_proxy_check ( lrmd_t lrmd,
GHashTable *  hash 
)

Definition at line 868 of file lrmd_client.c.

◆ remote_proxy_disconnected()

void remote_proxy_disconnected ( gpointer  data)

Definition at line 145 of file proxy_common.c.

◆ remote_proxy_dispatch()

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

Definition at line 116 of file proxy_common.c.

◆ remote_proxy_free()

void remote_proxy_free ( gpointer  data)

Definition at line 105 of file proxy_common.c.

◆ remote_proxy_nack_shutdown()

void remote_proxy_nack_shutdown ( lrmd_t lrmd)

We're not going to shutdown as response to a remote proxy shutdown request.

Parameters
[in]lrmdConnection to proxy

Definition at line 57 of file proxy_common.c.

◆ remote_proxy_new()

remote_proxy_t* remote_proxy_new ( lrmd_t lrmd,
struct ipc_client_callbacks proxy_callbacks,
const char *  node_name,
const char *  session_id,
const char *  channel 
)

Definition at line 163 of file proxy_common.c.

◆ remote_proxy_relay_event()

void remote_proxy_relay_event ( remote_proxy_t proxy,
xmlNode *  msg 
)

Definition at line 66 of file proxy_common.c.

◆ remote_proxy_relay_response()

void remote_proxy_relay_response ( remote_proxy_t proxy,
xmlNode *  msg,
int  msg_id 
)

Definition at line 79 of file proxy_common.c.

◆ set_daemon_option()

void set_daemon_option ( const char *  option,
const char *  value 
)

Definition at line 128 of file logging.c.

◆ stonith_ipc_server_init()

void stonith_ipc_server_init ( qb_ipcs_service_t **  ipcs,
struct qb_ipcs_service_handlers *  cb 
)

Definition at line 1029 of file utils.c.

◆ strip_text_nodes()

void strip_text_nodes ( xmlNode *  xml)

Definition at line 2206 of file xml.c.

◆ uid2username()

char* uid2username ( uid_t  uid)

◆ verify_all_options()

void verify_all_options ( GHashTable *  options,
pe_cluster_option option_list,
int  len 
)

Definition at line 377 of file utils.c.

Variable Documentation

◆ node_score_green

int node_score_green
extern

Definition at line 62 of file utils.c.

◆ node_score_red

int node_score_red
extern

Definition at line 61 of file utils.c.

◆ node_score_yellow

int node_score_yellow
extern

Definition at line 63 of file utils.c.