|
| rte_status_t | rte_redundancy_config_register_capability (rte_redundancy_capability_fn fn, void *context) |
| | Registers the capability callback rte_redundancy_config_load() consults after successfully parsing a file, before returning RTE_STATUS_OK. Call once at startup, before load(). No callback registered (the default) means load() accepts any successfully-parsed, internally-consistent config - the same behavior this module had before this function existed.
|
| static size_t | skip_ws (const char *buf, size_t len, size_t pos) |
| static rte_status_t | find_key_value_pos_bounded (const char *buf, size_t start_pos, size_t end_pos, const char *key, size_t *out_value_pos) |
| | Find "key" followed by a colon, return the index just past the colon (and any whitespace), i.e. where the value begins.
|
| static rte_status_t | find_key_value_pos (const char *buf, size_t len, const char *key, size_t *out_value_pos) |
| static rte_status_t | parse_string_value (const char *buf, size_t len, size_t pos, char *out, size_t out_size, size_t *out_end_pos) |
| static rte_status_t | parse_uint_value (const char *buf, size_t len, size_t pos, uint32_t *out) |
| static rte_status_t | parse_uint32_checked (const char *buf, size_t len, size_t pos, uint32_t *out) |
| | Checked variant of parse_uint_value(), used for the socket buffer keys (REQ-REDCFG-001). parse_uint_value() wraps modulo 2^32 and accepts a numeric prefix ("12x" -> 12); it is kept unchanged for the older keys. This one rejects instead.
|
| static rte_status_t | parse_optional_channel_u32 (const char *buf, size_t obj_start, size_t obj_end, const char *key, uint32_t *out) |
| | Optional checked unsigned key inside one channel object (REQ-REDCFG-001).
|
| static rte_status_t | parse_string_array (const char *buf, size_t len, size_t pos, char out[][RTE_REDUNDANCY_CONFIG_MAX_ROLE_NAME_LEN], uint32_t max_items, uint32_t *out_count) |
| rte_status_t | rte_channel_config_transport_from_string (const char *name, rte_channel_transport_t *out_transport) |
| | Parse transport name string ("flow", "netlink", "posix", "dds") into enum.
|
| rte_status_t | rte_channel_config_role_from_string (const char *name, rte_channel_role_t *out_role) |
| | Parse channel role name string ("listen", "connect", "publisher", "subscriber") into enum.
|
| static rte_status_t | parse_channel_object (const char *buf, size_t obj_start, size_t obj_end, rte_channel_def_t *out_channel) |
| static rte_status_t | parse_channels_array (const char *buf, size_t len, size_t pos, rte_channel_def_t *out_channels, uint32_t max_channels, uint32_t *out_count) |
| rte_status_t | rte_redundancy_config_topology_from_string (const char *name, rte_redundancy_topology_t *out_topology) |
| | Parse a topology name string ("2oo2", "2oo2_redundant", "2oo3", "nmr") into its enum value.
|
| const char * | rte_redundancy_config_topology_to_string (rte_redundancy_topology_t topology) |
| | Inverse of rte_redundancy_config_topology_from_string() - for logging/diagnostics.
|
| rte_status_t | rte_redundancy_config_standby_mode_from_string (const char *name, rte_standby_mode_t *out_mode) |
| | Parse a standby-mode name string ("hot", "warm", "cold") into its enum value.
|
| const char * | rte_redundancy_config_standby_mode_to_string (rte_standby_mode_t mode) |
| | Inverse of rte_redundancy_config_standby_mode_from_string() - for logging/diagnostics.
|
| static rte_status_t | parse_topology_replicas_and_quorum (const char *buf, size_t len, rte_redundancy_config_t *result) |
| static rte_status_t | parse_optional_standby_mode (const char *buf, size_t len, rte_redundancy_config_t *result) |
| static rte_status_t | parse_optional_roles (const char *buf, size_t len, rte_redundancy_config_t *result) |
| static rte_status_t | parse_optional_channels (const char *buf, size_t len, rte_redundancy_config_t *result) |
| rte_status_t | rte_redundancy_config_load (const char *path, rte_redundancy_config_t *out_config) |
| | Load a redundancy topology config from a JSON file.
|
| rte_status_t | rte_redundancy_config_apply_to_voter (const rte_redundancy_config_t *config, rte_voter_config_t *voter_cfg) |
| | Copy the resolved quorum from a loaded redundancy config into a rte_voter_config_t, leaving every other field of voter_cfg untouched (compare()/context/timeouts/safestate fields remain the caller's own responsibility to set).
|
| rte_status_t | rte_redundancy_config_find_channel_by_name (const rte_redundancy_config_t *config, const char *name, rte_channel_def_t *out_channel) |
| | Find channel definition by name in the given configuration.
|
| rte_status_t | rte_redundancy_config_find_channel_by_id (const rte_redundancy_config_t *config, uint32_t id, rte_channel_def_t *out_channel) |
| | Find channel definition by ID in the given configuration.
|
| const rte_redundancy_config_t * | rte_redundancy_config_get_active (void) |
| | Get the currently active loaded redundancy/channel configuration (if any).
|
| void | rte_redundancy_config_set_active (const rte_redundancy_config_t *config) |
| | Set the active configuration explicitly (or automatically by rte_redundancy_config_load).
|
See rte_redundancy_config.h.
The parser below is deliberately NOT a general JSON parser - it is a small, bounded scanner for exactly the flat, fixed-key schema documented in the header. stdio (fopen/fread/fclose) is used only at load time, matching the OCORA PI-API's own "stdio.h is init-only" allowance (see docs/rca/RCA-OCORA-PI-API.md Section 3a) - this is deployment-configuration loading, not a cyclic safety operation.
Definition in file rte_redundancy_config.c.