From ce280880a060d3bd6ecc308a382a30f91214fa3f Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Tue, 24 Nov 2026 09:45:08 -0500 Subject: [PATCH] add support for generalized unit registration, deregistration and affiliation, because the originating packet is consumed by the downstream peer handler, we only get the system generalized registration, dereg or affil announcements, we treat these as "system" protocol; --- src/fne/network/SubscriberOperationStore.cpp | 8 ++++++++ src/fne/network/SubscriberOperationStore.h | 10 ++++++++-- src/fne/network/packet/Announce.cpp | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/fne/network/SubscriberOperationStore.cpp b/src/fne/network/SubscriberOperationStore.cpp index 857f285f..93afdcac 100644 --- a/src/fne/network/SubscriberOperationStore.cpp +++ b/src/fne/network/SubscriberOperationStore.cpp @@ -227,6 +227,8 @@ const char* SubscriberOperationStore::protocolName(Protocol protocol) return "p25"; case Protocol::NXDN: return "nxdn"; + case Protocol::SYSTEM: + return "system"; } return "unknown"; @@ -259,6 +261,12 @@ const char* SubscriberOperationStore::kindName(Kind kind) return "emerg-call"; case Kind::RADIO_MONITOR: return "radio-monitor"; + case Kind::UNIT_REG: + return "unit-registration"; + case Kind::UNIT_DEREG: + return "unit-deregistration"; + case Kind::GRP_AFFIL: + return "group-affiliation"; } return "unknown"; diff --git a/src/fne/network/SubscriberOperationStore.h b/src/fne/network/SubscriberOperationStore.h index 7ea4a911..74107c6e 100644 --- a/src/fne/network/SubscriberOperationStore.h +++ b/src/fne/network/SubscriberOperationStore.h @@ -43,7 +43,9 @@ namespace network enum class Protocol : uint8_t { DMR = 0U, //!< Digital Mobile Radio. P25 = 1U, //!< Project 25. - NXDN = 2U //!< Next Generation Digital Narrowband. + NXDN = 2U, //!< Next Generation Digital Narrowband. + + SYSTEM = 3U, //!< System-level operation. }; /** @@ -64,7 +66,11 @@ namespace network EMERG_ALRM = 8U, //!< Emergency alarm request. EMERG_CALL = 9U, //!< Emergency voice call. - RADIO_MONITOR = 10U, //!< Radio monitor request. + RADIO_MONITOR = 10U, //!< Radio monitor request. + + UNIT_REG = 11U, //!< Unit registration request. + UNIT_DEREG = 12U, //!< Unit deregistration request. + GRP_AFFIL = 13U, //!< Group affiliation request. }; /** diff --git a/src/fne/network/packet/Announce.cpp b/src/fne/network/packet/Announce.cpp index 41270696..bba4d164 100644 --- a/src/fne/network/packet/Announce.cpp +++ b/src/fne/network/packet/Announce.cpp @@ -42,6 +42,7 @@ void MetadataNetwork::PacketHandler::announce(TrafficNetwork* network, MetadataN if (req->length >= static_cast(MSG_ANNC_GRP_AFFIL)) { uint32_t srcId = GET_UINT24(req->buffer, 0U); // Source Address uint32_t dstId = GET_UINT24(req->buffer, 3U); // Destination Address + network->subscriberOperations().oneShot(SubscriberOperationStore::Protocol::SYSTEM, SubscriberOperationStore::Kind::GRP_AFFIL, srcId, dstId); network->updatePeerAffiliation(peerId, srcId, dstId); } else { @@ -72,6 +73,7 @@ void MetadataNetwork::PacketHandler::announce(TrafficNetwork* network, MetadataN if (connection->connected() && connection->address() == ip && aff != nullptr) { if (req->length >= static_cast(MSG_ANNC_UNIT_REG)) { uint32_t srcId = GET_UINT24(req->buffer, 0U); // Source Address + network->subscriberOperations().oneShot(SubscriberOperationStore::Protocol::SYSTEM, SubscriberOperationStore::Kind::UNIT_REG, srcId, peerId); network->updatePeerUnitRegistration(peerId, srcId, ssrc); } else { @@ -101,6 +103,7 @@ void MetadataNetwork::PacketHandler::announce(TrafficNetwork* network, MetadataN if (connection->connected() && connection->address() == ip && aff != nullptr) { if (req->length >= static_cast(MSG_ANNC_UNIT_REG)) { uint32_t srcId = GET_UINT24(req->buffer, 0U); // Source Address + network->subscriberOperations().oneShot(SubscriberOperationStore::Protocol::SYSTEM, SubscriberOperationStore::Kind::UNIT_DEREG, srcId, peerId); network->removePeerUnitRegistration(peerId, srcId); } else {