pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
Macros | Functions | Variables
internal.h File Reference
#include <unistd.h>
#include <stdbool.h>
#include <stdint.h>
#include <glib.h>
#include <libxml/tree.h>
#include <crm/common/util.h>
#include <crm/common/logging.h>
#include <crm/common/mainloop.h>
#include <crm/common/actions_internal.h>
#include <crm/common/digests_internal.h>
#include <crm/common/health_internal.h>
#include <crm/common/io_internal.h>
#include <crm/common/iso8601_internal.h>
#include <crm/common/results_internal.h>
#include <crm/common/messages_internal.h>
#include <crm/common/strings_internal.h>
#include <crm/common/acl_internal.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 PCMK__NELEM(a)   ((int) (sizeof(a)/sizeof(a[0])) )
 
#define PCMK__FAIL_COUNT_PREFIX   "fail-count"
 
#define PCMK__LAST_FAILURE_PREFIX   "last-failure"
 

Functions

int pcmk__add_mainloop_ipc (crm_ipc_t *ipc, int priority, void *userdata, const struct ipc_client_callbacks *callbacks, mainloop_io_t **source)
 Connect to IPC and add it as a main loop source. More...
 
guint pcmk__mainloop_timer_get_period (const mainloop_timer_t *timer)
 Get period for mainloop timer. More...
 
void pcmk__xe_add_node (xmlNode *xml, const char *node, int nodeid)
 
int pcmk__scan_nvpair (const char *input, char **name, char **value)
 
char * pcmk__format_nvpair (const char *name, const char *value, const char *units)
 
void pcmk__xe_set_bool_attr (xmlNodePtr node, const char *name, bool value)
 
bool pcmk__xe_attr_is_true (const xmlNode *node, const char *name)
 
int pcmk__xe_get_bool_attr (const xmlNode *node, const char *name, bool *value)
 
pid_t pcmk__procfs_pid_of (const char *name)
 
unsigned int pcmk__procfs_num_cores (void)
 
int pcmk__procfs_pid2path (pid_t pid, char path[], size_t path_size)
 
bool pcmk__procfs_has_pids (void)
 
void crm_schema_init (void)
 
void crm_schema_cleanup (void)
 
int pcmk__pid_active (pid_t pid, const char *daemon)
 
int pcmk__read_pidfile (const char *filename, pid_t *pid)
 
int pcmk__pidfile_matches (const char *filename, pid_t expected_pid, const char *expected_name, pid_t *pid)
 
int pcmk__lock_pidfile (const char *filename, const char *name)
 
void pcmk__daemonize (const char *name, const char *pidfile)
 
void pcmk__panic (const char *origin)
 
pid_t pcmk__locate_sbd (void)
 
void pcmk__sleep_ms (unsigned int ms)
 
int pcmk__effective_rc (int rc)
 

Variables

bool pcmk__is_daemon
 
char * pcmk__our_nodename
 Node name of the local node. More...
 
int pcmk__score_red
 
int pcmk__score_green
 
int pcmk__score_yellow
 

Macro Definition Documentation

◆ PCMK__FAIL_COUNT_PREFIX

#define PCMK__FAIL_COUNT_PREFIX   "fail-count"

Definition at line 296 of file internal.h.

◆ PCMK__LAST_FAILURE_PREFIX

#define PCMK__LAST_FAILURE_PREFIX   "last-failure"

Definition at line 297 of file internal.h.

◆ PCMK__NELEM

#define PCMK__NELEM (   a)    ((int) (sizeof(a)/sizeof(a[0])) )

Definition at line 46 of file internal.h.

Function Documentation

◆ crm_schema_cleanup()

void crm_schema_cleanup ( void  )

Definition at line 523 of file schemas.c.

◆ crm_schema_init()

void crm_schema_init ( void  )

Definition at line 377 of file schemas.c.

◆ pcmk__add_mainloop_ipc()

int pcmk__add_mainloop_ipc ( crm_ipc_t ipc,
int  priority,
void *  userdata,
const struct ipc_client_callbacks callbacks,
mainloop_io_t **  source 
)

Connect to IPC and add it as a main loop source.

