DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
eval.h File Reference
#include "agent.h"
#include "runctx.h"
#include <cace/ari.h>
+ Include dependency graph for eval.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define REFDA_EVAL_ERR_BAD_TYPE   3
 Error result when an invalid type is present.
 
#define REFDA_EVAL_ERR_DEREF_FAILED   4
 Error result when dereferencing fails.
 
#define REFDA_EVAL_ERR_PROD_FAILED   5
 Error result when value production fails.
 
#define REFDA_EVAL_ERR_NON_SINGLE   6
 Error result when the evaluation does not resolve to a single value.
 

Functions

int refda_eval_target (refda_runctx_t *runctx, cace_ari_t *result, const cace_ari_t *ari)
 Implement the evaluation procedure from Section TBD of [ietf-dtn-amm-01].
 
int refda_eval_condition (refda_runctx_t *runctx, cace_ari_t *result, const cace_ari_t *condition)
 Evaluate given conditional ARI expression and return a boolean ARI indicating whether the condition was true or false.
 

Macro Definition Documentation

◆ REFDA_EVAL_ERR_BAD_TYPE

#define REFDA_EVAL_ERR_BAD_TYPE   3

Error result when an invalid type is present.

◆ REFDA_EVAL_ERR_DEREF_FAILED

#define REFDA_EVAL_ERR_DEREF_FAILED   4

Error result when dereferencing fails.

◆ REFDA_EVAL_ERR_NON_SINGLE

#define REFDA_EVAL_ERR_NON_SINGLE   6

Error result when the evaluation does not resolve to a single value.

◆ REFDA_EVAL_ERR_PROD_FAILED

#define REFDA_EVAL_ERR_PROD_FAILED   5

Error result when value production fails.

Function Documentation

◆ refda_eval_condition()

int refda_eval_condition ( refda_runctx_t runctx,
cace_ari_t result,
const cace_ari_t condition 
)

Evaluate given conditional ARI expression and return a boolean ARI indicating whether the condition was true or false.

Parameters
[in]runctxThe run context.
[out]resultThe single result value from the evaluation. This ARI must be initialized before the call and will be valid if the return code is zero but must be deinitialized regardless.
[in]conditionThe ARI to dereference, if necessary, and evaluate.
Returns
Zero if successful.

References cace_amm_type_convert(), cace_amm_type_get_builtin(), cace_ari_deinit(), CACE_ARI_INIT_UNDEFINED, CACE_ARI_TYPE_BOOL, CACE_LOG_ERR, refda_eval_target(), and result.

Referenced by refda_adm_ietf_dtnma_agent_ctrl_if_then_else(), and refda_exec_check_sbr_condition().

◆ refda_eval_target()

int refda_eval_target ( refda_runctx_t runctx,
cace_ari_t result,
const cace_ari_t ari 
)

Implement the evaluation procedure from Section TBD of [ietf-dtn-amm-01].

Parameters
[in]agentThe agent state for ARI lookup.
[out]resultThe single result value from the evaluation. This ARI must be initialized before the call and will be valid if the return code is zero but must be deinitialized regardless.
[in]ariThe ARI to dereference, if necessary, and evaluate.
Returns
Zero if successful.

References cace_ari_cget_ac(), cace_ari_set_copy(), CACE_ARI_TEXT_ENC_OPTS_DEFAULT, cace_ari_text_encode(), CACE_ARI_TYPE_OPER, CACE_LOG_DEBUG, cace_log_is_enabled_for(), CHKERR1, refda_eval_ctx_t::input, cace_ari_ac_t::items, cace_amm_lookup_t::obj_type, refda_eval_ctx_deinit(), refda_eval_ctx_init(), REFDA_EVAL_ERR_BAD_TYPE, REFDA_EVAL_ERR_NON_SINGLE, refda_eval_expand(), refda_eval_oper(), result, and refda_eval_ctx_t::stack.

Referenced by refda_adm_ietf_dtnma_agent_ctrl_wait_cond_check(), refda_adm_ietf_dtnma_agent_oper_tbl_filter(), refda_alarms_compress(), refda_alarms_mgr_state(), refda_alarms_purge(), refda_eval_condition(), refda_reporting_rptt_val(), TEST_CASE(), and test_refda_eval_target_failure().