Commit fdf86aaf authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 06b09000
...@@ -59,10 +59,10 @@ void UeAppTask::onLoop() ...@@ -59,10 +59,10 @@ void UeAppTask::onLoop()
auto *tunTask = m_tunTasks[w->psi]; auto *tunTask = m_tunTasks[w->psi];
if (tunTask) if (tunTask)
{ {
auto *nw = new NmAppToTun(NmAppToTun::DATA_PDU_DELIVERY); auto *m = new NmAppToTun(NmAppToTun::DATA_PDU_DELIVERY);
nw->psi = w->psi; m->psi = w->psi;
nw->data = std::move(w->pdu); m->data = std::move(w->pdu);
tunTask->push(nw); tunTask->push(m);
} }
break; break;
} }
......
...@@ -166,10 +166,10 @@ void NasMm::sendNasMessage(const nas::PlainMmMessage &msg) ...@@ -166,10 +166,10 @@ void NasMm::sendNasMessage(const nas::PlainMmMessage &msg)
} }
} }
auto *nw = new NmUeNasToRrc(NmUeNasToRrc::UPLINK_NAS_DELIVERY); auto *m = new NmUeNasToRrc(NmUeNasToRrc::UPLINK_NAS_DELIVERY);
nw->pduId = 0; m->pduId = 0;
nw->nasPdu = std::move(pdu); m->nasPdu = std::move(pdu);
m_base->rrcTask->push(nw); m_base->rrcTask->push(m);
} }
void NasMm::receiveNasMessage(const nas::NasMessage &msg) void NasMm::receiveNasMessage(const nas::NasMessage &msg)
......
...@@ -58,10 +58,10 @@ void NasSm::handleUplinkDataRequest(int psi, OctetString &&data) ...@@ -58,10 +58,10 @@ void NasSm::handleUplinkDataRequest(int psi, OctetString &&data)
handleUplinkStatusChange(psi, false); handleUplinkStatusChange(psi, false);
} }
auto *nw = new NmUeNasToRls(NmUeNasToRls::DATA_PDU_DELIVERY); auto *m = new NmUeNasToRls(NmUeNasToRls::DATA_PDU_DELIVERY);
nw->psi = psi; m->psi = psi;
nw->pdu = std::move(data); m->pdu = std::move(data);
m_base->rlsTask->push(nw); m_base->rlsTask->push(m);
} }
else else
{ {
......
...@@ -123,9 +123,9 @@ void NasTask::onLoop() ...@@ -123,9 +123,9 @@ void NasTask::onLoop()
void NasTask::performTick() void NasTask::performTick()
{ {
auto sendExpireMsg = [this](UeTimer *timer) { auto sendExpireMsg = [this](UeTimer *timer) {
auto *nw = new NmUeNasToNas(NmUeNasToNas::NAS_TIMER_EXPIRE); auto *m = new NmUeNasToNas(NmUeNasToNas::NAS_TIMER_EXPIRE);
nw->timer = timer; m->timer = timer;
push(nw); push(m);
}; };
if (timers.t3346.performTick()) if (timers.t3346.performTick())
......
...@@ -93,11 +93,11 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH_Message *msg) ...@@ -93,11 +93,11 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH_Message *msg)
return; return;
} }
auto *nw = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY); auto *m = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
nw->cellId = cellId; m->cellId = cellId;
nw->channel = rrc::RrcChannel::UL_CCCH; m->channel = rrc::RrcChannel::UL_CCCH;
nw->pdu = std::move(pdu); m->pdu = std::move(pdu);
m_base->rlsTask->push(nw); m_base->rlsTask->push(m);
} }
void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH1_Message *msg) void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH1_Message *msg)
...@@ -109,11 +109,11 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH1_Message *msg) ...@@ -109,11 +109,11 @@ void UeRrcTask::sendRrcMessage(int cellId, ASN_RRC_UL_CCCH1_Message *msg)
return; return;
} }
auto *nw = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY); auto *m = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
nw->cellId = cellId; m->cellId = cellId;
nw->channel = rrc::RrcChannel::UL_CCCH1; m->channel = rrc::RrcChannel::UL_CCCH1;
nw->pdu = std::move(pdu); m->pdu = std::move(pdu);
m_base->rlsTask->push(nw); m_base->rlsTask->push(m);
} }
void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg) void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
...@@ -125,11 +125,11 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg) ...@@ -125,11 +125,11 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
return; return;
} }
auto *nw = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY); auto *m = new NmUeRrcToRls(NmUeRrcToRls::RRC_PDU_DELIVERY);
nw->cellId = m_base->shCtx.currentCell.get<int>([](auto &value) { return value.cellId; }); m->cellId = m_base->shCtx.currentCell.get<int>([](auto &value) { return value.cellId; });
nw->channel = rrc::RrcChannel::UL_DCCH; m->channel = rrc::RrcChannel::UL_DCCH;
nw->pdu = std::move(pdu); m->pdu = std::move(pdu);
m_base->rlsTask->push(nw); m_base->rlsTask->push(m);
} }
void UeRrcTask::receiveRrcMessage(int cellId, ASN_RRC_BCCH_BCH_Message *msg) void UeRrcTask::receiveRrcMessage(int cellId, ASN_RRC_BCCH_BCH_Message *msg)
......
...@@ -64,9 +64,9 @@ void UeRrcTask::receiveDownlinkInformationTransfer(const ASN_RRC_DLInformationTr ...@@ -64,9 +64,9 @@ void UeRrcTask::receiveDownlinkInformationTransfer(const ASN_RRC_DLInformationTr
OctetString nasPdu = OctetString nasPdu =
asn::GetOctetString(*msg.criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message); asn::GetOctetString(*msg.criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message);
auto *nw = new NmUeRrcToNas(NmUeRrcToNas::NAS_DELIVERY); auto *m = new NmUeRrcToNas(NmUeRrcToNas::NAS_DELIVERY);
nw->nasPdu = std::move(nasPdu); m->nasPdu = std::move(nasPdu);
m_base->nasTask->push(nw); m_base->nasTask->push(m);
} }
} // namespace nr::ue } // namespace nr::ue
\ No newline at end of file
...@@ -37,9 +37,9 @@ static std::string GetErrorMessage(const std::string &cause) ...@@ -37,9 +37,9 @@ static std::string GetErrorMessage(const std::string &cause)
static nr::ue::NmUeTunToApp *NmError(std::string &&error) static nr::ue::NmUeTunToApp *NmError(std::string &&error)
{ {
auto *nw = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::TUN_ERROR); auto *m = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::TUN_ERROR);
nw->error = std::move(error); m->error = std::move(error);
return nw; return m;
} }
static void ReceiverThread(ReceiverArgs *args) static void ReceiverThread(ReceiverArgs *args)
...@@ -54,7 +54,7 @@ static void ReceiverThread(ReceiverArgs *args) ...@@ -54,7 +54,7 @@ static void ReceiverThread(ReceiverArgs *args)
while (true) while (true)
{ {
int n = ::read(fd, buffer, RECEIVER_BUFFER_SIZE); ssize_t n = ::read(fd, buffer, RECEIVER_BUFFER_SIZE);
if (n < 0) if (n < 0)
{ {
targetTask->push(NmError(GetErrorMessage("TUN device could not read"))); targetTask->push(NmError(GetErrorMessage("TUN device could not read")));
...@@ -63,10 +63,10 @@ static void ReceiverThread(ReceiverArgs *args) ...@@ -63,10 +63,10 @@ static void ReceiverThread(ReceiverArgs *args)
if (n > 0) if (n > 0)
{ {
auto *nw = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::DATA_PDU_DELIVERY); auto *m = new nr::ue::NmUeTunToApp(nr::ue::NmUeTunToApp::DATA_PDU_DELIVERY);
nw->psi = psi; m->psi = psi;
nw->data = OctetString::FromArray(buffer, static_cast<size_t>(n)); m->data = OctetString::FromArray(buffer, static_cast<size_t>(n));
targetTask->push(nw); targetTask->push(m);
} }
} }
} }
...@@ -104,7 +104,7 @@ void TunTask::onLoop() ...@@ -104,7 +104,7 @@ void TunTask::onLoop()
{ {
case NtsMessageType::UE_APP_TO_TUN: { case NtsMessageType::UE_APP_TO_TUN: {
auto *w = dynamic_cast<NmAppToTun *>(msg); auto *w = dynamic_cast<NmAppToTun *>(msg);
int res = ::write(m_fd, w->data.data(), w->data.length()); ssize_t res = ::write(m_fd, w->data.data(), w->data.length());
if (res < 0) if (res < 0)
push(NmError(GetErrorMessage("TUN device could not write"))); push(NmError(GetErrorMessage("TUN device could not write")));
else if (res != w->data.length()) else if (res != w->data.length())
......
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