diff --git a/src/fne/CMakeLists.txt b/src/fne/CMakeLists.txt index bb2c6b87..c5236b24 100644 --- a/src/fne/CMakeLists.txt +++ b/src/fne/CMakeLists.txt @@ -14,8 +14,8 @@ file(GLOB dvmfne_SRC "src/host/network/Network.h" "src/host/network/Network.cpp" - "src/fne/network/fne/*.h" - "src/fne/network/fne/*.cpp" + "src/fne/network/callhandler/*.h" + "src/fne/network/callhandler/*.cpp" "src/fne/network/influxdb/*.h" "src/fne/network/*.h" "src/fne/network/*.cpp" diff --git a/src/fne/HostFNE.cpp b/src/fne/HostFNE.cpp index a62e12f6..c82ffd96 100644 --- a/src/fne/HostFNE.cpp +++ b/src/fne/HostFNE.cpp @@ -16,9 +16,9 @@ #include "common/StopWatch.h" #include "common/Thread.h" #include "common/ThreadFunc.h" -#include "network/fne/TagDMRData.h" -#include "network/fne/TagP25Data.h" -#include "network/fne/TagNXDNData.h" +#include "network/callhandler/TagDMRData.h" +#include "network/callhandler/TagP25Data.h" +#include "network/callhandler/TagNXDNData.h" #include "ActivityLog.h" #include "HostFNE.h" #include "FNEMain.h" diff --git a/src/fne/HostFNE.h b/src/fne/HostFNE.h index bb690dfe..199ff87a 100644 --- a/src/fne/HostFNE.h +++ b/src/fne/HostFNE.h @@ -32,9 +32,9 @@ // Class Prototypes // --------------------------------------------------------------------------- -namespace network { namespace fne { class HOST_SW_API TagDMRData; } } -namespace network { namespace fne { class HOST_SW_API TagP25Data; } } -namespace network { namespace fne { class HOST_SW_API TagNXDNData; } } +namespace network { namespace callhandler { class HOST_SW_API TagDMRData; } } +namespace network { namespace callhandler { class HOST_SW_API TagP25Data; } } +namespace network { namespace callhandler { class HOST_SW_API TagNXDNData; } } // --------------------------------------------------------------------------- // Class Declaration @@ -56,9 +56,9 @@ private: yaml::Node m_conf; friend class network::FNENetwork; - friend class network::fne::TagDMRData; - friend class network::fne::TagP25Data; - friend class network::fne::TagNXDNData; + friend class network::callhandler::TagDMRData; + friend class network::callhandler::TagP25Data; + friend class network::callhandler::TagNXDNData; network::FNENetwork* m_network; network::DiagNetwork* m_diagNetwork; diff --git a/src/fne/network/DiagNetwork.cpp b/src/fne/network/DiagNetwork.cpp index 048d07d6..dce18f5a 100644 --- a/src/fne/network/DiagNetwork.cpp +++ b/src/fne/network/DiagNetwork.cpp @@ -18,7 +18,7 @@ #include "HostFNE.h" using namespace network; -using namespace network::fne; +using namespace network::callhandler; #include diff --git a/src/fne/network/FNENetwork.cpp b/src/fne/network/FNENetwork.cpp index 0da4ceb5..47e8ecf6 100644 --- a/src/fne/network/FNENetwork.cpp +++ b/src/fne/network/FNENetwork.cpp @@ -16,14 +16,14 @@ #include "common/Log.h" #include "common/Utils.h" #include "network/FNENetwork.h" -#include "network/fne/TagDMRData.h" -#include "network/fne/TagP25Data.h" -#include "network/fne/TagNXDNData.h" +#include "network/callhandler/TagDMRData.h" +#include "network/callhandler/TagP25Data.h" +#include "network/callhandler/TagNXDNData.h" #include "fne/ActivityLog.h" #include "HostFNE.h" using namespace network; -using namespace network::fne; +using namespace network::callhandler; #include #include diff --git a/src/fne/network/FNENetwork.h b/src/fne/network/FNENetwork.h index d1a8238c..9b8cb841 100644 --- a/src/fne/network/FNENetwork.h +++ b/src/fne/network/FNENetwork.h @@ -36,9 +36,9 @@ class HOST_SW_API HostFNE; class HOST_SW_API RESTAPI; -namespace network { namespace fne { class HOST_SW_API TagDMRData; } } -namespace network { namespace fne { class HOST_SW_API TagP25Data; } } -namespace network { namespace fne { class HOST_SW_API TagNXDNData; } } +namespace network { namespace callhandler { class HOST_SW_API TagDMRData; } } +namespace network { namespace callhandler { class HOST_SW_API TagP25Data; } } +namespace network { namespace callhandler { class HOST_SW_API TagNXDNData; } } namespace network { @@ -235,12 +235,12 @@ namespace network /// Gets the current status of the network. NET_CONN_STATUS getStatus() { return m_status; } - /// Gets the instance of the DMR traffic handler. - fne::TagDMRData* dmrTrafficHandler() const { return m_tagDMR; } - /// Gets the instance of the P25 traffic handler. - fne::TagP25Data* p25TrafficHandler() const { return m_tagP25; } - /// Gets the instance of the NXDN traffic handler. - fne::TagNXDNData* nxdnTrafficHandler() const { return m_tagNXDN; } + /// Gets the instance of the DMR call handler. + callhandler::TagDMRData* dmrTrafficHandler() const { return m_tagDMR; } + /// Gets the instance of the P25 call handler. + callhandler::TagP25Data* p25TrafficHandler() const { return m_tagP25; } + /// Gets the instance of the NXDN call handler. + callhandler::TagNXDNData* nxdnTrafficHandler() const { return m_tagNXDN; } /// Sets the instances of the Radio ID and Talkgroup Rules lookup tables. void setLookups(lookups::RadioIdLookup* ridLookup, lookups::TalkgroupRulesLookup* tidLookup, lookups::PeerListLookup* peerListLookup); @@ -264,12 +264,12 @@ namespace network private: friend class DiagNetwork; - friend class fne::TagDMRData; - fne::TagDMRData* m_tagDMR; - friend class fne::TagP25Data; - fne::TagP25Data* m_tagP25; - friend class fne::TagNXDNData; - fne::TagNXDNData* m_tagNXDN; + friend class callhandler::TagDMRData; + callhandler::TagDMRData* m_tagDMR; + friend class callhandler::TagP25Data; + callhandler::TagP25Data* m_tagP25; + friend class callhandler::TagNXDNData; + callhandler::TagNXDNData* m_tagNXDN; friend class ::RESTAPI; HostFNE* m_host; diff --git a/src/fne/network/RESTAPI.cpp b/src/fne/network/RESTAPI.cpp index 2cdadfa4..6bea52fb 100644 --- a/src/fne/network/RESTAPI.cpp +++ b/src/fne/network/RESTAPI.cpp @@ -17,8 +17,8 @@ #include "common/network/json/json.h" #include "common/Log.h" #include "common/Utils.h" -#include "fne/network/fne/TagDMRData.h" -#include "fne/network/fne/TagP25Data.h" +#include "fne/network/callhandler/TagDMRData.h" +#include "fne/network/callhandler/TagP25Data.h" #include "fne/network/RESTAPI.h" #include "HostFNE.h" diff --git a/src/fne/network/fne/TagDMRData.cpp b/src/fne/network/callhandler/TagDMRData.cpp similarity index 98% rename from src/fne/network/fne/TagDMRData.cpp rename to src/fne/network/callhandler/TagDMRData.cpp index e02bfbee..43cd18c1 100644 --- a/src/fne/network/fne/TagDMRData.cpp +++ b/src/fne/network/callhandler/TagDMRData.cpp @@ -20,12 +20,12 @@ #include "common/Log.h" #include "common/Utils.h" #include "network/FNENetwork.h" -#include "network/fne/TagDMRData.h" +#include "network/callhandler/TagDMRData.h" #include "HostFNE.h" using namespace system_clock; using namespace network; -using namespace network::fne; +using namespace network::callhandler; using namespace dmr; #include @@ -188,7 +188,8 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId RxStatus status = it->second; if (streamId != status.streamId) { if (status.srcId != 0U && status.srcId != srcId) { - LogWarning(LOG_NET, "DMR, Call Collision, peer = %u, srcId = %u, dstId = %u, streamId = %u, external = %u", peerId, srcId, dstId, streamId, external); + LogWarning(LOG_NET, "DMR, Call Collision, peer = %u, srcId = %u, dstId = %u, slotNo = %u, streamId = %u, rxPeer = %u, rxSrcId = %u, rxDstId = %u, rxSlotNo = %u, rxStreamId = %u, external = %u", + peerId, srcId, dstId, slotNo, streamId, status.peerId, status.srcId, status.dstId, status.slotNo, status.streamId, external); return false; } } @@ -215,6 +216,7 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId status.dstId = dstId; status.slotNo = slotNo; status.streamId = streamId; + status.peerId = peerId; m_status[dstId] = status; // this *could* be an issue if a dstId appears on both slots somehow... LogMessage(LOG_NET, "DMR, Call Start, peer = %u, srcId = %u, dstId = %u, streamId = %u, external = %u", peerId, srcId, dstId, streamId, external); diff --git a/src/fne/network/fne/TagDMRData.h b/src/fne/network/callhandler/TagDMRData.h similarity index 93% rename from src/fne/network/fne/TagDMRData.h rename to src/fne/network/callhandler/TagDMRData.h index 7bc3678d..2abc88bd 100644 --- a/src/fne/network/fne/TagDMRData.h +++ b/src/fne/network/callhandler/TagDMRData.h @@ -10,8 +10,8 @@ * Copyright (C) 2023-2024 Bryan Biedenkapp, N2PLL * */ -#if !defined(__FNE__TAG_DMR_DATA_H__) -#define __FNE__TAG_DMR_DATA_H__ +#if !defined(__CALLHANDLER__TAG_DMR_DATA_H__) +#define __CALLHANDLER__TAG_DMR_DATA_H__ #include "fne/Defines.h" #include "common/dmr/DMRDefines.h" @@ -24,11 +24,11 @@ namespace network { - namespace fne + namespace callhandler { // --------------------------------------------------------------------------- // Class Declaration - // Implements the DMR data FNE networking logic. + // Implements the DMR call handler and data FNE networking logic. // --------------------------------------------------------------------------- class HOST_SW_API TagDMRData { @@ -80,6 +80,7 @@ namespace network uint32_t dstId; uint8_t slotNo; uint32_t streamId; + uint32_t peerId; }; typedef std::pair StatusMapPair; std::unordered_map m_status; @@ -105,7 +106,7 @@ namespace network /// Helper to write a network CSBK. void write_CSBK(uint32_t peerId, uint8_t slot, dmr::lc::CSBK* csbk); }; - } // namespace fne + } // namespace callhandler } // namespace network -#endif // __FNE__TAG_DMR_DATA_H__ +#endif // __CALLHANDLER__TAG_DMR_DATA_H__ diff --git a/src/fne/network/fne/TagNXDNData.cpp b/src/fne/network/callhandler/TagNXDNData.cpp similarity index 98% rename from src/fne/network/fne/TagNXDNData.cpp rename to src/fne/network/callhandler/TagNXDNData.cpp index 41a42511..be356863 100644 --- a/src/fne/network/fne/TagNXDNData.cpp +++ b/src/fne/network/callhandler/TagNXDNData.cpp @@ -22,12 +22,12 @@ #include "common/Log.h" #include "common/Utils.h" #include "network/FNENetwork.h" -#include "network/fne/TagNXDNData.h" +#include "network/callhandler/TagNXDNData.h" #include "HostFNE.h" using namespace system_clock; using namespace network; -using namespace network::fne; +using namespace network::callhandler; using namespace nxdn; #include @@ -160,7 +160,8 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI RxStatus status = m_status[dstId]; if (streamId != status.streamId) { if (status.srcId != 0U && status.srcId != srcId) { - LogWarning(LOG_NET, "NXDN, Call Collision, peer = %u, srcId = %u, dstId = %u, streamId = %u, external = %u", peerId, srcId, dstId, streamId, external); + LogWarning(LOG_NET, "NXDN, Call Collision, peer = %u, srcId = %u, dstId = %u, streamId = %u, rxPeer = %u, rxSrcId = %u, rxDstId = %u, rxStreamId = %u, external = %u", + peerId, srcId, dstId, streamId, status.peerId, status.srcId, status.dstId, status.streamId, external); return false; } } @@ -186,6 +187,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI status.srcId = srcId; status.dstId = dstId; status.streamId = streamId; + status.peerId = peerId; m_status[dstId] = status; LogMessage(LOG_NET, "NXDN, Call Start, peer = %u, srcId = %u, dstId = %u, streamId = %u, external = %u", peerId, srcId, dstId, streamId, external); diff --git a/src/fne/network/fne/TagNXDNData.h b/src/fne/network/callhandler/TagNXDNData.h similarity index 92% rename from src/fne/network/fne/TagNXDNData.h rename to src/fne/network/callhandler/TagNXDNData.h index 5514fcce..8b997186 100644 --- a/src/fne/network/fne/TagNXDNData.h +++ b/src/fne/network/callhandler/TagNXDNData.h @@ -10,8 +10,8 @@ * Copyright (C) 2023-2024 Bryan Biedenkapp, N2PLL * */ -#if !defined(__FNE__TAG_NXDN_DATA_H__) -#define __FNE__TAG_NXDN_DATA_H__ +#if !defined(__CALLHANDLER__TAG_NXDN_DATA_H__) +#define __CALLHANDLER__TAG_NXDN_DATA_H__ #include "fne/Defines.h" #include "common/Clock.h" @@ -24,11 +24,11 @@ namespace network { - namespace fne + namespace callhandler { // --------------------------------------------------------------------------- // Class Declaration - // Implements the NXDN data FNE networking logic. + // Implements the NXDN call handler and data FNE networking logic. // --------------------------------------------------------------------------- class HOST_SW_API TagNXDNData { @@ -72,6 +72,7 @@ namespace network uint32_t srcId; uint32_t dstId; uint32_t streamId; + uint32_t peerId; }; typedef std::pair StatusMapPair; std::unordered_map m_status; @@ -94,7 +95,7 @@ namespace network /// Helper to write a network RCCH. void write_Message(uint32_t peerId, nxdn::lc::RCCH* rcch); }; - } // namespace fne + } // namespace callhandler } // namespace network -#endif // __FNE__TAG_NXDN_DATA_H__ +#endif // __CALLHANDLER__TAG_NXDN_DATA_H__ diff --git a/src/fne/network/fne/TagP25Data.cpp b/src/fne/network/callhandler/TagP25Data.cpp similarity index 99% rename from src/fne/network/fne/TagP25Data.cpp rename to src/fne/network/callhandler/TagP25Data.cpp index e30c8167..38d3e35c 100644 --- a/src/fne/network/fne/TagP25Data.cpp +++ b/src/fne/network/callhandler/TagP25Data.cpp @@ -18,12 +18,12 @@ #include "common/Thread.h" #include "common/Utils.h" #include "network/FNENetwork.h" -#include "network/fne/TagP25Data.h" +#include "network/callhandler/TagP25Data.h" #include "HostFNE.h" using namespace system_clock; using namespace network; -using namespace network::fne; +using namespace network::callhandler; using namespace p25; #include @@ -218,7 +218,8 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId RxStatus status = m_status[dstId]; if (streamId != status.streamId && ((duid != P25_DUID_TDU) && (duid != P25_DUID_TDULC))) { if (status.srcId != 0U && status.srcId != srcId) { - LogWarning(LOG_NET, "P25, Call Collision, peer = %u, srcId = %u, dstId = %u, streamId = %u, external = %u", peerId, srcId, dstId, streamId, external); + LogWarning(LOG_NET, "P25, Call Collision, peer = %u, srcId = %u, dstId = %u, streamId = %u, rxPeer = %u, rxSrcId = %u, rxDstId = %u, rxStreamId = %u, external = %u", + peerId, srcId, dstId, streamId, status.peerId, status.srcId, status.dstId, status.streamId, external); return false; } } @@ -244,6 +245,7 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId status.srcId = srcId; status.dstId = dstId; status.streamId = streamId; + status.peerId = peerId; m_status[dstId] = status; LogMessage(LOG_NET, "P25, Call Start, peer = %u, srcId = %u, dstId = %u, streamId = %u, external = %u", peerId, srcId, dstId, streamId, external); diff --git a/src/fne/network/fne/TagP25Data.h b/src/fne/network/callhandler/TagP25Data.h similarity index 95% rename from src/fne/network/fne/TagP25Data.h rename to src/fne/network/callhandler/TagP25Data.h index 9b479c83..3ee2c85e 100644 --- a/src/fne/network/fne/TagP25Data.h +++ b/src/fne/network/callhandler/TagP25Data.h @@ -10,8 +10,8 @@ * Copyright (C) 2023-2024 Bryan Biedenkapp, N2PLL * */ -#if !defined(__FNE__TAG_P25_DATA_H__) -#define __FNE__TAG_P25_DATA_H__ +#if !defined(__CALLHANDLER__TAG_P25_DATA_H__) +#define __CALLHANDLER__TAG_P25_DATA_H__ #include "fne/Defines.h" #include "common/Clock.h" @@ -29,11 +29,11 @@ namespace network { - namespace fne + namespace callhandler { // --------------------------------------------------------------------------- // Class Declaration - // Implements the P25 data FNE networking logic. + // Implements the P25 call handler and data FNE networking logic. // --------------------------------------------------------------------------- class HOST_SW_API TagP25Data { @@ -89,6 +89,7 @@ namespace network uint32_t srcId; uint32_t dstId; uint32_t streamId; + uint32_t peerId; }; typedef std::pair StatusMapPair; std::unordered_map m_status; @@ -120,7 +121,7 @@ namespace network /// Helper to write a network TSDU. void write_TSDU(uint32_t peerId, p25::lc::TSBK* tsbk); }; - } // namespace fne + } // namespace callhandler } // namespace network -#endif // __FNE__TAG_P25_DATA_H__ +#endif // __CALLHANDLER__TAG_P25_DATA_H__