|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
Zero-dependency, statically-allocated configuration parser for Role A/B. More...
#include <stdbool.h>#include <stdint.h>#include "rte/oal/netlink/rte_netlink.h"#include "rte/utils/types/rte_types.h"#include "../../common/site_config.h"Go to the source code of this file.
Data Structures | |
| struct | ab_gp_config_channel_t |
| struct | ab_gp_config_timers_t |
| struct | ab_gp_config_t |
Macros | |
| #define | AB_GP_CONFIG_MAX_CHANNELS 16U |
| #define | AB_GP_CONFIG_NAME_MAX_LEN 32U |
| #define | AB_GP_CONFIG_HOST_MAX_LEN 64U |
Functions | |
| rte_status_t | ab_gp_config_init_defaults (rte_example_site_t site, bool is_role_a, ab_gp_config_t *out_cfg) |
| Initializes default configuration in memory based on site and role. | |
| rte_status_t | ab_gp_config_load_file (const char *filepath, ab_gp_config_t *out_cfg) |
| Parses an INI-style configuration file into the static ab_gp_config_t structure. | |
| rte_status_t | ab_gp_config_find_channel (const ab_gp_config_t *cfg, const char *channel_name, rte_netlink_config_t *out_netlink_cfg) |
| Resolves netlink configuration for a named channel from the parsed config. | |
| rte_status_t | ab_gp_config_find_channel_by_id (const ab_gp_config_t *cfg, uint32_t channel_id, rte_netlink_config_t *out_netlink_cfg) |
| Resolves netlink configuration for a channel by numeric ID from the parsed config. | |
Zero-dependency, statically-allocated configuration parser for Role A/B.
Compliant with CENELEC EN 50128 SIL 4 and MISRA C:2012. Strictly no dynamic memory allocation.
Definition in file ab_gp_config.h.
| #define AB_GP_CONFIG_MAX_CHANNELS 16U |
Definition at line 19 of file ab_gp_config.h.
| #define AB_GP_CONFIG_NAME_MAX_LEN 32U |
Definition at line 20 of file ab_gp_config.h.
| #define AB_GP_CONFIG_HOST_MAX_LEN 64U |
Definition at line 21 of file ab_gp_config.h.
| rte_status_t ab_gp_config_init_defaults | ( | rte_example_site_t | site, |
| bool | is_role_a, | ||
| ab_gp_config_t * | out_cfg ) |
Initializes default configuration in memory based on site and role.
Definition at line 79 of file ab_gp_config.c.
| rte_status_t ab_gp_config_load_file | ( | const char * | filepath, |
| ab_gp_config_t * | out_cfg ) |
Parses an INI-style configuration file into the static ab_gp_config_t structure.
| filepath | Path to the configuration file. |
| out_cfg | Target configuration struct. |
Definition at line 228 of file ab_gp_config.c.
| rte_status_t ab_gp_config_find_channel | ( | const ab_gp_config_t * | cfg, |
| const char * | channel_name, | ||
| rte_netlink_config_t * | out_netlink_cfg ) |
Resolves netlink configuration for a named channel from the parsed config.
| cfg | Parsed configuration. |
| channel_name | Channel identifier string (e.g. "ab-peer", "ab-relay-train-0"). |
| out_netlink_cfg | Receives resolved netlink configuration. |
Definition at line 316 of file ab_gp_config.c.
| rte_status_t ab_gp_config_find_channel_by_id | ( | const ab_gp_config_t * | cfg, |
| uint32_t | channel_id, | ||
| rte_netlink_config_t * | out_netlink_cfg ) |
Resolves netlink configuration for a channel by numeric ID from the parsed config.
| cfg | Parsed configuration. |
| channel_id | Channel numeric ID (e.g. 1 for ab-peer). |
| out_netlink_cfg | Receives resolved netlink configuration. |
Definition at line 345 of file ab_gp_config.c.