Commit d8e1dff6 authored by aligungr's avatar aligungr

Mobile storage refactor

parent 4f597b8f
...@@ -353,7 +353,12 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg) ...@@ -353,7 +353,12 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg)
switchUState(E5UState::U3_ROAMING_NOT_ALLOWED); 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 // 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 // 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 // The UE shall abort any 5GMM signalling procedure, stop any of the timers T3510, T3516, T3517, T3519 or T3521 (if
// they were running) .. // they were running) ..
m_timers->t3510.stop(); m_timers->t3510.stop();
......
...@@ -168,7 +168,12 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi ...@@ -168,7 +168,12 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
case nas::EMmCause::ILLEGAL_ME: case nas::EMmCause::ILLEGAL_ME:
case nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED: { case nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED: {
switchUState(E5UState::U3_ROAMING_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); switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
break; break;
} }
...@@ -181,13 +186,21 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi ...@@ -181,13 +186,21 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
//} //}
case nas::EMmCause::TA_NOT_ALLOWED: { case nas::EMmCause::TA_NOT_ALLOWED: {
switchUState(E5UState::U3_ROAMING_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); switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
break; break;
} }
case nas::EMmCause::N1_MODE_NOT_ALLOWED: { case nas::EMmCause::N1_MODE_NOT_ALLOWED: {
switchUState(E5UState::U3_ROAMING_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); switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
break; break;
} }
...@@ -204,7 +217,12 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi ...@@ -204,7 +217,12 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
nas::utils::EnumToString(msg.mmCause->value)); nas::utils::EnumToString(msg.mmCause->value));
switchUState(E5UState::U3_ROAMING_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); switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
break; break;
} }
......
...@@ -20,7 +20,7 @@ void NasMm::sendRegistration(nas::ERegistrationType regType, bool dueToDereg) ...@@ -20,7 +20,7 @@ void NasMm::sendRegistration(nas::ERegistrationType regType, bool dueToDereg)
{ {
if (m_mmState != EMmState::MM_DEREGISTERED) 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; return;
} }
...@@ -90,7 +90,7 @@ void NasMm::sendRegistration(nas::ERegistrationType regType, bool dueToDereg) ...@@ -90,7 +90,7 @@ void NasMm::sendRegistration(nas::ERegistrationType regType, bool dueToDereg)
// Assign mobile identity // Assign mobile identity
request->mobileIdentity = getOrGeneratePreferredId(); request->mobileIdentity = getOrGeneratePreferredId();
// Assign last visited registered if available // Assign last visited registered TAI if available
if (m_storage.m_lastVisitedRegisteredTai.has_value()) if (m_storage.m_lastVisitedRegisteredTai.has_value())
request->lastVisitedRegisteredTai = *m_storage.m_lastVisitedRegisteredTai; request->lastVisitedRegisteredTai = *m_storage.m_lastVisitedRegisteredTai;
...@@ -301,7 +301,7 @@ void NasMm::receiveRegistrationReject(const nas::RegistrationReject &msg) ...@@ -301,7 +301,7 @@ void NasMm::receiveRegistrationReject(const nas::RegistrationReject &msg)
if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::ILLEGAL_ME || if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::ILLEGAL_ME ||
cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED) cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED)
{ {
m_storage.invalidateSim__(); m_storage.invalidateSim();
} }
if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::ILLEGAL_ME || if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::ILLEGAL_ME ||
......
...@@ -56,34 +56,8 @@ class MobileStorage ...@@ -56,34 +56,8 @@ class MobileStorage
m_configuredNssai = initials.configuredNssai; 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; 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