mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-22 22:21:18 +00:00
Add signed private fleet controls for filtering and secondary radio
Enroll a private channel and publisher public key on repeaters and room servers. Local Companion fleet sends sign targeted or whole-fleet commands, with expiry, durable replay protection, and a restricted command allowlist. Preserve exact transmitted-reply barriers for secondary-radio changes, bound validation and replies, and qualify crypto, persistence, transport scope, role permissions, and compact-profile exclusions with regression tests.
This commit is contained in:
1 parent
a14bbdc58f
commit
d83fa7cf8e
27 files changed
+3028
-2
No files matched your search
@@ -1166,9 +1166,35 @@ void MyMesh::onAdvertRecv(mesh::Packet* packet, const mesh::Identity& id,
|
||||
}
|
||||
|
||||
void MyMesh::onGroupPacketRecv(mesh::Packet* packet) {
|
||||
#if MESH_ENABLE_FLEET_CONTROL
|
||||
if (_cli.fleetChannel()) {
|
||||
TransportKey scope;
|
||||
const bool known = mesh::captureFleetReplyScope(region_map, recv_pkt_region, packet, scope);
|
||||
_cli.fleetChannel()->receive(packet, *this, known ? &scope : nullptr);
|
||||
}
|
||||
#endif
|
||||
_clock_sync.observeGroupPacket(packet);
|
||||
}
|
||||
|
||||
#if MESH_ENABLE_FLEET_CONTROL
|
||||
void MyMesh::onSendComplete(mesh::Packet* packet) {
|
||||
mesh::Mesh::onSendComplete(packet);
|
||||
if (_cli.fleetChannel()) _cli.fleetChannel()->complete(packet, _cli.radioProfiles());
|
||||
}
|
||||
|
||||
void MyMesh::onSendFail(mesh::Packet* packet) {
|
||||
mesh::Mesh::onSendFail(packet);
|
||||
if (_cli.fleetChannel()) _cli.fleetChannel()->fail(packet, _cli.radioProfiles());
|
||||
}
|
||||
|
||||
void MyMesh::onRadioProfileCopyQueued(mesh::Packet* packet,
|
||||
const mesh::Packet* original,
|
||||
uint8_t priority) {
|
||||
mesh::Mesh::onRadioProfileCopyQueued(packet, original, priority);
|
||||
if (_cli.fleetChannel()) _cli.fleetChannel()->copy(packet, original);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(WITH_MQTT_NEIGHBORS)
|
||||
|
||||
#define CTL_TYPE_NODE_DISCOVER_REQ 0x80
|
||||
@@ -2679,6 +2705,18 @@ void MyMesh::loop() {
|
||||
servicePendingSerialOutput();
|
||||
#endif
|
||||
_cli.loop();
|
||||
#if MESH_ENABLE_FLEET_CONTROL
|
||||
if (_cli.fleetChannel()) {
|
||||
_cli.fleetChannel()->service(*this, _cli.radioProfiles(), _prefs.node_name,
|
||||
[this](uint32_t sequence, char* command, char* reply) {
|
||||
if (region_load_active) {
|
||||
strcpy(reply, "Err - region load active; retry later");
|
||||
return;
|
||||
}
|
||||
handleCommand(sequence, command, reply);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
_clock_sync.loop();
|
||||
#if MESH_ENABLE_TELEMETRY_HISTORY
|
||||
sampleTelemetryHistory();
|
||||
|
||||
Reference in new issue
Block a user