Merge jayReflector additions: per-trunk filters, node-list, PTY mute
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.
This commit is contained in:
1 parent
6f5138cd11
commit
5708e2d0e8
17 files changed
+1287
-58
No files matched your search
@@ -1821,6 +1821,93 @@ class MsgUdpAudio : public ReflectorUdpMsgBase<101>
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
@brief Trunk node list message (jayReflector extension, type 121)
|
||||
|
||||
Sent by a reflector to its trunk peer whenever its local client list changes
|
||||
(login, logout, TG change). The receiving peer can publish it via its own
|
||||
MQTT publisher. Older peers that don't know type 121 ignore it — fully
|
||||
backward compatible.
|
||||
|
||||
Each entry: callsign, current TG, optional lat/lon/QTH name.
|
||||
*/
|
||||
class MsgTrunkNodeList : public ReflectorMsgBase<121>
|
||||
{
|
||||
public:
|
||||
struct NodeEntry
|
||||
{
|
||||
std::string callsign;
|
||||
uint32_t tg = 0;
|
||||
float lat = 0.0f;
|
||||
float lon = 0.0f;
|
||||
std::string qth_name;
|
||||
};
|
||||
|
||||
MsgTrunkNodeList(void) {}
|
||||
explicit MsgTrunkNodeList(const std::vector<NodeEntry>& nodes)
|
||||
{
|
||||
for (const auto& n : nodes)
|
||||
{
|
||||
m_callsigns.push_back(n.callsign);
|
||||
m_tgs.push_back(n.tg);
|
||||
m_lats.push_back(n.lat);
|
||||
m_lons.push_back(n.lon);
|
||||
m_qth_names.push_back(n.qth_name);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<NodeEntry> nodes(void) const
|
||||
{
|
||||
std::vector<NodeEntry> result;
|
||||
size_t sz = std::min(m_callsigns.size(), m_tgs.size());
|
||||
for (size_t i = 0; i < sz; ++i)
|
||||
{
|
||||
NodeEntry e;
|
||||
e.callsign = m_callsigns[i];
|
||||
e.tg = m_tgs[i];
|
||||
e.lat = (i < m_lats.size()) ? m_lats[i] : 0.0f;
|
||||
e.lon = (i < m_lons.size()) ? m_lons[i] : 0.0f;
|
||||
e.qth_name = (i < m_qth_names.size()) ? m_qth_names[i] : "";
|
||||
result.push_back(e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ASYNC_MSG_MEMBERS(m_callsigns, m_tgs, m_lats, m_lons, m_qth_names)
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_callsigns;
|
||||
std::vector<uint32_t> m_tgs;
|
||||
std::vector<float> m_lats;
|
||||
std::vector<float> m_lons;
|
||||
std::vector<std::string> m_qth_names;
|
||||
}; /* MsgTrunkNodeList */
|
||||
|
||||
|
||||
/**
|
||||
@brief Trunk filter advertisement (jayReflector extension, type 122)
|
||||
|
||||
Optional message sent (typically by a satellite after Hello) to tell the
|
||||
parent which TGs it wants to receive. Filter syntax matches TgFilter
|
||||
(exact / "24*" prefix / "10-20" range, comma-separated). Older peers
|
||||
silently ignore unknown message types.
|
||||
*/
|
||||
class MsgTrunkFilter : public ReflectorMsgBase<122>
|
||||
{
|
||||
public:
|
||||
MsgTrunkFilter(void) {}
|
||||
explicit MsgTrunkFilter(const std::string& filter)
|
||||
: m_filter(filter) {}
|
||||
|
||||
const std::string& filter(void) const { return m_filter; }
|
||||
|
||||
ASYNC_MSG_MEMBERS(m_filter)
|
||||
|
||||
private:
|
||||
std::string m_filter;
|
||||
}; /* MsgTrunkFilter */
|
||||
|
||||
|
||||
#endif /* REFLECTOR_MSG_INCLUDED */
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user