Commit 9b36a7da authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 5dc2ae1a
......@@ -10,8 +10,8 @@
#include <ue/app/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/rrc/task.hpp>
#include <ue/rls/task.hpp>
#include <ue/rrc/task.hpp>
#include <ue/tun/task.hpp>
#include <utils/common.hpp>
#include <utils/printer.hpp>
......@@ -106,8 +106,8 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
{
case app::UeCliCommand::STATUS: {
// TODO
//std::vector<Json> pduSessions{};
//for (auto &pduSession : m_base->appTask->m_pduSessions)
// std::vector<Json> pduSessions{};
// for (auto &pduSession : m_base->appTask->m_pduSessions)
// if (pduSession.has_value())
// pduSessions.push_back(ToJson(*pduSession));
......@@ -115,12 +115,12 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
{"cm-state", ToJson(m_base->nasTask->mm->m_cmState)},
{"rm-state", ToJson(m_base->nasTask->mm->m_rmState)},
{"mm-state", ToJson(m_base->nasTask->mm->m_mmSubState)},
{"5u-state", ToJson(m_base->nasTask->mm->m_usim->m_uState)},
{"5u-state", ToJson(m_base->nasTask->mm->m_storage->uState->get())},
{"sim-inserted", m_base->nasTask->mm->m_usim->isValid()},
{"stored-suci", ToJson(m_base->nasTask->mm->m_storage->storedSuci->get())},
{"stored-guti", ToJson(m_base->nasTask->mm->m_storage->storedGuti->get())},
{"has-emergency", ::ToJson(m_base->nasTask->mm->hasEmergency())},
//TODO {"pdu-sessions", Json::Arr(std::move(pduSessions))},
// TODO {"pdu-sessions", Json::Arr(std::move(pduSessions))},
});
sendResult(msg.address, json.dumpYaml());
break;
......
......@@ -306,15 +306,15 @@ void NasMm::switchCmState(ECmState state)
void NasMm::switchUState(E5UState state)
{
E5UState oldState = m_usim->m_uState;
m_usim->m_uState = state;
E5UState oldState = m_storage->uState->get();
m_storage->uState->set(state);
onSwitchUState(oldState, m_usim->m_uState);
onSwitchUState(oldState, state);
if (m_base->nodeListener)
{
m_base->nodeListener->onSwitch(app::NodeType::UE, m_base->config->getNodeName(), app::StateType::U5,
ToJson(oldState).str(), ToJson(m_usim->m_uState).str());
ToJson(oldState).str(), ToJson(state).str());
}
if (state != oldState)
......
......@@ -907,7 +907,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
// "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"
if (!includedInTaiList || m_usim->m_uState != E5UState::U1_UPDATED)
if (!includedInTaiList || m_storage->uState->get() != E5UState::U1_UPDATED)
{
// "The UE shall start timer T3511, shall set the 5GS update status to 5U2 NOT UPDATED and change to state
// 5GMM-REGISTERED.ATTEMPTING-REGISTRATION-UPDATE. When timer T3511 expires and the registration update
......@@ -920,7 +920,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
// "If the TAI of the current serving cell is included in the TAI list, the 5GS update status is equal to 5U1
// UPDATED, and the UE is not performing the registration procedure after an inter-system change from S1 mode to
// N1 mode"
if (includedInTaiList && m_usim->m_uState == E5UState::U1_UPDATED)
if (includedInTaiList && m_storage->uState->get() == E5UState::U1_UPDATED)
{
// "The UE shall keep the 5GS update status to 5U1 UPDATED and enter state 5GMM-REGISTERED.NORMAL-SERVICE."
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
......
......@@ -29,7 +29,7 @@ void NasMm::sendServiceRequest(EServiceReqCause reqCause)
m_logger->debug("Service Request canceled, already in 5GMM-SERVICE-REQUEST-INITIATED");
return;
}
if (m_usim->m_uState != E5UState::U1_UPDATED)
if (m_storage->uState->get() != E5UState::U1_UPDATED)
{
m_logger->err("Service Request canceled, UE not in 5U1 UPDATED state");
return;
......
......@@ -22,7 +22,9 @@ namespace nr::ue
MmStorage::MmStorage(TaskBase *base) : m_base{base}
{
storedSuci = std::make_unique<nas::NasSlot<nas::IE5gsMobileIdentity>>(0, std::nullopt);
uState = std::make_unique<nas::NasSlot<E5UState>>(0, std::nullopt);
storedSuci = std::make_unique<nas::NasSlot<nas::IE5gsMobileIdentity>>(0, std::nullopt);
storedGuti = std::make_unique<nas::NasSlot<nas::IE5gsMobileIdentity>>(0, std::nullopt);
......
......@@ -19,6 +19,8 @@ class MmStorage
TaskBase *m_base;
public:
std::unique_ptr<nas::NasSlot<E5UState>> uState;
std::unique_ptr<nas::NasSlot<nas::IE5gsMobileIdentity>> storedSuci;
std::unique_ptr<nas::NasSlot<nas::IE5gsMobileIdentity>> storedGuti;
......
......@@ -15,8 +15,6 @@ void ue::Usim::initialize(bool hasSupi, const UeConfig::Initials &initials)
{
m_isValid = hasSupi;
m_uState = E5UState::U1_UPDATED;
m_defConfiguredNssai = initials.defaultConfiguredNssai;
m_configuredNssai = initials.configuredNssai;
......
......@@ -27,9 +27,6 @@ class Usim
bool m_isValid{};
public:
// State related
E5UState m_uState{};
// Security related
std::unique_ptr<NasSecurityContext> m_currentNsCtx{};
std::unique_ptr<NasSecurityContext> m_nonCurrentNsCtx{};
......
......@@ -237,7 +237,7 @@ enum class ECmState
enum class E5UState
{
U1_UPDATED,
U1_UPDATED = 0,
U2_NOT_UPDATED,
U3_ROAMING_NOT_ALLOWED
};
......
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