pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
Functions
rules.c File Reference
#include <crm_internal.h>
#include <glib.h>
#include <crm/crm.h>
#include <crm/common/xml.h>
#include <crm/pengine/rules.h>
#include <crm/common/iso8601_internal.h>
#include <crm/common/nvpair_internal.h>
#include <crm/common/rules_internal.h>
#include <crm/common/xml_internal.h>
#include <crm/pengine/internal.h>
#include <crm/pengine/rules_internal.h>
#include <sys/types.h>
#include <regex.h>
#include <crm/pengine/rules_compat.h>
Include dependency graph for rules.c:

Go to the source code of this file.

Functions

 CRM_TRACE_INIT_DATA (pe_rules)
 
void pe_eval_nvpairs (xmlNode *top, const xmlNode *xml_obj, const char *set_name, const pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *next_change)
 Extract nvpair blocks contained by an XML element into a hash table. More...
 
void pe_unpack_nvpairs (xmlNode *top, const xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *now, crm_time_t *next_change)
 Extract nvpair blocks contained by an XML element into a hash table. More...
 
gboolean pe_eval_rules (xmlNode *ruleset, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
 
gboolean pe_evaluate_rules (xmlNode *ruleset, GHashTable *node_hash, crm_time_t *now, crm_time_t *next_change)
 
gboolean pe_test_rule (xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, crm_time_t *next_change, pe_match_data_t *match_data)
 
gboolean test_ruleset (xmlNode *ruleset, GHashTable *node_hash, crm_time_t *now)
 
gboolean test_rule (xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now)
 
gboolean pe_test_rule_re (xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_re_match_data_t *re_match_data)
 
gboolean pe_test_rule_full (xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_match_data_t *match_data)
 
gboolean pe_test_expression (xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, crm_time_t *next_change, pe_match_data_t *match_data)
 
gboolean test_expression (xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now)
 
gboolean pe_test_expression_re (xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_re_match_data_t *re_match_data)
 
gboolean pe_test_expression_full (xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_match_data_t *match_data)
 
gboolean pe_eval_expr (xmlNode *rule, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
 
gboolean pe_eval_subexpr (xmlNode *expr, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
 
void unpack_instance_attributes (xmlNode *top, xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *now)
 
enum expression_type find_expression_type (xmlNode *expr)
 
char * pe_expand_re_matches (const char *string, const pe_re_match_data_t *match_data)
 

Function Documentation

◆ CRM_TRACE_INIT_DATA()

CRM_TRACE_INIT_DATA ( pe_rules  )

◆ find_expression_type()

enum expression_type find_expression_type ( xmlNode *  expr)
Deprecated:
Do not use

Definition at line 467 of file rules.c.

◆ pe_eval_expr()

gboolean pe_eval_expr ( xmlNode *  rule,
const pe_rule_eval_data_t rule_data,
crm_time_t next_change 
)
Deprecated:
Use pcmk_evaluate_rule() on parent rule instead

Definition at line 428 of file rules.c.

◆ pe_eval_nvpairs()

void pe_eval_nvpairs ( xmlNode *  top,
const xmlNode *  xml_obj,
const char *  set_name,
const pe_rule_eval_data_t rule_data,
GHashTable *  hash,
const char *  always_first,
gboolean  overwrite,
crm_time_t next_change 
)

Extract nvpair blocks contained by an XML element into a hash table.

Parameters
[in,out]topIgnored
[in]xml_objXML element containing blocks of nvpair elements
[in]set_nameIf not NULL, only use blocks of this element
[in]rule_dataMatching parameters to use when unpacking
[out]hashWhere to store extracted name/value pairs
[in]always_firstIf not NULL, process block with this ID first
[in]overwriteWhether to replace existing values with same name
[out]next_changeIf not NULL, set to when evaluation will change

Definition at line 245 of file rules.c.

◆ pe_eval_rules()

gboolean pe_eval_rules ( xmlNode *  ruleset,
const pe_rule_eval_data_t rule_data,
crm_time_t next_change 
)
Deprecated:
Use pcmk_evaluate_rule() on each rule instead

Definition at line 305 of file rules.c.

◆ pe_eval_subexpr()

gboolean pe_eval_subexpr ( xmlNode *  expr,
const pe_rule_eval_data_t rule_data,
crm_time_t next_change 
)
Deprecated:
Use pcmk_evaluate_rule() on parent rule instead

Definition at line 438 of file rules.c.

◆ pe_evaluate_rules()

gboolean pe_evaluate_rules ( xmlNode *  ruleset,
GHashTable *  node_hash,
crm_time_t now,
crm_time_t next_change 
)
Deprecated:
Use pcmk_evaluate_rule() on each rule instead

Definition at line 316 of file rules.c.

◆ pe_expand_re_matches()

char* pe_expand_re_matches ( const char *  string,
const pe_re_match_data_t match_data 
)
Deprecated:
Do not use

Definition at line 473 of file rules.c.

◆ pe_test_expression()

gboolean pe_test_expression ( xmlNode *  expr,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now,
crm_time_t next_change,
pe_match_data_t match_data 
)
Deprecated:
Use pcmk_evaluate_rule() on parent rule instead

Definition at line 380 of file rules.c.

◆ pe_test_expression_full()

gboolean pe_test_expression_full ( xmlNode *  expr,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now,
pe_match_data_t match_data 
)
Deprecated:
Use pcmk_evaluate_rule() on parent rule instead

Definition at line 420 of file rules.c.

◆ pe_test_expression_re()

gboolean pe_test_expression_re ( xmlNode *  expr,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now,
pe_re_match_data_t re_match_data 
)
Deprecated:
Use pcmk_evaluate_rule() on parent rule instead

Definition at line 409 of file rules.c.

◆ pe_test_rule()

gboolean pe_test_rule ( xmlNode *  rule,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now,
crm_time_t next_change,
pe_match_data_t match_data 
)
Deprecated:
Use pcmk_evaluate_rule() instead

Definition at line 328 of file rules.c.

◆ pe_test_rule_full()

gboolean pe_test_rule_full ( xmlNode *  rule,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now,
pe_match_data_t match_data 
)
Deprecated:
Use pcmk_evaluate_rule() instead

Definition at line 373 of file rules.c.

◆ pe_test_rule_re()

gboolean pe_test_rule_re ( xmlNode *  rule,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now,
pe_re_match_data_t re_match_data 
)
Deprecated:
Use pcmk_evaluate_rule() instead

Definition at line 362 of file rules.c.

◆ pe_unpack_nvpairs()

void pe_unpack_nvpairs ( xmlNode *  top,
const xmlNode *  xml_obj,
const char *  set_name,
GHashTable *  node_hash,
GHashTable *  hash,
const char *  always_first,
gboolean  overwrite,
crm_time_t now,
crm_time_t next_change 
)

Extract nvpair blocks contained by an XML element into a hash table.

Parameters
[in,out]topIgnored
[in]xml_objXML element containing blocks of nvpair elements
[in]set_nameElement name to identify nvpair blocks
[in]node_hashNode attributes to use when evaluating rules
[out]hashWhere to store extracted name/value pairs
[in]always_firstIf not NULL, process block with this ID first
[in]overwriteWhether to replace existing values with same name
[in]nowTime to use when evaluating rules
[out]next_changeIf not NULL, set to when evaluation will change

Definition at line 282 of file rules.c.

◆ test_expression()

gboolean test_expression ( xmlNode *  expr,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now 
)
Deprecated:
Use pcmk_evaluate_rule() on parent rule instead

Definition at line 403 of file rules.c.

◆ test_rule()

gboolean test_rule ( xmlNode *  rule,
GHashTable *  node_hash,
enum rsc_role_e  role,
crm_time_t now 
)
Deprecated:
Use pcmk_evaluate_rule() instead

Definition at line 356 of file rules.c.

◆ test_ruleset()

gboolean test_ruleset ( xmlNode *  ruleset,
GHashTable *  node_hash,
crm_time_t now 
)
Deprecated:
Use pcmk_evaluate_rule() on each rule instead

Definition at line 350 of file rules.c.

◆ unpack_instance_attributes()

void unpack_instance_attributes ( xmlNode *  top,
xmlNode *  xml_obj,
const char *  set_name,
GHashTable *  node_hash,
GHashTable *  hash,
const char *  always_first,
gboolean  overwrite,
crm_time_t now 
)
Deprecated:
Use pe_unpack_nvpairs() instead

Definition at line 449 of file rules.c.