pfcp_peer: add configurable heartbeat fail threshold + association reset
Introduce heartbeat_fail_threshold (default: 3) that tracks consecutive unanswered PFCP Heartbeat Requests via the heartbeat_fail_count field and resets the association when the threshold is reached. The counter applies to both periodic heartbeats and those triggered via the REST API, and resets to zero on any successful Heartbeat Response.
pfcp_peer: detect UPF restart via RTS mismatch in Heartbeat Response
Check the Recovery Timestamp (RTS) in each Heartbeat Response against the value stored during Association Setup (`rem_rts`). A mismatch means the UPF has restarted; log a warning, increment the new `pfcp.peer_restart counter`, and reset the PFCP association so it is re-established with the restarted peer.
The `is_integer(ExpRTS)` guard prevents a spurious reset when a stale Heartbeat Response arrives in the connecting state (where `rem_rts` is still undefined).
Reduce verbosity of the Tx/Rx Heartbeat Req/Resp log messages from LOG_INFO to LOG_DEBUG in preparation for periodic heartbeat support. Without this change, periodic heartbeats would flood the logging.
Add a heartbeat_interval parameter to the pfcp_peer config section. When non-zero, pfcp_peer sends a periodic Heartbeat Request to the UPF at the configured interval using a named gen_statem timeout (hb_timer). The timer is started on entry to the connected state and cancelled on re-entry to the connecting state. Default is 10000 ms (10 seconds).
Add a heartbeat_interval parameter to the pfcp_peer config section. When non-zero, pfcp_peer sends a periodic Heartbeat Request to the UPF at the configured interval using a named gen_statem timeout (hb_timer). The timer is started on entry to the connected state and cancelled on re-entry to the connecting state. Default is 0 (disabled).
pfcp_peer: add configurable heartbeat miss count + association reset
Introduce heartbeat_miss_count (default: 3) that tracks consecutive unanswered PFCP Heartbeat Requests and resets the association when the threshold is reached. The counter applies to both periodic heartbeats and those triggered via the REST API, and resets to zero on any successful Heartbeat Response.
pfcp_peer: make assoc_setup and heartbeat_req timeouts configurable
Add assoc_setup_timeout and heartbeat_req_timeout as optional fields in the pfcp_peer config map, with 2000 ms defaults. Store the full cfg() map in #peer_state{} and read values from it with maps:get/3 at the point of use.
pfcp_peer: detect UPF restart via RTS mismatch in Heartbeat Response
Check the Recovery Timestamp (RTS) in each Heartbeat Response against the value stored during Association Setup (`rem_rts`). A mismatch means the UPF has restarted; log a warning, increment the new `pfcp.peer_restart counter`, and reset the PFCP association so it is re-established with the restarted peer.
The `is_integer(ExpRTS)` guard prevents a spurious reset when a stale Heartbeat Response arrives in the connecting state (where `rem_rts` is still undefined).
config/sys.config: group pfcp_peer params into a map
Following the same pattern as sctp_{client,server}, group the flat pfcp_loc_addr/pfcp_rem_addr environment variables into a pfcp_peer map. The old flat keys are still supported for backwards compat.
Changes: * osmo_s1gw_sup: add pfcp_cfg(), merging legacy flat keys with the new pfcp_peer map (new takes priority); store the resolved config back via set_env(pfcp_peer, ...) so all consumers see a single canonical map * pfcp_peer: change start_link/2 to start_link/1 taking a cfg() map; simplify init() using sctp_common:parse_addr/1; add cfg() type * rest_server: read pfcp laddr/raddr from the pfcp_peer map