Commit 8078dd5f authored by aligungr's avatar aligungr

RRC developments

parent 03d6cc66
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#include "storage.hpp"
static constexpr const size_t FORBIDDEN_TAI_LIST_SIZE = 40;
static constexpr const int64_t FORBIDDEN_TAI_CLEAR_PERIOD = 1000ll * 60ll * 60ll * 12ll;
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}
{
}
} // namespace nr::ue
\ No newline at end of file
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#include <lib/nas/msg.hpp>
#include <lib/nas/storage.hpp>
namespace nr::ue
{
class MmStorage
{
public:
nas::NasListT1<Tai> m_forbiddenTaiListRoaming;
nas::NasListT1<Tai> m_forbiddenTaiListRps;
public:
MmStorage();
};
} // namespace nr::ue
......@@ -104,6 +104,11 @@ bool operator==(const SingleSlice &lhs, const SingleSlice &rhs)
return ((int)*lhs.sd) == ((int)*rhs.sd);
}
bool operator!=(const SingleSlice &lhs, const SingleSlice &rhs)
{
return !(lhs == rhs);
}
bool operator==(const Plmn &lhs, const Plmn &rhs)
{
if (lhs.mcc != rhs.mcc)
......@@ -123,6 +128,21 @@ bool operator==(const GlobalNci &lhs, const GlobalNci &rhs)
return lhs.plmn == rhs.plmn && lhs.nci == rhs.nci;
}
bool operator!=(const GlobalNci &lhs, const GlobalNci &rhs)
{
return !(lhs == rhs);
}
bool operator==(const Tai &lhs, const Tai &rhs)
{
return lhs.plmn == rhs.plmn && lhs.tac == rhs.tac;
}
bool operator!=(const Tai &lhs, const Tai &rhs)
{
return !(lhs == rhs);
}
void NetworkSlice::addIfNotExists(const SingleSlice &slice)
{
if (!std::any_of(slices.begin(), slices.end(), [&slice](auto &s) { return s == slice; }))
......
......@@ -34,6 +34,12 @@ struct Plmn
[[nodiscard]] bool hasValue() const;
};
struct Tai
{
Plmn plmn;
int tac{};
};
struct SingleSlice
{
octet sst{};
......@@ -196,10 +202,17 @@ struct UacAiBarringSet
bool ai15 = false;
};
bool operator==(const SingleSlice &lhs, const SingleSlice &rhs);
bool operator==(const Plmn &lhs, const Plmn &rhs);
bool operator!=(const Plmn &lhs, const Plmn &rhs);
bool operator==(const Tai &lhs, const Tai &rhs);
bool operator!=(const Tai &lhs, const Tai &rhs);
bool operator==(const SingleSlice &lhs, const SingleSlice &rhs);
bool operator!=(const SingleSlice &lhs, const SingleSlice &rhs);
bool operator==(const GlobalNci &lhs, const GlobalNci &rhs);
bool operator!=(const GlobalNci &lhs, const GlobalNci &rhs);
Json ToJson(const Supi &v);
Json ToJson(const Plmn &v);
......
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