Commit 9b20fb79 authored by aligungr's avatar aligungr

UAC implementation

parent 1a6d3c28
...@@ -73,112 +73,109 @@ bool NasMm::isInNonAllowedArea() ...@@ -73,112 +73,109 @@ bool NasMm::isInNonAllowedArea()
return false; return false;
} }
std::bitset<16> NasMm::determineAccessIdentities() void NasMm::performUac()
{ {
std::bitset<16> ais; auto accessIdentities = [this]() {
std::bitset<16> ais;
auto currentPlmn = m_base->shCtx.getCurrentPlmn(); auto currentPlmn = m_base->shCtx.getCurrentPlmn();
if (m_base->config->uacAic.mps && m_rmState == ERmState::RM_REGISTERED && currentPlmn.hasValue()) if (m_base->config->uacAic.mps && m_rmState == ERmState::RM_REGISTERED && currentPlmn.hasValue())
{
if (currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn) ||
currentPlmn.mcc == m_base->config->hplmn.mcc)
{ {
ais[1] = true; if (currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn) ||
currentPlmn.mcc == m_base->config->hplmn.mcc)
ais[1] = true;
} }
}
if (m_base->config->uacAic.mcs && m_rmState == ERmState::RM_REGISTERED && currentPlmn.hasValue()) if (m_base->config->uacAic.mcs && m_rmState == ERmState::RM_REGISTERED && currentPlmn.hasValue())
{
if (currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn) ||
currentPlmn.mcc == m_base->config->hplmn.mcc)
{ {
ais[2] = true; if (currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn) ||
currentPlmn.mcc == m_base->config->hplmn.mcc)
ais[2] = true;
} }
}
if (m_nwFeatureSupport) if (m_nwFeatureSupport)
{ {
if (m_nwFeatureSupport->mpsi == nas::EMpsIndicator::SUPPORTED) if (m_nwFeatureSupport->mpsi == nas::EMpsIndicator::SUPPORTED)
ais[1] = true; ais[1] = true;
if (m_nwFeatureSupport->mcsi && m_nwFeatureSupport->mcsi == nas::EMcsIndicator::VALID) if (m_nwFeatureSupport->mcsi && m_nwFeatureSupport->mcsi == nas::EMcsIndicator::VALID)
ais[2] = true; ais[2] = true;
} }
if (currentPlmn.hasValue() && if (currentPlmn.hasValue() &&
(currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn))) (currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn)))
{ {
ais[11] = true; ais[11] = true;
ais[15] = true; ais[15] = true;
} }
if (currentPlmn.hasValue() && if (currentPlmn.hasValue() &&
(currentPlmn == m_base->config->hplmn || currentPlmn.mcc == m_base->config->hplmn.mcc)) (currentPlmn == m_base->config->hplmn || currentPlmn.mcc == m_base->config->hplmn.mcc))
{ {
ais[12] = true; ais[12] = true;
ais[13] = true; ais[13] = true;
ais[14] = true; ais[14] = true;
} }
if (ais.none()) if (ais.none())
ais[0] = true; ais[0] = true;
return ais; return ais;
} }();
int NasMm::determineAccessCategory() auto accessCategory = [this]() {
{ /* Check for Rule #1 */
/* Check for Rule #1 */ if (m_procCtl.mobilityRegistration)
if (m_procCtl.mobilityRegistration)
{
if (m_procCtl.mobilityRegistration == ERegUpdateCause::PAGING_OR_NOTIFICATION)
{ {
return 0; if (m_procCtl.mobilityRegistration == ERegUpdateCause::PAGING_OR_NOTIFICATION)
{
return 0;
}
} }
}
if (m_procCtl.serviceRequest) if (m_procCtl.serviceRequest)
{
if (m_procCtl.serviceRequest == EServiceReqCause::IDLE_PAGING ||
m_procCtl.serviceRequest == EServiceReqCause::CONNECTED_3GPP_NOTIFICATION_N3GPP ||
m_procCtl.serviceRequest == EServiceReqCause::IDLE_3GPP_NOTIFICATION_N3GPP)
{ {
return 0; if (m_procCtl.serviceRequest == EServiceReqCause::IDLE_PAGING ||
m_procCtl.serviceRequest == EServiceReqCause::CONNECTED_3GPP_NOTIFICATION_N3GPP ||
m_procCtl.serviceRequest == EServiceReqCause::IDLE_3GPP_NOTIFICATION_N3GPP)
{
return 0;
}
} }
}
/* Check for Rule #2 */ /* Check for Rule #2 */
if (hasEmergency()) if (hasEmergency())
return 2; return 2;
/* Check for Rule #3 */ /* Check for Rule #3 */
// TODO: Operator defined access category not supported // TODO: Operator defined access category not supported
/* Check for Rule #4 */ /* Check for Rule #4 */
// TODO: Access attempt for delay tolerant service // TODO: Access attempt for delay tolerant service
/* Check for Rule #5 */ /* Check for Rule #5 */
// TODO: MO MMTel voice call // TODO: MO MMTel voice call
/* Check for Rule #6 */ /* Check for Rule #6 */
// TODO: MO MMTel video call // TODO: MO MMTel video call
/* Check for Rule #7 */ /* Check for Rule #7 */
// TODO: MO SMS over NAS or MO SMSoIP // TODO: MO SMS over NAS or MO SMSoIP
/* Check for Rule #8 */ /* Check for Rule #8 */
if (hasPendingProcedure() && !m_sm->anyUplinkDataPending()) if (hasPendingProcedure() && !m_sm->anyUplinkDataPending())
return 3; return 3;
/* Check for Rule #9 */ /* Check for Rule #9 */
if (hasPendingProcedure() && m_sm->anyUplinkDataPending()) if (hasPendingProcedure() && m_sm->anyUplinkDataPending())
return 7; return 7;
/* Check for Rule #10 */ /* Check for Rule #10 */
if (m_sm->anyUplinkDataPending()) if (m_sm->anyUplinkDataPending())
return 7; return 7;
return 0; return 0;
}();
} }
} // namespace nr::ue } // namespace nr::ue
...@@ -174,8 +174,7 @@ class NasMm ...@@ -174,8 +174,7 @@ class NasMm
bool hasEmergency(); bool hasEmergency();
void setN1Capability(bool enabled); void setN1Capability(bool enabled);
bool isInNonAllowedArea(); bool isInNonAllowedArea();
std::bitset<16> determineAccessIdentities(); void performUac();
int determineAccessCategory();
private: /* eCall */ private: /* eCall */
bool startECallInactivityIfNeeded(); bool startECallInactivityIfNeeded();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment