Commit 93cd83c7 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 4fe5f473
...@@ -11,15 +11,29 @@ ...@@ -11,15 +11,29 @@
static constexpr const size_t FORBIDDEN_TAI_LIST_SIZE = 40; static constexpr const size_t FORBIDDEN_TAI_LIST_SIZE = 40;
static constexpr const int64_t FORBIDDEN_TAI_CLEAR_PERIOD = 1000ll * 60ll * 60ll * 12ll; static constexpr const int64_t FORBIDDEN_TAI_CLEAR_PERIOD = 1000ll * 60ll * 60ll * 12ll;
static void BackupTaiListInSharedCtx(const std::vector<Tai> &buffer, size_t count, Locked<std::vector<Tai>> &target)
{
target.mutate([count, &buffer](auto &value) {
value.clear();
for (size_t i = 0; i < count; i++)
value.push_back(buffer[i]);
});
}
namespace nr::ue namespace nr::ue
{ {
MmStorage::MmStorage(TaskBase *base) : m_base{base} MmStorage::MmStorage(TaskBase *base) : m_base{base}
{ {
m_forbiddenTaiListRoaming = m_forbiddenTaiListRoaming = std::make_unique<nas::NasListT1<Tai>>(
std::make_unique<nas::NasListT1<Tai>>(FORBIDDEN_TAI_LIST_SIZE, FORBIDDEN_TAI_CLEAR_PERIOD, std::nullopt); FORBIDDEN_TAI_LIST_SIZE, FORBIDDEN_TAI_CLEAR_PERIOD, [this](const std::vector<Tai> &buffer, size_t count) {
m_forbiddenTaiListRps = BackupTaiListInSharedCtx(buffer, count, m_base->shCtx.forbiddenTaiRoaming);
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, [this](const std::vector<Tai> &buffer, size_t count) {
BackupTaiListInSharedCtx(buffer, count, m_base->shCtx.forbiddenTaiRps);
});
} }
} // namespace nr::ue } // namespace nr::ue
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <atomic> #include <atomic>
#include <memory> #include <memory>
#include <unordered_set> #include <unordered_set>
#include <set>
#include <lib/app/monitor.hpp> #include <lib/app/monitor.hpp>
#include <lib/app/ue_ctl.hpp> #include <lib/app/ue_ctl.hpp>
...@@ -161,6 +162,8 @@ struct UeSharedContext ...@@ -161,6 +162,8 @@ struct UeSharedContext
Locked<std::unordered_set<Plmn>> availablePlmns; Locked<std::unordered_set<Plmn>> availablePlmns;
Locked<Plmn> selectedPlmn; Locked<Plmn> selectedPlmn;
Locked<CurrentCellInfo> currentCell; Locked<CurrentCellInfo> currentCell;
Locked<std::vector<Tai>> forbiddenTaiRoaming;
Locked<std::vector<Tai>> forbiddenTaiRps;
}; };
struct TaskBase struct TaskBase
......
...@@ -170,3 +170,15 @@ bool Plmn::hasValue() const ...@@ -170,3 +170,15 @@ bool Plmn::hasValue() const
{ {
return this->mcc != 0; return this->mcc != 0;
} }
Tai::Tai() : plmn{}, tac{}
{
}
Tai::Tai(const Plmn &plmn, int tac) : plmn{plmn}, tac{tac}
{
}
Tai::Tai(int mcc, int mnc, bool longMnc, int tac) : plmn{mcc, mnc, longMnc}, tac{tac}
{
}
...@@ -37,7 +37,11 @@ struct Plmn ...@@ -37,7 +37,11 @@ struct Plmn
struct Tai struct Tai
{ {
Plmn plmn; Plmn plmn;
int tac{}; int tac;
Tai();
Tai(const Plmn& plmn, int tac);
Tai(int mcc, int mnc, bool longMnc, int tac);
}; };
struct SingleSlice struct SingleSlice
......
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