diff options
author | Dmitrijs Goloscapovs <dmitrijs.goloscapovs@zabbix.com> | 2022-11-09 14:41:59 +0300 |
---|---|---|
committer | Dmitrijs Goloscapovs <dmitrijs.goloscapovs@zabbix.com> | 2022-11-09 14:41:59 +0300 |
commit | 1873100855685ae887206895a1e119b93d9905fe (patch) | |
tree | a0db691b5aa4c5480309e57f4df0d5ab91c4c678 | |
parent | e6fe3bbc2a53bd7a3fafaab28f59c06c0794d228 (diff) |
........S. [ZBX-21616] renamed define
-rw-r--r-- | include/zbxdbhigh.h | 8 | ||||
-rw-r--r-- | src/libs/zbxdbcache/dbconfig.c | 16 | ||||
-rw-r--r-- | src/libs/zbxdbhigh/template_item.c | 4 | ||||
-rw-r--r-- | src/libs/zbxdbupgrade/dbupgrade_3010.c | 4 | ||||
-rw-r--r-- | src/zabbix_server/actions.c | 16 | ||||
-rw-r--r-- | src/zabbix_server/escalator/escalator.c | 8 | ||||
-rw-r--r-- | src/zabbix_server/lld/lld.c | 22 | ||||
-rw-r--r-- | src/zabbix_server/service/service_manager.c | 6 |
8 files changed, 42 insertions, 42 deletions
diff --git a/include/zbxdbhigh.h b/include/zbxdbhigh.h index 1eded731847..c68079b9dd2 100644 --- a/include/zbxdbhigh.h +++ b/include/zbxdbhigh.h @@ -846,10 +846,10 @@ int DBselect_ids_names(const char *sql, zbx_vector_uint64_t *ids, zbx_vector_str int zbx_db_check_version_info(struct zbx_db_version_info_t *info, int allow_unsupported); /* condition evaluation types */ -#define ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR 0 -#define ZBX_ACTION_CONDITION_EVAL_TYPE_AND 1 -#define ZBX_ACTION_CONDITION_EVAL_TYPE_OR 2 -#define ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION 3 +#define ZBX_CONDITION_EVAL_TYPE_AND_OR 0 +#define ZBX_CONDITION_EVAL_TYPE_AND 1 +#define ZBX_CONDITION_EVAL_TYPE_OR 2 +#define ZBX_CONDITION_EVAL_TYPE_EXPRESSION 3 /* condition types */ #define ZBX_CONDITION_TYPE_HOST_GROUP 0 diff --git a/src/libs/zbxdbcache/dbconfig.c b/src/libs/zbxdbcache/dbconfig.c index 4bfdb8a6c65..776c952b766 100644 --- a/src/libs/zbxdbcache/dbconfig.c +++ b/src/libs/zbxdbcache/dbconfig.c @@ -4449,7 +4449,7 @@ static void DCsync_action_conditions(zbx_dbsync_t *sync) zbx_vector_ptr_append(&action->conditions, condition); } - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) zbx_vector_ptr_append(&actions, action); } @@ -4469,7 +4469,7 @@ static void DCsync_action_conditions(zbx_dbsync_t *sync) { zbx_vector_ptr_remove_noorder(&action->conditions, index); - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) zbx_vector_ptr_append(&actions, action); } } @@ -4489,7 +4489,7 @@ static void DCsync_action_conditions(zbx_dbsync_t *sync) { action = (zbx_dc_action_t *)actions.values[i]; - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) zbx_vector_ptr_sort(&action->conditions, dc_compare_action_conditions_by_type); } @@ -4756,7 +4756,7 @@ static void DCsync_corr_conditions(zbx_dbsync_t *sync) zbx_vector_ptr_append(&correlation->conditions, condition); /* sort the conditions later */ - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == correlation->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == correlation->evaltype) zbx_vector_ptr_append(&correlations, correlation); } @@ -4778,7 +4778,7 @@ static void DCsync_corr_conditions(zbx_dbsync_t *sync) ZBX_DEFAULT_PTR_COMPARE_FUNC))) { /* sort the conditions later */ - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == correlation->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == correlation->evaltype) zbx_vector_ptr_append(&correlations, correlation); zbx_vector_ptr_remove_noorder(&correlation->conditions, index); @@ -13341,7 +13341,7 @@ static char *dc_correlation_formula_dup(const zbx_dc_correlation_t *dc_correlati const zbx_dc_corr_condition_t *dc_condition; zbx_uint64_t last_id; - if (ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION == dc_correlation->evaltype || 0 == + if (ZBX_CONDITION_EVAL_TYPE_EXPRESSION == dc_correlation->evaltype || 0 == dc_correlation->conditions.values_num) { return zbx_strdup(NULL, dc_correlation->formula); @@ -13351,10 +13351,10 @@ static char *dc_correlation_formula_dup(const zbx_dc_correlation_t *dc_correlati switch (dc_correlation->evaltype) { - case ZBX_ACTION_CONDITION_EVAL_TYPE_OR: + case ZBX_CONDITION_EVAL_TYPE_OR: op = " or"; break; - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND: + case ZBX_CONDITION_EVAL_TYPE_AND: op = " and"; break; } diff --git a/src/libs/zbxdbhigh/template_item.c b/src/libs/zbxdbhigh/template_item.c index 9500bb99dbb..e1c7d26b3cd 100644 --- a/src/libs/zbxdbhigh/template_item.c +++ b/src/libs/zbxdbhigh/template_item.c @@ -722,7 +722,7 @@ static void update_template_lld_rule_formulas(zbx_vector_ptr_t *items, zbx_vecto { zbx_template_item_t *item = (zbx_template_item_t *)items->values[i]; - if (0 == (ZBX_FLAG_DISCOVERY_RULE & item->flags) || ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION != + if (0 == (ZBX_FLAG_DISCOVERY_RULE & item->flags) || ZBX_CONDITION_EVAL_TYPE_EXPRESSION != item->evaltype) { continue; @@ -2297,7 +2297,7 @@ static void save_template_lld_overrides(zbx_vector_ptr_t *overrides, zbx_hashset override_conditionid, (int)override_condition->operator, override_condition->macro, override_condition->value); - if (ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION == override->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_EXPRESSION == override->evaltype) { update_template_lld_formula(&override->formula, override_condition->override_conditionid, override_conditionid); diff --git a/src/libs/zbxdbupgrade/dbupgrade_3010.c b/src/libs/zbxdbupgrade/dbupgrade_3010.c index 5b27f3904da..8110eff3759 100644 --- a/src/libs/zbxdbupgrade/dbupgrade_3010.c +++ b/src/libs/zbxdbupgrade/dbupgrade_3010.c @@ -465,7 +465,7 @@ static int DBpatch_3010024_validate_action(zbx_uint64_t actionid, int eventsourc DB_RESULT result; int conditiontype, ret = ZBX_3010024_ACTION_DISABLE, value; - /* evaltype: 0 - ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR, 1 - ZBX_ACTION_CONDITION_EVAL_TYPE_AND */ + /* evaltype: 0 - ZBX_CONDITION_EVAL_TYPE_AND_OR, 1 - ZBX_CONDITION_EVAL_TYPE_AND */ if (evaltype != 0 && evaltype != 1) return ret; @@ -1045,7 +1045,7 @@ static int DBpatch_3010026(void) index = conditionids.values_num; DBpatch_3010026_get_conditionids(actionid, row[4], eventsource, &conditionids); - /* evaltype: 3 - ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION */ + /* evaltype: 3 - ZBX_CONDITION_EVAL_TYPE_EXPRESSION */ if (3 != evaltype) continue; diff --git a/src/zabbix_server/actions.c b/src/zabbix_server/actions.c index 02880e50e0d..c1f92974718 100644 --- a/src/zabbix_server/actions.c +++ b/src/zabbix_server/actions.c @@ -2586,14 +2586,14 @@ static int check_action_conditions(zbx_uint64_t eventid, const zbx_action_eval_t zabbix_log(LOG_LEVEL_DEBUG, "In %s() actionid:" ZBX_FS_UI64 " eventsource:%d", __func__, action->actionid, (int)action->eventsource); - if (ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) expression = zbx_strdup(expression, action->formula); for (i = 0; i < action->conditions.values_num; i++) { condition = (zbx_condition_t *)action->conditions.values[i]; - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == action->evaltype && + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == action->evaltype && old_type == condition->conditiontype && SUCCEED == ret) { continue; /* short-circuit true OR condition block to the next AND condition */ @@ -2608,7 +2608,7 @@ static int check_action_conditions(zbx_uint64_t eventid, const zbx_action_eval_t switch (action->evaltype) { - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR: + case ZBX_CONDITION_EVAL_TYPE_AND_OR: if (old_type == condition->conditiontype) /* assume conditions are sorted by type */ { if (SUCCEED == condition_result) @@ -2624,7 +2624,7 @@ static int check_action_conditions(zbx_uint64_t eventid, const zbx_action_eval_t } break; - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND: + case ZBX_CONDITION_EVAL_TYPE_AND: if (FAIL == condition_result) /* break if any AND condition is FALSE */ { ret = FAIL; @@ -2632,7 +2632,7 @@ static int check_action_conditions(zbx_uint64_t eventid, const zbx_action_eval_t } break; - case ZBX_ACTION_CONDITION_EVAL_TYPE_OR: + case ZBX_CONDITION_EVAL_TYPE_OR: if (SUCCEED == condition_result) /* break if any OR condition is TRUE */ { ret = SUCCEED; @@ -2641,7 +2641,7 @@ static int check_action_conditions(zbx_uint64_t eventid, const zbx_action_eval_t ret = FAIL; break; - case ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION: + case ZBX_CONDITION_EVAL_TYPE_EXPRESSION: zbx_snprintf(tmp, sizeof(tmp), "{" ZBX_FS_UI64 "}", condition->conditionid); id_len = strlen(tmp); @@ -2658,7 +2658,7 @@ static int check_action_conditions(zbx_uint64_t eventid, const zbx_action_eval_t } } - if (ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) { if (SUCCEED == zbx_evaluate(&eval_result, expression, error, sizeof(error), NULL)) ret = (SUCCEED != zbx_double_compare(eval_result, 0) ? SUCCEED : FAIL); @@ -3052,7 +3052,7 @@ static void prepare_actions_conditions_eval(zbx_vector_ptr_t *actions, zbx_hashs } else { - if (ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) { char search[ZBX_MAX_UINT64_LEN + 2]; char replace[ZBX_MAX_UINT64_LEN + 2]; diff --git a/src/zabbix_server/escalator/escalator.c b/src/zabbix_server/escalator/escalator.c index fb2608dbac4..4fcf7f35132 100644 --- a/src/zabbix_server/escalator/escalator.c +++ b/src/zabbix_server/escalator/escalator.c @@ -1801,7 +1801,7 @@ static int check_operation_conditions(const ZBX_DB_EVENT *event, zbx_uint64_t op DB_ROW row; zbx_condition_t condition; - int ret = SUCCEED; /* SUCCEED required for ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR */ + int ret = SUCCEED; /* SUCCEED required for ZBX_CONDITION_EVAL_TYPE_AND_OR */ int cond, exit = 0; unsigned char old_type = 0xff; @@ -1827,7 +1827,7 @@ static int check_operation_conditions(const ZBX_DB_EVENT *event, zbx_uint64_t op switch (evaltype) { - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR: + case ZBX_CONDITION_EVAL_TYPE_AND_OR: if (old_type == condition.conditiontype) /* OR conditions */ { if (SUCCEED == check_action_condition(event, &condition)) @@ -1843,7 +1843,7 @@ static int check_operation_conditions(const ZBX_DB_EVENT *event, zbx_uint64_t op } old_type = condition.conditiontype; break; - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND: + case ZBX_CONDITION_EVAL_TYPE_AND: cond = check_action_condition(event, &condition); /* Break if any of AND conditions is FALSE */ if (cond == FAIL) @@ -1854,7 +1854,7 @@ static int check_operation_conditions(const ZBX_DB_EVENT *event, zbx_uint64_t op else ret = SUCCEED; break; - case ZBX_ACTION_CONDITION_EVAL_TYPE_OR: + case ZBX_CONDITION_EVAL_TYPE_OR: cond = check_action_condition(event, &condition); /* Break if any of OR conditions is TRUE */ if (cond == SUCCEED) diff --git a/src/zabbix_server/lld/lld.c b/src/zabbix_server/lld/lld.c index cb9b5c7ee0c..57dee2a8b30 100644 --- a/src/zabbix_server/lld/lld.c +++ b/src/zabbix_server/lld/lld.c @@ -116,7 +116,7 @@ static void lld_filter_init(lld_filter_t *filter) { zbx_vector_ptr_create(&filter->conditions); filter->expression = NULL; - filter->evaltype = ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR; + filter->evaltype = ZBX_CONDITION_EVAL_TYPE_AND_OR; } /****************************************************************************** @@ -195,7 +195,7 @@ static int lld_filter_load(lld_filter_t *filter, zbx_uint64_t lld_ruleid, const ; DBfree_result(result); - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == filter->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == filter->evaltype) zbx_vector_ptr_sort(&filter->conditions, lld_condition_compare_by_macro); zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%s", __func__, zbx_result_string(ret)); @@ -307,7 +307,7 @@ static int filter_evaluate_and_or_andor(const lld_filter_t *filter, const struct switch (filter->evaltype) { - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR: + case ZBX_CONDITION_EVAL_TYPE_AND_OR: if (NULL == lastmacro) { zbx_chrcpy_alloc(&expression, &expression_alloc, &expression_offset, '('); @@ -321,8 +321,8 @@ static int filter_evaluate_and_or_andor(const lld_filter_t *filter, const struct lastmacro = condition->macro; break; - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND: - case ZBX_ACTION_CONDITION_EVAL_TYPE_OR: + case ZBX_CONDITION_EVAL_TYPE_AND: + case ZBX_CONDITION_EVAL_TYPE_OR: if (0 != i) { zbx_chrcpy_alloc(&expression, &expression_alloc, &expression_offset, ' '); @@ -351,7 +351,7 @@ static int filter_evaluate_and_or_andor(const lld_filter_t *filter, const struct if (filter->conditions.values_num == i + 1) { - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == filter->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == filter->evaltype) zbx_chrcpy_alloc(&expression, &expression_alloc, &expression_offset, ')'); expression_offset++; @@ -485,11 +485,11 @@ static int filter_evaluate(const lld_filter_t *filter, const struct zbx_json_par switch (filter->evaltype) { - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR: - case ZBX_ACTION_CONDITION_EVAL_TYPE_AND: - case ZBX_ACTION_CONDITION_EVAL_TYPE_OR: + case ZBX_CONDITION_EVAL_TYPE_AND_OR: + case ZBX_CONDITION_EVAL_TYPE_AND: + case ZBX_CONDITION_EVAL_TYPE_OR: return filter_evaluate_and_or_andor(filter, jp_row, lld_macro_paths, info); - case ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION: + case ZBX_CONDITION_EVAL_TYPE_EXPRESSION: return filter_evaluate_expression(filter, jp_row, lld_macro_paths, info); } @@ -540,7 +540,7 @@ static int lld_override_conditions_load(zbx_vector_ptr_t *overrides, const zbx_v { override = (lld_override_t *)overrides->values[i]; - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == override->filter.evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == override->filter.evaltype) zbx_vector_ptr_sort(&override->filter.conditions, lld_condition_compare_by_macro); } diff --git a/src/zabbix_server/service/service_manager.c b/src/zabbix_server/service/service_manager.c index 1176eb38b01..37fce7b163c 100644 --- a/src/zabbix_server/service/service_manager.c +++ b/src/zabbix_server/service/service_manager.c @@ -968,14 +968,14 @@ static void update_action_formula(zbx_service_action_t *action) zabbix_log(LOG_LEVEL_DEBUG, "In %s() actionid:" ZBX_FS_UI64, __func__, action->actionid); - if (0 == action->conditions.values_num || ZBX_ACTION_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) + if (0 == action->conditions.values_num || ZBX_CONDITION_EVAL_TYPE_EXPRESSION == action->evaltype) goto out; for (i = 0; i < action->conditions.values_num; i++) { condition = (zbx_service_action_condition_t *)action->conditions.values[i]; - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) { if (last_type != condition->conditiontype) { @@ -1002,7 +1002,7 @@ static void update_action_formula(zbx_service_action_t *action) last_type = condition->conditiontype; } - if (ZBX_ACTION_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) + if (ZBX_CONDITION_EVAL_TYPE_AND_OR == action->evaltype) zbx_chrcpy_alloc(&formula, &formula_alloc, &formula_offset, ')'); zbx_free(action->formula); |