pacemaker  3.0.0-d8340737c4
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 test_rule (xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now)
 

Function Documentation

◆ CRM_TRACE_INIT_DATA()

CRM_TRACE_INIT_DATA ( pe_rules  )

◆ 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 (all internal callers pass FALSE)
[out]next_changeIf not NULL, set to when evaluation will change

Definition at line 185 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 (all internal callers pass FALSE)
[in]nowTime to use when evaluating rules
[out]next_changeIf not NULL, set to when evaluation will change

Definition at line 223 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 246 of file rules.c.