add support to optionally demand a SU perform a full registration with a site if a affiliation request is refused;

pull/83/head
Bryan Biedenkapp 12 months ago
parent 560ef40dca
commit 89210c05aa

@ -225,6 +225,8 @@ protocols:
legacyGroupReg: false legacyGroupReg: false
# Flag indicating the host should send a network grant demand TDU for conventional traffic. # Flag indicating the host should send a network grant demand TDU for conventional traffic.
convNetGrantDemand: false convNetGrantDemand: false
# Flag indicating the host should demand a full unit registration for a refused affiliation request.
demandUnitRegForRefusedAff: true
# Flag indicating the host should verify group affiliation. # Flag indicating the host should verify group affiliation.
verifyAff: false verifyAff: false
# Flag indicating the host should verify unit registration. # Flag indicating the host should verify unit registration.

@ -5,7 +5,7 @@
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* Copyright (C) 2016,2017,2018 Jonathan Naylor, G4KLX * Copyright (C) 2016,2017,2018 Jonathan Naylor, G4KLX
* Copyright (C) 2017-2024 Bryan Biedenkapp, N2PLL * Copyright (C) 2017-2025 Bryan Biedenkapp, N2PLL
* *
*/ */
#include "Defines.h" #include "Defines.h"
@ -78,6 +78,7 @@ Control::Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t q
m_convNetGrantDemand(false), m_convNetGrantDemand(false),
m_sndcpSupport(false), m_sndcpSupport(false),
m_ignoreAffiliationCheck(false), m_ignoreAffiliationCheck(false),
m_demandUnitRegForRefusedAff(true),
m_idenTable(idenTable), m_idenTable(idenTable),
m_ridLookup(ridLookup), m_ridLookup(ridLookup),
m_tidLookup(tidLookup), m_tidLookup(tidLookup),
@ -267,6 +268,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw
m_sndcpSupport = p25Protocol["sndcpSupport"].as<bool>(false); m_sndcpSupport = p25Protocol["sndcpSupport"].as<bool>(false);
m_ignoreAffiliationCheck = p25Protocol["ignoreAffiliationCheck"].as<bool>(false); m_ignoreAffiliationCheck = p25Protocol["ignoreAffiliationCheck"].as<bool>(false);
m_demandUnitRegForRefusedAff = p25Protocol["demandUnitRegForRefusedAff"].as<bool>(true);
yaml::Node control = p25Protocol["control"]; yaml::Node control = p25Protocol["control"];
m_enableControl = control["enable"].as<bool>(false); m_enableControl = control["enable"].as<bool>(false);
@ -488,6 +490,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw
LogInfo(" Unit-to-Unit Availability Check: %s", m_control->m_unitToUnitAvailCheck ? "yes" : "no"); LogInfo(" Unit-to-Unit Availability Check: %s", m_control->m_unitToUnitAvailCheck ? "yes" : "no");
LogInfo(" Explicit Source ID Support: %s", m_allowExplicitSourceId ? "yes" : "no"); LogInfo(" Explicit Source ID Support: %s", m_allowExplicitSourceId ? "yes" : "no");
LogInfo(" Conventional Network Grant Demand: %s", m_convNetGrantDemand ? "yes" : "no"); LogInfo(" Conventional Network Grant Demand: %s", m_convNetGrantDemand ? "yes" : "no");
LogInfo(" Demand Unit Registration for Refused Affiliation: %s", m_demandUnitRegForRefusedAff ? "yes" : "no");
if (disableUnitRegTimeout) { if (disableUnitRegTimeout) {
LogInfo(" Disable Unit Registration Timeout: yes"); LogInfo(" Disable Unit Registration Timeout: yes");

@ -5,7 +5,7 @@
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* Copyright (C) 2016,2017 Jonathan Naylor, G4KLX * Copyright (C) 2016,2017 Jonathan Naylor, G4KLX
* Copyright (C) 2017-2024 Bryan Biedenkapp, N2PLL * Copyright (C) 2017-2025 Bryan Biedenkapp, N2PLL
* *
*/ */
/** /**
@ -308,6 +308,7 @@ namespace p25
bool m_convNetGrantDemand; bool m_convNetGrantDemand;
bool m_sndcpSupport; bool m_sndcpSupport;
bool m_ignoreAffiliationCheck; bool m_ignoreAffiliationCheck;
bool m_demandUnitRegForRefusedAff;
::lookups::IdenTableLookup* m_idenTable; ::lookups::IdenTableLookup* m_idenTable;
::lookups::RadioIdLookup* m_ridLookup; ::lookups::RadioIdLookup* m_ridLookup;

@ -4,7 +4,7 @@
* GPLv2 Open Source. Use is subject to license terms. * GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* Copyright (C) 2017-2024 Bryan Biedenkapp, N2PLL * Copyright (C) 2017-2025 Bryan Biedenkapp, N2PLL
* Copyright (C) 2022 Jason-UWU * Copyright (C) 2022 Jason-UWU
* *
*/ */
@ -540,7 +540,11 @@ bool ControlSignaling::process(uint8_t* data, uint32_t len, std::unique_ptr<lc::
writeRF_TSDU_ACK_FNE(srcId, TSBKO::IOSP_GRP_AFF, true, true); writeRF_TSDU_ACK_FNE(srcId, TSBKO::IOSP_GRP_AFF, true, true);
} }
writeRF_TSDU_Grp_Aff_Rsp(srcId, dstId); if (writeRF_TSDU_Grp_Aff_Rsp(srcId, dstId) == ResponseCode::REFUSED) {
if (m_p25->m_demandUnitRegForRefusedAff) {
writeRF_TSDU_U_Reg_Cmd(srcId);
}
}
} }
break; break;
case TSBKO::ISP_GRP_AFF_Q_RSP: case TSBKO::ISP_GRP_AFF_Q_RSP:
@ -2637,10 +2641,8 @@ void ControlSignaling::writeRF_TSDU_Deny(uint32_t srcId, uint32_t dstId, uint8_t
/* Helper to write a group affiliation response packet. */ /* Helper to write a group affiliation response packet. */
bool ControlSignaling::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId) uint8_t ControlSignaling::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId)
{ {
bool ret = false;
std::unique_ptr<IOSP_GRP_AFF> iosp = std::make_unique<IOSP_GRP_AFF>(); std::unique_ptr<IOSP_GRP_AFF> iosp = std::make_unique<IOSP_GRP_AFF>();
iosp->setMFId(m_lastMFID); iosp->setMFId(m_lastMFID);
iosp->setAnnounceGroup(m_announcementGroup); iosp->setAnnounceGroup(m_announcementGroup);
@ -2714,7 +2716,6 @@ bool ControlSignaling::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId)
} }
::ActivityLog("P25", true, "group affiliation request from %u to %s %u", srcId, "TG ", dstId); ::ActivityLog("P25", true, "group affiliation request from %u to %s %u", srcId, "TG ", dstId);
ret = true;
// update dynamic affiliation table // update dynamic affiliation table
m_p25->m_affiliations.groupAff(srcId, dstId); m_p25->m_affiliations.groupAff(srcId, dstId);
@ -2724,7 +2725,7 @@ bool ControlSignaling::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId)
} }
writeRF_TSDU_SBF_Imm(iosp.get(), noNet); writeRF_TSDU_SBF_Imm(iosp.get(), noNet);
return ret; return iosp->getResponse();
} }
/* Helper to write a unit registration response packet. */ /* Helper to write a unit registration response packet. */

