Commit 55e8b4a1 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 3c6590c5
......@@ -7,6 +7,8 @@
//
#include <array>
#include <functional>
#include <optional>
#include <vector>
#include <utils/common.hpp>
......@@ -23,16 +25,20 @@ namespace nas
template <typename T>
class NasListT1
{
public:
using backup_functor_type = std::function<void(const std::vector<T> &buffer, size_t size)>;
private:
const size_t m_sizeLimit;
const int64_t m_autoClearingPeriod;
const std::optional<backup_functor_type> m_backupFunctor;
std::vector<T> m_data;
size_t m_size;
int64_t m_lastAutoCleared;
public:
NasListT1(size_t sizeLimit, int64_t autoClearingPeriod)
NasListT1(size_t sizeLimit, int64_t autoClearingPeriod, std::optional<backup_functor_type> backupFunctor)
: m_sizeLimit{sizeLimit}, m_autoClearingPeriod{autoClearingPeriod}, m_data{sizeLimit}, m_size{},
m_lastAutoCleared{::utils::CurrentTimeMillis()}
{
......@@ -158,6 +164,8 @@ class NasListT1
void touch()
{
if (m_backupFunctor)
(*m_backupFunctor)(m_data, m_size);
}
};
......
......@@ -253,7 +253,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
tai.plmn.isLongMnc = m_usim->m_currentTai->plmn.isLongMnc;
tai.tac = (int)m_usim->m_currentTai->tac;
m_storage.m_forbiddenTaiListRoaming.add(tai);
m_storage.m_forbiddenTaiListRoaming->add(tai);
}
if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED)
......
......@@ -569,7 +569,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
tai.plmn.isLongMnc = m_usim->m_currentTai->plmn.isLongMnc;
tai.tac = (int)m_usim->m_currentTai->tac;
m_storage.m_forbiddenTaiListRoaming.add(tai);
m_storage.m_forbiddenTaiListRoaming->add(tai);
}
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
......@@ -733,7 +733,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
tai.plmn.isLongMnc = m_usim->m_currentTai->plmn.isLongMnc;
tai.tac = (int)m_usim->m_currentTai->tac;
m_storage.m_forbiddenTaiListRoaming.add(tai);
m_storage.m_forbiddenTaiListRoaming->add(tai);
}
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
......
......@@ -316,7 +316,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
tai.plmn.isLongMnc = m_usim->m_currentTai->plmn.isLongMnc;
tai.tac = (int)m_usim->m_currentTai->tac;
m_storage.m_forbiddenTaiListRps.add(tai);
m_storage.m_forbiddenTaiListRps->add(tai);
}
if (cause == nas::EMmCause::ROAMING_NOT_ALLOWED_IN_TA || cause == nas::EMmCause::NO_SUITIBLE_CELLS_IN_TA)
......@@ -327,7 +327,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
tai.plmn.isLongMnc = m_usim->m_currentTai->plmn.isLongMnc;
tai.tac = (int)m_usim->m_currentTai->tac;
m_storage.m_forbiddenTaiListRoaming.add(tai);
m_storage.m_forbiddenTaiListRoaming->add(tai);
nas::utils::RemoveFromTaiList(m_usim->m_taiList, *m_usim->m_currentTai);
}
......
......@@ -15,10 +15,11 @@ namespace nr::ue
{
MmStorage::MmStorage()
: m_forbiddenTaiListRoaming{FORBIDDEN_TAI_LIST_SIZE, FORBIDDEN_TAI_CLEAR_PERIOD}, m_forbiddenTaiListRps{
FORBIDDEN_TAI_LIST_SIZE,
FORBIDDEN_TAI_CLEAR_PERIOD}
{
m_forbiddenTaiListRoaming =
std::make_unique<nas::NasListT1<Tai>>(FORBIDDEN_TAI_LIST_SIZE, FORBIDDEN_TAI_CLEAR_PERIOD, std::nullopt);
m_forbiddenTaiListRps =
std::make_unique<nas::NasListT1<Tai>>(FORBIDDEN_TAI_LIST_SIZE, FORBIDDEN_TAI_CLEAR_PERIOD, std::nullopt);
}
} // namespace nr::ue
\ No newline at end of file
......@@ -15,8 +15,8 @@ namespace nr::ue
class MmStorage
{
public:
nas::NasListT1<Tai> m_forbiddenTaiListRoaming;
nas::NasListT1<Tai> m_forbiddenTaiListRps;
std::unique_ptr<nas::NasListT1<Tai>> m_forbiddenTaiListRoaming;
std::unique_ptr<nas::NasListT1<Tai>> m_forbiddenTaiListRps;
public:
MmStorage();
......
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