Commit c0d05ab6 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 629a07ad
......@@ -10,7 +10,6 @@
#include <lib/crypt/milenage.hpp>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <ue/nas/storage.hpp>
#include <ue/nas/usim/usim.hpp>
#include <ue/nts.hpp>
......@@ -179,7 +178,7 @@ class NasMm
bool switchToECallInactivityIfNeeded();
private: /* Timer */
void onTimerExpire(nas::NasTimer &timer);
void onTimerExpire(UeTimer &timer);
public:
/* Interface */
......
......@@ -16,7 +16,7 @@
namespace nr::ue
{
void NasMm::onTimerExpire(nas::NasTimer &timer)
void NasMm::onTimerExpire(UeTimer &timer)
{
auto logExpired = [this, &timer]() {
m_logger->debug("NAS timer[%d] expired [%d]", timer.getCode(), timer.getExpiryCount());
......
......@@ -11,7 +11,6 @@
#include <array>
#include <bitset>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <ue/nts.hpp>
#include <ue/types.hpp>
#include <utils/nts.hpp>
......@@ -84,8 +83,8 @@ class NasSm
void receiveReleaseCommand(const nas::PduSessionReleaseCommand &msg);
/* Timer */
std::unique_ptr<nas::NasTimer> newTransactionTimer(int code);
void onTimerExpire(nas::NasTimer &timer);
std::unique_ptr<UeTimer> newTransactionTimer(int code);
void onTimerExpire(UeTimer &timer);
void onTransactionTimerExpire(int pti);
/* Procedure */
......
......@@ -16,20 +16,20 @@
namespace nr::ue
{
std::unique_ptr<nas::NasTimer> NasSm::newTransactionTimer(int code)
std::unique_ptr<UeTimer> NasSm::newTransactionTimer(int code)
{
std::unique_ptr<nas::NasTimer> timer;
std::unique_ptr<UeTimer> timer;
switch (code)
{
case 3580:
timer = std::make_unique<nas::NasTimer>(3580, false, 16);
timer = std::make_unique<UeTimer>(3580, false, 16);
break;
case 3581:
timer = std::make_unique<nas::NasTimer>(3581, false, 16);
timer = std::make_unique<UeTimer>(3581, false, 16);
break;
case 3582:
timer = std::make_unique<nas::NasTimer>(3582, false, 16);
timer = std::make_unique<UeTimer>(3582, false, 16);
break;
default:
m_logger->err("Bad SM transaction timer code");
......@@ -40,7 +40,7 @@ std::unique_ptr<nas::NasTimer> NasSm::newTransactionTimer(int code)
return timer;
}
void NasSm::onTimerExpire(nas::NasTimer &timer)
void NasSm::onTimerExpire(UeTimer &timer)
{
}
......
......@@ -122,7 +122,7 @@ void NasTask::onLoop()
void NasTask::performTick()
{
auto sendExpireMsg = [this](nas::NasTimer *timer) {
auto sendExpireMsg = [this](UeTimer *timer) {
auto *nw = new NwUeNasToNas(NwUeNasToNas::NAS_TIMER_EXPIRE);
nw->timer = timer;
push(nw);
......
......@@ -11,7 +11,6 @@
#include <ue/nas/usim/usim.hpp>
#include <lib/crypt/milenage.hpp>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <ue/nas/mm/mm.hpp>
#include <ue/nas/sm/sm.hpp>
#include <ue/nts.hpp>
......
......@@ -14,7 +14,6 @@
#include <utility>
#include <lib/app/cli_base.hpp>
#include <lib/nas/timer.hpp>
#include <lib/rls/rls_base.hpp>
#include <lib/rrc/rrc.hpp>
#include <utils/network.hpp>
......@@ -174,7 +173,7 @@ struct NwUeNasToNas : NtsMessage
} present;
// NAS_TIMER_EXPIRE
nas::NasTimer *timer{};
UeTimer *timer{};
explicit NwUeNasToNas(PR present) : NtsMessage(NtsMessageType::UE_NAS_TO_NAS), present(present)
{
......
......@@ -12,31 +12,28 @@
#include <utils/common.hpp>
namespace nas
{
NasTimer::NasTimer(int timerCode, bool isMmTimer, int defaultInterval)
UeTimer::UeTimer(int timerCode, bool isMmTimer, int defaultInterval)
: m_code(timerCode), m_isMm(isMmTimer), m_interval(defaultInterval), m_startMillis(0), m_isRunning(false),
m_expiryCount(0), m_lastDebugPrintMs(0)
{
}
bool NasTimer::isRunning() const
bool UeTimer::isRunning() const
{
return m_isRunning;
}
int NasTimer::getCode() const
int UeTimer::getCode() const
{
return m_code;
}
bool NasTimer::isMmTimer() const
bool UeTimer::isMmTimer() const
{
return m_isMm;
}
void NasTimer::start(bool clearExpiryCount)
void UeTimer::start(bool clearExpiryCount)
{
if (clearExpiryCount)
resetExpiryCount();
......@@ -44,7 +41,7 @@ void NasTimer::start(bool clearExpiryCount)
m_isRunning = true;
}
void NasTimer::start(const nas::IEGprsTimer2 &v, bool clearExpiryCount)
void UeTimer::start(const nas::IEGprsTimer2 &v, bool clearExpiryCount)
{
if (clearExpiryCount)
resetExpiryCount();
......@@ -53,7 +50,7 @@ void NasTimer::start(const nas::IEGprsTimer2 &v, bool clearExpiryCount)
m_isRunning = true;
}
void NasTimer::start(const nas::IEGprsTimer3 &v, bool clearExpiryCount)
void UeTimer::start(const nas::IEGprsTimer3 &v, bool clearExpiryCount)
{
if (clearExpiryCount)
resetExpiryCount();
......@@ -81,7 +78,7 @@ void NasTimer::start(const nas::IEGprsTimer3 &v, bool clearExpiryCount)
m_isRunning = true;
}
void NasTimer::stop(bool clearExpiryCount)
void UeTimer::stop(bool clearExpiryCount)
{
if (clearExpiryCount)
resetExpiryCount();
......@@ -93,7 +90,7 @@ void NasTimer::stop(bool clearExpiryCount)
}
}
bool NasTimer::performTick()
bool UeTimer::performTick()
{
if (m_isRunning)
{
......@@ -114,12 +111,12 @@ bool NasTimer::performTick()
return false;
}
int NasTimer::getInterval() const
int UeTimer::getInterval() const
{
return m_interval;
}
int NasTimer::getRemaining() const
int UeTimer::getRemaining() const
{
if (!m_isRunning)
return 0;
......@@ -128,17 +125,17 @@ int NasTimer::getRemaining() const
return std::max(m_interval - elapsed, 0);
}
void NasTimer::resetExpiryCount()
void UeTimer::resetExpiryCount()
{
m_expiryCount = 0;
}
int NasTimer::getExpiryCount() const
int UeTimer::getExpiryCount() const
{
return m_expiryCount;
}
Json ToJson(const NasTimer &v)
Json ToJson(const UeTimer &v)
{
std::stringstream ss{};
if (v.isRunning())
......@@ -148,5 +145,3 @@ Json ToJson(const NasTimer &v)
return ss.str();
}
} // namespace nas
......@@ -8,14 +8,10 @@
#pragma once
#include "ie4.hpp"
#include <lib/nas/ie4.hpp>
#include <utils/json.hpp>
namespace nas
{
class NasTimer
class UeTimer
{
private:
const int m_code;
......@@ -29,12 +25,12 @@ class NasTimer
long m_lastDebugPrintMs;
public:
NasTimer(int timerCode, bool isMmTimer, int defaultInterval);
UeTimer(int timerCode, bool isMmTimer, int defaultInterval);
public:
void start(bool clearExpiryCount = true);
void start(const IEGprsTimer2 &v, bool clearExpiryCount = true);
void start(const IEGprsTimer3 &v, bool clearExpiryCount = true);
void start(const nas::IEGprsTimer2 &v, bool clearExpiryCount = true);
void start(const nas::IEGprsTimer3 &v, bool clearExpiryCount = true);
void stop(bool clearExpiryCount = true);
void resetExpiryCount();
bool performTick();
......@@ -46,6 +42,4 @@ class NasTimer
[[nodiscard]] int getExpiryCount() const;
};
Json ToJson(const NasTimer &v);
} // namespace nas
\ No newline at end of file
Json ToJson(const UeTimer &v);
......@@ -8,6 +8,8 @@
#pragma once
#include "timer.hpp"
#include <array>
#include <atomic>
#include <memory>
......@@ -17,7 +19,6 @@
#include <lib/app/monitor.hpp>
#include <lib/app/ue_ctl.hpp>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <utils/common_types.hpp>
#include <utils/json.hpp>
#include <utils/locked.hpp>
......@@ -189,26 +190,26 @@ struct TaskBase
struct NasTimers
{
nas::NasTimer t3346; /* MM - ... */
nas::NasTimer t3396; /* SM - ... */
nas::NasTimer t3444; /* MM - ... */
nas::NasTimer t3445; /* MM - ... */
nas::NasTimer t3502; /* MM - Initiation of the registration procedure, if still required */
nas::NasTimer t3510; /* MM - Registration Request transmission timer */
nas::NasTimer t3511; /* MM - Retransmission of the REGISTRATION REQUEST, if still required */
nas::NasTimer t3512; /* MM - Periodic registration update timer */
nas::NasTimer t3516; /* MM - 5G AKA - RAND and RES* storing timer */
nas::NasTimer t3517; /* MM - Service Request transmission timer */
nas::NasTimer t3519; /* MM - Transmission with fresh SUCI timer */
nas::NasTimer t3520; /* MM - ... */
nas::NasTimer t3521; /* MM - De-registration transmission timer for not switch off */
nas::NasTimer t3525; /* MM - ... */
nas::NasTimer t3540; /* MM - ... */
nas::NasTimer t3584; /* SM - ... */
nas::NasTimer t3585; /* SM - ... */
UeTimer t3346; /* MM - ... */
UeTimer t3396; /* SM - ... */
UeTimer t3444; /* MM - ... */
UeTimer t3445; /* MM - ... */
UeTimer t3502; /* MM - Initiation of the registration procedure, if still required */
UeTimer t3510; /* MM - Registration Request transmission timer */
UeTimer t3511; /* MM - Retransmission of the REGISTRATION REQUEST, if still required */
UeTimer t3512; /* MM - Periodic registration update timer */
UeTimer t3516; /* MM - 5G AKA - RAND and RES* storing timer */
UeTimer t3517; /* MM - Service Request transmission timer */
UeTimer t3519; /* MM - Transmission with fresh SUCI timer */
UeTimer t3520; /* MM - ... */
UeTimer t3521; /* MM - De-registration transmission timer for not switch off */
UeTimer t3525; /* MM - ... */
UeTimer t3540; /* MM - ... */
UeTimer t3584; /* SM - ... */
UeTimer t3585; /* SM - ... */
NasTimers();
};
......@@ -333,7 +334,7 @@ struct ProcedureTransaction
static constexpr const int MAX_ID = 254;
EPtState state{};
std::unique_ptr<nas::NasTimer> timer{};
std::unique_ptr<UeTimer> timer{};
std::unique_ptr<nas::SmMessage> message{};
int psi{};
};
......
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