Commit de9a3790 authored by aligungr's avatar aligungr

SRA dev.

parent d526e59f
......@@ -12,7 +12,7 @@
#include <gnb/gtp/task.hpp>
#include <gnb/ngap/task.hpp>
#include <gnb/rrc/task.hpp>
#include <gnb/sra/task.hpp>
#include <gnb/rls/task.hpp>
#include <gnb/sctp/task.hpp>
#include <utils/common.hpp>
#include <utils/printer.hpp>
......@@ -36,7 +36,7 @@ void GnbCmdHandler::sendError(const InetAddress &address, const std::string &out
void GnbCmdHandler::pauseTasks()
{
m_base->gtpTask->requestPause();
m_base->sraTask->requestPause();
m_base->rlsTask->requestPause();
m_base->ngapTask->requestPause();
m_base->rrcTask->requestPause();
m_base->sctpTask->requestPause();
......@@ -45,7 +45,7 @@ void GnbCmdHandler::pauseTasks()
void GnbCmdHandler::unpauseTasks()
{
m_base->gtpTask->requestUnpause();
m_base->sraTask->requestUnpause();
m_base->rlsTask->requestUnpause();
m_base->ngapTask->requestUnpause();
m_base->rrcTask->requestUnpause();
m_base->sctpTask->requestUnpause();
......@@ -55,7 +55,7 @@ bool GnbCmdHandler::isAllPaused()
{
if (!m_base->gtpTask->isPauseConfirmed())
return false;
if (!m_base->sraTask->isPauseConfirmed())
if (!m_base->rlsTask->isPauseConfirmed())
return false;
if (!m_base->ngapTask->isPauseConfirmed())
return false;
......
......@@ -9,10 +9,9 @@
#include "gnb.hpp"
#include "app/task.hpp"
#include "gtp/task.hpp"
#include "sra/task.hpp"
#include "rls/task.hpp"
#include "ngap/task.hpp"
#include "rrc/task.hpp"
#include "sra/task.hpp"
#include "sctp/task.hpp"
#include <app/cli_base.hpp>
......@@ -33,7 +32,7 @@ GNodeB::GNodeB(GnbConfig *config, app::INodeListener *nodeListener, NtsTask *cli
base->ngapTask = new NgapTask(base);
base->rrcTask = new GnbRrcTask(base);
base->gtpTask = new GtpTask(base);
base->sraTask = new GnbSraTask(base);
base->rlsTask = new GnbRlsTask(base);
taskBase = base;
}
......@@ -45,14 +44,14 @@ GNodeB::~GNodeB()
taskBase->ngapTask->quit();
taskBase->rrcTask->quit();
taskBase->gtpTask->quit();
taskBase->sraTask->quit();
taskBase->rlsTask->quit();
delete taskBase->appTask;
delete taskBase->sctpTask;
delete taskBase->ngapTask;
delete taskBase->rrcTask;
delete taskBase->gtpTask;
delete taskBase->sraTask;
delete taskBase->rlsTask;
delete taskBase->logBase;
......@@ -65,7 +64,7 @@ void GNodeB::start()
taskBase->sctpTask->start();
taskBase->ngapTask->start();
taskBase->rrcTask->start();
taskBase->sraTask->start();
taskBase->rlsTask->start();
taskBase->gtpTask->start();
}
......
......@@ -10,7 +10,7 @@
#include <asn/ngap/ASN_NGAP_QosFlowSetupRequestItem.h>
#include <gnb/gtp/proto.hpp>
#include <gnb/sra/task.hpp>
#include <gnb/rls/task.hpp>
#include <utils/constants.hpp>
#include <utils/libc_error.hpp>
......@@ -76,11 +76,11 @@ void GtpTask::onLoop()
}
break;
}
case NtsMessageType::GNB_SRA_TO_GTP: {
auto *w = dynamic_cast<NwGnbSraToGtp *>(msg);
case NtsMessageType::GNB_RLS_TO_GTP: {
auto *w = dynamic_cast<NwGnbRlsToGtp *>(msg);
switch (w->present)
{
case NwGnbSraToGtp::DATA_PDU_DELIVERY: {
case NwGnbRlsToGtp::DATA_PDU_DELIVERY: {
handleUplinkData(w->ueId, w->psi, std::move(w->pdu));
break;
}
......@@ -239,11 +239,11 @@ void GtpTask::handleUdpReceive(const udp::NwUdpServerReceive &msg)
if (m_rateLimiter->allowDownlinkPacket(sessionInd, gtp->payload.length()))
{
auto *w = new NwGnbGtpToSra(NwGnbGtpToSra::DATA_PDU_DELIVERY);
auto *w = new NwGnbGtpToRls(NwGnbGtpToRls::DATA_PDU_DELIVERY);
w->ueId = GetUeId(sessionInd);
w->psi = GetPsi(sessionInd);
w->pdu = std::move(gtp->payload);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
delete gtp;
......
......@@ -23,7 +23,7 @@
namespace nr::gnb
{
struct NwGnbSraToRrc : NtsMessage
struct NwGnbRlsToRrc : NtsMessage
{
enum PR
{
......@@ -39,12 +39,12 @@ struct NwGnbSraToRrc : NtsMessage
rrc::RrcChannel channel{};
OctetString pdu{};
explicit NwGnbSraToRrc(PR present) : NtsMessage(NtsMessageType::GNB_SRA_TO_RRC), present(present)
explicit NwGnbRlsToRrc(PR present) : NtsMessage(NtsMessageType::GNB_RLS_TO_RRC), present(present)
{
}
};
struct NwGnbSraToGtp : NtsMessage
struct NwGnbRlsToGtp : NtsMessage
{
enum PR
{
......@@ -56,12 +56,12 @@ struct NwGnbSraToGtp : NtsMessage
int psi{};
OctetString pdu{};
explicit NwGnbSraToGtp(PR present) : NtsMessage(NtsMessageType::GNB_SRA_TO_GTP), present(present)
explicit NwGnbRlsToGtp(PR present) : NtsMessage(NtsMessageType::GNB_RLS_TO_GTP), present(present)
{
}
};
struct NwGnbGtpToSra : NtsMessage
struct NwGnbGtpToRls : NtsMessage
{
enum PR
{
......@@ -73,12 +73,12 @@ struct NwGnbGtpToSra : NtsMessage
int psi{};
OctetString pdu{};
explicit NwGnbGtpToSra(PR present) : NtsMessage(NtsMessageType::GNB_GTP_TO_SRA), present(present)
explicit NwGnbGtpToRls(PR present) : NtsMessage(NtsMessageType::GNB_GTP_TO_RLS), present(present)
{
}
};
struct NwGnbRrcToSra : NtsMessage
struct NwGnbRrcToRls : NtsMessage
{
enum PR
{
......@@ -91,7 +91,7 @@ struct NwGnbRrcToSra : NtsMessage
rrc::RrcChannel channel{};
OctetString pdu{};
explicit NwGnbRrcToSra(PR present) : NtsMessage(NtsMessageType::GNB_RRC_TO_SRA), present(present)
explicit NwGnbRrcToRls(PR present) : NtsMessage(NtsMessageType::GNB_RRC_TO_RLS), present(present)
{
}
};
......
......@@ -28,7 +28,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
namespace nr::gnb
{
void GnbSraTask::handleCellInfoRequest(int ueId, const sra::SraCellInfoRequest &msg)
void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &msg)
{
int dbm = EstimateSimulatedDbm(m_base->config->phyLocation, msg.simPos);
if (dbm < MIN_ALLOWED_DBM)
......@@ -37,7 +37,7 @@ void GnbSraTask::handleCellInfoRequest(int ueId, const sra::SraCellInfoRequest &
return;
}
sra::SraCellInfoResponse resp{m_sti};
rls::SraCellInfoResponse resp{m_sti};
resp.cellId.nci = m_base->config->nci;
resp.cellId.plmn = m_base->config->plmn;
resp.tac = m_base->config->tac;
......@@ -48,19 +48,19 @@ void GnbSraTask::handleCellInfoRequest(int ueId, const sra::SraCellInfoRequest &
sendSraMessage(ueId, resp);
}
void GnbSraTask::handleUplinkPduDelivery(int ueId, sra::SraPduDelivery &msg)
void GnbRlsTask::handleUplinkPduDelivery(int ueId, rls::SraPduDelivery &msg)
{
if (msg.pduType == sra::EPduType::RRC)
if (msg.pduType == rls::EPduType::RRC)
{
auto *nw = new NwGnbSraToRrc(NwGnbSraToRrc::RRC_PDU_DELIVERY);
auto *nw = new NwGnbRlsToRrc(NwGnbRlsToRrc::RRC_PDU_DELIVERY);
nw->ueId = ueId;
nw->channel = static_cast<rrc::RrcChannel>(msg.payload.get4I(0));
nw->pdu = std::move(msg.pdu);
m_base->rrcTask->push(nw);
}
else if (msg.pduType == sra::EPduType::DATA)
else if (msg.pduType == rls::EPduType::DATA)
{
auto *nw = new NwGnbSraToGtp(NwGnbSraToGtp::DATA_PDU_DELIVERY);
auto *nw = new NwGnbRlsToGtp(NwGnbRlsToGtp::DATA_PDU_DELIVERY);
nw->ueId = ueId;
nw->psi = msg.payload.get4I(0);
nw->pdu = std::move(msg.pdu);
......@@ -68,9 +68,9 @@ void GnbSraTask::handleUplinkPduDelivery(int ueId, sra::SraPduDelivery &msg)
}
}
void GnbSraTask::handleDownlinkDelivery(int ueId, sra::EPduType pduType, OctetString &&pdu, OctetString &&payload)
void GnbRlsTask::handleDownlinkDelivery(int ueId, rls::EPduType pduType, OctetString &&pdu, OctetString &&payload)
{
sra::SraPduDelivery resp{m_sti};
rls::SraPduDelivery resp{m_sti};
resp.pduType = pduType;
resp.pdu = std::move(pdu);
resp.payload = std::move(payload);
......
......@@ -16,7 +16,7 @@ static const int64_t LAST_SEEN_THRESHOLD = 3000;
namespace nr::gnb
{
int GnbSraTask::updateUeInfo(const InetAddress &addr, uint64_t sti)
int GnbRlsTask::updateUeInfo(const InetAddress &addr, uint64_t sti)
{
if (m_stiToUeId.count(sti))
{
......@@ -41,7 +41,7 @@ int GnbSraTask::updateUeInfo(const InetAddress &addr, uint64_t sti)
}
}
void GnbSraTask::onPeriodicLostControl()
void GnbRlsTask::onPeriodicLostControl()
{
int64_t current = utils::CurrentTimeMillis();
......@@ -64,7 +64,7 @@ void GnbSraTask::onPeriodicLostControl()
m_ueCtx.erase(ueId);
m_logger->debug("Signal lost detected for UE[%d]", ueId);
auto *w = new NwGnbSraToRrc(NwGnbSraToRrc::SIGNAL_LOST);
auto *w = new NwGnbRlsToRrc(NwGnbRlsToRrc::SIGNAL_LOST);
w->ueId = ueId;
m_base->rrcTask->push(w);
}
......
......@@ -20,13 +20,14 @@ static const int TIMER_PERIOD_LOST_CONTROL = 2000;
namespace nr::gnb
{
GnbSraTask::GnbSraTask(TaskBase *base) : m_base{base}, m_udpTask{}, m_ueCtx{}, m_stiToUeId{}, m_ueIdCounter{}
GnbRlsTask::GnbRlsTask(TaskBase *base)
: m_base{base}, m_udpTask{}, m_powerOn{}, m_ueCtx{}, m_stiToUeId{}, m_ueIdCounter{}
{
m_logger = m_base->logBase->makeUniqueLogger("sra");
m_logger = m_base->logBase->makeUniqueLogger("rls");
m_sti = utils::Random64();
}
void GnbSraTask::onStart()
void GnbRlsTask::onStart()
{
try
{
......@@ -35,7 +36,7 @@ void GnbSraTask::onStart()
}
catch (const LibError &e)
{
m_logger->err("SRA failure [%s]", e.what());
m_logger->err("RLS failure [%s]", e.what());
quit();
return;
}
......@@ -43,7 +44,7 @@ void GnbSraTask::onStart()
setTimer(TIMER_ID_LOST_CONTROL, TIMER_PERIOD_LOST_CONTROL);
}
void GnbSraTask::onLoop()
void GnbRlsTask::onLoop()
{
NtsMessage *msg = take();
if (!msg)
......@@ -51,28 +52,28 @@ void GnbSraTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::GNB_RRC_TO_SRA: {
auto *w = dynamic_cast<NwGnbRrcToSra *>(msg);
case NtsMessageType::GNB_RRC_TO_RLS: {
auto *w = dynamic_cast<NwGnbRrcToRls *>(msg);
switch (w->present)
{
case NwGnbRrcToSra::RRC_PDU_DELIVERY: {
handleDownlinkDelivery(w->ueId, sra::EPduType::RRC, std::move(w->pdu),
case NwGnbRrcToRls::RRC_PDU_DELIVERY: {
handleDownlinkDelivery(w->ueId, rls::EPduType::RRC, std::move(w->pdu),
OctetString::FromOctet4(static_cast<int>(w->channel)));
break;
}
case NwGnbRrcToSra::RADIO_POWER_ON: {
case NwGnbRrcToRls::RADIO_POWER_ON: {
m_powerOn = true;
break;
}
}
break;
}
case NtsMessageType::GNB_GTP_TO_SRA: {
auto *w = dynamic_cast<NwGnbGtpToSra *>(msg);
case NtsMessageType::GNB_GTP_TO_RLS: {
auto *w = dynamic_cast<NwGnbGtpToRls *>(msg);
switch (w->present)
{
case NwGnbGtpToSra::DATA_PDU_DELIVERY: {
handleDownlinkDelivery(w->ueId, sra::EPduType::DATA, std::move(w->pdu),
case NwGnbGtpToRls::DATA_PDU_DELIVERY: {
handleDownlinkDelivery(w->ueId, rls::EPduType::DATA, std::move(w->pdu),
OctetString::FromOctet4(static_cast<int>(w->psi)));
break;
}
......@@ -81,7 +82,7 @@ void GnbSraTask::onLoop()
}
case NtsMessageType::UDP_SERVER_RECEIVE: {
auto *w = dynamic_cast<udp::NwUdpServerReceive *>(msg);
auto sraMsg = sra::DecodeSraMessage(OctetView{w->packet});
auto sraMsg = rls::DecodeRlsMessage(OctetView{w->packet});
if (sraMsg == nullptr)
{
m_logger->err("Unable to decode SRA message");
......@@ -107,7 +108,7 @@ void GnbSraTask::onLoop()
delete msg;
}
void GnbSraTask::onQuit()
void GnbRlsTask::onQuit()
{
if (m_udpTask != nullptr)
m_udpTask->quit();
......
......@@ -14,7 +14,7 @@
#include <thread>
#include <udp/server_task.hpp>
#include <unordered_map>
#include <urs/sra_pdu.hpp>
#include <urs/rls_pdu.hpp>
#include <utils/logger.hpp>
#include <utils/nts.hpp>
#include <vector>
......@@ -22,7 +22,7 @@
namespace nr::gnb
{
class GnbSraTask : public NtsTask
class GnbRlsTask : public NtsTask
{
private:
TaskBase *m_base;
......@@ -38,8 +38,8 @@ class GnbSraTask : public NtsTask
friend class GnbCmdHandler;
public:
explicit GnbSraTask(TaskBase *base);
~GnbSraTask() override = default;
explicit GnbRlsTask(TaskBase *base);
~GnbRlsTask() override = default;
protected:
void onStart() override;
......@@ -47,13 +47,13 @@ class GnbSraTask : public NtsTask
void onQuit() override;
private: /* Transport */
void receiveSraMessage(const InetAddress &addr, sra::SraMessage &msg);
void sendSraMessage(int ueId, const sra::SraMessage &msg);
void receiveSraMessage(const InetAddress &addr, rls::SraMessage &msg);
void sendSraMessage(int ueId, const rls::SraMessage &msg);
private: /* Handler */
void handleCellInfoRequest(int ueId, const sra::SraCellInfoRequest &msg);
void handleUplinkPduDelivery(int ueId, sra::SraPduDelivery &msg);
void handleDownlinkDelivery(int ueId, sra::EPduType pduType, OctetString &&pdu, OctetString &&payload);
void handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &msg);
void handleUplinkPduDelivery(int ueId, rls::SraPduDelivery &msg);
void handleDownlinkDelivery(int ueId, rls::EPduType pduType, OctetString &&pdu, OctetString &&payload);
private: /* UE Management */
int updateUeInfo(const InetAddress &addr, uint64_t sti);
......
......@@ -11,7 +11,7 @@
namespace nr::gnb
{
void GnbSraTask::receiveSraMessage(const InetAddress &addr, sra::SraMessage &msg)
void GnbRlsTask::receiveSraMessage(const InetAddress &addr, rls::SraMessage &msg)
{
if (!m_powerOn)
{
......@@ -23,12 +23,12 @@ void GnbSraTask::receiveSraMessage(const InetAddress &addr, sra::SraMessage &msg
switch (msg.msgType)
{
case sra::EMessageType::CELL_INFO_REQUEST: {
handleCellInfoRequest(ueId, (const sra::SraCellInfoRequest &)msg);
case rls::EMessageType::CELL_INFO_REQUEST: {
handleCellInfoRequest(ueId, (const rls::SraCellInfoRequest &)msg);
break;
}
case sra::EMessageType::PDU_DELIVERY: {
handleUplinkPduDelivery(ueId, (sra::SraPduDelivery &)msg);
case rls::EMessageType::PDU_DELIVERY: {
handleUplinkPduDelivery(ueId, (rls::SraPduDelivery &)msg);
break;
}
default:
......@@ -37,7 +37,7 @@ void GnbSraTask::receiveSraMessage(const InetAddress &addr, sra::SraMessage &msg
}
}
void GnbSraTask::sendSraMessage(int ueId, const sra::SraMessage &msg)
void GnbRlsTask::sendSraMessage(int ueId, const rls::SraMessage &msg)
{
if (!m_ueCtx.count(ueId))
{
......@@ -46,7 +46,7 @@ void GnbSraTask::sendSraMessage(int ueId, const sra::SraMessage &msg)
}
OctetString stream{};
sra::EncodeSraMessage(msg, stream);
rls::EncodeRlsMessage(msg, stream);
m_udpTask->send(m_ueCtx[ueId]->addr, stream);
}
......
......@@ -9,7 +9,7 @@
#include "task.hpp"
#include <asn/rrc/ASN_RRC_UL-CCCH-Message.h>
#include <asn/rrc/ASN_RRC_UL-DCCH-Message.h>
#include <gnb/sra/task.hpp>
#include <gnb/rls/task.hpp>
#include <rrc/encode.hpp>
namespace nr::gnb
......@@ -103,11 +103,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_BCCH_BCH_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::BCCH_BCH;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_BCCH_DL_SCH_Message *msg)
......@@ -119,11 +119,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_BCCH_DL_SCH_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::BCCH_DL_SCH;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_DL_CCCH_Message *msg)
......@@ -135,11 +135,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_DL_CCCH_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::DL_CCCH;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_DL_DCCH_Message *msg)
......@@ -151,11 +151,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_DL_DCCH_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::DL_DCCH;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_PCCH_Message *msg)
......@@ -167,11 +167,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_PCCH_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::PCCH;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_CCCH_Message *msg)
......@@ -183,11 +183,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_CCCH_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::UL_CCCH;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_CCCH1_Message *msg)
......@@ -199,11 +199,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_CCCH1_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::UL_CCCH1;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_DCCH_Message *msg)
......@@ -215,11 +215,11 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_DCCH_Message *msg)
return;
}
auto *w = new NwGnbRrcToSra(NwGnbRrcToSra::RRC_PDU_DELIVERY);
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::UL_DCCH;
w->pdu = std::move(pdu);
m_base->sraTask->push(w);
m_base->rlsTask->push(w);
}
void GnbRrcTask::receiveRrcMessage(int ueId, ASN_RRC_BCCH_BCH_Message *msg)
......
......@@ -10,7 +10,7 @@
#include <asn/rrc/ASN_RRC_DLInformationTransfer-IEs.h>
#include <asn/rrc/ASN_RRC_DLInformationTransfer.h>
#include <gnb/nts.hpp>
#include <gnb/sra/task.hpp>
#include <gnb/rls/task.hpp>
#include <rrc/encode.hpp>
namespace nr::gnb
......@@ -38,15 +38,15 @@ void GnbRrcTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::GNB_SRA_TO_RRC: {
auto *w = dynamic_cast<NwGnbSraToRrc *>(msg);
case NtsMessageType::GNB_RLS_TO_RRC: {
auto *w = dynamic_cast<NwGnbRlsToRrc *>(msg);
switch (w->present)
{
case NwGnbSraToRrc::RRC_PDU_DELIVERY: {
case NwGnbRlsToRrc::RRC_PDU_DELIVERY: {
handleUplinkRrc(w->ueId, w->channel, w->pdu);
break;
}
case NwGnbSraToRrc::SIGNAL_LOST: {
case NwGnbRlsToRrc::SIGNAL_LOST: {
handleRadioLinkFailure(w->ueId);
break;
}
......@@ -58,7 +58,7 @@ void GnbRrcTask::onLoop()
switch (w->present)
{
case NwGnbNgapToRrc::RADIO_POWER_ON: {
m_base->sraTask->push(new NwGnbRrcToSra(NwGnbRrcToSra::RADIO_POWER_ON));
m_base->rlsTask->push(new NwGnbRrcToRls(NwGnbRrcToRls::RADIO_POWER_ON));
break;
}
case NwGnbNgapToRrc::NAS_DELIVERY: {
......
......@@ -26,7 +26,7 @@ class GnbAppTask;
class GtpTask;
class NgapTask;
class GnbRrcTask;
class GnbSraTask;
class GnbRlsTask;
class SctpTask;
enum class EAmfState
......@@ -337,7 +337,7 @@ struct TaskBase
NgapTask *ngapTask{};
GnbRrcTask *rrcTask{};
SctpTask *sctpTask{};
GnbSraTask *sraTask{};
GnbRlsTask *rlsTask{};
};
Json ToJson(const GnbStatusInfo &v);
......
......@@ -11,7 +11,7 @@
#include <ue/app/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/rrc/task.hpp>
#include <ue/sra/task.hpp>
#include <ue/rls/task.hpp>
#include <ue/tun/task.hpp>
#include <utils/common.hpp>
#include <utils/printer.hpp>
......@@ -47,14 +47,14 @@ void UeCmdHandler::pauseTasks()
{
m_base->nasTask->requestPause();
m_base->rrcTask->requestPause();
m_base->sraTask->requestPause();
m_base->rlsTask->requestPause();
}
void UeCmdHandler::unpauseTasks()
{
m_base->nasTask->requestUnpause();
m_base->rrcTask->requestUnpause();
m_base->sraTask->requestUnpause();
m_base->rlsTask->requestUnpause();
}
bool UeCmdHandler::isAllPaused()
......@@ -63,7 +63,7 @@ bool UeCmdHandler::isAllPaused()
return false;
if (!m_base->rrcTask->isPauseConfirmed())
return false;
if (!m_base->sraTask->isPauseConfirmed())
if (!m_base->rlsTask->isPauseConfirmed())
return false;
return true;
}
......@@ -115,7 +115,7 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg)
{"mm-state", ToJson(m_base->nasTask->mm->m_mmSubState)},
{"5u-state", ToJson(m_base->nasTask->mm->m_usim->m_uState)},
{"camped-cell",
::ToJson(m_base->sraTask->m_servingCell.has_value() ? m_base->sraTask->m_servingCell->gnbName : "")},
::ToJson(m_base->rlsTask->m_servingCell.has_value() ? m_base->rlsTask->m_servingCell->gnbName : "")},
{"sim-inserted", m_base->nasTask->mm->m_usim->isValid()},
{"stored-suci", ToJson(m_base->nasTask->mm->m_usim->m_storedSuci)},
{"stored-guti", ToJson(m_base->nasTask->mm->m_usim->m_storedGuti)},
......@@ -164,7 +164,7 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg)
break;
}
case app::UeCliCommand::COVERAGE: {
auto &map = m_base->sraTask->m_activeMeasurements;
auto &map = m_base->rlsTask->m_activeMeasurements;
if (map.empty())
{
sendResult(msg.address, "No cell exists in the range");
......
......@@ -9,7 +9,7 @@
#include "task.hpp"
#include "cmd_handler.hpp"
#include <nas/utils.hpp>
#include <ue/sra/task.hpp>
#include <ue/rls/task.hpp>
#include <ue/tun/tun.hpp>
#include <utils/common.hpp>
#include <utils/constants.hpp>
......@@ -50,11 +50,11 @@ void UeAppTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::UE_SRA_TO_APP: {
auto *w = dynamic_cast<NwUeSraToApp *>(msg);
case NtsMessageType::UE_RLS_TO_APP: {
auto *w = dynamic_cast<NwUeRlsToApp *>(msg);
switch (w->present)
{
case NwUeSraToApp::DATA_PDU_DELIVERY: {
case NwUeRlsToApp::DATA_PDU_DELIVERY: {
auto *tunTask = m_tunTasks[w->psi];
if (tunTask)
{
......@@ -226,10 +226,10 @@ void UeAppTask::handleUplinkDataRequest(int psi, OctetString &&data)
{
if (m_cmState == ECmState::CM_CONNECTED)
{
auto *nw = new NwUeAppToSra(NwUeAppToSra::DATA_PDU_DELIVERY);
auto *nw = new NwUeAppToRls(NwUeAppToRls::DATA_PDU_DELIVERY);
nw->psi = psi;
nw->pdu = std::move(data);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
else
{
......
......@@ -110,7 +110,7 @@ struct NwUeNasToRrc : NtsMessage
}
};
struct NwUeRrcToSra : NtsMessage
struct NwUeRrcToRls : NtsMessage
{
enum PR
{
......@@ -127,12 +127,12 @@ struct NwUeRrcToSra : NtsMessage
rrc::RrcChannel channel{};
OctetString pdu{};
explicit NwUeRrcToSra(PR present) : NtsMessage(NtsMessageType::UE_RRC_TO_SRA), present(present)
explicit NwUeRrcToRls(PR present) : NtsMessage(NtsMessageType::UE_RRC_TO_RLS), present(present)
{
}
};
struct NwUeSraToRrc : NtsMessage
struct NwUeRlsToRrc : NtsMessage
{
enum PR
{
......@@ -152,7 +152,7 @@ struct NwUeSraToRrc : NtsMessage
rrc::RrcChannel channel{};
OctetString pdu{};
explicit NwUeSraToRrc(PR present) : NtsMessage(NtsMessageType::UE_SRA_TO_RRC), present(present)
explicit NwUeRlsToRrc(PR present) : NtsMessage(NtsMessageType::UE_RLS_TO_RRC), present(present)
{
}
};
......@@ -186,7 +186,7 @@ struct NwUeNasToApp : NtsMessage
}
};
struct NwUeAppToSra : NtsMessage
struct NwUeAppToRls : NtsMessage
{
enum PR
{
......@@ -197,12 +197,12 @@ struct NwUeAppToSra : NtsMessage
int psi{};
OctetString pdu{};
explicit NwUeAppToSra(PR present) : NtsMessage(NtsMessageType::UE_APP_TO_SRA), present(present)
explicit NwUeAppToRls(PR present) : NtsMessage(NtsMessageType::UE_APP_TO_RLS), present(present)
{
}
};
struct NwUeSraToApp : NtsMessage
struct NwUeRlsToApp : NtsMessage
{
enum PR
{
......@@ -213,7 +213,7 @@ struct NwUeSraToApp : NtsMessage
int psi{};
OctetString pdu{};
explicit NwUeSraToApp(PR present) : NtsMessage(NtsMessageType::UE_SRA_TO_APP), present(present)
explicit NwUeRlsToApp(PR present) : NtsMessage(NtsMessageType::UE_RLS_TO_APP), present(present)
{
}
};
......
......@@ -14,7 +14,7 @@
namespace nr::ue
{
void UeSraTask::onMeasurement()
void UeRlsTask::onMeasurement()
{
std::vector<GlobalNci> entered{};
std::vector<GlobalNci> exited{};
......@@ -41,12 +41,12 @@ void UeSraTask::onMeasurement()
// Issue another cell info request for each address in the search space
for (auto &ip : m_cellSearchSpace)
{
sra::SraCellInfoRequest req{m_sti};
sendSraMessage(ip, req);
rls::SraCellInfoRequest req{m_sti};
sendRlsMessage(ip, req);
}
}
void UeSraTask::receiveCellInfoResponse(const sra::SraCellInfoResponse &msg)
void UeRlsTask::receiveCellInfoResponse(const rls::SraCellInfoResponse &msg)
{
UeCellMeasurement meas{};
meas.sti = msg.sti;
......@@ -59,7 +59,7 @@ void UeSraTask::receiveCellInfoResponse(const sra::SraCellInfoResponse &msg)
m_pendingMeasurements[meas.cellId] = meas;
}
void UeSraTask::onCoverageChange(const std::vector<GlobalNci> &entered, const std::vector<GlobalNci> &exited)
void UeRlsTask::onCoverageChange(const std::vector<GlobalNci> &entered, const std::vector<GlobalNci> &exited)
{
m_logger->debug("Coverage change detected. [%d] cell entered, [%d] cell exited", static_cast<int>(entered.size()),
static_cast<int>(exited.size()));
......@@ -71,22 +71,22 @@ void UeSraTask::onCoverageChange(const std::vector<GlobalNci> &entered, const st
{
m_logger->warn("Signal lost from camped cell");
m_servingCell = std::nullopt;
m_base->rrcTask->push(new NwUeSraToRrc(NwUeSraToRrc::RADIO_LINK_FAILURE));
m_base->rrcTask->push(new NwUeRlsToRrc(NwUeRlsToRrc::RADIO_LINK_FAILURE));
}
}
void UeSraTask::plmnSearchRequested()
void UeRlsTask::plmnSearchRequested()
{
std::vector<UeCellMeasurement> measurements{};
for (auto &m : m_activeMeasurements)
measurements.push_back(m.second);
auto *w = new NwUeSraToRrc(NwUeSraToRrc::PLMN_SEARCH_RESPONSE);
auto *w = new NwUeRlsToRrc(NwUeRlsToRrc::PLMN_SEARCH_RESPONSE);
w->measurements = std::move(measurements);
m_base->rrcTask->push(w);
}
void UeSraTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuitable)
void UeRlsTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuitable)
{
if (!m_activeMeasurements.count(cellId))
{
......@@ -104,7 +104,7 @@ void UeSraTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuita
m_servingCell->linkIp = measurement.linkIp;
m_servingCell->cellCategory = isSuitable ? ECellCategory::SUITABLE_CELL : ECellCategory::ACCEPTABLE_CELL;
auto *w = new NwUeSraToRrc(NwUeSraToRrc::SERVING_CELL_CHANGE);
auto *w = new NwUeRlsToRrc(NwUeRlsToRrc::SERVING_CELL_CHANGE);
w->servingCell = *m_servingCell;
m_base->rrcTask->push(w);
}
......
......@@ -17,7 +17,7 @@ static const int TIMER_PERIOD_MEASUREMENT = 2000;
namespace nr::ue
{
UeSraTask::UeSraTask(TaskBase *base)
UeRlsTask::UeRlsTask(TaskBase *base)
: m_base{base}, m_udpTask{}, m_cellSearchSpace{}, m_pendingMeasurements{}, m_activeMeasurements{}, m_servingCell{}
{
m_logger = m_base->logBase->makeUniqueLogger(m_base->config->getLoggerPrefix() + "sra");
......@@ -28,7 +28,7 @@ UeSraTask::UeSraTask(TaskBase *base)
m_sti = utils::Random64();
}
void UeSraTask::onStart()
void UeRlsTask::onStart()
{
m_udpTask = new udp::UdpServerTask(this);
......@@ -42,7 +42,7 @@ void UeSraTask::onStart()
onMeasurement();
}
void UeSraTask::onLoop()
void UeRlsTask::onLoop()
{
NtsMessage *msg = take();
if (!msg)
......@@ -50,29 +50,29 @@ void UeSraTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::UE_RRC_TO_SRA: {
auto *w = dynamic_cast<NwUeRrcToSra *>(msg);
case NtsMessageType::UE_RRC_TO_RLS: {
auto *w = dynamic_cast<NwUeRrcToRls *>(msg);
switch (w->present)
{
case NwUeRrcToSra::PLMN_SEARCH_REQUEST:
case NwUeRrcToRls::PLMN_SEARCH_REQUEST:
plmnSearchRequested();
break;
case NwUeRrcToSra::CELL_SELECTION_COMMAND:
case NwUeRrcToRls::CELL_SELECTION_COMMAND:
handleCellSelectionCommand(w->cellId, w->isSuitableCell);
break;
case NwUeRrcToSra::RRC_PDU_DELIVERY:
deliverUplinkPdu(sra::EPduType::RRC, std::move(w->pdu),
case NwUeRrcToRls::RRC_PDU_DELIVERY:
deliverUplinkPdu(rls::EPduType::RRC, std::move(w->pdu),
OctetString::FromOctet4(static_cast<int>(w->channel)));
break;
}
break;
}
case NtsMessageType::UE_APP_TO_SRA: {
auto *w = dynamic_cast<NwUeAppToSra *>(msg);
case NtsMessageType::UE_APP_TO_RLS: {
auto *w = dynamic_cast<NwUeAppToRls *>(msg);
switch (w->present)
{
case NwUeAppToSra::DATA_PDU_DELIVERY: {
deliverUplinkPdu(sra::EPduType::DATA, std::move(w->pdu), OctetString::FromOctet4(static_cast<int>(w->psi)));
case NwUeAppToRls::DATA_PDU_DELIVERY: {
deliverUplinkPdu(rls::EPduType::DATA, std::move(w->pdu), OctetString::FromOctet4(static_cast<int>(w->psi)));
break;
}
}
......@@ -89,13 +89,13 @@ void UeSraTask::onLoop()
}
case NtsMessageType::UDP_SERVER_RECEIVE: {
auto *w = dynamic_cast<udp::NwUdpServerReceive *>(msg);
auto sraMsg = sra::DecodeSraMessage(OctetView{w->packet});
if (sraMsg == nullptr)
auto rlsMsg = rls::DecodeRlsMessage(OctetView{w->packet});
if (rlsMsg == nullptr)
{
m_logger->err("Unable to decode SRA message");
m_logger->err("Unable to decode RLS message");
break;
}
receiveSraMessage(w->fromAddress, *sraMsg);
receiveRlsMessage(w->fromAddress, *rlsMsg);
break;
}
default:
......@@ -106,7 +106,7 @@ void UeSraTask::onLoop()
delete msg;
}
void UeSraTask::onQuit()
void UeRlsTask::onQuit()
{
m_udpTask->quit();
delete m_udpTask;
......
......@@ -15,7 +15,7 @@
#include <udp/server_task.hpp>
#include <ue/types.hpp>
#include <unordered_map>
#include <urs/sra_pdu.hpp>
#include <urs/rls_pdu.hpp>
#include <utils/common_types.hpp>
#include <utils/logger.hpp>
#include <utils/nts.hpp>
......@@ -24,7 +24,7 @@
namespace nr::ue
{
class UeSraTask : public NtsTask
class UeRlsTask : public NtsTask
{
private:
TaskBase *m_base;
......@@ -41,8 +41,8 @@ class UeSraTask : public NtsTask
friend class UeCmdHandler;
public:
explicit UeSraTask(TaskBase *base);
~UeSraTask() override = default;
explicit UeRlsTask(TaskBase *base);
~UeRlsTask() override = default;
protected:
void onStart() override;
......@@ -50,14 +50,14 @@ class UeSraTask : public NtsTask
void onQuit() override;
private: /* Transport */
void receiveSraMessage(const InetAddress &address, sra::SraMessage &msg);
void sendSraMessage(const InetAddress &address, const sra::SraMessage &msg);
void deliverUplinkPdu(sra::EPduType pduType, OctetString &&pdu, OctetString &&payload);
void deliverDownlinkPdu(sra::SraPduDelivery &msg);
void receiveRlsMessage(const InetAddress &address, rls::SraMessage &msg);
void sendRlsMessage(const InetAddress &address, const rls::SraMessage &msg);
void deliverUplinkPdu(rls::EPduType pduType, OctetString &&pdu, OctetString &&payload);
void deliverDownlinkPdu(rls::SraPduDelivery &msg);
private: /* Measurement */
void onMeasurement();
void receiveCellInfoResponse(const sra::SraCellInfoResponse &msg);
void receiveCellInfoResponse(const rls::SraCellInfoResponse &msg);
void onCoverageChange(const std::vector<GlobalNci> &entered, const std::vector<GlobalNci> &exited);
void plmnSearchRequested();
void handleCellSelectionCommand(const GlobalNci &cellId, bool isSuitable);
......
......@@ -15,15 +15,15 @@
namespace nr::ue
{
void UeSraTask::receiveSraMessage(const InetAddress &address, sra::SraMessage &msg)
void UeRlsTask::receiveRlsMessage(const InetAddress &address, rls::SraMessage &msg)
{
switch (msg.msgType)
{
case sra::EMessageType::CELL_INFO_RESPONSE: {
receiveCellInfoResponse((const sra::SraCellInfoResponse &)msg);
case rls::EMessageType::CELL_INFO_RESPONSE: {
receiveCellInfoResponse((const rls::SraCellInfoResponse &)msg);
break;
case sra::EMessageType::PDU_DELIVERY: {
deliverDownlinkPdu((sra::SraPduDelivery &)msg);
case rls::EMessageType::PDU_DELIVERY: {
deliverDownlinkPdu((rls::SraPduDelivery &)msg);
break;
}
default:
......@@ -33,14 +33,14 @@ void UeSraTask::receiveSraMessage(const InetAddress &address, sra::SraMessage &m
}
}
void UeSraTask::sendSraMessage(const InetAddress &address, const sra::SraMessage &msg)
void UeRlsTask::sendRlsMessage(const InetAddress &address, const rls::SraMessage &msg)
{
OctetString stream{};
sra::EncodeSraMessage(msg, stream);
rls::EncodeRlsMessage(msg, stream);
m_udpTask->send(address, stream);
}
void UeSraTask::deliverUplinkPdu(sra::EPduType pduType, OctetString &&pdu, OctetString &&payload)
void UeRlsTask::deliverUplinkPdu(rls::EPduType pduType, OctetString &&pdu, OctetString &&payload)
{
if (!m_servingCell.has_value())
{
......@@ -48,25 +48,25 @@ void UeSraTask::deliverUplinkPdu(sra::EPduType pduType, OctetString &&pdu, Octet
return;
}
sra::SraPduDelivery msg{m_sti};
rls::SraPduDelivery msg{m_sti};
msg.pduType = pduType;
msg.pdu = std::move(pdu);
msg.payload = std::move(payload);
sendSraMessage(InetAddress{m_servingCell->linkIp, cons::PortalPort}, msg);
sendRlsMessage(InetAddress{m_servingCell->linkIp, cons::PortalPort}, msg);
}
void UeSraTask::deliverDownlinkPdu(sra::SraPduDelivery &msg)
void UeRlsTask::deliverDownlinkPdu(rls::SraPduDelivery &msg)
{
if (msg.pduType == sra::EPduType::RRC)
if (msg.pduType == rls::EPduType::RRC)
{
auto *nw = new NwUeSraToRrc(NwUeSraToRrc::RRC_PDU_DELIVERY);
auto *nw = new NwUeRlsToRrc(NwUeRlsToRrc::RRC_PDU_DELIVERY);
nw->channel = static_cast<rrc::RrcChannel>(msg.payload.get4I(0));
nw->pdu = std::move(msg.pdu);
m_base->rrcTask->push(nw);
}
else if (msg.pduType == sra::EPduType::DATA)
else if (msg.pduType == rls::EPduType::DATA)
{
auto *nw = new NwUeSraToApp(NwUeSraToApp::DATA_PDU_DELIVERY);
auto *nw = new NwUeRlsToApp(NwUeRlsToApp::DATA_PDU_DELIVERY);
nw->psi = msg.payload.get4I(0);
nw->pdu = std::move(msg.pdu);
m_base->appTask->push(nw);
......
......@@ -9,7 +9,7 @@
#include "task.hpp"
#include <rrc/encode.hpp>
#include <ue/sra/task.hpp>
#include <ue/rls/task.hpp>
#include <asn/rrc/ASN_RRC_RRCReject.h>
#include <asn/rrc/ASN_RRC_RRCSetup.h>
......@@ -107,10 +107,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_BCH_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::BCCH_BCH;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_DL_SCH_Message *msg)
......@@ -122,10 +122,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_DL_SCH_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::BCCH_DL_SCH;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_DL_CCCH_Message *msg)
......@@ -137,10 +137,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_DL_CCCH_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::DL_CCCH;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_DL_DCCH_Message *msg)
......@@ -152,10 +152,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_DL_DCCH_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::DL_DCCH;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_PCCH_Message *msg)
......@@ -167,10 +167,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_PCCH_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::PCCH;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_UL_CCCH_Message *msg)
......@@ -182,10 +182,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_CCCH_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::UL_CCCH;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_UL_CCCH1_Message *msg)
......@@ -197,10 +197,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_CCCH1_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::UL_CCCH1;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
......@@ -212,10 +212,10 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
return;
}
auto *nw = new NwUeRrcToSra(NwUeRrcToSra::RRC_PDU_DELIVERY);
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::UL_DCCH;
nw->pdu = std::move(pdu);
m_base->sraTask->push(nw);
m_base->rlsTask->push(nw);
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_BCCH_BCH_Message *msg)
......
......@@ -14,7 +14,7 @@
#include <rrc/encode.hpp>
#include <ue/app/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/sra/task.hpp>
#include <ue/rls/task.hpp>
#include <utils/common.hpp>
namespace nr::ue
......@@ -49,7 +49,7 @@ void UeRrcTask::onLoop()
switch (w->present)
{
case NwUeNasToRrc::PLMN_SEARCH_REQUEST: {
m_base->sraTask->push(new NwUeRrcToSra(NwUeRrcToSra::PLMN_SEARCH_REQUEST));
m_base->rlsTask->push(new NwUeRrcToRls(NwUeRrcToRls::PLMN_SEARCH_REQUEST));
break;
}
case NwUeNasToRrc::INITIAL_NAS_DELIVERY: {
......@@ -66,36 +66,36 @@ void UeRrcTask::onLoop()
break;
}
case NwUeNasToRrc::CELL_SELECTION_COMMAND: {
auto *wr = new NwUeRrcToSra(NwUeRrcToSra::CELL_SELECTION_COMMAND);
auto *wr = new NwUeRrcToRls(NwUeRrcToRls::CELL_SELECTION_COMMAND);
wr->cellId = w->cellId;
wr->isSuitableCell = w->isSuitableCell;
m_base->sraTask->push(wr);
m_base->rlsTask->push(wr);
break;
}
}
break;
}
case NtsMessageType::UE_SRA_TO_RRC: {
auto *w = dynamic_cast<NwUeSraToRrc *>(msg);
case NtsMessageType::UE_RLS_TO_RRC: {
auto *w = dynamic_cast<NwUeRlsToRrc *>(msg);
switch (w->present)
{
case NwUeSraToRrc::PLMN_SEARCH_RESPONSE: {
case NwUeRlsToRrc::PLMN_SEARCH_RESPONSE: {
auto *wr = new NwUeRrcToNas(NwUeRrcToNas::PLMN_SEARCH_RESPONSE);
wr->measurements = std::move(w->measurements);
m_base->nasTask->push(wr);
break;
}
case NwUeSraToRrc::SERVING_CELL_CHANGE: {
case NwUeRlsToRrc::SERVING_CELL_CHANGE: {
auto *wr = new NwUeRrcToNas(NwUeRrcToNas::SERVING_CELL_CHANGE);
wr->servingCell = w->servingCell;
m_base->nasTask->push(wr);
break;
}
case NwUeSraToRrc::RRC_PDU_DELIVERY: {
case NwUeRlsToRrc::RRC_PDU_DELIVERY: {
handleDownlinkRrc(w->channel, w->pdu);
break;
}
case NwUeSraToRrc::RADIO_LINK_FAILURE: {
case NwUeRlsToRrc::RADIO_LINK_FAILURE: {
handleRadioLinkFailure();
break;
}
......
......@@ -26,7 +26,7 @@ namespace nr::ue
class UeAppTask;
class NasTask;
class UeRrcTask;
class UeSraTask;
class UeRlsTask;
class UserEquipment;
struct SupportedAlgs
......@@ -124,7 +124,7 @@ struct TaskBase
UeAppTask *appTask{};
NasTask *nasTask{};
UeRrcTask *rrcTask{};
UeSraTask *sraTask{};
UeRlsTask *rlsTask{};
};
struct UeTimers
......
......@@ -9,9 +9,9 @@
#include "ue.hpp"
#include "app/task.hpp"
#include "sra/task.hpp"
#include "nas/task.hpp"
#include "rrc/task.hpp"
#include "rls/task.hpp"
namespace nr::ue
{
......@@ -30,7 +30,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
base->nasTask = new NasTask(base);
base->rrcTask = new UeRrcTask(base);
base->appTask = new UeAppTask(base);
base->sraTask = new UeSraTask(base);
base->rlsTask = new UeRlsTask(base);
taskBase = base;
}
......@@ -39,12 +39,12 @@ UserEquipment::~UserEquipment()
{
taskBase->nasTask->quit();
taskBase->rrcTask->quit();
taskBase->sraTask->quit();
taskBase->rlsTask->quit();
taskBase->appTask->quit();
delete taskBase->nasTask;
delete taskBase->rrcTask;
delete taskBase->sraTask;
delete taskBase->rlsTask;
delete taskBase->appTask;
delete taskBase->logBase;
......@@ -56,7 +56,7 @@ void UserEquipment::start()
{
taskBase->nasTask->start();
taskBase->rrcTask->start();
taskBase->sraTask->start();
taskBase->rlsTask->start();
taskBase->appTask->start();
}
......
......@@ -6,10 +6,10 @@
// and subject to the terms and conditions defined in LICENSE file.
//
#include "sra_pdu.hpp"
#include "rls_pdu.hpp"
#include <utils/constants.hpp>
namespace sra
namespace rls
{
static void AppendPlmn(const Plmn &plmn, OctetString &stream)
......@@ -42,7 +42,7 @@ static GlobalNci DecodeGlobalNci(const OctetView &stream)
return res;
}
void EncodeSraMessage(const SraMessage &msg, OctetString &stream)
void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
{
stream.appendOctet(0x03); // (Just for old RLS compatibility)
......@@ -80,7 +80,7 @@ void EncodeSraMessage(const SraMessage &msg, OctetString &stream)
}
}
std::unique_ptr<SraMessage> DecodeSraMessage(const OctetView &stream)
std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
{
auto first = stream.readI(); // (Just for old RLS compatibility)
if (first != 3)
......
......@@ -14,7 +14,7 @@
#include <utils/octet_string.hpp>
#include <utils/octet_view.hpp>
namespace sra
namespace rls
{
enum class EMessageType : uint8_t
......@@ -75,7 +75,7 @@ struct SraPduDelivery : SraMessage
}
};
void EncodeSraMessage(const SraMessage &msg, OctetString &stream);
std::unique_ptr<SraMessage> DecodeSraMessage(const OctetView &stream);
void EncodeRlsMessage(const SraMessage &msg, OctetString &stream);
std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream);
} // namespace sra
\ No newline at end of file
......@@ -34,24 +34,24 @@ enum class NtsMessageType
UDP_SERVER_RECEIVE,
CLI_SEND_RESPONSE,
GNB_SRA_TO_RRC,
GNB_SRA_TO_GTP,
GNB_GTP_TO_SRA,
GNB_RRC_TO_SRA,
GNB_RLS_TO_RRC,
GNB_RLS_TO_GTP,
GNB_GTP_TO_RLS,
GNB_RRC_TO_RLS,
GNB_NGAP_TO_RRC,
GNB_RRC_TO_NGAP,
GNB_NGAP_TO_GTP,
GNB_SCTP,
UE_APP_TO_SRA,
UE_APP_TO_RLS,
UE_APP_TO_TUN,
UE_TUN_TO_APP,
UE_RRC_TO_NAS,
UE_NAS_TO_RRC,
UE_RRC_TO_SRA,
UE_RRC_TO_RLS,
UE_NAS_TO_NAS,
UE_SRA_TO_RRC,
UE_SRA_TO_APP,
UE_RLS_TO_RRC,
UE_RLS_TO_APP,
UE_NAS_TO_APP,
};
......
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