@ -1072,7 +1072,7 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const
skipRidCheck = true ;
}
LogDebug ( LOG_NET , " P25, duid = $%02X, mfId = $%02X, lco = $%02X, srcId = %u, dstId = %u " , duid , control . getMFId ( ) , control . getLCO ( ) , control . getSrcId ( ) , control . getDstId ( ) ) ;
//LogDebug(LOG_NET, " P25, duid = $%02X, mfId = $%02X, lco = $%02X, srcId = %u, dstId = %u", duid, control.getMFId(), control.getLCO(), control.getSrcId(), control.getDstId());
// is the source ID a blacklisted ID?
if ( ! skipRidCheck ) {
@ -1249,6 +1249,16 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const
return false ;
}
// peer always send list takes priority over any following affiliation rules
bool isAlwaysPeer = false ;
std : : vector < uint32_t > alwaysSend = tg . config ( ) . alwaysSend ( ) ;
if ( alwaysSend . size ( ) > 0 ) {
auto it = std : : find ( alwaysSend . begin ( ) , alwaysSend . end ( ) , peerId ) ;
if ( it ! = alwaysSend . end ( ) ) {
isAlwaysPeer = true ; // skip any following checks and always send traffic
}
}
// is the TGID active?
if ( ! tg . config ( ) . active ( ) ) {
// report error event to InfluxDB
@ -1269,6 +1279,8 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const
return false ;
}
// always peers can violate the rules...hurray
if ( ! isAlwaysPeer ) {
// does the TGID have a permitted RID list?
if ( tg . config ( ) . permittedRIDs ( ) . size ( ) > 0 ) {
// does the transmitting RID have permission?
@ -1292,11 +1304,11 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const
return false ;
}
}
}
return true ;
}
/* Helper to write a grant packet. */
bool TagP25Data : : write_TSDU_Grant ( uint32_t peerId , uint32_t srcId , uint32_t dstId , uint8_t serviceOptions , bool grp )