@ -4,7 +4,7 @@
* GPLv2 Open Source. Use is subject to license terms. * GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* Copyright (C) 2017-2024 Bryan Biedenkapp, N2PLL * Copyright (C) 2017-2025 Bryan Biedenkapp, N2PLL
* *
*/ */
/** /**
@ -364,8 +364,9 @@ namespace p25
* @brief Helper to write a group affiliation response packet. * @brief Helper to write a group affiliation response packet.
* @param srcId Source Radio ID. * @param srcId Source Radio ID.
* @param dstId Destination ID. * @param dstId Destination ID.
* @returns uint8_t Grant response code.
*/ */
bool writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId); uint8_t writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId);
/** /**
* @brief Helper to write a unit registration response packet. * @brief Helper to write a unit registration response packet.
* @param srcId Source Radio ID. * @param srcId Source Radio ID.

@ -409,7 +409,7 @@ bool Voice::process(uint8_t* data, uint32_t len)
// are we auto-registering legacy radios to groups? // are we auto-registering legacy radios to groups?
if (m_p25->m_legacyGroupReg && group) { if (m_p25->m_legacyGroupReg && group) {
if (!m_p25->m_affiliations.isGroupAff(srcId, dstId)) { if (!m_p25->m_affiliations.isGroupAff(srcId, dstId)) {
if (!m_p25->m_control->writeRF_TSDU_Grp_Aff_Rsp(srcId, dstId)) { if (m_p25->m_control->writeRF_TSDU_Grp_Aff_Rsp(srcId, dstId) != ResponseCode::ACCEPT) {
LogWarning(LOG_RF, P25_HDU_STR " denial, conventional affiliation required, not affiliated to TGID, srcId = %u, dstId = %u", srcId, dstId); LogWarning(LOG_RF, P25_HDU_STR " denial, conventional affiliation required, not affiliated to TGID, srcId = %u, dstId = %u", srcId, dstId);
m_p25->m_rfLastDstId = 0U; m_p25->m_rfLastDstId = 0U;
m_p25->m_rfLastSrcId = 0U; m_p25->m_rfLastSrcId = 0U;

Loading…
Cancel
Save

Powered by TurnKey Linux.