Commit dc8bebb8 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 95e2f034
......@@ -241,8 +241,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED)
{
nas::utils::AddToPlmnList(m_usim->m_forbiddenPlmnList,
nas::utils::PlmnFrom(m_base->shCtx.getCurrentPlmn()));
m_storage->forbiddenPlmnList->add(m_base->shCtx.getCurrentPlmn());
}
if (cause == nas::EMmCause::TA_NOT_ALLOWED)
......
......@@ -85,7 +85,7 @@ void NasMm::performPlmnSelection()
{
if (plmn == m_base->config->hplmn)
continue; // If it's the HPLMN, it's already added above
if (nas::utils::PlmnListContains(m_usim->m_forbiddenPlmnList, plmn))
if (m_storage->forbiddenPlmnList->contains(plmn))
continue;
if (nas::utils::ServiceAreaListForbidsPlmn(m_storage->serviceAreaList->get(), nas::utils::PlmnFrom(plmn)))
continue;
......
......@@ -258,8 +258,8 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
// PLMN code that is already in the list of "forbidden PLMNs". ..
if (!hasEmergency())
{
for (auto &forbiddenPlmn : m_usim->m_forbiddenPlmnList.plmns)
m_storage->equivalentPlmnList->remove(nas::utils::PlmnFrom(forbiddenPlmn));
m_storage->forbiddenPlmnList->forEach(
[this](auto &forbiddenPlmn) { m_storage->equivalentPlmnList->remove(forbiddenPlmn); });
}
// .. in addition, the UE shall add to the stored list the PLMN code of the registered PLMN that sent the list
m_storage->equivalentPlmnList->add(m_base->shCtx.getCurrentPlmn());
......@@ -379,8 +379,8 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
// PLMN code that is already in the list of "forbidden PLMNs". ..
if (!hasEmergency())
{
for (auto &forbiddenPlmn : m_usim->m_forbiddenPlmnList.plmns)
m_storage->equivalentPlmnList->remove(nas::utils::PlmnFrom(forbiddenPlmn));
m_storage->forbiddenPlmnList->forEach(
[this](auto &forbiddenPlmn) { m_storage->equivalentPlmnList->remove(forbiddenPlmn); });
}
// .. in addition, the UE shall add to the stored list the PLMN code of the registered PLMN that sent the list
m_storage->equivalentPlmnList->add(m_base->shCtx.getCurrentPlmn());
......@@ -603,8 +603,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
{
nas::utils::AddToPlmnList(m_usim->m_forbiddenPlmnList,
nas::utils::PlmnFrom(m_base->shCtx.getCurrentPlmn()));
m_storage->forbiddenPlmnList->add(m_base->shCtx.getCurrentPlmn());
}
if (cause == nas::EMmCause::CONGESTION)
......@@ -764,7 +763,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
{
nas::utils::AddToPlmnList(m_usim->m_forbiddenPlmnList, nas::utils::PlmnFrom(m_base->shCtx.getCurrentPlmn()));
m_storage->forbiddenPlmnList->add(m_base->shCtx.getCurrentPlmn());
}
if (cause == nas::EMmCause::CONGESTION)
......
......@@ -306,7 +306,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
{
nas::utils::AddToPlmnList(m_usim->m_forbiddenPlmnList, nas::utils::PlmnFrom(m_base->shCtx.getCurrentPlmn()));
m_storage->forbiddenPlmnList->add(m_base->shCtx.getCurrentPlmn());
}
if (cause == nas::EMmCause::TA_NOT_ALLOWED)
......
......@@ -43,6 +43,8 @@ MmStorage::MmStorage(TaskBase *base) : m_base{base}
taiList = std::make_unique<nas::NasSlot<nas::IE5gsTrackingAreaIdentityList>>(0, std::nullopt);
equivalentPlmnList = std::make_unique<nas::NasList<Plmn>>(16, 0, std::nullopt);
forbiddenPlmnList = std::make_unique<nas::NasList<Plmn>>(16, 0, std::nullopt);
}
} // namespace nr::ue
\ No newline at end of file
......@@ -23,6 +23,7 @@ class MmStorage
std::unique_ptr<nas::NasSlot<nas::IE5gsMobileIdentity>> storedGuti;
std::unique_ptr<nas::NasList<Plmn>> equivalentPlmnList;
std::unique_ptr<nas::NasList<Plmn>> forbiddenPlmnList;
std::unique_ptr<nas::NasSlot<nas::IE5gsTrackingAreaIdentityList>> taiList;
std::unique_ptr<nas::NasSlot<Tai>> lastVisitedRegisteredTai;
......
......@@ -30,9 +30,6 @@ class Usim
// State related
E5UState m_uState{};
// Plmn related
nas::IEPlmnList m_forbiddenPlmnList{};
// Security related
std::unique_ptr<NasSecurityContext> m_currentNsCtx{};
std::unique_ptr<NasSecurityContext> m_nonCurrentNsCtx{};
......
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