Parameters
[in,out]ipcIPC connection to add
[in]priorityEvent source priority to use for connection
[in]userdataData to register with callbacks
[in]callbacksDispatch and destroy callbacks for connection
[out]sourceNewly allocated event source
Returns
Standard Pacemaker return code
Note
On failure, the caller is still responsible for ipc. On success, the caller should call mainloop_del_ipc_client() when source is no longer needed, which will lead to the disconnection of the IPC later in the main loop if it is connected. However the IPC disconnects, mainloop_gio_destroy() will free ipc and source after calling the destroy callback.

Definition at line 864 of file mainloop.c.

◆ pcmk__daemonize()

void pcmk__daemonize ( const char *  name,
const char *  pidfile 
)

Definition at line 421 of file utils.c.

◆ pcmk__effective_rc()

int pcmk__effective_rc ( int  rc)

Definition at line 71 of file agents.c.

◆ pcmk__format_nvpair()

char* pcmk__format_nvpair ( const char *  name,
const char *  value,
const char *  units 
)

Definition at line 284 of file nvpair.c.

◆ pcmk__locate_sbd()

pid_t pcmk__locate_sbd ( void  )

Definition at line 194 of file watchdog.c.

◆ pcmk__lock_pidfile()

int pcmk__lock_pidfile ( const char *  filename,
const char *  name 
)

Definition at line 214 of file pid.c.

◆ pcmk__mainloop_timer_get_period()

guint pcmk__mainloop_timer_get_period ( const mainloop_timer_t timer)

Get period for mainloop timer.

Parameters
[in]timerTimer
Returns
Period in ms

Definition at line 910 of file mainloop.c.

◆ pcmk__panic()

void pcmk__panic ( const char *  origin)

Definition at line 161 of file watchdog.c.

◆ pcmk__pid_active()

int pcmk__pid_active ( pid_t  pid,
const char *  daemon 
)

Definition at line 23 of file pid.c.

◆ pcmk__pidfile_matches()

int pcmk__pidfile_matches ( const char *  filename,
pid_t  expected_pid,
const char *  expected_name,
pid_t *  pid 
)

Definition at line 172 of file pid.c.

◆ pcmk__procfs_has_pids()

bool pcmk__procfs_has_pids ( void  )

Definition at line 211 of file procfs.c.

◆ pcmk__procfs_num_cores()

unsigned int pcmk__procfs_num_cores ( void  )

Definition at line 145 of file procfs.c.

◆ pcmk__procfs_pid2path()

int pcmk__procfs_pid2path ( pid_t  pid,
char  path[],
size_t  path_size 
)

Definition at line 179 of file procfs.c.

◆ pcmk__procfs_pid_of()

pid_t pcmk__procfs_pid_of ( const char *  name)

Definition at line 111 of file procfs.c.

◆ pcmk__read_pidfile()

int pcmk__read_pidfile ( const char *  filename,
pid_t *  pid 
)

Definition at line 111 of file pid.c.

◆ pcmk__scan_nvpair()

int pcmk__scan_nvpair ( const char *  input,
char **  name,
char **  value 
)

Definition at line 221 of file nvpair.c.

◆ pcmk__sleep_ms()

void pcmk__sleep_ms ( unsigned int  ms)

Definition at line 561 of file utils.c.

◆ pcmk__xe_add_node()

void pcmk__xe_add_node ( xmlNode *  xml,
const char *  node,
int  nodeid 
)

Definition at line 15 of file nodes.c.

◆ pcmk__xe_attr_is_true()

bool pcmk__xe_attr_is_true ( const xmlNode *  node,
const char *  name 
)

Definition at line 905 of file nvpair.c.

◆ pcmk__xe_get_bool_attr()

int pcmk__xe_get_bool_attr ( const xmlNode *  node,
const char *  name,
bool *  value 
)

Definition at line 878 of file nvpair.c.

◆ pcmk__xe_set_bool_attr()

void pcmk__xe_set_bool_attr ( xmlNodePtr  node,
const char *  name,
bool  value 
)

Definition at line 872 of file nvpair.c.

Variable Documentation

◆ pcmk__is_daemon

bool pcmk__is_daemon

Definition at line 47 of file logging.c.

◆ pcmk__our_nodename

char* pcmk__our_nodename

Node name of the local node.

Definition at line 48 of file logging.c.

◆ pcmk__score_green

int pcmk__score_green

Definition at line 21 of file scores.c.

◆ pcmk__score_red

int pcmk__score_red

Definition at line 20 of file scores.c.

◆ pcmk__score_yellow

int pcmk__score_yellow

Definition at line 22 of file scores.c.