@ -12,7 +12,7 @@
//
/*
* Copyright ( C ) 2015 , 2016 , 2017 , 2018 Jonathan Naylor , G4KLX
* Copyright ( C ) 2017 - 202 2 by Bryan Biedenkapp N2PLL
* Copyright ( C ) 2017 - 202 3 by Bryan Biedenkapp N2PLL
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
@ -53,6 +53,17 @@ using namespace dmr::packet;
// Macros
// ---------------------------------------------------------------------------
# define CHECK_AUTHORITATIVE(_DST_ID) \
if ( ! m_slot - > m_authoritative & & m_slot - > m_permittedDstId ! = dstId ) { \
LogWarning ( LOG_RF , " [NON-AUTHORITATIVE] Ignoring RF traffic, destination not permitted! " ) ; \
return false ; \
}
# define CHECK_NET_AUTHORITATIVE(_DST_ID) \
if ( ! m_slot - > m_authoritative & & m_slot - > m_permittedDstId ! = dstId ) { \
return ; \
}
# define CHECK_TRAFFIC_COLLISION(_DST_ID) \
if ( m_slot - > m_netState ! = RS_NET_IDLE & & _DST_ID = = m_slot - > m_netLastDstId ) { \
LogWarning ( LOG_RF , " DMR Slot %u, Traffic collision detect, preempting new RF traffic to existing network traffic! " , m_slot - > m_slotNo ) ; \
@ -103,6 +114,7 @@ bool Voice::process(uint8_t* data, uint32_t len)
uint32_t dstId = lc - > getDstId ( ) ;
uint8_t flco = lc - > getFLCO ( ) ;
CHECK_AUTHORITATIVE ( dstId ) ;
CHECK_TRAFFIC_COLLISION ( dstId ) ;
// validate source RID
@ -477,6 +489,7 @@ bool Voice::process(uint8_t* data, uint32_t len)
uint32_t dstId = lc - > getDstId ( ) ;
uint8_t flco = lc - > getFLCO ( ) ;
CHECK_AUTHORITATIVE ( dstId ) ;
CHECK_TRAFFIC_COLLISION ( dstId ) ;
// validate the source RID
@ -638,6 +651,7 @@ void Voice::processNetwork(const data::Data& dmrData)
uint32_t dstId = lc - > getDstId ( ) ;
uint8_t flco = lc - > getFLCO ( ) ;
CHECK_NET_AUTHORITATIVE ( dstId ) ;
CHECK_TG_HANG ( dstId ) ;
if ( dstId ! = dmrData . getDstId ( ) | | srcId ! = dmrData . getSrcId ( ) | | flco ! = dmrData . getFLCO ( ) )
@ -721,6 +735,7 @@ void Voice::processNetwork(const data::Data& dmrData)
uint32_t srcId = lc - > getSrcId ( ) ;
uint32_t dstId = lc - > getDstId ( ) ;
CHECK_NET_AUTHORITATIVE ( dstId ) ;
CHECK_TG_HANG ( dstId ) ;
m_slot - > m_netLC = std : : move ( lc ) ;
@ -816,6 +831,8 @@ void Voice::processNetwork(const data::Data& dmrData)
uint32_t dstId = lc - > getDstId ( ) ;
uint32_t srcId = lc - > getSrcId ( ) ;
CHECK_NET_AUTHORITATIVE ( dstId ) ;
m_slot - > m_netLC = std : : move ( lc ) ;
// The standby LC data