Commit b96f4a2b authored by aligungr's avatar aligungr

Performance improvements

parent e593da15
......@@ -67,10 +67,6 @@ void UeL3Task::onLoop()
{
m_rrc->handleRlsSapMessage(dynamic_cast<NmUeRlsToRrc &>(*msg));
}
else if (msg->msgType == NtsMessageType::UE_RRC_TO_NAS)
{
m_nas->handleSapMessage(std::move(msg));
}
else if (msg->msgType == NtsMessageType::UE_TUN_TO_APP || msg->msgType == NtsMessageType::UE_RLS_TO_NAS)
{
m_nas->handleSapMessage(std::move(msg));
......
......@@ -35,10 +35,6 @@ void NasLayer::handleSapMessage(std::unique_ptr<NtsMessage> msg)
{
switch (msg->msgType)
{
case NtsMessageType::UE_RRC_TO_NAS: {
m_mm->handleRrcEvent(dynamic_cast<NmUeRrcToNas &>(*msg));
break;
}
case NtsMessageType::UE_TUN_TO_APP: {
auto &w = dynamic_cast<NmUeTunToApp &>(*msg);
switch (w.present)
......@@ -129,4 +125,12 @@ void NasLayer::handleActiveCellChange(const Tai &prevTai)
m_mm->handleActiveCellChange(prevTai);
}
void NasLayer::handleNasDelivery(const OctetString &data)
{
OctetView buffer{data};
auto nasMessage = nas::DecodeNasMessage(buffer);
if (nasMessage != nullptr)
m_mm->receiveNasMessage(*nasMessage);
}
} // namespace nr::ue
\ No newline at end of file
......@@ -42,6 +42,7 @@ class NasLayer
void handleRadioLinkFailure();
void handleRrcEstablishmentFailure();
void handleActiveCellChange(const Tai &prevTai);
void handleNasDelivery(const OctetString& data);
};
} // namespace nr::ue
\ No newline at end of file
......@@ -193,9 +193,6 @@ class NasMm
void deregistrationRequired(EDeregCause cause);
void invokeProcedures();
bool hasPendingProcedure();
private: /* Service Access Point */
void handleRrcEvent(const NmUeRrcToNas &msg);
};
} // 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 "mm.hpp"
#include <utils/common.hpp>
namespace nr::ue
{
void NasMm::handleRrcEvent(const NmUeRrcToNas &msg)
{
if (m_mmState == EMmState::MM_NULL)
return;
switch (msg.present)
{
case NmUeRrcToNas::NAS_DELIVERY: {
OctetView buffer{msg.nasPdu};
auto nasMessage = nas::DecodeNasMessage(buffer);
if (nasMessage != nullptr)
receiveNasMessage(*nasMessage);
break;
}
}
}
} // namespace nr::ue
......@@ -56,21 +56,6 @@ struct NmUeTunToApp : NtsMessage
}
};
struct NmUeRrcToNas : NtsMessage
{
enum PR
{
NAS_DELIVERY,
} present;
// NAS_DELIVERY
OctetString nasPdu;
explicit NmUeRrcToNas(PR present) : NtsMessage(NtsMessageType::UE_RRC_TO_NAS), present(present)
{
}
};
struct NmUeRrcToRls : NtsMessage
{
enum PR
......
......@@ -65,9 +65,7 @@ void UeRrcLayer::receiveDownlinkInformationTransfer(const ASN_RRC_DLInformationT
OctetString nasPdu =
asn::GetOctetString(*msg.criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message);
auto m = std::make_unique<NmUeRrcToNas>(NmUeRrcToNas::NAS_DELIVERY);
m->nasPdu = std::move(nasPdu);
m_base->l3Task->push(std::move(m));
m_base->l3Task->nas().handleNasDelivery(nasPdu);
}
} // namespace nr::ue
\ No newline at end of file
......@@ -48,7 +48,6 @@ enum class NtsMessageType
UE_APP_TO_TUN,
UE_TUN_TO_APP,
UE_RRC_TO_NAS,
UE_RRC_TO_RLS,
UE_RLS_TO_RRC,
UE_RLS_TO_NAS,
......
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