diff --git a/configs/fne-config.example.yml b/configs/fne-config.example.yml index 569d92d3..b18aa374 100644 --- a/configs/fne-config.example.yml +++ b/configs/fne-config.example.yml @@ -68,6 +68,8 @@ master: # Flag indicating whether or not NXDN traffic will be passed. allowNXDNTraffic: true + # Flag indicating whether packet data will be passed. + disablePacketData: false # Flag indicating whether verbose dumping of data packets is enabled. dumpDataPacket: false diff --git a/src/fne/network/FNENetwork.cpp b/src/fne/network/FNENetwork.cpp index fe438586..b9f52ac8 100644 --- a/src/fne/network/FNENetwork.cpp +++ b/src/fne/network/FNENetwork.cpp @@ -89,6 +89,7 @@ FNENetwork::FNENetwork(HostFNE* host, const std::string& address, uint16_t port, m_influxOrg("dvm"), m_influxBucket("dvm"), m_influxLogRawData(false), + m_disablePacketData(false), m_dumpDataPacket(false), m_reportPeerPing(reportPeerPing), m_verbose(verbose) @@ -147,6 +148,7 @@ void FNENetwork::setOptions(yaml::Node& conf, bool printOptions) m_filterHeaders = conf["filterHeaders"].as(true); m_filterTerminators = conf["filterTerminators"].as(true); + m_disablePacketData = conf["disablePacketData"].as(false); m_dumpDataPacket = conf["dumpDataPacket"].as(false); /* @@ -169,6 +171,7 @@ void FNENetwork::setOptions(yaml::Node& conf, bool printOptions) if (m_disallowAdjStsBcast) { LogWarning(LOG_NET, "NOTICE: All P25 ADJ_STS_BCAST messages will be blocked and dropped!"); } + LogInfo(" Disable Packet Data: %s", m_disablePacketData ? "yes" : "no"); LogInfo(" Dump Packet Data: %s", m_dumpDataPacket ? "yes" : "no"); LogInfo(" Disable P25 ADJ_STS_BCAST to external peers: %s", m_disallowExtAdjStsBcast ? "yes" : "no"); LogInfo(" Allow conventional sites to override affiliation and receive all traffic: %s", m_allowConvSiteAffOverride ? "yes" : "no"); diff --git a/src/fne/network/FNENetwork.h b/src/fne/network/FNENetwork.h index 26398be6..0ea07066 100644 --- a/src/fne/network/FNENetwork.h +++ b/src/fne/network/FNENetwork.h @@ -458,7 +458,9 @@ namespace network bool m_influxLogRawData; influxdb::ServerInfo m_influxServer; + bool m_disablePacketData; bool m_dumpDataPacket; + bool m_reportPeerPing; bool m_verbose; diff --git a/src/fne/network/callhandler/TagDMRData.cpp b/src/fne/network/callhandler/TagDMRData.cpp index e1f56430..53624435 100644 --- a/src/fne/network/callhandler/TagDMRData.cpp +++ b/src/fne/network/callhandler/TagDMRData.cpp @@ -97,6 +97,14 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId dmrData.setN(n); } + if (dataType == DataType::DATA_HEADER || + dataType == DataType::RATE_12_DATA || + dataType == DataType::RATE_34_DATA || + dataType == DataType::RATE_1_DATA) { + if (m_network->m_disablePacketData) + return false; + } + // perform TGID route rewrites if configured routeRewrite(buffer, peerId, dmrData, dataType, dstId, slotNo, false); dstId = __GET_UINT16(buffer, 8U); diff --git a/src/fne/network/callhandler/TagNXDNData.cpp b/src/fne/network/callhandler/TagNXDNData.cpp index e3558106..0318dc54 100644 --- a/src/fne/network/callhandler/TagNXDNData.cpp +++ b/src/fne/network/callhandler/TagNXDNData.cpp @@ -66,6 +66,12 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI uint32_t srcId = __GET_UINT16(data, 5U); uint32_t dstId = __GET_UINT16(data, 8U); + if (messageType == MessageType::RTCH_DCALL_HDR || + messageType == MessageType::RTCH_DCALL_DATA) { + if (m_network->m_disablePacketData) + return false; + } + // perform TGID route rewrites if configured routeRewrite(buffer, peerId, messageType, dstId, false); dstId = __GET_UINT16(buffer, 8U); diff --git a/src/fne/network/callhandler/TagP25Data.cpp b/src/fne/network/callhandler/TagP25Data.cpp index 9ebaeac2..1a7fd149 100644 --- a/src/fne/network/callhandler/TagP25Data.cpp +++ b/src/fne/network/callhandler/TagP25Data.cpp @@ -85,6 +85,8 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId FrameType::E frameType = FrameType::DATA_UNIT; if (duid == DUID::PDU) { + if (m_network->m_disablePacketData) + return false; return m_packetData->processFrame(data, len, peerId, pktSeq, streamId, external); }