|
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 "ab_gp_config.h"#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "rte/oal/memory/rte_mem_util.h"#include "../../common/common_config.h"Go to the source code of this file.
Macros | |
| #define | MAX_LINE_LEN 256U |
Functions | |
| static void | trim_whitespace (char *str) |
| static ab_gp_config_channel_t * | get_or_create_channel (ab_gp_config_t *cfg, const char *name) |
| 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. | |
| static void | apply_timer_setting (ab_gp_config_timers_t *timers, const char *key, const char *val) |
| static void | apply_channel_setting (ab_gp_config_channel_t *ch, const char *key, const char *val) |
| static void | apply_global_setting (ab_gp_config_t *cfg, const char *key, const char *val) |
| 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.c.
| #define MAX_LINE_LEN 256U |
Definition at line 19 of file ab_gp_config.c.
|
static |
Definition at line 21 of file ab_gp_config.c.
|
static |
Definition at line 54 of file ab_gp_config.c.
| 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.
|
static |
Definition at line 109 of file ab_gp_config.c.
|
static |
Definition at line 170 of file ab_gp_config.c.
|
static |
Definition at line 212 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.