Safe Communication Framework
0.1.0 build feea4f9
ERTMS/ETCS safe communication (Subset-037 EuroRadio, Subset-098 RBC/RBC), CENELEC EN 50128 SIL 4 oriented
Toggle main menu visibility
Loading...
Searching...
No Matches
ale.h
Go to the documentation of this file.
1
24
#ifndef SAFECOMM_ALE_H
25
#define SAFECOMM_ALE_H
26
27
#include <stdbool.h>
28
#include <stdint.h>
29
30
#include "
safecomm/status.h
"
31
#include "
safecomm/config/config.h
"
32
33
#ifdef __cplusplus
34
extern
"C"
{
35
#endif
36
38
#define SAFECOMM_ALE_MAX_PEERS 64U
39
41
typedef
struct
42
{
43
uint32_t
peer_id
;
44
char
ab_a_host[64];
45
char
ab_b_host[64];
46
uint16_t ab_port;
47
bool
in_use;
48
}
safecomm_ale_peer_t
;
49
51
typedef
struct
52
{
53
char
listen_host[64];
54
uint16_t listen_port;
55
safecomm_ale_peer_t
peers[
SAFECOMM_ALE_MAX_PEERS
];
56
uint32_t peer_count;
57
}
safecomm_ale_t
;
58
68
safecomm_status_t
safecomm_ale_from_config
(
const
safecomm_config_t
*cfg,
safecomm_ale_t
*out);
69
75
const
safecomm_ale_peer_t
*
safecomm_ale_lookup
(
const
safecomm_ale_t
*ale, uint32_t peer_id);
76
77
#ifdef __cplusplus
78
}
79
#endif
80
81
#endif
/* SAFECOMM_ALE_H */
safecomm_ale_from_config
safecomm_status_t safecomm_ale_from_config(const safecomm_config_t *cfg, safecomm_ale_t *out)
Build an ALE from a loaded config (ale.* keys) + its peer map.
Definition
ale.c:72
SAFECOMM_ALE_MAX_PEERS
#define SAFECOMM_ALE_MAX_PEERS
Max concurrent peer connections one ALE instance tracks.
Definition
ale.h:38
safecomm_ale_lookup
const safecomm_ale_peer_t * safecomm_ale_lookup(const safecomm_ale_t *ale, uint32_t peer_id)
Resolve a peer id to its A/B endpoint pair.
Definition
ale.c:104
config.h
File-based configuration for the Safe Communication Framework.
status.h
Common status codes for the Safe Communication Framework.
safecomm_status_t
safecomm_status_t
Result of a Safe Communication Framework operation.
Definition
status.h:17
safecomm_ale_peer_t
One routed peer: external bearer <-> the A/B endpoint pair.
Definition
ale.h:42
safecomm_ale_peer_t::peer_id
uint32_t peer_id
Definition
ale.h:43
safecomm_ale_t
An ALE instance. Caller-allocated, opaque.
Definition
ale.h:52
safecomm_config_t
A loaded configuration file. Caller-allocated, opaque in use.
Definition
config.h:66
include
safecomm
ale
ale.h
Generated by
1.18.0