Commit d8e1dff6 authored by aligungr's avatar aligungr

Mobile storage refactor

parent 4f597b8f
......@@ -353,7 +353,12 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg)
switchUState(E5UState::U3_ROAMING_NOT_ALLOWED);
// Delete the stored 5G-GUTI, TAI list, last visited registered TAI and ngKSI. The USIM shall be considered invalid
// until switching off the UE or the UICC containing the USIM is removed
m_storage.invalidateSim__();
m_storage.m_storedGuti = {};
m_storage.m_lastVisitedRegisteredTai = {};
m_storage.m_taiList = {};
m_storage.m_currentNsCtx = {};
m_storage.m_nonCurrentNsCtx = {};
m_storage.invalidateSim();
// The UE shall abort any 5GMM signalling procedure, stop any of the timers T3510, T3516, T3517, T3519 or T3521 (if
// they were running) ..
m_timers->t3510.stop();
......
......@@ -168,7 +168,12 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
case nas::EMmCause::ILLEGAL_ME:
case nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED: {
switchUState(E5UState::U3_ROAMING_NOT_ALLOWED);
m_storage.invalidateSim__();
m_storage.m_storedGuti = {};
m_storage.m_lastVisitedRegisteredTai = {};
m_storage.m_taiList = {};
m_storage.m_currentNsCtx = {};
m_storage.m_nonCurrentNsCtx = {};
m_storage.invalidateSim();
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
break;
}
......@@ -181,13 +186,21 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
//}
case nas::EMmCause::TA_NOT_ALLOWED: {
switchUState(E5UState::U3_ROAMING_NOT_ALLOWED);
m_storage.discardUsim();
m_storage.m_storedGuti = {};
m_storage.m_lastVisitedRegisteredTai = {};
m_storage.m_taiList = {};
m_storage.m_currentNsCtx = {};
m_storage.m_nonCurrentNsCtx = {};
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
break;
}
case nas::EMmCause::N1_MODE_NOT_ALLOWED: {
switchUState(E5UState::U3_ROAMING_NOT_ALLOWED);
m_storage.discardUsim();
m_storage.m_storedGuti = {};
m_storage.m_lastVisitedRegisteredTai = {};
m_storage.m_taiList = {};
m_storage.m_currentNsCtx = {};
m_storage.m_nonCurrentNsCtx = {};
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
break;
}
......@@ -204,7 +217,12 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
nas::utils::EnumToString(msg.mmCause->value));
switchUState(E5UState::U3_ROAMING_NOT_ALLOWED);
m_storage.invalidateSim__();
m_storage.m_storedGuti = {};
m_storage.m_lastVisitedRegisteredTai = {};
m_storage.m_taiList = {};
m_storage.m_currentNsCtx = {};
m_storage.m_nonCurrentNsCtx = {};
m_storage.invalidateSim();
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
break;
}
......
......@@ -20,7 +20,7 @@ void NasMm::sendRegistration(nas::ERegistrationType regType, bool dueToDereg)
{
if (m_mmState != EMmState::MM_DEREGISTERED)
{
m_logger->warn("Registration could be triggered. UE is not in MM-DEREGISTERED state.");
m_logger->warn("Registration could not be triggered. UE is not in MM-DEREGISTERED state.");
return;
}
......@@ -90,7 +90,7 @@ void NasMm::sendRegistration(nas::ERegistrationType regType, bool dueToDereg)
// Assign mobile identity
request->mobileIdentity = getOrGeneratePreferredId();
// Assign last visited registered if available
// Assign last visited registered TAI if available
if (m_storage.m_lastVisitedRegisteredTai.has_value())
request->lastVisitedRegisteredTai = *m_storage.m_lastVisitedRegisteredTai;
......@@ -301,7 +301,7 @@ void NasMm::receiveRegistrationReject(const nas::RegistrationReject &msg)
if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::ILLEGAL_ME ||
cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED)
{
m_storage.invalidateSim__();
m_storage.invalidateSim();
}
if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::ILLEGAL_ME ||
......
......@@ -56,34 +56,8 @@ class MobileStorage
m_configuredNssai = initials.configuredNssai;
}
void discardLocation()
void invalidateSim()
{
m_storedGuti = {};
m_lastVisitedRegisteredTai = {};
}
void discardPlmn()
{
m_taiList = {};
}
void discardSecurity()
{
m_currentNsCtx = {};
m_nonCurrentNsCtx = {};
}
void discardUsim()
{
discardLocation();
discardPlmn();
discardSecurity();
}
// todo metodları kaldır geri
void invalidateSim__()
{
// TODO: log
m_simIsValid = false;
}
......
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