add ability to disable NON-AUTHORITATIVE log warnings (functionality is made optional as it makes diagnostics easier); remove redundant error message from grant demands;

pull/72/head
Bryan Biedenkapp 1 year ago
parent ff6658cae7
commit 7736e03aef

@ -17,6 +17,8 @@ daemon: true
# 6 - Fatal # 6 - Fatal
# #
log: log:
# Flag indicating whether or not the NON-AUTHORITATIVE errors should be logged.
disableNonAuthoritiveLogging: false
# Console display logging level (used when in foreground). # Console display logging level (used when in foreground).
displayLevel: 1 displayLevel: 1
# File logging level. # File logging level.

@ -185,6 +185,7 @@ int Host::run()
// initialize system logging // initialize system logging
yaml::Node logConf = m_conf["log"]; yaml::Node logConf = m_conf["log"];
bool useSyslog = logConf["useSyslog"].as<bool>(false); bool useSyslog = logConf["useSyslog"].as<bool>(false);
g_disableNonAuthoritativeLogging = logConf["disableNonAuthoritiveLogging"].as<bool>(false);
if (g_foreground) if (g_foreground)
useSyslog = false; useSyslog = false;
ret = ::LogInitialise(logConf["filePath"].as<std::string>(), logConf["fileRoot"].as<std::string>(), ret = ::LogInitialise(logConf["filePath"].as<std::string>(), logConf["fileRoot"].as<std::string>(),

@ -58,6 +58,8 @@ bool g_fireCCVCNotification = false;
uint8_t* g_gitHashBytes = nullptr; uint8_t* g_gitHashBytes = nullptr;
bool g_disableNonAuthoritativeLogging = false;
bool g_modemDebug = false; bool g_modemDebug = false;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

@ -62,6 +62,9 @@ extern bool g_fireCCVCNotification;
/** @brief */ /** @brief */
extern uint8_t* g_gitHashBytes; extern uint8_t* g_gitHashBytes;
/** @brief (Global) Flag disabling NON-AUTHORITATIVE error logging. */
extern bool g_disableNonAuthoritativeLogging;
/** @brief (Global) Modem debug flag. Forces modem debug regardless of configuration settings. */ /** @brief (Global) Modem debug flag. Forces modem debug regardless of configuration settings. */
extern bool g_modemDebug; extern bool g_modemDebug;

@ -21,6 +21,7 @@
#include "common/dmr/acl/AccessControl.h" #include "common/dmr/acl/AccessControl.h"
#include "remote/RESTClient.h" #include "remote/RESTClient.h"
#include "ActivityLog.h" #include "ActivityLog.h"
#include "HostMain.h"
using namespace dmr; using namespace dmr;
using namespace dmr::defines; using namespace dmr::defines;
@ -414,7 +415,8 @@ void Slot::processNetwork(const data::NetData& dmrData)
// don't process network frames if this modem isn't authoritative // don't process network frames if this modem isn't authoritative
if (!m_authoritative && m_permittedDstId != dmrData.getDstId()) { if (!m_authoritative && m_permittedDstId != dmrData.getDstId()) {
LogWarning(LOG_NET, "DMR Slot %u, [NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted!", m_slotNo); if (!g_disableNonAuthoritativeLogging)
LogWarning(LOG_NET, "DMR Slot %u, [NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted!", m_slotNo);
return; return;
} }

@ -857,6 +857,15 @@ bool ControlSignaling::writeRF_CSBK_Grant(uint32_t srcId, uint32_t dstId, uint8_
::lookups::TalkgroupRuleGroupVoice groupVoice = m_tscc->m_tidLookup->find(dstId); ::lookups::TalkgroupRuleGroupVoice groupVoice = m_tscc->m_tidLookup->find(dstId);
slot = groupVoice.source().tgSlot(); slot = groupVoice.source().tgSlot();
// is this an affiliation required group?
::lookups::TalkgroupRuleGroupVoice tid = m_tscc->m_tidLookup->find(dstId, slot);
if (tid.config().affiliated()) {
if (!m_tscc->m_affiliations->hasGroupAff(dstId)) {
LogWarning(LOG_RF, "DMR Slot %u, CSBK, RAND (Random Access, GRP_VOICE_CALL (Group Voice Call) ignored, no group affiliations, dstId = %u", m_tscc->m_slotNo, dstId);
return false;
}
}
uint32_t availChNo = m_tscc->m_affiliations->getAvailableChannelForSlot(slot); uint32_t availChNo = m_tscc->m_affiliations->getAvailableChannelForSlot(slot);
if (!m_tscc->m_affiliations->rfCh()->isRFChAvailable() || availChNo == 0U) { if (!m_tscc->m_affiliations->rfCh()->isRFChAvailable() || availChNo == 0U) {
if (grp) { if (grp) {

@ -22,6 +22,7 @@
#include "dmr/packet/Data.h" #include "dmr/packet/Data.h"
#include "dmr/Slot.h" #include "dmr/Slot.h"
#include "ActivityLog.h" #include "ActivityLog.h"
#include "HostMain.h"
using namespace dmr; using namespace dmr;
using namespace dmr::defines; using namespace dmr::defines;
@ -36,7 +37,8 @@ using namespace dmr::packet;
#define CHECK_AUTHORITATIVE(_DST_ID) \ #define CHECK_AUTHORITATIVE(_DST_ID) \
if (!m_slot->m_authoritative && m_slot->m_permittedDstId != dstId) { \ if (!m_slot->m_authoritative && m_slot->m_permittedDstId != dstId) { \
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!"); \ if (!g_disableNonAuthoritativeLogging) \
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!"); \
m_slot->m_rfState = RS_RF_LISTENING; \ m_slot->m_rfState = RS_RF_LISTENING; \
return false; \ return false; \
} }

@ -20,6 +20,7 @@
#include "dmr/packet/Voice.h" #include "dmr/packet/Voice.h"
#include "dmr/Slot.h" #include "dmr/Slot.h"
#include "ActivityLog.h" #include "ActivityLog.h"
#include "HostMain.h"
using namespace dmr; using namespace dmr;
using namespace dmr::defines; using namespace dmr::defines;
@ -34,7 +35,8 @@ using namespace dmr::packet;
#define CHECK_AUTHORITATIVE(_DST_ID) \ #define CHECK_AUTHORITATIVE(_DST_ID) \
if (!m_slot->m_authoritative && m_slot->m_permittedDstId != _DST_ID) { \ if (!m_slot->m_authoritative && m_slot->m_permittedDstId != _DST_ID) { \
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted, dstId = %u", _DST_ID); \ if (!g_disableNonAuthoritativeLogging) \
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted, dstId = %u", _DST_ID); \
m_slot->m_rfState = RS_RF_LISTENING; \ m_slot->m_rfState = RS_RF_LISTENING; \
return false; \ return false; \
} }

@ -468,6 +468,15 @@ bool ControlSignaling::writeRF_Message_Grant(uint32_t srcId, uint32_t dstId, uin
} }
if (!m_nxdn->m_affiliations.isGranted(dstId)) { if (!m_nxdn->m_affiliations.isGranted(dstId)) {
// is this an affiliation required group?
::lookups::TalkgroupRuleGroupVoice tid = m_nxdn->m_tidLookup->find(dstId);
if (tid.config().affiliated()) {
if (!m_nxdn->m_affiliations.hasGroupAff(dstId)) {
LogWarning(LOG_RF, "NXDN, %s ignored, no group affiliations, dstId = %u", rcch->toString().c_str(), dstId);
return false;
}
}
if (!m_nxdn->m_affiliations.rfCh()->isRFChAvailable()) { if (!m_nxdn->m_affiliations.rfCh()->isRFChAvailable()) {
if (grp) { if (grp) {
if (!net) { if (!net) {

@ -18,6 +18,7 @@
#include "common/Log.h" #include "common/Log.h"
#include "nxdn/packet/Voice.h" #include "nxdn/packet/Voice.h"
#include "ActivityLog.h" #include "ActivityLog.h"
#include "HostMain.h"
using namespace nxdn; using namespace nxdn;
using namespace nxdn::defines; using namespace nxdn::defines;
@ -114,7 +115,8 @@ using namespace nxdn::packet;
} \ } \
\ \
if (!m_nxdn->m_authoritative && m_nxdn->m_permittedDstId != _DST_ID) { \ if (!m_nxdn->m_authoritative && m_nxdn->m_permittedDstId != _DST_ID) { \
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted, dstId = %u", _DST_ID); \ if (!g_disableNonAuthoritativeLogging) \
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted, dstId = %u", _DST_ID); \
resetNet(); \ resetNet(); \
if (m_nxdn->m_network != nullptr) \ if (m_nxdn->m_network != nullptr) \
m_nxdn->m_network->resetNXDN(); \ m_nxdn->m_network->resetNXDN(); \
@ -230,7 +232,8 @@ bool Voice::process(FuncChannelType::E fct, ChOption::E option, uint8_t* data, u
// don't process RF frames if this modem isn't authoritative // don't process RF frames if this modem isn't authoritative
if (!m_nxdn->m_authoritative && m_nxdn->m_permittedDstId != dstId) { if (!m_nxdn->m_authoritative && m_nxdn->m_permittedDstId != dstId) {
if (m_nxdn->m_rfState != RS_RF_AUDIO) { if (m_nxdn->m_rfState != RS_RF_AUDIO) {
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!"); if (!g_disableNonAuthoritativeLogging)
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!");
m_nxdn->m_rfState = RS_RF_LISTENING; m_nxdn->m_rfState = RS_RF_LISTENING;
m_nxdn->m_rfMask = 0x00U; m_nxdn->m_rfMask = 0x00U;
m_nxdn->m_rfLC.reset(); m_nxdn->m_rfLC.reset();
@ -681,7 +684,8 @@ bool Voice::processNetwork(FuncChannelType::E fct, ChOption::E option, lc::RTCH&
if (!m_nxdn->m_authoritative && m_nxdn->m_permittedDstId != dstId) { if (!m_nxdn->m_authoritative && m_nxdn->m_permittedDstId != dstId) {
if (m_nxdn->m_netState != RS_NET_AUDIO) { if (m_nxdn->m_netState != RS_NET_AUDIO) {
// bryanb: do we want to log this condition? // bryanb: do we want to log this condition?
//LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted!"); //if (!g_disableNonAuthoritativeLogging)
// LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted!");
m_nxdn->m_netState = RS_NET_IDLE; m_nxdn->m_netState = RS_NET_IDLE;
m_nxdn->m_netMask = 0x00U; m_nxdn->m_netMask = 0x00U;
m_nxdn->m_netLC.reset(); m_nxdn->m_netLC.reset();

@ -1436,12 +1436,14 @@ void Control::processNetwork()
} }
// perform grant response logic // perform grant response logic
m_control->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, !unitToUnit, true);
/*
if (!m_control->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, !unitToUnit, true)) if (!m_control->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, !unitToUnit, true))
{ {
LogError(LOG_NET, P25_TSDU_STR " call failure, network call not granted, dstId = %u", dstId); LogError(LOG_NET, P25_TSDU_STR " call rejected, network call not granted, dstId = %u", dstId);
return; return;
} }
*/
return; return;
} }

@ -2179,6 +2179,15 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_
} }
if (!m_p25->m_affiliations.isGranted(dstId)) { if (!m_p25->m_affiliations.isGranted(dstId)) {
// is this an affiliation required group?
::lookups::TalkgroupRuleGroupVoice tid = m_p25->m_tidLookup->find(dstId);
if (tid.config().affiliated()) {
if (!m_p25->m_affiliations.hasGroupAff(dstId)) {
LogWarning(LOG_NET, P25_TSDU_STR ", TSBKO, IOSP_GRP_VCH (Group Voice Channel Request) ignored, no group affiliations, dstId = %u", dstId);
return false;
}
}
if (!m_p25->m_affiliations.rfCh()->isRFChAvailable()) { if (!m_p25->m_affiliations.rfCh()->isRFChAvailable()) {
if (grp) { if (grp) {
if (!net) { if (!net) {

@ -21,6 +21,7 @@
#include "common/Utils.h" #include "common/Utils.h"
#include "p25/packet/Voice.h" #include "p25/packet/Voice.h"
#include "ActivityLog.h" #include "ActivityLog.h"
#include "HostMain.h"
using namespace p25; using namespace p25;
using namespace p25::defines; using namespace p25::defines;
@ -134,7 +135,8 @@ bool Voice::process(uint8_t* data, uint32_t len)
// don't process RF frames if this modem isn't authoritative // don't process RF frames if this modem isn't authoritative
if (!m_p25->m_authoritative && m_p25->m_permittedDstId != lc.getDstId()) { if (!m_p25->m_authoritative && m_p25->m_permittedDstId != lc.getDstId()) {
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!"); if (!g_disableNonAuthoritativeLogging)
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!");
resetRF(); resetRF();
m_p25->m_rfState = RS_RF_LISTENING; m_p25->m_rfState = RS_RF_LISTENING;
return false; return false;
@ -220,7 +222,8 @@ bool Voice::process(uint8_t* data, uint32_t len)
// don't process RF frames if this modem isn't authoritative // don't process RF frames if this modem isn't authoritative
if (!m_p25->m_authoritative && m_p25->m_permittedDstId != lc.getDstId()) { if (!m_p25->m_authoritative && m_p25->m_permittedDstId != lc.getDstId()) {
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!"); if (!g_disableNonAuthoritativeLogging)
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!");
resetRF(); resetRF();
m_p25->m_rfState = RS_RF_LISTENING; m_p25->m_rfState = RS_RF_LISTENING;
return false; return false;
@ -587,7 +590,8 @@ bool Voice::process(uint8_t* data, uint32_t len)
if (m_p25->m_rfState == RS_RF_AUDIO) { if (m_p25->m_rfState == RS_RF_AUDIO) {
// don't process RF frames if this modem isn't authoritative // don't process RF frames if this modem isn't authoritative
if (!m_p25->m_authoritative && m_p25->m_permittedDstId != m_rfLC.getDstId()) { if (!m_p25->m_authoritative && m_p25->m_permittedDstId != m_rfLC.getDstId()) {
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!"); if (!g_disableNonAuthoritativeLogging)
LogWarning(LOG_RF, "[NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted!");
resetRF(); resetRF();
m_p25->m_rfState = RS_RF_LISTENING; m_p25->m_rfState = RS_RF_LISTENING;
return false; return false;
@ -1164,7 +1168,8 @@ bool Voice::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L
// don't process network frames if this modem isn't authoritative // don't process network frames if this modem isn't authoritative
if (!m_p25->m_authoritative && m_p25->m_permittedDstId != dstId) { if (!m_p25->m_authoritative && m_p25->m_permittedDstId != dstId) {
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted, dstId = %u", dstId); if (!g_disableNonAuthoritativeLogging)
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic, destination not permitted, dstId = %u", dstId);
resetNet(); resetNet();
if (m_p25->m_network != nullptr) if (m_p25->m_network != nullptr)
m_p25->m_network->resetP25(); m_p25->m_network->resetP25();
@ -1678,7 +1683,7 @@ void Voice::writeNet_LDU1()
(m_netLC.getPriority() & 0x07U); // Priority (m_netLC.getPriority() & 0x07U); // Priority
if (!m_p25->m_control->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, group, true)) { if (!m_p25->m_control->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, group, true)) {
LogError(LOG_NET, P25_HDU_STR " call failure, network call not granted, dstId = %u", dstId); LogError(LOG_NET, P25_HDU_STR " call rejected, network call not granted, dstId = %u", dstId);
if ((!m_p25->m_networkWatchdog.isRunning() || m_p25->m_networkWatchdog.hasExpired()) && if ((!m_p25->m_networkWatchdog.isRunning() || m_p25->m_networkWatchdog.hasExpired()) &&
m_p25->m_netLastDstId != 0U) { m_p25->m_netLastDstId != 0U) {
@ -1929,7 +1934,8 @@ void Voice::writeNet_LDU2()
// don't process network frames if this modem isn't authoritative // don't process network frames if this modem isn't authoritative
if (!m_p25->m_authoritative && m_p25->m_permittedDstId != dstId) { if (!m_p25->m_authoritative && m_p25->m_permittedDstId != dstId) {
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic (LDU2), destination not permitted!"); if (!g_disableNonAuthoritativeLogging)
LogWarning(LOG_NET, "[NON-AUTHORITATIVE] Ignoring network traffic (LDU2), destination not permitted!");
resetNet(); resetNet();
return; return;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.