pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
internal.h File Reference
#include <glib.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/types.h>
#include <crm/common/logging.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 CRM_FAIL_COUNT_PREFIX   "fail-count"
 
#define CRM_LAST_FAILURE_PREFIX   "last-failure"
 

Functions

char * generate_series_filename (const char *directory, const char *series, int sequence, gboolean bzip)
 
int get_last_sequence (const char *directory, const char *series)
 
void write_last_sequence (const char *directory, const char *series, int sequence, int max)
 
int crm_chown_last_sequence (const char *directory, const char *series, uid_t uid, gid_t gid)
 
bool pcmk__daemon_can_write (const char *dir, const char *file)
 
void crm_sync_directory (const char *name)
 
char * crm_read_contents (const char *filename)
 
int crm_write_sync (int fd, const char *contents)
 
int crm_set_nonblocking (int fd)
 
const char * crm_get_tmpdir (void)
 
int crm_procfs_process_info (struct dirent *entry, char *name, int *pid)
 
int crm_procfs_pid_of (const char *name)
 
unsigned int crm_procfs_num_cores (void)
 
void crm_schema_init (void)
 
void crm_schema_cleanup (void)
 
int crm_pid_active (long pid, const char *daemon)
 
long crm_pidfile_inuse (const char *filename, long mypid, const char *daemon)
 
long crm_read_pidfile (const char *filename)
 
int crm_lock_pidfile (const char *filename, const char *name)
 
char * generate_op_key (const char *rsc_id, const char *op_type, guint interval_ms)
 Generate an operation key. More...
 
char * generate_notify_key (const char *rsc_id, const char *notify_type, const char *op_type)
 
char * generate_transition_key (int action, int transition_id, int target_rc, const char *node)
 
void filter_action_parameters (xmlNode *param_set, const char *version)
 
xmlNode * create_operation_update (xmlNode *parent, lrmd_event_data_t *event, const char *caller_version, int target_rc, const char *node, const char *origin, int level)
 
const char * pcmk_message_name (const char *name)
 Get name to be used as identifier for cluster messages. More...
 
long long crm_int_helper (const char *text, char **end_text)
 
guint crm_parse_ms (const char *text)
 
bool crm_starts_with (const char *str, const char *prefix)
 Check whether a string starts with a certain sequence. More...
 
gboolean crm_ends_with (const char *s, const char *match)
 
gboolean crm_ends_with_ext (const char *s, const char *match)
 
char * add_list_element (char *list, const char *value)
 
bool crm_compress_string (const char *data, int length, int max, char **result, unsigned int *result_len)
 
gint crm_alpha_sort (gconstpointer a, gconstpointer b)
 Compare two strings alphabetically (case-insensitive) More...
 

Macro Definition Documentation

#define CRM_FAIL_COUNT_PREFIX   "fail-count"

Definition at line 132 of file internal.h.

#define CRM_LAST_FAILURE_PREFIX   "last-failure"

Definition at line 133 of file internal.h.

Function Documentation

char* add_list_element ( char *  list,
const char *  value 
)

Definition at line 408 of file strings.c.

xmlNode* create_operation_update ( xmlNode *  parent,
lrmd_event_data_t event,
const char *  caller_version,
int  target_rc,
const char *  node,
const char *  origin,
int  level 
)

Definition at line 440 of file operations.c.

gint crm_alpha_sort ( gconstpointer  a,
gconstpointer  b 
)

Compare two strings alphabetically (case-insensitive)

Parameters
[in]aFirst string to compare
[in]bSecond string to compare
Returns
0 if strings are equal, -1 if a < b, 1 if a > b
Note
Usable as a GCompareFunc with g_list_sort(). NULL is considered less than non-NULL.

Definition at line 489 of file strings.c.

int crm_chown_last_sequence ( const char *  directory,
const char *  series,
uid_t  uid,
gid_t  gid 
)

Definition at line 217 of file io.c.

bool crm_compress_string ( const char *  data,
int  length,
int  max,
char **  result,
unsigned int *  result_len 
)

