|
DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
#include "exec_status.h"#include "agent.h"#include "runctx.h"#include "amm/sbr.h"#include "amm/tbr.h"#include <cace/ari.h>#include <m-atomic.h>
Include dependency graph for exec.h:
This graph shows which files directly or indirectly include this file:Macros | |
| #define | REFDA_EXEC_ERR_BAD_TYPE 3 |
| Error result when an invalid type is present. | |
| #define | REFDA_EXEC_ERR_DEREF_FAILED 4 |
| Error result when dereferencing fails. | |
| #define | REFDA_EXEC_ERR_PROD_FAILED 5 |
| Error result when value production fails. | |
Functions | |
| int | refda_exec_add_target (refda_runctx_ptr_t *runctxp, const cace_ari_t *target, refda_exec_status_t *finish) |
| From outside the exec worker thread, inject a single execution target and allow its sequence to be tracked to its finish. | |
| void * | refda_exec_worker (void *arg) |
| Work thread function for the Agent execution manager. | |
| int | refda_exec_waiting (refda_agent_t *agent) |
| Execute any waiting sequences as part of normal worker iteration. | |
| bool | refda_exec_worker_iteration (refda_agent_t *agent) |
| Helper function to run a single iteration of the exec worker thread. | |
| int | refda_exec_tbr_enable (refda_agent_t *agent, refda_amm_tbr_desc_t *tbr) |
| Begin periodic execution of a time based rule. | |
| int | refda_exec_tbr_disable (refda_agent_t *agent, refda_amm_tbr_desc_t *tbr) |
| Cease periodic execution of a time based rule. | |
| int | refda_exec_sbr_enable (refda_agent_t *agent, refda_amm_sbr_desc_t *sbr) |
| Begin periodic execution of a state based rule. | |
| int | refda_exec_sbr_disable (refda_agent_t *agent, refda_amm_sbr_desc_t *sbr) |
| Cease periodic execution of a state based rule. | |
| int | refda_exec_next (refda_exec_seq_t *seq, const cace_ari_t *target) |
| Setup an ARI to execute next in the sequence. | |
| #define REFDA_EXEC_ERR_BAD_TYPE 3 |
Error result when an invalid type is present.
| #define REFDA_EXEC_ERR_DEREF_FAILED 4 |
Error result when dereferencing fails.
| #define REFDA_EXEC_ERR_PROD_FAILED 5 |
Error result when value production fails.
| int refda_exec_add_target | ( | refda_runctx_ptr_t * | runctxp, |
| const cace_ari_t * | target, | ||
| refda_exec_status_t * | finish | ||
| ) |
From outside the exec worker thread, inject a single execution target and allow its sequence to be tracked to its finish.
This function is thread safe on the agent.
| [in] | runctxp | The run context, which includes the agent pointer. |
| [in] | target | The execution target (CTRL ref or macro). |
| [in] | finish | An optional execution-finished state for the whole target, or a null pointer to not track this state. |
References agent, refda_runctx_t::agent, CACE_LOG_CRIT, CACE_LOG_ERR, CHKERR1, refda_agent_t::exec_next_pid, refda_agent_t::exec_state, refda_agent_t::exec_state_mutex, refda_agent_t::execs_sem, refda_exec_status_t::failed, refda_exec_status_t::finished, refda_exec_seq_t::pid, refda_exec_proc_expand(), refda_exec_seq_t::runctx, and refda_exec_seq_t::status.
Referenced by refda_agent_startup_exec(), and refda_exec_add_execset().
| int refda_exec_next | ( | refda_exec_seq_t * | seq, |
| const cace_ari_t * | target | ||
| ) |
Setup an ARI to execute next in the sequence.
The front of the execution sequence, the current item, is not modified.
| [in] | agent | The agent context pointer |
| [in] | seq | The sequence within which to inject the ARI target(s) |
| [in] | target | The ARI to execute |
References CHKERR1, and refda_exec_proc_expand().
Referenced by refda_adm_ietf_dtnma_agent_ctrl_catch(), and refda_adm_ietf_dtnma_agent_ctrl_if_then_else().
| int refda_exec_sbr_disable | ( | refda_agent_t * | agent, |
| refda_amm_sbr_desc_t * | sbr | ||
| ) |
Cease periodic execution of a state based rule.
| [in] | agent | The agent context pointer |
| [in] | sbr | The rule to disable |
References agent, CHKERR1, refda_amm_sbr_desc_t::enabled, refda_agent_t::instr, and refda_instr_t::num_sbrs.
Referenced by refda_adm_ietf_dtnma_agent_ctrl_ensure_rule_enabled(), refda_adm_ietf_dtnma_agent_ctrl_obsolete_rule(), refda_adm_ietf_dtnma_agent_ctrl_reset_rule_enabled(), and refda_exec_run_sbr().
| int refda_exec_sbr_enable | ( | refda_agent_t * | agent, |
| refda_amm_sbr_desc_t * | sbr | ||
| ) |
Begin periodic execution of a state based rule.
| [in] | agent | The agent context pointer |
| [in] | sbr | The rule to execute |
References refda_amm_sbr_desc_t::action, agent, cace_ari_cget_ac(), CACE_LOG_ERR, refda_amm_sbr_desc_t::condition, refda_amm_sbr_desc_t::enabled, refda_amm_sbr_desc_t::exec_count, refda_agent_t::instr, refda_instr_t::num_sbrs, refda_exec_schedule_sbr(), and result.
Referenced by refda_adm_ietf_dtnma_agent_ctrl_ensure_rule_enabled(), refda_adm_ietf_dtnma_agent_ctrl_ensure_sbr(), refda_adm_ietf_dtnma_agent_ctrl_reset_rule_enabled(), refda_agent_init_sbr(), test_refda_exec_state_based_rule(), and test_refda_exec_state_based_rule_cond_false_then_true().
| int refda_exec_tbr_disable | ( | refda_agent_t * | agent, |
| refda_amm_tbr_desc_t * | tbr | ||
| ) |
Cease periodic execution of a time based rule.
| [in] | agent | The agent context pointer |
| [in] | tbr | The rule to disable |
References agent, CHKERR1, refda_amm_tbr_desc_t::enabled, refda_agent_t::instr, and refda_instr_t::num_tbrs.
Referenced by refda_adm_ietf_dtnma_agent_ctrl_ensure_rule_enabled(), refda_adm_ietf_dtnma_agent_ctrl_obsolete_rule(), refda_adm_ietf_dtnma_agent_ctrl_reset_rule_enabled(), refda_exec_run_tbr(), and refda_exec_schedule_tbr().
| int refda_exec_tbr_enable | ( | refda_agent_t * | agent, |
| refda_amm_tbr_desc_t * | tbr | ||
| ) |
Begin periodic execution of a time based rule.
| [in] | agent | The agent context pointer |
| [in] | tbr | The rule to execute |
References refda_amm_tbr_desc_t::action, agent, cace_ari_cget_ac(), CACE_LOG_ERR, CHKERR1, refda_amm_tbr_desc_t::enabled, refda_amm_tbr_desc_t::exec_count, refda_agent_t::instr, refda_instr_t::num_tbrs, refda_exec_schedule_tbr(), and result.
Referenced by refda_adm_ietf_dtnma_agent_ctrl_ensure_rule_enabled(), refda_adm_ietf_dtnma_agent_ctrl_ensure_tbr(), refda_adm_ietf_dtnma_agent_ctrl_reset_rule_enabled(), refda_agent_init_tbr(), and test_refda_exec_time_based_rule().
| int refda_exec_waiting | ( | refda_agent_t * | agent | ) |
Execute any waiting sequences as part of normal worker iteration.
| [in] | agent | The agent state. |
References agent, CACE_LOG_CRIT, CACE_LOG_DEBUG, CACE_LOG_ERR, CACE_LOG_WARNING, refda_agent_t::exec_state, refda_agent_t::exec_state_mutex, refda_exec_item_t::execution_stage, refda_exec_seq_t::items, refda_exec_seq_t::pid, refda_exec_proc_run(), and REFDA_EXEC_WAITING.
Referenced by refda_exec_worker_iteration(), test_refda_exec_state_based_rule(), test_refda_exec_state_based_rule_cond_false_then_true(), and test_refda_exec_time_based_rule().
| void * refda_exec_worker | ( | void * | arg | ) |
Work thread function for the Agent execution manager.
| [in] | arg | The context refda_agent_t pointer. |
References agent, CACE_LOG_INFO, and refda_exec_worker_iteration().
Referenced by refda_agent_start().
| bool refda_exec_worker_iteration | ( | refda_agent_t * | agent | ) |
Helper function to run a single iteration of the exec worker thread.
| [in] | agent | The agent state. |
References agent, refda_runctx_t::agent, refda_timeline_sbr_event_t::agent, refda_timeline_tbr_event_t::agent, cace_ari_is_undefined(), CACE_LOG_DEBUG, CACE_LOG_ERR, CACE_LOG_INFO, cace_log_is_enabled_for(), cace_timeperiod_encode(), refda_timeline_sbr_event_t::callback, refda_timeline_tbr_event_t::callback, refda_timeline_exec_event_t::callback, refda_timeline_event_t::exec, refda_agent_t::exec_end, refda_agent_t::exec_timeline, refda_agent_t::execs, refda_agent_t::execs_enable, refda_agent_t::execs_sem, refda_exec_item_t::execution_stage, refda_agent_t::instr, refda_timeline_exec_event_t::item, refda_instr_t::num_ctrls_run, refda_timeline_event_t::purpose, refda_ctrl_exec_ctx_deinit(), refda_ctrl_exec_ctx_init(), refda_exec_add_execset(), refda_exec_proc_ctrl_finish(), refda_exec_waiting(), REFDA_EXEC_WAITING, refda_msgdata_deinit(), refda_msgdata_init(), refda_agent_t::rptgs, refda_agent_t::rptgs_sem, refda_ctrl_exec_ctx_t::runctx, refda_timeline_sbr_event_t::sbr, refda_timeline_event_t::sbr, refda_timeline_tbr_event_t::tbr, refda_timeline_event_t::tbr, refda_timeline_event_t::ts, and refda_msgdata_t::value.
Referenced by refda_exec_worker(), test_refda_exec_state_based_rule(), test_refda_exec_state_based_rule_cond_false_then_true(), and test_refda_exec_time_based_rule().