Commit f7e87387 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 5f51d36f
...@@ -434,7 +434,7 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg) ...@@ -434,7 +434,7 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg)
// until switching off the UE or the UICC containing the USIM is removed // until switching off the UE or the UICC containing the USIM is removed
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
m_usim->m_nonCurrentNsCtx = {}; m_usim->m_nonCurrentNsCtx = {};
m_usim->invalidate(); m_usim->invalidate();
......
...@@ -49,11 +49,11 @@ void NasMm::receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &ms ...@@ -49,11 +49,11 @@ void NasMm::receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &ms
if (msg.taiList.has_value()) if (msg.taiList.has_value())
{ {
hasNewConfig = true; hasNewConfig = true;
m_usim->m_taiList = *msg.taiList;
m_storage->taiList->set(*msg.taiList);
Tai currentTai = m_base->shCtx.getCurrentTai(); Tai currentTai = m_base->shCtx.getCurrentTai();
if (currentTai.hasValue() && if (currentTai.hasValue() && nas::utils::TaiListContains(*msg.taiList, nas::VTrackingAreaIdentity{currentTai}))
nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{currentTai}))
m_storage->lastVisitedRegisteredTai->set(currentTai); m_storage->lastVisitedRegisteredTai->set(currentTai);
} }
......
...@@ -196,7 +196,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi ...@@ -196,7 +196,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
// enter the state 5GMM-DEREGISTERED.PLMN-SEARCH in order to perform a PLMN selection according to 3GPP // enter the state 5GMM-DEREGISTERED.PLMN-SEARCH in order to perform a PLMN selection according to 3GPP
// TS 23.122 [5]; otherwise the UE shall enter the state 5GMM-DEREGISTERED.ATTEMPTING-REGISTRATION." // TS 23.122 [5]; otherwise the UE shall enter the state 5GMM-DEREGISTERED.ATTEMPTING-REGISTRATION."
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_equivalentPlmnList = {}; m_usim->m_equivalentPlmnList = {};
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
...@@ -220,7 +220,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi ...@@ -220,7 +220,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
switchUState(E5UState::U3_ROAMING_NOT_ALLOWED); switchUState(E5UState::U3_ROAMING_NOT_ALLOWED);
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
m_usim->m_nonCurrentNsCtx = {}; m_usim->m_nonCurrentNsCtx = {};
} }
......
...@@ -91,7 +91,7 @@ bool NasMm::switchToECallInactivityIfNeeded() ...@@ -91,7 +91,7 @@ bool NasMm::switchToECallInactivityIfNeeded()
// Perform item c) in 5.5.3 // Perform item c) in 5.5.3
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_equivalentPlmnList = {}; m_usim->m_equivalentPlmnList = {};
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
......
...@@ -173,7 +173,7 @@ void NasMm::handleActiveCellChange() ...@@ -173,7 +173,7 @@ void NasMm::handleActiveCellChange()
else else
switchMmState(EMmSubState::MM_REGISTERED_PS); switchMmState(EMmSubState::MM_REGISTERED_PS);
if (!nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{currentTai})) if (!nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{currentTai}))
sendMobilityRegistration(ERegUpdateCause::ENTER_UNLISTED_TRACKING_AREA); sendMobilityRegistration(ERegUpdateCause::ENTER_UNLISTED_TRACKING_AREA);
else else
m_storage->lastVisitedRegisteredTai->set(currentTai); m_storage->lastVisitedRegisteredTai->set(currentTai);
...@@ -198,7 +198,7 @@ void NasMm::handleActiveCellChange() ...@@ -198,7 +198,7 @@ void NasMm::handleActiveCellChange()
else else
switchMmState(EMmSubState::MM_DEREGISTERED_PS); switchMmState(EMmSubState::MM_DEREGISTERED_PS);
if (nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{currentTai})) if (nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{currentTai}))
m_storage->lastVisitedRegisteredTai->set(currentTai); m_storage->lastVisitedRegisteredTai->set(currentTai);
} }
} }
......
...@@ -232,9 +232,10 @@ void NasMm::receiveRegistrationAccept(const nas::RegistrationAccept &msg) ...@@ -232,9 +232,10 @@ void NasMm::receiveRegistrationAccept(const nas::RegistrationAccept &msg)
void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg) void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
{ {
// Store the TAI list as a registration area // Store the TAI list as a registration area
m_usim->m_taiList = msg.taiList.value_or(nas::IE5gsTrackingAreaIdentityList{}); m_storage->taiList->set(msg.taiList.value_or(nas::IE5gsTrackingAreaIdentityList{}));
Tai currentTai = m_base->shCtx.getCurrentTai(); Tai currentTai = m_base->shCtx.getCurrentTai();
if (currentTai.hasValue() && nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{currentTai})) if (currentTai.hasValue() &&
nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{currentTai}))
m_storage->lastVisitedRegisteredTai->set(currentTai); m_storage->lastVisitedRegisteredTai->set(currentTai);
// Store the service area list // Store the service area list
...@@ -346,11 +347,10 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg ...@@ -346,11 +347,10 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
// list. If there is no TAI list received, the UE shall consider the old TAI list as valid." // list. If there is no TAI list received, the UE shall consider the old TAI list as valid."
if (msg.taiList.has_value()) if (msg.taiList.has_value())
{ {
m_usim->m_taiList = *msg.taiList; m_storage->taiList->set(*msg.taiList);
Tai currentTai = m_base->shCtx.getCurrentTai(); Tai currentTai = m_base->shCtx.getCurrentTai();
if (currentTai.hasValue() && if (currentTai.hasValue() && nas::utils::TaiListContains(*msg.taiList, nas::VTrackingAreaIdentity{currentTai}))
nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{currentTai}))
m_storage->lastVisitedRegisteredTai->set(currentTai); m_storage->lastVisitedRegisteredTai->set(currentTai);
} }
...@@ -529,7 +529,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg) ...@@ -529,7 +529,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
{ {
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
m_usim->m_nonCurrentNsCtx = {}; m_usim->m_nonCurrentNsCtx = {};
} }
...@@ -678,7 +678,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg ...@@ -678,7 +678,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
{ {
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
m_usim->m_nonCurrentNsCtx = {}; m_usim->m_nonCurrentNsCtx = {};
} }
...@@ -817,7 +817,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType) ...@@ -817,7 +817,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType)
{ {
// The UE shall delete 5G-GUTI, TAI list, last visited TAI, list of equivalent PLMNs and ngKSI, .. // The UE shall delete 5G-GUTI, TAI list, last visited TAI, list of equivalent PLMNs and ngKSI, ..
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_equivalentPlmnList = {}; m_usim->m_equivalentPlmnList = {};
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
...@@ -847,7 +847,8 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType) ...@@ -847,7 +847,8 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
if (m_regCounter < 5) if (m_regCounter < 5)
{ {
auto tai = m_base->shCtx.getCurrentTai(); auto tai = m_base->shCtx.getCurrentTai();
bool includedInTaiList = nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{tai}); bool includedInTaiList =
nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{tai});
// "If the TAI of the current serving cell is not included in the TAI list or the 5GS update status is different // "If the TAI of the current serving cell is not included in the TAI list or the 5GS update status is different
// to 5U1 UPDATED" // to 5U1 UPDATED"
......
...@@ -34,7 +34,8 @@ void NasMm::sendServiceRequest(EServiceReqCause reqCause) ...@@ -34,7 +34,8 @@ void NasMm::sendServiceRequest(EServiceReqCause reqCause)
m_logger->err("Service Request canceled, UE not in 5U1 UPDATED state"); m_logger->err("Service Request canceled, UE not in 5U1 UPDATED state");
return; return;
} }
if (!nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{m_base->shCtx.getCurrentTai()})) if (!nas::utils::TaiListContains(m_storage->taiList->get(),
nas::VTrackingAreaIdentity{m_base->shCtx.getCurrentTai()}))
{ {
m_logger->err("Service Request canceled, current TAI is not in the TAI list"); m_logger->err("Service Request canceled, current TAI is not in the TAI list");
return; return;
...@@ -288,7 +289,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg) ...@@ -288,7 +289,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
{ {
m_storage->storedGuti->clear(); m_storage->storedGuti->clear();
m_storage->lastVisitedRegisteredTai->clear(); m_storage->lastVisitedRegisteredTai->clear();
m_usim->m_taiList = {}; m_storage->taiList->clear();
m_usim->m_currentNsCtx = {}; m_usim->m_currentNsCtx = {};
m_usim->m_nonCurrentNsCtx = {}; m_usim->m_nonCurrentNsCtx = {};
} }
...@@ -321,7 +322,8 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg) ...@@ -321,7 +322,8 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if (tai.hasValue()) if (tai.hasValue())
{ {
m_storage->forbiddenTaiListRoaming->add(tai); m_storage->forbiddenTaiListRoaming->add(tai);
nas::utils::RemoveFromTaiList(m_usim->m_taiList, nas::VTrackingAreaIdentity{tai}); m_storage->taiList->mutate(
[&tai](auto &value) { nas::utils::RemoveFromTaiList(value, nas::VTrackingAreaIdentity{tai}); });
} }
} }
......
...@@ -29,6 +29,8 @@ MmStorage::MmStorage(TaskBase *base) : m_base{base} ...@@ -29,6 +29,8 @@ MmStorage::MmStorage(TaskBase *base) : m_base{base}
storedGuti = std::make_unique<nas::NasSlot<nas::IE5gsMobileIdentity>>(0, std::nullopt); storedGuti = std::make_unique<nas::NasSlot<nas::IE5gsMobileIdentity>>(0, std::nullopt);
taiList = std::make_unique<nas::NasSlot<nas::IE5gsTrackingAreaIdentityList>>(0, std::nullopt);
lastVisitedRegisteredTai = std::make_unique<nas::NasSlot<Tai>>(0, std::nullopt); lastVisitedRegisteredTai = std::make_unique<nas::NasSlot<Tai>>(0, std::nullopt);
forbiddenTaiListRoaming = std::make_unique<nas::NasList<Tai>>( forbiddenTaiListRoaming = std::make_unique<nas::NasList<Tai>>(
......
...@@ -22,6 +22,7 @@ class MmStorage ...@@ -22,6 +22,7 @@ class MmStorage
std::unique_ptr<nas::NasSlot<nas::IE5gsMobileIdentity>> storedSuci; std::unique_ptr<nas::NasSlot<nas::IE5gsMobileIdentity>> storedSuci;
std::unique_ptr<nas::NasSlot<nas::IE5gsMobileIdentity>> storedGuti; std::unique_ptr<nas::NasSlot<nas::IE5gsMobileIdentity>> storedGuti;
std::unique_ptr<nas::NasSlot<nas::IE5gsTrackingAreaIdentityList>> taiList;
std::unique_ptr<nas::NasSlot<Tai>> lastVisitedRegisteredTai; std::unique_ptr<nas::NasSlot<Tai>> lastVisitedRegisteredTai;
std::unique_ptr<nas::NasList<Tai>> forbiddenTaiListRoaming; std::unique_ptr<nas::NasList<Tai>> forbiddenTaiListRoaming;
std::unique_ptr<nas::NasList<Tai>> forbiddenTaiListRps; std::unique_ptr<nas::NasList<Tai>> forbiddenTaiListRps;
......
...@@ -31,7 +31,6 @@ class Usim ...@@ -31,7 +31,6 @@ class Usim
E5UState m_uState{}; E5UState m_uState{};
// Plmn related // Plmn related
nas::IE5gsTrackingAreaIdentityList m_taiList{};
nas::IEPlmnList m_equivalentPlmnList{}; nas::IEPlmnList m_equivalentPlmnList{};
nas::IEPlmnList m_forbiddenPlmnList{}; nas::IEPlmnList m_forbiddenPlmnList{};
......
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