Definition at line 427 of file strings.c.

gboolean crm_ends_with ( const char *  s,
const char *  match 
)

Definition at line 309 of file strings.c.

gboolean crm_ends_with_ext ( const char *  s,
const char *  match 
)

Definition at line 338 of file strings.c.

const char* crm_get_tmpdir ( void  )

Definition at line 500 of file io.c.

long long crm_int_helper ( const char *  text,
char **  end_text 
)

Definition at line 34 of file strings.c.

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

Definition at line 168 of file pid.c.

guint crm_parse_ms ( const char *  text)

Definition at line 143 of file strings.c.

int crm_pid_active ( long  pid,
const char *  daemon 
)

Definition at line 23 of file pid.c.

long crm_pidfile_inuse ( const char *  filename,
long  mypid,
const char *  daemon 
)

Definition at line 141 of file pid.c.

unsigned int crm_procfs_num_cores ( void  )

Definition at line 144 of file procfs.c.

int crm_procfs_pid_of ( const char *  name)

Definition at line 110 of file procfs.c.

int crm_procfs_process_info ( struct dirent *  entry,
char *  name,
int *  pid 
)

Definition at line 39 of file procfs.c.

char* crm_read_contents ( const char *  filename)

Definition at line 410 of file io.c.

long crm_read_pidfile ( const char *  filename)

Definition at line 103 of file pid.c.

void crm_schema_cleanup ( void  )

Definition at line 546 of file schemas.c.

void crm_schema_init ( void  )

Definition at line 374 of file schemas.c.

int crm_set_nonblocking ( int  fd)

Definition at line 486 of file io.c.

bool crm_starts_with ( const char *  str,
const char *  prefix 
)

Check whether a string starts with a certain sequence.

Parameters
[in]strString to check
[in]matchSequence to match against beginning of str
Returns
TRUE if str begins with match, FALSE otherwise
Note
This is equivalent to !strncmp(s, prefix, strlen(prefix)) but is likely less efficient when prefix is a string literal if the compiler optimizes away the strlen() at compile time, and more efficient otherwise.

Definition at line 259 of file strings.c.

void crm_sync_directory ( const char *  name)

Definition at line 373 of file io.c.

int crm_write_sync ( int  fd,
const char *  contents 
)

Definition at line 456 of file io.c.

void filter_action_parameters ( xmlNode *  param_set,
const char *  version 
)

Definition at line 270 of file operations.c.

char* generate_notify_key ( const char *  rsc_id,
const char *  notify_type,
const char *  op_type 
)

Definition at line 128 of file operations.c.

char* generate_op_key ( const char *  rsc_id,
const char *  op_type,
guint  interval_ms 
)

Generate an operation key.

Parameters
[in]rsc_idID of resource being operated on
[in]op_typeOperation name
[in]interval_msOperation interval
Returns
Newly allocated memory containing operation key as string
Note
It is the caller's responsibility to free() the result.

Definition at line 39 of file operations.c.

char* generate_series_filename ( const char *  directory,
const char *  series,
int  sequence,
gboolean  bzip 
)

Definition at line 75 of file io.c.

char* generate_transition_key ( int  action,
int  transition_id,
int  target_rc,
const char *  node 
)

Definition at line 201 of file operations.c.

int get_last_sequence ( const char *  directory,
const char *  series 
)

Definition at line 102 of file io.c.

bool pcmk__daemon_can_write ( const char *  dir,
const char *  file 
)

Definition at line 305 of file io.c.

const char* pcmk_message_name ( const char *  name)

Get name to be used as identifier for cluster messages.

Parameters
[in]nameActual system name to check
Returns
Non-NULL cluster message identifier corresponding to name
Note
The Pacemaker daemons were renamed in version 2.0.0, but the old names must continue to be used as the identifier for cluster messages, so that mixed-version clusters are possible during a rolling upgrade.

Definition at line 1100 of file utils.c.

void write_last_sequence ( const char *  directory,
const char *  series,
int  sequence,
int  max 
)

Definition at line 168 of file io.c.