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
@@ -65,6 +65,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "ProtoVer.h"
|
||||
#include "ReflectorClient.h"
|
||||
#include "TrunkLink.h"
|
||||
#include "ReflectorMsg.h"
|
||||
#include "SatelliteLink.h"
|
||||
#include "SatelliteClient.h"
|
||||
#include "MqttPublisher.h"
|
||||
@@ -258,10 +259,18 @@ class Reflector : public sigc::trackable
|
||||
void onClientAuthenticated(const std::string& callsign, uint32_t tg,
|
||||
const std::string& ip);
|
||||
void onTrunkStateChanged(const std::string& section,
|
||||
const std::string& peer_id,
|
||||
const std::string& direction, bool up,
|
||||
const std::string& host = "",
|
||||
uint16_t port = 0);
|
||||
|
||||
// Triggered when a local client logs in/out or changes TG. Schedules
|
||||
// a debounced node-list emission to all trunk peers and to MQTT.
|
||||
void scheduleNodeListUpdate(void);
|
||||
// Called by TrunkLink when a peer sends us its node list.
|
||||
void onPeerNodeList(const std::string& peer_id,
|
||||
const std::vector<MsgTrunkNodeList::NodeEntry>& nodes);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
@@ -309,6 +318,7 @@ class Reflector : public sigc::trackable
|
||||
std::vector<TrunkLink*> m_trunk_links;
|
||||
std::set<uint32_t> m_cluster_tgs;
|
||||
bool m_trunk_debug = false;
|
||||
Async::Timer m_nodelist_timer;
|
||||
static const size_t TRUNK_MAX_PENDING_CONS = 5;
|
||||
|
||||
FramedTcpServer* m_trunk_srv = nullptr;
|
||||
@@ -367,6 +377,7 @@ class Reflector : public sigc::trackable
|
||||
Async::FramedTcpConnection::DisconnectReason reason);
|
||||
void onSatelliteLinkFailed(SatelliteLink* link);
|
||||
void processSatelliteCleanup(Async::Timer* t);
|
||||
void sendNodeListToAllPeers(void);
|
||||
bool loadCertificateFiles(void);
|
||||
bool loadServerCertificateFiles(void);
|
||||
bool generateKeyFile(Async::SslKeypair& pkey, const std::string& keyfile);
|
||||
|
||||
Reference in new issue
Block a user