Underscores are not in the configured per-id charset [A-Za-z0-9-]+,
so SECRET_SAT_PINNED= was correctly rejected as malformed at startup.
Switch SAT_PINNED -> SAT-PINNED (and same for SAT_UNPINNED) so the
test fixture matches the spec.
A non-owner reflector with two trunk legs (a country gateway sitting
between an international mesh and a national mesh) now forwards inbound
trunk traffic toward the actual prefix owner — automatically, via
longest-prefix-match in its own [TRUNK_x] table. Cluster TGs keep their
deliberate single-hop semantic to prevent loops in cyclic meshes.
Implementation
- Reflector::shouldRelayInbound(tg) composes the inbound relay decision:
* isLocalTG -> fan out (existing owner-relay)
* isClusterTG -> stop (anti-loop; cluster TGs broadcast outbound
from local clients only)
* hasPrefixRoute -> gateway forwarding via per-trunk isSharedTG
- The four isLocalTG gates in TrunkLink::handleMsgPeer{TalkerStart,
TalkerStop,Audio,Flush} are replaced by shouldRelayInbound. Source
exclusion in forwardTrunk*ToOtherTrunks plus per-link interest
tracking keep the topology naturally loop-free.
Tests
- topology.py: per-reflector `peers` filter for sparse layouts; new
reflector `d` (prefix 1219, trunked only to `b`) demonstrating
gateway-only reachability from `a` to `d`.
- generate_configs.py: honours the peers filter.
- test_trunk.py:
* setUpClass and test_01 skip non-existent pairs in sparse layouts.
* test_37_gateway_prefix_routing: a-client (122) <-> d-client (1219)
over TG 121950 in both directions, no CLUSTER_TGS.
* test_38_cluster_tg_local_client_broadcast: explicit coverage for
the outbound local-client cluster broadcast path.
- All previously passing tests still pass: 41/41 trunk + 7/7
mqtt-deltas + 14/14 twin.
Docs
- docs/TOPOLOGY_EXAMPLES.md (new) + .pdf + topology_pdf/ build sources +
build_topology_pdf.sh: visual cookbook of the five topology shapes
(international full-mesh, national mesh joined at gateway, satellite
tree, hybrid satellite-under-regional, HA twin pair). Includes an
MCC-range appendix with the recommendation to draw cluster TGs from
100-199 / 800-999 to avoid country-prefix collisions.
- docs/PEER_PROTOCOL.md: rewrote the "Owner-Relay Fanout" section as
"Inbound Relay (shouldRelayInbound)" with the three-regime
composition and clarified the single-mesh fanout caveat.
- README.md: feature bullet now describes gateway prefix routing and
links to TOPOLOGY_EXAMPLES.md (also added to the documentation list).
test_32_three_way_conversation drives one distinct V2 client on each of
the three mesh reflectors. All three select a TG owned by reflector 'b'
(121001), then each talks in round-robin while the other two listen.
Pass 1 primes m_peer_interested_tgs on every reflector pair; pass 2
measures and fails if any of the six sender→listener pairs delivers no
UDP audio/flush.
Exercises the owner-relay path (refA→refB→refC and refC→refB→refA) that
test_11 and test_17 miss because they only use two reflectors.
TEST_CLIENTS gains N0THRD — distinct callsigns are mandatory: when two
non-owners forward TrunkTalkerStart to the owner with the same
callsign, the owner's per-TG trunk-talker slot cannot disambiguate.
A small MsgHeartbeat (type 1) keepalive is sent between turns so idle
listener sockets do not hit HEARTBEAT_RX_CNT_RESET (15s).
- Move MQTT init above the satellite early-return in Reflector::initialize so
satellite-mode reflectors publish to MQTT (client connect/disconnect, talker
events, full status, etc.) just like full reflectors.
- Add reflector-sat (SATELLITE_OF=reflector-a) to the default test compose so
satellite mode is exercised end-to-end. New test_31 verifies MQTT
client-connect/disconnect events under the satellite's own topic prefix.
- Add RedisStore::pushClientStatus and Reflector::publishClientStatus to write
the per-client status JSON (qth, rx siglev/sql_open/enabled/active,
monitoredTGs, selected TG, ...) to live:client:<callsign>.status. Hooked
from publishRxUpdate, handleNodeInfo, setMonitoredTGs, and setTg.
- New Redis test_live_client_status_blob sends a synthetic MsgNodeInfoV2 with
qth+rx and asserts the parsed blob contains the expected fields.
31/31 trunk + 10/10 twin + 14/14 redis pass.
TwinLink::handleMsgTrunkAudio and handleMsgTrunkFlush now call
forwardAudioToSatellitesExcept / forwardFlushToSatellitesExcept,
mirroring TrunkLink. Without this, satellites attached to a twin
member only saw talker-state updates for traffic originated on the
partner — the audio frames themselves were dropped.
Adds test_09 (satellite handshakes with the twin parent) and test_10
(client on ref2 transmits; satellite on ref1 receives TalkerStart +
audio frames via the TWIN-mirror path). Wires a [SATELLITE] section
and host port mapping into the twin topology generator and lets
SatellitePeer.connect_satellite take an explicit port override.
Three fixes surfaced while running the E3 integration suite end-to-end:
1. sendMsgOnPairedInbound / sendMsgOnPairedOutbound / TwinLink sendMsgOn*
now check isConnected() before calling write(). Without the guard, a
heartbeat TX firing between the remote peer dying and our RX-timeout
cleanup tripped an "assert sock >= 0" inside Async::TcpConnection::write
and crashed the reflector (seen in test_07 as ref2 exiting with SIGSEGV
after ref1 was killed).
2. Twin topology trunk_port_base values reduced (45000-48000) so the
http-port offset (+3080) stays <= 65535. The earlier 60000-63000 bases
produced 66080, which docker compose rejected as an invalid hostPort.
3. Twin reflector names lowercased (refa, refc) to satisfy Docker's image
tag constraint (lowercase-only).
All 7 integration tests now pass end-to-end:
- twin handshake (mutual authenticated hello)
- no HMAC/prefix errors on startup
- refa's PAIRED=1 trunk reports connected=True
- both pair members see TRUNK_IT_DE back to refa
- no twin-related ERRORs in startup logs
- kill ref2 -> ref1 detects timeout, restart -> re-handshakes
- kill ref1 -> refa stays connected to the pair via ref2 (failover)
Add TWIN_TOPOLOGY data (TWIN_REFLECTORS, TWIN_TRUNKS) to topology.py and
extend generate_configs.py to render [TWIN] sections, TWIN_LISTEN_PORT, and
PAIRED=1 multi-host trunk sections when invoked with --topology twin (or
TOPOLOGY=twin env var). Default topology and its generated output are
unchanged.
- topology.py: add REDIS constants and redis_db_index() helper; support a
'redis' key in REFLECTORS entries (default off — not flipped for any
reflector here).
- generate_configs.py: emit [REDIS] section per reflector when flagged,
add redis:7-alpine service to docker-compose when any reflector is
flagged, add depends_on for redis-enabled reflectors.
No reflector has 'redis: True' set; regenerated configs match master
byte-for-byte. Later tests (F2+) will flip the flag selectively and
handle Redis population via --import-conf-to-redis.
Ports DJ1JAY / FM-Funknetz' jayReflector features (https://github.com/dj1jay/jayReflector)
into GeuReflector while keeping the in-process MqttPublisher.
Per-trunk config (TrunkLink): BLACKLIST_TGS, ALLOW_TGS, TG_MAP (with
explicit-route bypass of the prefix routing check), PEER_ID. New helpers
TgFilter.h provide exact / "24*" / "10-20" syntax shared across keys.
Wire protocol (additive, backward compatible — older peers ignore unknown
types): MsgTrunkNodeList (type 121) carries callsign + current_tg + optional
lat/lon/QTH; MsgTrunkFilter (type 122) reserved for satellite TG filters.
Reflector emits debounced (500 ms) MsgTrunkNodeList to all trunk peers on
local client login/logout/TG change. Inbound lists are republished via MQTT
under nodes/<peer_id>; the local list under nodes/local. New MQTT_NAME global
key inserts a path component so several reflectors can share a TOPIC_PREFIX.
PTY commands (Reflector): TRUNK MUTE|UNMUTE <section> <callsign>,
TRUNK RELOAD [<section>] re-reads BLACKLIST_TGS/ALLOW_TGS/TG_MAP without
restart, TRUNK STATUS [<section>] dumps a one-line summary per link.
Mute is applied on the inbound audio path.
Tests: 8 new integration tests (19-27) plus a TEST_PEER_FILTER fixture in
topology.py. Tests cover PEER_ID hello, BLACKLIST/ALLOW/TG_MAP semantics,
PTY MUTE/RELOAD/STATUS via docker exec, MQTT_NAME topic namespacing, and
node-list emission. Total now 27 tests.
Docs: docs/JAY-additions.md credits DJ1JAY / FM-Funknetz and lists every
merged feature with file pointers and the filter-evaluation order.
README.md links it. svxreflector.conf.in documents every new key.
Bumps SVXREFLECTOR to 1.3.99.13+trunk.
Add mosquitto broker to test Docker Compose, configure [MQTT] sections
in all generated reflector configs, and add test_18_mqtt_talker_event
that verifies talker start/stop events are published to MQTT topics.
Trunk link matching now requires the peer's hello ID (section name) to
match the local [TRUNK_x] section name. Both sides of a trunk link must
use the same section name, agreed upon by both sysops. This replaces
the previous matching by secret+prefix only.
BREAKING CHANGE: existing deployments must rename their [TRUNK_x]
sections so both sides use the same name for each link.
Also cap TRUNK_DEBUG audio frame logging at 500 frames per trunk link
to prevent excessive log output during sustained transmissions.
Two bugs prevented real-world trunk conversations from working:
1. onTrunkTalkerUpdated only notified clients selected on a TG, not
clients monitoring it. SvxLink repeaters monitoring a foreign TG
never received MsgTalkerStart and could not auto-switch. Fixed by
adding TgMonitorFilter to trunk talker broadcasts, matching the
existing behavior of onTalkerUpdated for local talkers.
2. Trunk TG routing was one-way: when a client visited a foreign TG,
isSharedTG forwarded to the owner, but the owner had no return
path. Added per-link peer interest tracking — when a peer sends
MsgTrunkTalkerStart for a TG, the receiving side records interest
and forwards local activity on that TG back. Interest refreshes
on audio, expires after 10 minutes idle, clears on disconnect.
New integration test verifies the full round-trip: client-A talks on
a foreign TG, monitoring client-B receives the notification, client-B
replies, and client-A receives audio back through the trunk.
5 new tests covering satellite protocol: handshake and /status visibility,
audio delivery from satellite to parent's local clients, trunk-to-satellite
audio forwarding, satellite audio routed to trunk peers via parent, and
disconnect cleanup. Reflector-a acts as the satellite parent with a
[SATELLITE] section; a SatellitePeer class connects as a fake satellite
using MsgTrunkHello with ROLE_SATELLITE.
The receive-side handlers (handleMsgTrunkTalkerStart, handleMsgTrunkAudio,
etc.) used isSharedTG() which only checks the remote peer's prefix. This
caused non-cluster TGs to be silently dropped on the receiving reflector —
e.g. a client on reflector-a talking on TG 40001 (owned by reflector-b)
would never reach reflector-b because reflector-b checked the TG against
reflector-a's prefix instead of its own.
Add isOwnedTG() that accepts TGs matching either the local or remote
prefix, and use it in all four receive handlers. The send-side still uses
isSharedTG() (remote prefix only) which is correct.
Also add a Docker-based integration test suite (tests/) with 11 automated
tests covering handshake, routing, cross-reflector audio delivery, cluster
TGs, heartbeat, disconnect cleanup, and trunk-to-trunk isolation. An
interactive mode lets users test arbitrary TG numbers with routing verified
via reflector logs. Topology is defined once in tests/topology.py.
Fix Dockerfile to copy built shared libraries to the runtime image.