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
Loading...
Searching...
No Matches
ale.h File Reference

Application Layer Entity (ALE) — NON-VITAL, runs in the Gateway. More...

#include <stdbool.h>
#include <stdint.h>
#include "safecomm/status.h"
#include "safecomm/config/config.h"
Include dependency graph for ale.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  safecomm_ale_peer_t
 One routed peer: external bearer <-> the A/B endpoint pair. More...
struct  safecomm_ale_t
 An ALE instance. Caller-allocated, opaque. More...

Macros

#define SAFECOMM_ALE_MAX_PEERS   64U
 Max concurrent peer connections one ALE instance tracks.

Functions

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.
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.

Detailed Description

Application Layer Entity (ALE) — NON-VITAL, runs in the Gateway.

The ALE is the concentration / routing point between the outside world and the vital A/B channels (ADR-002):

  • Accepts inbound bearer connections (EVCs for SS-037, the peer RBC for SS-098) on ale.listen_host:ale.listen_port.
  • Identifies the peer (NID_ENGINE for a train, RBC-ID for a neighbour) and looks it up in ale.peer_map_file.
  • Relays the raw bearer byte stream to BOTH A and B for that peer — it does NOT hold KSMAC and cannot read or alter a SaF PDU; the SFM in A/B is the only thing that authenticates.
  • Multiplexes many peers over the A/B internal links.

Because the ALE cannot forge an authenticated message, it stays outside the safety case: a fault here can drop or misroute a connection (the SFM's supervision timer then fires safe-side) but cannot inject a false MA or handover message.

REQ-SC-ALE-001..012 — see docs/requirements/SRS.md.

Definition in file ale.h.

Macro Definition Documentation

◆ SAFECOMM_ALE_MAX_PEERS

#define SAFECOMM_ALE_MAX_PEERS   64U

Max concurrent peer connections one ALE instance tracks.

Definition at line 38 of file ale.h.

Function Documentation

◆ 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.

Parameters
cfgloaded configuration (ale.listen_host, ale.listen_port, ale.peer_map_file). Non-NULL.
outreceives the ALE. Non-NULL.
Returns
SAFECOMM_STATUS_OK / _INVALID_PARAM / _TRANSPORT (peer map unreadable) / _NOT_IMPLEMENTED.
Note
REQ-SC-ALE-003.

Definition at line 72 of file ale.c.

◆ 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.

Returns
the peer entry, or NULL if peer_id is not in the map.
Note
REQ-SC-ALE-006.

Definition at line 104 of file ale.c.