|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Pairwise channel comparison (ADR-025): validates parameters, receives from both registered channels, and compares them. More...
#include <string.h>#include "rte/redundancy/cross_comparator/rte_cross_comparator.h"#include "rte/utils/lifecycle/rte_lifecycle.h"#include "rte/oal/log/rte_log.h"#include "rte/utils/safestate/rte_safestate.h"Go to the source code of this file.
Functions | |
| static bool | cross_comparator_data_equal (const rte_cross_comparator_t *cmp, const void *a, const void *b, size_t size) |
| rte_status_t | rte_cross_comparator_init (rte_cross_comparator_storage_t *storage, const rte_cross_comparator_config_t *config) |
| Initializes a cross-comparator with zero registered channels. | |
| rte_status_t | rte_cross_comparator_register_channel (rte_cross_comparator_t *cmp, rte_channel_t *channel) |
| Registers one already-initialized channel (channel A, then B). | |
| static rte_status_t | cross_comparator_finish (rte_cross_comparator_t *cmp, rte_voting_result_t local_result, const void *agreed_data, size_t data_size, rte_voting_result_t *result, void *out_data, size_t *out_size) |
| rte_status_t | rte_cross_comparator_execute (rte_cross_comparator_t *cmp, size_t data_size, rte_voting_result_t *result, void *out_data, size_t *out_size) |
| Receives from both registered channels and compares them. | |
| rte_status_t | rte_cross_comparator_execute_buffers (rte_cross_comparator_t *cmp, const void *local_data, const void *peer_data, size_t data_size, rte_voting_result_t *result, void *out_data, size_t *out_size) |
| Compares two already-in-hand data buffers directly, with the same on_disagreement-then-unconditional-safestate semantics as rte_cross_comparator_execute() - no rte_channel_t registration needed. Added per direct request as part of the RCA/OCORA compatibility initiative's Phase 2b (see docs/rca/ at the workspace root and TODO.dox): an integrator whose local/peer data already arrived through its own transport (e.g. RBC_GP's kind-multiplexed peer_channel, which carries cross-compare traffic alongside checkpoint/site-state frames on one shared link - not something a generic comparator API can transparently subsume) no longer needs to hand-wire two pure in-memory rte_channel_t "already arrived" adapters (send() that is never called, recv() that just returns a buffer) purely to satisfy rte_cross_comparator_execute()'s channel-based interface - this collapses that boilerplate to one call. | |
| rte_status_t | rte_cross_comparator_get_aggregated_health (const rte_cross_comparator_t *cmp, uint32_t *healthy_count, uint32_t *total_disagreements) |
| Aggregated health across both registered channels. | |
| rte_status_t | rte_cross_comparator_destroy (rte_cross_comparator_t *cmp) |
| Destroys a cross-comparator instance. | |
Pairwise channel comparison (ADR-025): validates parameters, receives from both registered channels, and compares them.
Definition in file rte_cross_comparator.c.
|
static |
Definition at line 14 of file rte_cross_comparator.c.
|
static |
Shared tail for both rte_cross_comparator_execute() and rte_cross_comparator_execute_buffers(): given a computed local_result, applies the exact same AGREED/DISAGREED/other handling (callback, unconditional safestate on DISAGREED) both public entry points must have identically - see rte_cross_comparator.h's own RCA/OCORA PI-API compatibility note for why this exists.
Definition at line 102 of file rte_cross_comparator.c.