add support to grant demand to support denying a grant and supporting unit to unit; better support LOC_REG_RSP being sent over the network;

pull/41/head 2023-09-05
Bryan Biedenkapp 2 years ago
parent a09338f57d
commit 5c371c97cb

@ -1111,6 +1111,8 @@ void Control::processNetwork()
} }
bool grantDemand = (buffer[14U] & 0x80U) == 0x80U; bool grantDemand = (buffer[14U] & 0x80U) == 0x80U;
bool grantDenial = (buffer[14U] & 0x40U) == 0x40U;
bool unitToUnit = (buffer[14U] & 0x01U) == 0x01U;
// process network message header // process network message header
uint8_t duid = buffer[22U]; uint8_t duid = buffer[22U];
@ -1283,7 +1285,15 @@ void Control::processNetwork()
LogMessage(LOG_NET, P25_TSDU_STR " remote grant demand, srcId = %u, dstId = %u", srcId, dstId); LogMessage(LOG_NET, P25_TSDU_STR " remote grant demand, srcId = %u, dstId = %u", srcId, dstId);
} }
if (!m_control->writeRF_TSDU_Grant(srcId, dstId, serviceOptions, true, true)) { // are we denying the grant?
if (grantDenial) {
m_control->writeRF_TSDU_Deny(srcId, dstId, P25_DENY_RSN_PTT_COLLIDE, (!unitToUnit) ? TSBK_IOSP_GRP_VCH : TSBK_IOSP_UU_VCH);
return;
}
// perform grant response logic
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 failure, network call not granted, dstId = %u", dstId);
return; return;
} }

@ -2726,11 +2726,14 @@ bool ControlSignaling::writeRF_TSDU_Loc_Reg_Rsp(uint32_t srcId, uint32_t dstId,
osp->setDstId(dstId); osp->setDstId(dstId);
osp->setSrcId(srcId); osp->setSrcId(srcId);
bool noNet = false;
// validate the source RID // validate the source RID
if (!acl::AccessControl::validateSrcId(srcId)) { if (!acl::AccessControl::validateSrcId(srcId)) {
LogWarning(LOG_RF, P25_TSDU_STR ", %s denial, RID rejection, srcId = %u", osp->toString().c_str(), srcId); LogWarning(LOG_RF, P25_TSDU_STR ", %s denial, RID rejection, srcId = %u", osp->toString().c_str(), srcId);
::ActivityLog("P25", true, "location registration request from %u denied", srcId); ::ActivityLog("P25", true, "location registration request from %u denied", srcId);
osp->setResponse(P25_RSP_REFUSED); osp->setResponse(P25_RSP_REFUSED);
noNet = true;
} }
// validate the source RID is registered // validate the source RID is registered
@ -2751,6 +2754,7 @@ bool ControlSignaling::writeRF_TSDU_Loc_Reg_Rsp(uint32_t srcId, uint32_t dstId,
LogWarning(LOG_RF, P25_TSDU_STR ", %s denial, TGID rejection, dstId = %u", osp->toString().c_str(), dstId); LogWarning(LOG_RF, P25_TSDU_STR ", %s denial, TGID rejection, dstId = %u", osp->toString().c_str(), dstId);
::ActivityLog("P25", true, "location registration request from %u to %s %u denied", srcId, "TG ", dstId); ::ActivityLog("P25", true, "location registration request from %u to %s %u denied", srcId, "TG ", dstId);
osp->setResponse(P25_RSP_DENY); osp->setResponse(P25_RSP_DENY);
noNet = true;
} }
} }
} }
@ -2764,7 +2768,7 @@ bool ControlSignaling::writeRF_TSDU_Loc_Reg_Rsp(uint32_t srcId, uint32_t dstId,
ret = true; ret = true;
} }
writeRF_TSDU_SBF_Imm(osp.get(), false); writeRF_TSDU_SBF_Imm(osp.get(), noNet);
return ret; return ret;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.