Commit 0b5cad7a authored by aligungr's avatar aligungr

UE SRA dev.

parent 2ab318fe
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "mr/task.hpp" #include "mr/task.hpp"
#include "ngap/task.hpp" #include "ngap/task.hpp"
#include "rrc/task.hpp" #include "rrc/task.hpp"
#include "sas/task.hpp" #include "sra/task.hpp"
#include "sctp/task.hpp" #include "sctp/task.hpp"
#include <app/cli_base.hpp> #include <app/cli_base.hpp>
...@@ -35,7 +35,7 @@ GNodeB::GNodeB(GnbConfig *config, app::INodeListener *nodeListener, NtsTask *cli ...@@ -35,7 +35,7 @@ GNodeB::GNodeB(GnbConfig *config, app::INodeListener *nodeListener, NtsTask *cli
base->rrcTask = new GnbRrcTask(base); base->rrcTask = new GnbRrcTask(base);
base->gtpTask = new GtpTask(base); base->gtpTask = new GtpTask(base);
base->mrTask = new GnbMrTask(base); base->mrTask = new GnbMrTask(base);
base->sasTask = new GnbSasTask(base); base->sraTask = new GnbSraTask(base);
taskBase = base; taskBase = base;
} }
...@@ -48,7 +48,7 @@ GNodeB::~GNodeB() ...@@ -48,7 +48,7 @@ GNodeB::~GNodeB()
taskBase->rrcTask->quit(); taskBase->rrcTask->quit();
taskBase->gtpTask->quit(); taskBase->gtpTask->quit();
taskBase->mrTask->quit(); taskBase->mrTask->quit();
taskBase->sasTask->quit(); taskBase->sraTask->quit();
delete taskBase->appTask; delete taskBase->appTask;
delete taskBase->sctpTask; delete taskBase->sctpTask;
...@@ -56,7 +56,7 @@ GNodeB::~GNodeB() ...@@ -56,7 +56,7 @@ GNodeB::~GNodeB()
delete taskBase->rrcTask; delete taskBase->rrcTask;
delete taskBase->gtpTask; delete taskBase->gtpTask;
delete taskBase->mrTask; delete taskBase->mrTask;
delete taskBase->sasTask; delete taskBase->sraTask;
delete taskBase->logBase; delete taskBase->logBase;
...@@ -69,7 +69,7 @@ void GNodeB::start() ...@@ -69,7 +69,7 @@ void GNodeB::start()
taskBase->sctpTask->start(); taskBase->sctpTask->start();
taskBase->ngapTask->start(); taskBase->ngapTask->start();
taskBase->rrcTask->start(); taskBase->rrcTask->start();
taskBase->sasTask->start(); taskBase->sraTask->start();
taskBase->mrTask->start(); taskBase->mrTask->start();
taskBase->gtpTask->start(); taskBase->gtpTask->start();
} }
......
...@@ -26,7 +26,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos) ...@@ -26,7 +26,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
namespace nr::gnb namespace nr::gnb
{ {
void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCellInfoRequest &msg) void GnbSraTask::handleCellInfoRequest(const InetAddress &addr, const sra::SraCellInfoRequest &msg)
{ {
int dbm = EstimateSimulatedDbm(m_base->config->phyLocation, msg.simPos); int dbm = EstimateSimulatedDbm(m_base->config->phyLocation, msg.simPos);
if (dbm < MIN_ALLOWED_DBM) if (dbm < MIN_ALLOWED_DBM)
...@@ -35,7 +35,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe ...@@ -35,7 +35,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe
return; return;
} }
sas::SasCellInfoResponse resp{}; sra::SraCellInfoResponse resp{};
resp.cellId.nci = m_base->config->nci; resp.cellId.nci = m_base->config->nci;
resp.cellId.plmn = m_base->config->plmn; resp.cellId.plmn = m_base->config->plmn;
resp.tac = m_base->config->tac; resp.tac = m_base->config->tac;
...@@ -43,7 +43,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe ...@@ -43,7 +43,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe
resp.gnbName = m_base->config->name; resp.gnbName = m_base->config->name;
resp.linkIp = m_base->config->portalIp; resp.linkIp = m_base->config->portalIp;
sendSasMessage(addr, resp); sendSraMessage(addr, resp);
} }
} // namespace nr::gnb } // namespace nr::gnb
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
namespace nr::gnb namespace nr::gnb
{ {
GnbSasTask::GnbSasTask(TaskBase *base) : m_base{base}, m_udpTask{} GnbSraTask::GnbSraTask(TaskBase *base) : m_base{base}, m_udpTask{}
{ {
m_logger = m_base->logBase->makeUniqueLogger("sas"); m_logger = m_base->logBase->makeUniqueLogger("sra");
} }
void GnbSasTask::onStart() void GnbSraTask::onStart()
{ {
try try
{ {
...@@ -30,13 +30,13 @@ void GnbSasTask::onStart() ...@@ -30,13 +30,13 @@ void GnbSasTask::onStart()
} }
catch (const LibError &e) catch (const LibError &e)
{ {
m_logger->err("SAS failure [%s]", e.what()); m_logger->err("SRA failure [%s]", e.what());
quit(); quit();
return; return;
} }
} }
void GnbSasTask::onLoop() void GnbSraTask::onLoop()
{ {
NtsMessage *msg = take(); NtsMessage *msg = take();
if (!msg) if (!msg)
...@@ -46,13 +46,13 @@ void GnbSasTask::onLoop() ...@@ -46,13 +46,13 @@ void GnbSasTask::onLoop()
{ {
case NtsMessageType::UDP_SERVER_RECEIVE: { case NtsMessageType::UDP_SERVER_RECEIVE: {
auto *w = dynamic_cast<udp::NwUdpServerReceive *>(msg); auto *w = dynamic_cast<udp::NwUdpServerReceive *>(msg);
auto sasMsg = sas::DecodeSasMessage(OctetView{w->packet}); auto sraMsg = sra::DecodeSraMessage(OctetView{w->packet});
if (sasMsg == nullptr) if (sraMsg == nullptr)
{ {
m_logger->err("Unable to decode SAS message"); m_logger->err("Unable to decode SRA message");
break; break;
} }
receiveSasMessage(w->fromAddress, *sasMsg); receiveSraMessage(w->fromAddress, *sraMsg);
break; break;
} }
default: default:
...@@ -63,7 +63,7 @@ void GnbSasTask::onLoop() ...@@ -63,7 +63,7 @@ void GnbSasTask::onLoop()
delete msg; delete msg;
} }
void GnbSasTask::onQuit() void GnbSraTask::onQuit()
{ {
if (m_udpTask != nullptr) if (m_udpTask != nullptr)
m_udpTask->quit(); m_udpTask->quit();
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <udp/server_task.hpp> #include <udp/server_task.hpp>
#include <unordered_map> #include <unordered_map>
#include <urs/rls/gnb_entity.hpp> #include <urs/rls/gnb_entity.hpp>
#include <urs/sas_pdu.hpp> #include <urs/sra_pdu.hpp>
#include <utils/logger.hpp> #include <utils/logger.hpp>
#include <utils/nts.hpp> #include <utils/nts.hpp>
#include <vector> #include <vector>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
namespace nr::gnb namespace nr::gnb
{ {
class GnbSasTask : public NtsTask class GnbSraTask : public NtsTask
{ {
private: private:
TaskBase *m_base; TaskBase *m_base;
...@@ -33,8 +33,8 @@ class GnbSasTask : public NtsTask ...@@ -33,8 +33,8 @@ class GnbSasTask : public NtsTask
friend class GnbCmdHandler; friend class GnbCmdHandler;
public: public:
explicit GnbSasTask(TaskBase *base); explicit GnbSraTask(TaskBase *base);
~GnbSasTask() override = default; ~GnbSraTask() override = default;
protected: protected:
void onStart() override; void onStart() override;
...@@ -42,11 +42,11 @@ class GnbSasTask : public NtsTask ...@@ -42,11 +42,11 @@ class GnbSasTask : public NtsTask
void onQuit() override; void onQuit() override;
private: /* Transport */ private: /* Transport */
void receiveSasMessage(const InetAddress &addr, const sas::SasMessage &msg); void receiveSraMessage(const InetAddress &addr, const sra::SraMessage &msg);
void sendSasMessage(const InetAddress &addr, const sas::SasMessage &msg); void sendSraMessage(const InetAddress &addr, const sra::SraMessage &msg);
private: /* Handler */ private: /* Handler */
void handleCellInfoRequest(const InetAddress &addr, const sas::SasCellInfoRequest &msg); void handleCellInfoRequest(const InetAddress &addr, const sra::SraCellInfoRequest &msg);
}; };
} // namespace nr::gnb } // namespace nr::gnb
\ No newline at end of file
...@@ -11,23 +11,23 @@ ...@@ -11,23 +11,23 @@
namespace nr::gnb namespace nr::gnb
{ {
void GnbSasTask::receiveSasMessage(const InetAddress &addr, const sas::SasMessage &msg) void GnbSraTask::receiveSraMessage(const InetAddress &addr, const sra::SraMessage &msg)
{ {
switch (msg.msgType) switch (msg.msgType)
{ {
case sas::SasMessageType::CELL_INFO_REQUEST: case sra::SraMessageType::CELL_INFO_REQUEST:
handleCellInfoRequest(addr, (const sas::SasCellInfoRequest &)msg); handleCellInfoRequest(addr, (const sra::SraCellInfoRequest &)msg);
break; break;
default: default:
m_logger->err("Unhandled SAS message received with type[%d]", static_cast<int>(msg.msgType)); m_logger->err("Unhandled SRA message received with type[%d]", static_cast<int>(msg.msgType));
break; break;
} }
} }
void GnbSasTask::sendSasMessage(const InetAddress &addr, const sas::SasMessage &msg) void GnbSraTask::sendSraMessage(const InetAddress &addr, const sra::SraMessage &msg)
{ {
OctetString stream{}; OctetString stream{};
sas::EncodeSasMessage(msg, stream); sra::EncodeSraMessage(msg, stream);
m_udpTask->send(addr, stream); m_udpTask->send(addr, stream);
} }
......
...@@ -26,7 +26,7 @@ class GtpTask; ...@@ -26,7 +26,7 @@ class GtpTask;
class GnbMrTask; class GnbMrTask;
class NgapTask; class NgapTask;
class GnbRrcTask; class GnbRrcTask;
class GnbSasTask; class GnbSraTask;
class SctpTask; class SctpTask;
enum class EAmfState enum class EAmfState
...@@ -326,7 +326,7 @@ struct TaskBase ...@@ -326,7 +326,7 @@ struct TaskBase
NgapTask *ngapTask{}; NgapTask *ngapTask{};
GnbRrcTask *rrcTask{}; GnbRrcTask *rrcTask{};
SctpTask *sctpTask{}; SctpTask *sctpTask{};
GnbSasTask *sasTask{}; GnbSraTask *sraTask{};
}; };
struct MrUeContext struct MrUeContext
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <ue/mr/task.hpp> #include <ue/mr/task.hpp>
#include <ue/nas/task.hpp> #include <ue/nas/task.hpp>
#include <ue/rrc/task.hpp> #include <ue/rrc/task.hpp>
#include <ue/sas/task.hpp> #include <ue/sra/task.hpp>
#include <ue/tun/task.hpp> #include <ue/tun/task.hpp>
#include <utils/common.hpp> #include <utils/common.hpp>
#include <utils/printer.hpp> #include <utils/printer.hpp>
...@@ -163,7 +163,7 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg) ...@@ -163,7 +163,7 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg)
break; break;
} }
case app::UeCliCommand::COVERAGE: { case app::UeCliCommand::COVERAGE: {
auto &map = m_base->sasTask->m_activeMeasurements; auto &map = m_base->sraTask->m_activeMeasurements;
if (map.empty()) if (map.empty())
{ {
sendResult(msg.address, "No cell exists in the range"); sendResult(msg.address, "No cell exists in the range");
......
...@@ -218,7 +218,7 @@ struct NwUeRrcToMr : NtsMessage ...@@ -218,7 +218,7 @@ struct NwUeRrcToMr : NtsMessage
} }
}; };
struct NwUeRrcToSas : NtsMessage struct NwUeRrcToSra : NtsMessage
{ {
enum PR enum PR
{ {
...@@ -230,12 +230,12 @@ struct NwUeRrcToSas : NtsMessage ...@@ -230,12 +230,12 @@ struct NwUeRrcToSas : NtsMessage
GlobalNci cellId{}; GlobalNci cellId{};
bool isSuitableCell{}; // otherwise 'acceptable' bool isSuitableCell{}; // otherwise 'acceptable'
explicit NwUeRrcToSas(PR present) : NtsMessage(NtsMessageType::UE_RRC_TO_SAS), present(present) explicit NwUeRrcToSra(PR present) : NtsMessage(NtsMessageType::UE_RRC_TO_SRA), present(present)
{ {
} }
}; };
struct NwUeSasToRrc : NtsMessage struct NwUeSraToRrc : NtsMessage
{ {
enum PR enum PR
{ {
...@@ -249,7 +249,7 @@ struct NwUeSasToRrc : NtsMessage ...@@ -249,7 +249,7 @@ struct NwUeSasToRrc : NtsMessage
// SERVING_CELL_CHANGE // SERVING_CELL_CHANGE
UeCellInfo servingCell{}; UeCellInfo servingCell{};
explicit NwUeSasToRrc(PR present) : NtsMessage(NtsMessageType::UE_SAS_TO_RRC), present(present) explicit NwUeSraToRrc(PR present) : NtsMessage(NtsMessageType::UE_SRA_TO_RRC), present(present)
{ {
} }
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <ue/app/task.hpp> #include <ue/app/task.hpp>
#include <ue/mr/task.hpp> #include <ue/mr/task.hpp>
#include <ue/nas/task.hpp> #include <ue/nas/task.hpp>
#include <ue/sas/task.hpp> #include <ue/sra/task.hpp>
#include <utils/common.hpp> #include <utils/common.hpp>
namespace nr::ue namespace nr::ue
...@@ -65,7 +65,7 @@ void UeRrcTask::onLoop() ...@@ -65,7 +65,7 @@ void UeRrcTask::onLoop()
switch (w->present) switch (w->present)
{ {
case NwUeNasToRrc::PLMN_SEARCH_REQUEST: { case NwUeNasToRrc::PLMN_SEARCH_REQUEST: {
m_base->sasTask->push(new NwUeRrcToSas(NwUeRrcToSas::PLMN_SEARCH_REQUEST)); m_base->sraTask->push(new NwUeRrcToSra(NwUeRrcToSra::PLMN_SEARCH_REQUEST));
break; break;
} }
case NwUeNasToRrc::INITIAL_NAS_DELIVERY: { case NwUeNasToRrc::INITIAL_NAS_DELIVERY: {
...@@ -87,26 +87,26 @@ void UeRrcTask::onLoop() ...@@ -87,26 +87,26 @@ void UeRrcTask::onLoop()
break; break;
} }
case NwUeNasToRrc::CELL_SELECTION_COMMAND: { case NwUeNasToRrc::CELL_SELECTION_COMMAND: {
auto *wr = new NwUeRrcToSas(NwUeRrcToSas::CELL_SELECTION_COMMAND); auto *wr = new NwUeRrcToSra(NwUeRrcToSra::CELL_SELECTION_COMMAND);
wr->cellId = w->cellId; wr->cellId = w->cellId;
wr->isSuitableCell = w->isSuitableCell; wr->isSuitableCell = w->isSuitableCell;
m_base->sasTask->push(wr); m_base->sraTask->push(wr);
break; break;
} }
} }
break; break;
} }
case NtsMessageType::UE_SAS_TO_RRC: { case NtsMessageType::UE_SRA_TO_RRC: {
auto *w = dynamic_cast<NwUeSasToRrc *>(msg); auto *w = dynamic_cast<NwUeSraToRrc *>(msg);
switch (w->present) switch (w->present)
{ {
case NwUeSasToRrc::PLMN_SEARCH_RESPONSE: { case NwUeSraToRrc::PLMN_SEARCH_RESPONSE: {
auto *wr = new NwUeRrcToNas(NwUeRrcToNas::PLMN_SEARCH_RESPONSE); auto *wr = new NwUeRrcToNas(NwUeRrcToNas::PLMN_SEARCH_RESPONSE);
wr->measurements = std::move(w->measurements); wr->measurements = std::move(w->measurements);
m_base->nasTask->push(wr); m_base->nasTask->push(wr);
break; break;
} }
case NwUeSasToRrc::SERVING_CELL_CHANGE: { case NwUeSraToRrc::SERVING_CELL_CHANGE: {
auto *wr = new NwUeRrcToNas(NwUeRrcToNas::SERVING_CELL_CHANGE); auto *wr = new NwUeRrcToNas(NwUeRrcToNas::SERVING_CELL_CHANGE);
wr->servingCell = w->servingCell; wr->servingCell = w->servingCell;
m_base->nasTask->push(wr); m_base->nasTask->push(wr);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
namespace nr::ue namespace nr::ue
{ {
void UeSasTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuitable) void UeSraTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuitable)
{ {
if (!m_activeMeasurements.count(cellId)) if (!m_activeMeasurements.count(cellId))
{ {
...@@ -31,7 +31,7 @@ void UeSasTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuita ...@@ -31,7 +31,7 @@ void UeSasTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuita
m_servingCell->linkIp = measurement.linkIp; m_servingCell->linkIp = measurement.linkIp;
m_servingCell->cellCategory = isSuitable ? ECellCategory::SUITABLE_CELL : ECellCategory::ACCEPTABLE_CELL; m_servingCell->cellCategory = isSuitable ? ECellCategory::SUITABLE_CELL : ECellCategory::ACCEPTABLE_CELL;
auto *w = new NwUeSasToRrc(NwUeSasToRrc::SERVING_CELL_CHANGE); auto *w = new NwUeSraToRrc(NwUeSraToRrc::SERVING_CELL_CHANGE);
w->servingCell = *m_servingCell; w->servingCell = *m_servingCell;
m_base->rrcTask->push(w); m_base->rrcTask->push(w);
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
namespace nr::ue namespace nr::ue
{ {
void UeSasTask::onMeasurement() void UeSraTask::onMeasurement()
{ {
std::vector<GlobalNci> entered{}; std::vector<GlobalNci> entered{};
std::vector<GlobalNci> exited{}; std::vector<GlobalNci> exited{};
...@@ -41,12 +41,12 @@ void UeSasTask::onMeasurement() ...@@ -41,12 +41,12 @@ void UeSasTask::onMeasurement()
// Issue another cell info request for each address in the search space // Issue another cell info request for each address in the search space
for (auto &ip : m_cellSearchSpace) for (auto &ip : m_cellSearchSpace)
{ {
sas::SasCellInfoRequest req{}; sra::SraCellInfoRequest req{};
sendSasMessage(ip, req); sendSraMessage(ip, req);
} }
} }
void UeSasTask::receiveCellInfoResponse(const sas::SasCellInfoResponse &msg) void UeSraTask::receiveCellInfoResponse(const sra::SraCellInfoResponse &msg)
{ {
UeCellMeasurement meas{}; UeCellMeasurement meas{};
meas.cellId = msg.cellId; meas.cellId = msg.cellId;
...@@ -58,19 +58,19 @@ void UeSasTask::receiveCellInfoResponse(const sas::SasCellInfoResponse &msg) ...@@ -58,19 +58,19 @@ void UeSasTask::receiveCellInfoResponse(const sas::SasCellInfoResponse &msg)
m_pendingMeasurements[meas.cellId] = meas; m_pendingMeasurements[meas.cellId] = meas;
} }
void UeSasTask::onCoverageChange(const std::vector<GlobalNci> &entered, const std::vector<GlobalNci> &exited) void UeSraTask::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()), m_logger->debug("Coverage change detected. [%d] cell entered, [%d] cell exited", static_cast<int>(entered.size()),
static_cast<int>(exited.size())); static_cast<int>(exited.size()));
} }
void UeSasTask::plmnSearchRequested() void UeSraTask::plmnSearchRequested()
{ {
std::vector<UeCellMeasurement> measurements{}; std::vector<UeCellMeasurement> measurements{};
for (auto &m : m_activeMeasurements) for (auto &m : m_activeMeasurements)
measurements.push_back(m.second); measurements.push_back(m.second);
auto *w = new NwUeSasToRrc(NwUeSasToRrc::PLMN_SEARCH_RESPONSE); auto *w = new NwUeSraToRrc(NwUeSraToRrc::PLMN_SEARCH_RESPONSE);
w->measurements = std::move(measurements); w->measurements = std::move(measurements);
m_base->rrcTask->push(w); m_base->rrcTask->push(w);
} }
......
...@@ -16,16 +16,16 @@ static const int TIMER_PERIOD_MEASUREMENT = 2000; ...@@ -16,16 +16,16 @@ static const int TIMER_PERIOD_MEASUREMENT = 2000;
namespace nr::ue namespace nr::ue
{ {
UeSasTask::UeSasTask(TaskBase *base) UeSraTask::UeSraTask(TaskBase *base)
: m_base{base}, m_udpTask{}, m_cellSearchSpace{}, m_pendingMeasurements{}, m_activeMeasurements{}, m_servingCell{} : m_base{base}, m_udpTask{}, m_cellSearchSpace{}, m_pendingMeasurements{}, m_activeMeasurements{}, m_servingCell{}
{ {
m_logger = m_base->logBase->makeUniqueLogger(m_base->config->getLoggerPrefix() + "sas"); m_logger = m_base->logBase->makeUniqueLogger(m_base->config->getLoggerPrefix() + "sra");
for (auto &addr : m_base->config->gnbSearchList) for (auto &addr : m_base->config->gnbSearchList)
m_cellSearchSpace.emplace_back(addr, cons::PortalPort); m_cellSearchSpace.emplace_back(addr, cons::PortalPort);
} }
void UeSasTask::onStart() void UeSraTask::onStart()
{ {
m_udpTask = new udp::UdpServerTask(this); m_udpTask = new udp::UdpServerTask(this);
...@@ -39,7 +39,7 @@ void UeSasTask::onStart() ...@@ -39,7 +39,7 @@ void UeSasTask::onStart()
onMeasurement(); onMeasurement();
} }
void UeSasTask::onLoop() void UeSraTask::onLoop()
{ {
NtsMessage *msg = take(); NtsMessage *msg = take();
if (!msg) if (!msg)
...@@ -47,11 +47,11 @@ void UeSasTask::onLoop() ...@@ -47,11 +47,11 @@ void UeSasTask::onLoop()
switch (msg->msgType) switch (msg->msgType)
{ {
case NtsMessageType::UE_RRC_TO_SAS: { case NtsMessageType::UE_RRC_TO_SRA: {
auto *w = dynamic_cast<NwUeRrcToSas *>(msg); auto *w = dynamic_cast<NwUeRrcToSra *>(msg);
if (w->present == NwUeRrcToSas::PLMN_SEARCH_REQUEST) if (w->present == NwUeRrcToSra::PLMN_SEARCH_REQUEST)
plmnSearchRequested(); plmnSearchRequested();
else if (w->present == NwUeRrcToSas::CELL_SELECTION_COMMAND) else if (w->present == NwUeRrcToSra::CELL_SELECTION_COMMAND)
handleCellSelectionCommand(w->cellId, w->isSuitableCell); handleCellSelectionCommand(w->cellId, w->isSuitableCell);
break; break;
} }
...@@ -66,13 +66,13 @@ void UeSasTask::onLoop() ...@@ -66,13 +66,13 @@ void UeSasTask::onLoop()
} }
case NtsMessageType::UDP_SERVER_RECEIVE: { case NtsMessageType::UDP_SERVER_RECEIVE: {
auto *w = dynamic_cast<udp::NwUdpServerReceive *>(msg); auto *w = dynamic_cast<udp::NwUdpServerReceive *>(msg);
auto sasMsg = sas::DecodeSasMessage(OctetView{w->packet}); auto sraMsg = sra::DecodeSraMessage(OctetView{w->packet});
if (sasMsg == nullptr) if (sraMsg == nullptr)
{ {
m_logger->err("Unable to decode SAS message"); m_logger->err("Unable to decode SRA message");
break; break;
} }
receiveSasMessage(w->fromAddress, *sasMsg); receiveSraMessage(w->fromAddress, *sraMsg);
break; break;
} }
default: default:
...@@ -83,7 +83,7 @@ void UeSasTask::onLoop() ...@@ -83,7 +83,7 @@ void UeSasTask::onLoop()
delete msg; delete msg;
} }
void UeSasTask::onQuit() void UeSraTask::onQuit()
{ {
m_udpTask->quit(); m_udpTask->quit();
delete m_udpTask; delete m_udpTask;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <udp/server_task.hpp> #include <udp/server_task.hpp>
#include <ue/types.hpp> #include <ue/types.hpp>
#include <unordered_map> #include <unordered_map>
#include <urs/sas_pdu.hpp> #include <urs/sra_pdu.hpp>
#include <utils/common_types.hpp> #include <utils/common_types.hpp>
#include <utils/logger.hpp> #include <utils/logger.hpp>
#include <utils/nts.hpp> #include <utils/nts.hpp>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
namespace nr::ue namespace nr::ue
{ {
class UeSasTask : public NtsTask class UeSraTask : public NtsTask
{ {
private: private:
TaskBase *m_base; TaskBase *m_base;
...@@ -39,8 +39,8 @@ class UeSasTask : public NtsTask ...@@ -39,8 +39,8 @@ class UeSasTask : public NtsTask
friend class UeCmdHandler; friend class UeCmdHandler;
public: public:
explicit UeSasTask(TaskBase *base); explicit UeSraTask(TaskBase *base);
~UeSasTask() override = default; ~UeSraTask() override = default;
protected: protected:
void onStart() override; void onStart() override;
...@@ -48,12 +48,12 @@ class UeSasTask : public NtsTask ...@@ -48,12 +48,12 @@ class UeSasTask : public NtsTask
void onQuit() override; void onQuit() override;
private: /* Transport */ private: /* Transport */
void receiveSasMessage(const InetAddress &address, const sas::SasMessage &msg); void receiveSraMessage(const InetAddress &address, const sra::SraMessage &msg);
void sendSasMessage(const InetAddress &address, const sas::SasMessage &msg); void sendSraMessage(const InetAddress &address, const sra::SraMessage &msg);
private: /* Measurement */ private: /* Measurement */
void onMeasurement(); void onMeasurement();
void receiveCellInfoResponse(const sas::SasCellInfoResponse &msg); void receiveCellInfoResponse(const sra::SraCellInfoResponse &msg);
void onCoverageChange(const std::vector<GlobalNci> &entered, const std::vector<GlobalNci> &exited); void onCoverageChange(const std::vector<GlobalNci> &entered, const std::vector<GlobalNci> &exited);
void plmnSearchRequested(); void plmnSearchRequested();
......
...@@ -11,24 +11,24 @@ ...@@ -11,24 +11,24 @@
namespace nr::ue namespace nr::ue
{ {
void UeSasTask::receiveSasMessage(const InetAddress &address, const sas::SasMessage &msg) void UeSraTask::receiveSraMessage(const InetAddress &address, const sra::SraMessage &msg)
{ {
switch (msg.msgType) switch (msg.msgType)
{ {
case sas::SasMessageType::CELL_INFO_RESPONSE: { case sra::SraMessageType::CELL_INFO_RESPONSE: {
receiveCellInfoResponse((const sas::SasCellInfoResponse &)msg); receiveCellInfoResponse((const sra::SraCellInfoResponse &)msg);
break; break;
default: default:
m_logger->err("Unhandled SAS message type[%d]", static_cast<int>(msg.msgType)); m_logger->err("Unhandled SRA message type[%d]", static_cast<int>(msg.msgType));
break; break;
} }
} }
} }
void UeSasTask::sendSasMessage(const InetAddress &address, const sas::SasMessage &msg) void UeSraTask::sendSraMessage(const InetAddress &address, const sra::SraMessage &msg)
{ {
OctetString stream{}; OctetString stream{};
sas::EncodeSasMessage(msg, stream); sra::EncodeSraMessage(msg, stream);
m_udpTask->send(address, stream); m_udpTask->send(address, stream);
} }
......
...@@ -27,7 +27,7 @@ class UeAppTask; ...@@ -27,7 +27,7 @@ class UeAppTask;
class UeMrTask; class UeMrTask;
class NasTask; class NasTask;
class UeRrcTask; class UeRrcTask;
class UeSasTask; class UeSraTask;
class UserEquipment; class UserEquipment;
struct SupportedAlgs struct SupportedAlgs
...@@ -126,7 +126,7 @@ struct TaskBase ...@@ -126,7 +126,7 @@ struct TaskBase
UeMrTask *mrTask{}; UeMrTask *mrTask{};
NasTask *nasTask{}; NasTask *nasTask{};
UeRrcTask *rrcTask{}; UeRrcTask *rrcTask{};
UeSasTask *sasTask{}; UeSraTask *sraTask{};
}; };
struct UeTimers struct UeTimers
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "mr/task.hpp" #include "mr/task.hpp"
#include "nas/task.hpp" #include "nas/task.hpp"
#include "rrc/task.hpp" #include "rrc/task.hpp"
#include "sas/task.hpp" #include "sra/task.hpp"
namespace nr::ue namespace nr::ue
{ {
...@@ -32,7 +32,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController, ...@@ -32,7 +32,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
base->rrcTask = new UeRrcTask(base); base->rrcTask = new UeRrcTask(base);
base->mrTask = new UeMrTask(base); base->mrTask = new UeMrTask(base);
base->appTask = new UeAppTask(base); base->appTask = new UeAppTask(base);
base->sasTask = new UeSasTask(base); base->sraTask = new UeSraTask(base);
taskBase = base; taskBase = base;
} }
...@@ -42,13 +42,13 @@ UserEquipment::~UserEquipment() ...@@ -42,13 +42,13 @@ UserEquipment::~UserEquipment()
taskBase->nasTask->quit(); taskBase->nasTask->quit();
taskBase->rrcTask->quit(); taskBase->rrcTask->quit();
taskBase->mrTask->quit(); taskBase->mrTask->quit();
taskBase->sasTask->quit(); taskBase->sraTask->quit();
taskBase->appTask->quit(); taskBase->appTask->quit();
delete taskBase->nasTask; delete taskBase->nasTask;
delete taskBase->rrcTask; delete taskBase->rrcTask;
delete taskBase->mrTask; delete taskBase->mrTask;
delete taskBase->sasTask; delete taskBase->sraTask;
delete taskBase->appTask; delete taskBase->appTask;
delete taskBase->logBase; delete taskBase->logBase;
...@@ -61,7 +61,7 @@ void UserEquipment::start() ...@@ -61,7 +61,7 @@ void UserEquipment::start()
taskBase->nasTask->start(); taskBase->nasTask->start();
taskBase->rrcTask->start(); taskBase->rrcTask->start();
taskBase->mrTask->start(); taskBase->mrTask->start();
taskBase->sasTask->start(); taskBase->sraTask->start();
taskBase->appTask->start(); taskBase->appTask->start();
} }
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
// and subject to the terms and conditions defined in LICENSE file. // and subject to the terms and conditions defined in LICENSE file.
// //
#include "sas_pdu.hpp" #include "sra_pdu.hpp"
#include <utils/constants.hpp> #include <utils/constants.hpp>
namespace sas namespace sra
{ {
static void AppendPlmn(const Plmn &plmn, OctetString &stream) static void AppendPlmn(const Plmn &plmn, OctetString &stream)
...@@ -42,7 +42,7 @@ static GlobalNci DecodeGlobalNci(const OctetView &stream) ...@@ -42,7 +42,7 @@ static GlobalNci DecodeGlobalNci(const OctetView &stream)
return res; return res;
} }
void EncodeSasMessage(const SasMessage &msg, OctetString &stream) void EncodeSraMessage(const SraMessage &msg, OctetString &stream)
{ {
stream.appendOctet(0x03); // (Just for old RLS compatibility) stream.appendOctet(0x03); // (Just for old RLS compatibility)
...@@ -50,16 +50,16 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream) ...@@ -50,16 +50,16 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream)
stream.appendOctet(cons::Minor); stream.appendOctet(cons::Minor);
stream.appendOctet(cons::Patch); stream.appendOctet(cons::Patch);
stream.appendOctet(static_cast<uint8_t>(msg.msgType)); stream.appendOctet(static_cast<uint8_t>(msg.msgType));
if (msg.msgType == SasMessageType::CELL_INFO_REQUEST) if (msg.msgType == SraMessageType::CELL_INFO_REQUEST)
{ {
auto m = (const SasCellInfoRequest &)msg; auto m = (const SraCellInfoRequest &)msg;
stream.appendOctet4(m.simPos.x); stream.appendOctet4(m.simPos.x);
stream.appendOctet4(m.simPos.y); stream.appendOctet4(m.simPos.y);
stream.appendOctet4(m.simPos.z); stream.appendOctet4(m.simPos.z);
} }
else if (msg.msgType == SasMessageType::CELL_INFO_RESPONSE) else if (msg.msgType == SraMessageType::CELL_INFO_RESPONSE)
{ {
auto m = (const SasCellInfoResponse &)msg; auto m = (const SraCellInfoResponse &)msg;
AppendGlobalNci(m.cellId, stream); AppendGlobalNci(m.cellId, stream);
stream.appendOctet4(m.tac); stream.appendOctet4(m.tac);
stream.appendOctet4(m.dbm); stream.appendOctet4(m.dbm);
...@@ -70,7 +70,7 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream) ...@@ -70,7 +70,7 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream)
} }
} }
std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream) std::unique_ptr<SraMessage> DecodeSraMessage(const OctetView &stream)
{ {
auto first = stream.readI(); // (Just for old RLS compatibility) auto first = stream.readI(); // (Just for old RLS compatibility)
if (first != 3) if (first != 3)
...@@ -83,18 +83,18 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream) ...@@ -83,18 +83,18 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream)
if (stream.read() != cons::Patch) if (stream.read() != cons::Patch)
return nullptr; return nullptr;
auto msgType = static_cast<SasMessageType>(stream.readI()); auto msgType = static_cast<SraMessageType>(stream.readI());
if (msgType == SasMessageType::CELL_INFO_REQUEST) if (msgType == SraMessageType::CELL_INFO_REQUEST)
{ {
auto res = std::make_unique<SasCellInfoRequest>(); auto res = std::make_unique<SraCellInfoRequest>();
res->simPos.x = stream.read4I(); res->simPos.x = stream.read4I();
res->simPos.y = stream.read4I(); res->simPos.y = stream.read4I();
res->simPos.z = stream.read4I(); res->simPos.z = stream.read4I();
return res; return res;
} }
else if (msgType == SasMessageType::CELL_INFO_RESPONSE) else if (msgType == SraMessageType::CELL_INFO_RESPONSE)
{ {
auto res = std::make_unique<SasCellInfoResponse>(); auto res = std::make_unique<SraCellInfoResponse>();
res->cellId = DecodeGlobalNci(stream); res->cellId = DecodeGlobalNci(stream);
res->tac = stream.read4I(); res->tac = stream.read4I();
res->dbm = stream.read4I(); res->dbm = stream.read4I();
...@@ -106,4 +106,4 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream) ...@@ -106,4 +106,4 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream)
return nullptr; return nullptr;
} }
} // namespace sas } // namespace sra
...@@ -14,35 +14,35 @@ ...@@ -14,35 +14,35 @@
#include <utils/octet_string.hpp> #include <utils/octet_string.hpp>
#include <utils/octet_view.hpp> #include <utils/octet_view.hpp>
namespace sas namespace sra
{ {
enum class SasMessageType : uint8_t enum class SraMessageType : uint8_t
{ {
RESERVED = 0, RESERVED = 0,
CELL_INFO_REQUEST, CELL_INFO_REQUEST,
CELL_INFO_RESPONSE, CELL_INFO_RESPONSE,
}; };
struct SasMessage struct SraMessage
{ {
const SasMessageType msgType; const SraMessageType msgType;
explicit SasMessage(SasMessageType msgType) : msgType(msgType) explicit SraMessage(SraMessageType msgType) : msgType(msgType)
{ {
} }
}; };
struct SasCellInfoRequest : SasMessage struct SraCellInfoRequest : SraMessage
{ {
Vector3 simPos{}; Vector3 simPos{};
SasCellInfoRequest() : SasMessage(SasMessageType::CELL_INFO_REQUEST) SraCellInfoRequest() : SraMessage(SraMessageType::CELL_INFO_REQUEST)
{ {
} }
}; };
struct SasCellInfoResponse : SasMessage struct SraCellInfoResponse : SraMessage
{ {
GlobalNci cellId{}; GlobalNci cellId{};
int tac{}; int tac{};
...@@ -50,12 +50,12 @@ struct SasCellInfoResponse : SasMessage ...@@ -50,12 +50,12 @@ struct SasCellInfoResponse : SasMessage
std::string gnbName{}; std::string gnbName{};
std::string linkIp{}; std::string linkIp{};
SasCellInfoResponse() : SasMessage(SasMessageType::CELL_INFO_RESPONSE) SraCellInfoResponse() : SraMessage(SraMessageType::CELL_INFO_RESPONSE)
{ {
} }
}; };
void EncodeSasMessage(const SasMessage &msg, OctetString &stream); void EncodeSraMessage(const SraMessage &msg, OctetString &stream);
std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream); std::unique_ptr<SraMessage> DecodeSraMessage(const OctetView &stream);
} // namespace sas } // namespace sra
\ No newline at end of file \ No newline at end of file
...@@ -53,9 +53,9 @@ enum class NtsMessageType ...@@ -53,9 +53,9 @@ enum class NtsMessageType
UE_RRC_TO_NAS, UE_RRC_TO_NAS,
UE_NAS_TO_RRC, UE_NAS_TO_RRC,
UE_RRC_TO_MR, UE_RRC_TO_MR,
UE_RRC_TO_SAS, UE_RRC_TO_SRA,
UE_NAS_TO_NAS, UE_NAS_TO_NAS,
UE_SAS_TO_RRC, UE_SRA_TO_RRC,
UE_NAS_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