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;

r05a06_dev
Bryan Biedenkapp 9 hours ago
parent ea157e2d8d
commit ce280880a0

@ -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";

@ -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.
};
/**

@ -42,6 +42,7 @@ void MetadataNetwork::PacketHandler::announce(TrafficNetwork* network, MetadataN
if (req->length >= static_cast<int>(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<int>(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<int>(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 {

Loading…
Cancel
Save

Powered by TurnKey Linux.