Commit 9d6b4b0c authored by aligungr's avatar aligungr

name refactor: SRA -> RLS

parent de9a3790
......@@ -28,7 +28,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
namespace nr::gnb
{
void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &msg)
void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::RlsCellInfoRequest &msg)
{
int dbm = EstimateSimulatedDbm(m_base->config->phyLocation, msg.simPos);
if (dbm < MIN_ALLOWED_DBM)
......@@ -37,7 +37,7 @@ void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &
return;
}
rls::SraCellInfoResponse resp{m_sti};
rls::RlsCellInfoResponse resp{m_sti};
resp.cellId.nci = m_base->config->nci;
resp.cellId.plmn = m_base->config->plmn;
resp.tac = m_base->config->tac;
......@@ -45,10 +45,10 @@ void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &
resp.gnbName = m_base->config->name;
resp.linkIp = m_base->config->portalIp;
sendSraMessage(ueId, resp);
sendRlsMessage(ueId, resp);
}
void GnbRlsTask::handleUplinkPduDelivery(int ueId, rls::SraPduDelivery &msg)
void GnbRlsTask::handleUplinkPduDelivery(int ueId, rls::RlsPduDelivery &msg)
{
if (msg.pduType == rls::EPduType::RRC)
{
......@@ -70,11 +70,11 @@ void GnbRlsTask::handleUplinkPduDelivery(int ueId, rls::SraPduDelivery &msg)
void GnbRlsTask::handleDownlinkDelivery(int ueId, rls::EPduType pduType, OctetString &&pdu, OctetString &&payload)
{
rls::SraPduDelivery resp{m_sti};
rls::RlsPduDelivery resp{m_sti};
resp.pduType = pduType;
resp.pdu = std::move(pdu);
resp.payload = std::move(payload);
sendSraMessage(ueId, resp);
sendRlsMessage(ueId, resp);
}
} // namespace nr::gnb
......@@ -30,7 +30,7 @@ int GnbRlsTask::updateUeInfo(const InetAddress &addr, uint64_t sti)
{
int ueId = ++m_ueIdCounter;
m_stiToUeId[sti] = ueId;
auto ctx = std::make_unique<SraUeContext>(ueId);
auto ctx = std::make_unique<RlsUeContext>(ueId);
ctx->sti = sti;
ctx->addr = addr;
ctx->lastSeen = utils::CurrentTimeMillis();
......
......@@ -82,13 +82,13 @@ void GnbRlsTask::onLoop()
}
case NtsMessageType::UDP_SERVER_RECEIVE: {
auto *w = dynamic_cast<udp::NwUdpServerReceive *>(msg);
auto sraMsg = rls::DecodeRlsMessage(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;
}
case NtsMessageType::TIMER_EXPIRED: {
......
......@@ -31,7 +31,7 @@ class GnbRlsTask : public NtsTask
bool m_powerOn;
uint64_t m_sti;
std::unordered_map<int, std::unique_ptr<SraUeContext>> m_ueCtx;
std::unordered_map<int, std::unique_ptr<RlsUeContext>> m_ueCtx;
std::unordered_map<uint64_t, int> m_stiToUeId;
int m_ueIdCounter;
......@@ -47,12 +47,12 @@ class GnbRlsTask : public NtsTask
void onQuit() override;
private: /* Transport */
void receiveSraMessage(const InetAddress &addr, rls::SraMessage &msg);
void sendSraMessage(int ueId, const rls::SraMessage &msg);
void receiveRlsMessage(const InetAddress &addr, rls::RlsMessage &msg);
void sendRlsMessage(int ueId, const rls::RlsMessage &msg);
private: /* Handler */
void handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &msg);
void handleUplinkPduDelivery(int ueId, rls::SraPduDelivery &msg);
void handleCellInfoRequest(int ueId, const rls::RlsCellInfoRequest &msg);
void handleUplinkPduDelivery(int ueId, rls::RlsPduDelivery &msg);
void handleDownlinkDelivery(int ueId, rls::EPduType pduType, OctetString &&pdu, OctetString &&payload);
private: /* UE Management */
......
......@@ -11,11 +11,11 @@
namespace nr::gnb
{
void GnbRlsTask::receiveSraMessage(const InetAddress &addr, rls::SraMessage &msg)
void GnbRlsTask::receiveRlsMessage(const InetAddress &addr, rls::RlsMessage &msg)
{
if (!m_powerOn)
{
// ignore received SRA message
// ignore received RLS message
return;
}
......@@ -24,24 +24,24 @@ void GnbRlsTask::receiveSraMessage(const InetAddress &addr, rls::SraMessage &msg
switch (msg.msgType)
{
case rls::EMessageType::CELL_INFO_REQUEST: {
handleCellInfoRequest(ueId, (const rls::SraCellInfoRequest &)msg);
handleCellInfoRequest(ueId, (const rls::RlsCellInfoRequest &)msg);
break;
}
case rls::EMessageType::PDU_DELIVERY: {
handleUplinkPduDelivery(ueId, (rls::SraPduDelivery &)msg);
handleUplinkPduDelivery(ueId, (rls::RlsPduDelivery &)msg);
break;
}
default:
m_logger->err("Unhandled SRA message received with type[%d]", static_cast<int>(msg.msgType));
m_logger->err("Unhandled RLS message received with type[%d]", static_cast<int>(msg.msgType));
break;
}
}
void GnbRlsTask::sendSraMessage(int ueId, const rls::SraMessage &msg)
void GnbRlsTask::sendRlsMessage(int ueId, const rls::RlsMessage &msg)
{
if (!m_ueCtx.count(ueId))
{
m_logger->err("SRA message sending failure, UE[%d] not exists", ueId);
m_logger->err("RLS message sending failure, UE[%d] not exists", ueId);
return;
}
......
......@@ -104,14 +104,14 @@ struct NgapAmfContext
std::vector<PlmnSupport *> plmnSupportList{};
};
struct SraUeContext
struct RlsUeContext
{
const int ueId;
uint64_t sti{};
InetAddress addr{};
int64_t lastSeen{};
explicit SraUeContext(int ueId) : ueId(ueId)
explicit RlsUeContext(int ueId) : ueId(ueId)
{
}
};
......
......@@ -41,12 +41,12 @@ void UeRlsTask::onMeasurement()
// Issue another cell info request for each address in the search space
for (auto &ip : m_cellSearchSpace)
{
rls::SraCellInfoRequest req{m_sti};
rls::RlsCellInfoRequest req{m_sti};
sendRlsMessage(ip, req);
}
}
void UeRlsTask::receiveCellInfoResponse(const rls::SraCellInfoResponse &msg)
void UeRlsTask::receiveCellInfoResponse(const rls::RlsCellInfoResponse &msg)
{
UeCellMeasurement meas{};
meas.sti = msg.sti;
......
......@@ -20,7 +20,7 @@ namespace nr::ue
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");
m_logger = m_base->logBase->makeUniqueLogger(m_base->config->getLoggerPrefix() + "rls");
for (auto &addr : m_base->config->gnbSearchList)
m_cellSearchSpace.emplace_back(addr, cons::PortalPort);
......
......@@ -50,14 +50,14 @@ class UeRlsTask : public NtsTask
void onQuit() override;
private: /* Transport */
void receiveRlsMessage(const InetAddress &address, rls::SraMessage &msg);
void sendRlsMessage(const InetAddress &address, const rls::SraMessage &msg);
void receiveRlsMessage(const InetAddress &address, rls::RlsMessage &msg);
void sendRlsMessage(const InetAddress &address, const rls::RlsMessage &msg);
void deliverUplinkPdu(rls::EPduType pduType, OctetString &&pdu, OctetString &&payload);
void deliverDownlinkPdu(rls::SraPduDelivery &msg);
void deliverDownlinkPdu(rls::RlsPduDelivery &msg);
private: /* Measurement */
void onMeasurement();
void receiveCellInfoResponse(const rls::SraCellInfoResponse &msg);
void receiveCellInfoResponse(const rls::RlsCellInfoResponse &msg);
void onCoverageChange(const std::vector<GlobalNci> &entered, const std::vector<GlobalNci> &exited);
void plmnSearchRequested();
void handleCellSelectionCommand(const GlobalNci &cellId, bool isSuitable);
......
......@@ -15,25 +15,25 @@
namespace nr::ue
{
void UeRlsTask::receiveRlsMessage(const InetAddress &address, rls::SraMessage &msg)
void UeRlsTask::receiveRlsMessage(const InetAddress &address, rls::RlsMessage &msg)
{
switch (msg.msgType)
{
case rls::EMessageType::CELL_INFO_RESPONSE: {
receiveCellInfoResponse((const rls::SraCellInfoResponse &)msg);
receiveCellInfoResponse((const rls::RlsCellInfoResponse &)msg);
break;
case rls::EMessageType::PDU_DELIVERY: {
deliverDownlinkPdu((rls::SraPduDelivery &)msg);
deliverDownlinkPdu((rls::RlsPduDelivery &)msg);
break;
}
default:
m_logger->err("Unhandled SRA message type[%d]", static_cast<int>(msg.msgType));
m_logger->err("Unhandled RLS message type[%d]", static_cast<int>(msg.msgType));
break;
}
}
}
void UeRlsTask::sendRlsMessage(const InetAddress &address, const rls::SraMessage &msg)
void UeRlsTask::sendRlsMessage(const InetAddress &address, const rls::RlsMessage &msg)
{
OctetString stream{};
rls::EncodeRlsMessage(msg, stream);
......@@ -44,18 +44,18 @@ void UeRlsTask::deliverUplinkPdu(rls::EPduType pduType, OctetString &&pdu, Octet
{
if (!m_servingCell.has_value())
{
m_logger->warn("SRA uplink delivery requested without a serving cell");
m_logger->warn("RLS uplink delivery requested without a serving cell");
return;
}
rls::SraPduDelivery msg{m_sti};
rls::RlsPduDelivery msg{m_sti};
msg.pduType = pduType;
msg.pdu = std::move(pdu);
msg.payload = std::move(payload);
sendRlsMessage(InetAddress{m_servingCell->linkIp, cons::PortalPort}, msg);
}
void UeRlsTask::deliverDownlinkPdu(rls::SraPduDelivery &msg)
void UeRlsTask::deliverDownlinkPdu(rls::RlsPduDelivery &msg)
{
if (msg.pduType == rls::EPduType::RRC)
{
......
......@@ -42,7 +42,7 @@ static GlobalNci DecodeGlobalNci(const OctetView &stream)
return res;
}
void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
void EncodeRlsMessage(const RlsMessage &msg, OctetString &stream)
{
stream.appendOctet(0x03); // (Just for old RLS compatibility)
......@@ -53,14 +53,14 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
stream.appendOctet8(msg.sti);
if (msg.msgType == EMessageType::CELL_INFO_REQUEST)
{
auto &m = (const SraCellInfoRequest &)msg;
auto &m = (const RlsCellInfoRequest &)msg;
stream.appendOctet4(m.simPos.x);
stream.appendOctet4(m.simPos.y);
stream.appendOctet4(m.simPos.z);
}
else if (msg.msgType == EMessageType::CELL_INFO_RESPONSE)
{
auto &m = (const SraCellInfoResponse &)msg;
auto &m = (const RlsCellInfoResponse &)msg;
AppendGlobalNci(m.cellId, stream);
stream.appendOctet4(m.tac);
stream.appendOctet4(m.dbm);
......@@ -71,7 +71,7 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
}
else if (msg.msgType == EMessageType::PDU_DELIVERY)
{
auto &m = (const SraPduDelivery &)msg;
auto &m = (const RlsPduDelivery &)msg;
stream.appendOctet(static_cast<uint8_t>(m.pduType));
stream.appendOctet4(m.pdu.length());
stream.append(m.pdu);
......@@ -80,7 +80,7 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
}
}
std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
std::unique_ptr<RlsMessage> DecodeRlsMessage(const OctetView &stream)
{
auto first = stream.readI(); // (Just for old RLS compatibility)
if (first != 3)
......@@ -98,7 +98,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
if (msgType == EMessageType::CELL_INFO_REQUEST)
{
auto res = std::make_unique<SraCellInfoRequest>(sti);
auto res = std::make_unique<RlsCellInfoRequest>(sti);
res->simPos.x = stream.read4I();
res->simPos.y = stream.read4I();
res->simPos.z = stream.read4I();
......@@ -106,7 +106,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
}
else if (msgType == EMessageType::CELL_INFO_RESPONSE)
{
auto res = std::make_unique<SraCellInfoResponse>(sti);
auto res = std::make_unique<RlsCellInfoResponse>(sti);
res->cellId = DecodeGlobalNci(stream);
res->tac = stream.read4I();
res->dbm = stream.read4I();
......@@ -116,7 +116,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
}
else if (msgType == EMessageType::PDU_DELIVERY)
{
auto res = std::make_unique<SraPduDelivery>(sti);
auto res = std::make_unique<RlsPduDelivery>(sti);
res->pduType = static_cast<EPduType>(stream.readI());
res->pdu = stream.readOctetString(stream.read4I());
res->payload = stream.readOctetString(stream.read4I());
......@@ -126,4 +126,4 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
return nullptr;
}
} // namespace sra
} // namespace rls
......@@ -32,26 +32,26 @@ enum class EPduType : uint8_t
DATA
};
struct SraMessage
struct RlsMessage
{
const EMessageType msgType;
const uint64_t sti{};
explicit SraMessage(EMessageType msgType, uint64_t sti) : msgType(msgType), sti(sti)
explicit RlsMessage(EMessageType msgType, uint64_t sti) : msgType(msgType), sti(sti)
{
}
};
struct SraCellInfoRequest : SraMessage
struct RlsCellInfoRequest : RlsMessage
{
Vector3 simPos{};
explicit SraCellInfoRequest(uint64_t sti) : SraMessage(EMessageType::CELL_INFO_REQUEST, sti)
explicit RlsCellInfoRequest(uint64_t sti) : RlsMessage(EMessageType::CELL_INFO_REQUEST, sti)
{
}
};
struct SraCellInfoResponse : SraMessage
struct RlsCellInfoResponse : RlsMessage
{
GlobalNci cellId{};
int tac{};
......@@ -59,23 +59,23 @@ struct SraCellInfoResponse : SraMessage
std::string gnbName{};
std::string linkIp{};
explicit SraCellInfoResponse(uint64_t sti) : SraMessage(EMessageType::CELL_INFO_RESPONSE, sti)
explicit RlsCellInfoResponse(uint64_t sti) : RlsMessage(EMessageType::CELL_INFO_RESPONSE, sti)
{
}
};
struct SraPduDelivery : SraMessage
struct RlsPduDelivery : RlsMessage
{
EPduType pduType{};
OctetString pdu{};
OctetString payload{};
explicit SraPduDelivery(uint64_t sti) : SraMessage(EMessageType::PDU_DELIVERY, sti)
explicit RlsPduDelivery(uint64_t sti) : RlsMessage(EMessageType::PDU_DELIVERY, sti)
{
}
};
void EncodeRlsMessage(const SraMessage &msg, OctetString &stream);
std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream);
void EncodeRlsMessage(const RlsMessage &msg, OctetString &stream);
std::unique_ptr<RlsMessage> DecodeRlsMessage(const OctetView &stream);
} // namespace sra
\ No newline at end of file
} // namespace rls
\ No newline at end of file
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