ignore affiliation checks for ISSI-type peers, they are excluded from affiliation rule checking;

pull/51/head
Bryan Biedenkapp 2 years ago
parent 94da264f55
commit 096efcef1a

@ -281,7 +281,7 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
// is coming from a external peer
if (dstPeerId != peerId) {
// is this peer ignored?
if (!isPeerPermitted(dstPeerId, dmrData, streamId)) {
if (!isPeerPermitted(dstPeerId, dmrData, streamId, true)) {
continue;
}
@ -558,8 +558,9 @@ bool TagDMRData::processCSBK(uint8_t* buffer, uint32_t peerId, dmr::data::Data&
/// <param name="peerId">Peer ID</param>
/// <param name="data"></param>
/// <param name="streamId">Stream ID</param>
/// <param name="external"></param>
/// <returns></returns>
bool TagDMRData::isPeerPermitted(uint32_t peerId, data::Data& data, uint32_t streamId)
bool TagDMRData::isPeerPermitted(uint32_t peerId, data::Data& data, uint32_t streamId, bool external)
{
// private calls are always permitted
if (data.getDataType() == FLCO_PRIVATE) {
@ -590,7 +591,8 @@ bool TagDMRData::isPeerPermitted(uint32_t peerId, data::Data& data, uint32_t str
}
// is this a TG that requires affiliations to repeat?
if (tg.config().affiliated()) {
// NOTE: external peers *always* repeat traffic regardless of affiliation
if (tg.config().affiliated() && !external) {
// check the affiliations for this peer to see if we can repeat traffic
lookups::AffiliationLookup* aff = m_network->m_peerAffiliations[peerId];
if (aff == nullptr) {

@ -81,7 +81,7 @@ namespace network
bool processCSBK(uint8_t* buffer, uint32_t peerId, dmr::data::Data& dmrData);
/// <summary>Helper to determine if the peer is permitted for traffic.</summary>
bool isPeerPermitted(uint32_t peerId, dmr::data::Data& data, uint32_t streamId);
bool isPeerPermitted(uint32_t peerId, dmr::data::Data& data, uint32_t streamId, bool external = false);
/// <summary>Helper to validate the DMR call stream.</summary>
bool validate(uint32_t peerId, dmr::data::Data& data, uint32_t streamId);

@ -248,7 +248,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
// is coming from a external peer
if (dstPeerId != peerId) {
// is this peer ignored?
if (!isPeerPermitted(dstPeerId, lc, messageType, streamId)) {
if (!isPeerPermitted(dstPeerId, lc, messageType, streamId, true)) {
continue;
}
@ -391,8 +391,9 @@ bool TagNXDNData::peerRewrite(uint32_t peerId, uint32_t& dstId, bool outbound)
/// <param name="lc"></param>
/// <param name="messageType"></param>
/// <param name="streamId">Stream ID</param>
/// <param name="external"></param>
/// <returns></returns>
bool TagNXDNData::isPeerPermitted(uint32_t peerId, lc::RTCH& lc, uint8_t messageType, uint32_t streamId)
bool TagNXDNData::isPeerPermitted(uint32_t peerId, lc::RTCH& lc, uint8_t messageType, uint32_t streamId, bool external)
{
// private calls are always permitted
if (!lc.getGroup()) {
@ -423,7 +424,8 @@ bool TagNXDNData::isPeerPermitted(uint32_t peerId, lc::RTCH& lc, uint8_t message
}
// is this a TG that requires affiliations to repeat?
if (tg.config().affiliated()) {
// NOTE: external peers *always* repeat traffic regardless of affiliation
if (tg.config().affiliated() && !external) {
// check the affiliations for this peer to see if we can repeat traffic
lookups::AffiliationLookup* aff = m_network->m_peerAffiliations[peerId];
if (aff == nullptr) {

@ -72,7 +72,7 @@ namespace network
bool peerRewrite(uint32_t peerId, uint32_t& dstId, bool outbound = true);
/// <summary>Helper to determine if the peer is permitted for traffic.</summary>
bool isPeerPermitted(uint32_t peerId, nxdn::lc::RTCH& lc, uint8_t messageType, uint32_t streamId);
bool isPeerPermitted(uint32_t peerId, nxdn::lc::RTCH& lc, uint8_t messageType, uint32_t streamId, bool external = false);
/// <summary>Helper to validate the NXDN call stream.</summary>
bool validate(uint32_t peerId, nxdn::lc::RTCH& control, uint8_t messageType, uint32_t streamId);

@ -311,7 +311,7 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
// is coming from a external peer
if (dstPeerId != peerId) {
// is this peer ignored?
if (!isPeerPermitted(dstPeerId, control, duid, streamId)) {
if (!isPeerPermitted(dstPeerId, control, duid, streamId, true)) {
continue;
}
@ -734,8 +734,9 @@ bool TagP25Data::processTSDUToExternal(uint8_t* buffer, uint32_t srcPeerId, uint
/// <param name="control"></param>
/// <param name="duid"></param>
/// <param name="streamId">Stream ID</param>
/// <param name="external"></param>
/// <returns></returns>
bool TagP25Data::isPeerPermitted(uint32_t peerId, lc::LC& control, uint8_t duid, uint32_t streamId)
bool TagP25Data::isPeerPermitted(uint32_t peerId, lc::LC& control, uint8_t duid, uint32_t streamId, bool external)
{
// private calls are always permitted
if (control.getLCO() == LC_PRIVATE) {
@ -773,7 +774,8 @@ bool TagP25Data::isPeerPermitted(uint32_t peerId, lc::LC& control, uint8_t duid,
}
// is this a TG that requires affiliations to repeat?
if (tg.config().affiliated()) {
// NOTE: external peers *always* repeat traffic regardless of affiliation
if (tg.config().affiliated() && !external) {
// check the affiliations for this peer to see if we can repeat traffic
lookups::AffiliationLookup* aff = m_network->m_peerAffiliations[peerId];
if (aff == nullptr) {

@ -94,7 +94,7 @@ namespace network
bool processTSDUToExternal(uint8_t* buffer, uint32_t srcPeerId, uint32_t dstPeerId, uint8_t duid);
/// <summary>Helper to determine if the peer is permitted for traffic.</summary>
bool isPeerPermitted(uint32_t peerId, p25::lc::LC& control, uint8_t duid, uint32_t streamId);
bool isPeerPermitted(uint32_t peerId, p25::lc::LC& control, uint8_t duid, uint32_t streamId, bool external = false);
/// <summary>Helper to validate the P25 call stream.</summary>
bool validate(uint32_t peerId, p25::lc::LC& control, uint8_t duid, const p25::lc::TSBK* tsbk, uint32_t streamId);

Loading…
Cancel
Save

Powered by TurnKey Linux.