DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
eval.c File Reference
#include "eval.h"
#include "eval_ctx.h"
#include "oper_eval_ctx.h"
#include "valprod.h"
#include "amm/oper.h"
#include "cace/ari/text.h"
#include "cace/amm/lookup.h"
#include "cace/util/logging.h"
#include "cace/util/defs.h"
+ Include dependency graph for eval.c:

Functions

static int refda_eval_expand (refda_runctx_t *runctx, refda_eval_item_t out, const cace_ari_t *in)
 Expand a reference to a literal value matching SIMPLE or EXPR typedef.
 
static int refda_eval_oper (const cace_amm_lookup_t *deref, refda_eval_ctx_t *ctx)
 
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.
 

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_expand()

◆ refda_eval_oper()

◆ 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().