Commit 84304df4 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent ae349f91
......@@ -36,6 +36,8 @@ void NasMm::sendDeregistration(EDeregCause deregCause)
m_logger->debug("Starting de-registration procedure due to [%s]", ToJson(deregCause).str().c_str());
updateProvidedGuti();
auto request = std::make_unique<nas::DeRegistrationRequestUeOriginating>();
request->deRegistrationType = MakeDeRegistrationType(deregCause);
......@@ -253,7 +255,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
{
m_storage->forbiddenTaiListRps->add(tai);
m_storage->serviceAreaList->mutate([&tai](auto &value) {
nas::utils::RemoveFromServiceAreaList(value, nas::VTrackingAreaIdentity{tai});
nas::utils::RemoveFromServiceAreaList(value, nas::VTrackingAreaIdentity{tai});
});
}
}
......
......@@ -168,6 +168,7 @@ class NasMm
void handleRrcEstablishmentFailure();
void handleRadioLinkFailure();
void handlePaging(const std::vector<GutiMobileIdentity> &tmsiIds);
void updateProvidedGuti(bool provide = true);
public: /* Access Control */
bool isHighPriority();
......
......@@ -294,4 +294,31 @@ void NasMm::handlePaging(const std::vector<GutiMobileIdentity> &tmsiIds)
sendServiceRequest(EServiceReqCause::IDLE_PAGING);
}
void NasMm::updateProvidedGuti(bool provide)
{
if (m_cmState != ECmState::CM_IDLE)
return;
auto &guti = m_storage->storedGuti->get();
if (!provide || guti.type == nas::EIdentityType::NO_IDENTITY)
{
m_base->shCtx.providedGuti.set({});
m_base->shCtx.providedTmsi.set({});
}
else
{
auto tai = m_base->shCtx.getCurrentTai();
if (tai.hasValue() && nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{tai}))
{
m_base->shCtx.providedGuti.set({});
m_base->shCtx.providedTmsi.set(guti.gutiOrTmsi);
}
else
{
m_base->shCtx.providedGuti.set(guti.gutiOrTmsi);
m_base->shCtx.providedTmsi.set({});
}
}
}
} // namespace nr::ue
\ No newline at end of file
......@@ -45,6 +45,8 @@ void NasMm::sendInitialRegistration(EInitialRegCause regCause)
nas::utils::EnumToString(isEmergencyReg ? nas::ERegistrationType::EMERGENCY_REGISTRATION
: nas::ERegistrationType::INITIAL_REGISTRATION));
updateProvidedGuti();
// The UE shall mark the 5G NAS security context on the USIM or in the non-volatile memory as invalid when the UE
// initiates an initial registration procedure
m_usim->m_currentNsCtx = {};
......@@ -148,6 +150,11 @@ void NasMm::sendMobilityRegistration(ERegUpdateCause updateCause)
: nas::ERegistrationType::MOBILITY_REGISTRATION_UPDATING),
ToJson(updateCause).str().c_str());
// "if the registration procedure for mobility and periodic update was triggered due to the last CONFIGURATION
// UPDATE COMMAND message that indicates "registration requested" including: ... the UE NAS shall not provide the
// lower layers with the 5G-S-TMSI or the registered GUAMI; "
updateProvidedGuti(updateCause != ERegUpdateCause::CONFIGURATION_UPDATE);
// Switch state
switchMmState(EMmSubState::MM_REGISTERED_INITIATED_PS);
......
......@@ -83,6 +83,8 @@ void NasMm::sendServiceRequest(EServiceReqCause reqCause)
}
}
updateProvidedGuti();
auto request = std::make_unique<nas::ServiceRequest>();
if (reqCause == EServiceReqCause::IDLE_PAGING)
......
......@@ -166,6 +166,8 @@ struct UeSharedContext
Locked<ActiveCellInfo> currentCell;
Locked<std::vector<Tai>> forbiddenTaiRoaming;
Locked<std::vector<Tai>> forbiddenTaiRps;
Locked<GutiMobileIdentity> providedGuti;
Locked<GutiMobileIdentity> providedTmsi;
Plmn getCurrentPlmn();
Tai getCurrentTai();
......
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