Skip to content

Commit

Permalink
Merge pull request #335 from aligungr/dev
Browse files Browse the repository at this point in the history
Release v3.2.0
  • Loading branch information
aligungr authored May 28, 2021
2 parents 2d2a23e + 78a27d3 commit 0b4389c
Show file tree
Hide file tree
Showing 138 changed files with 6,309 additions and 2,479 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a href="https://github.com/aligungr/UERANSIM"><img src="/.github/logo.png" width="75" title="UERANSIM"></a>
</p>
<p align="center">
<img src="https://img.shields.io/badge/UERANSIM-v3.1.9-blue" />
<img src="https://img.shields.io/badge/UERANSIM-v3.2.0-blue" />
<img src="https://img.shields.io/badge/3GPP-R15-orange" />
<img src="https://img.shields.io/badge/License-GPL--3.0-green"/>
</p>
Expand Down
1 change: 0 additions & 1 deletion config/custom-ue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ sessions:
slice:
sst: 1
sd: 1
emergency: false

# Configured NSSAI for this UE by HPLMN
configured-nssai:
Expand Down
1 change: 0 additions & 1 deletion config/free5gc-ue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ sessions:
slice:
sst: 0x01
sd: 0x010203
emergency: false

# Configured NSSAI for this UE by HPLMN
configured-nssai:
Expand Down
2 changes: 0 additions & 2 deletions config/open5gs-ue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ sessions:
apn: 'internet'
slice:
sst: 1
sd: 1
emergency: false

# Configured NSSAI for this UE by HPLMN
configured-nssai:
Expand Down
4 changes: 2 additions & 2 deletions src/gnb/app/cmd_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ bool GnbCmdHandler::isAllPaused()
return true;
}

void GnbCmdHandler::handleCmd(NwGnbCliCommand &msg)
void GnbCmdHandler::handleCmd(NmGnbCliCommand &msg)
{
pauseTasks();

Expand Down Expand Up @@ -97,7 +97,7 @@ void GnbCmdHandler::handleCmd(NwGnbCliCommand &msg)
unpauseTasks();
}

void GnbCmdHandler::handleCmdImpl(NwGnbCliCommand &msg)
void GnbCmdHandler::handleCmdImpl(NmGnbCliCommand &msg)
{
switch (msg.cmd->present)
{
Expand Down
4 changes: 2 additions & 2 deletions src/gnb/app/cmd_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class GnbCmdHandler
{
}

void handleCmd(NwGnbCliCommand &msg);
void handleCmd(NmGnbCliCommand &msg);

private:
void pauseTasks();
void unpauseTasks();
bool isAllPaused();

private:
void handleCmdImpl(NwGnbCliCommand &msg);
void handleCmdImpl(NmGnbCliCommand &msg);

private:
void sendResult(const InetAddress &address, const std::string &output);
Expand Down
6 changes: 3 additions & 3 deletions src/gnb/app/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ void GnbAppTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::GNB_STATUS_UPDATE: {
auto *w = dynamic_cast<NwGnbStatusUpdate *>(msg);
auto *w = dynamic_cast<NmGnbStatusUpdate *>(msg);
switch (w->what)
{
case NwGnbStatusUpdate::NGAP_IS_UP:
case NmGnbStatusUpdate::NGAP_IS_UP:
m_statusInfo.isNgapUp = w->isNgapUp;
break;
}
break;
}
case NtsMessageType::GNB_CLI_COMMAND: {
auto *w = dynamic_cast<NwGnbCliCommand *>(msg);
auto *w = dynamic_cast<NmGnbCliCommand *>(msg);
GnbCmdHandler handler{m_base};
handler.handleCmd(*w);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/gnb/gnb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void GNodeB::start()

void GNodeB::pushCommand(std::unique_ptr<app::GnbCliCommand> cmd, const InetAddress &address)
{
taskBase->appTask->push(new NwGnbCliCommand(std::move(cmd), address));
taskBase->appTask->push(new NmGnbCliCommand(std::move(cmd), address));
}

} // namespace nr::gnb
16 changes: 8 additions & 8 deletions src/gnb/gtp/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,33 @@ void GtpTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::GNB_NGAP_TO_GTP: {
auto *w = dynamic_cast<NwGnbNgapToGtp *>(msg);
auto *w = dynamic_cast<NmGnbNgapToGtp *>(msg);
switch (w->present)
{
case NwGnbNgapToGtp::UE_CONTEXT_UPDATE: {
case NmGnbNgapToGtp::UE_CONTEXT_UPDATE: {
handleUeContextUpdate(*w->update);
break;
}
case NwGnbNgapToGtp::UE_CONTEXT_RELEASE: {
case NmGnbNgapToGtp::UE_CONTEXT_RELEASE: {
handleUeContextDelete(w->ueId);
break;
}
case NwGnbNgapToGtp::SESSION_CREATE: {
case NmGnbNgapToGtp::SESSION_CREATE: {
handleSessionCreate(w->resource);
break;
}
case NwGnbNgapToGtp::SESSION_RELEASE: {
case NmGnbNgapToGtp::SESSION_RELEASE: {
handleSessionRelease(w->ueId, w->psi);
break;
}
}
break;
}
case NtsMessageType::GNB_RLS_TO_GTP: {
auto *w = dynamic_cast<NwGnbRlsToGtp *>(msg);
auto *w = dynamic_cast<NmGnbRlsToGtp *>(msg);
switch (w->present)
{
case NwGnbRlsToGtp::DATA_PDU_DELIVERY: {
case NmGnbRlsToGtp::DATA_PDU_DELIVERY: {
handleUplinkData(w->ueId, w->psi, std::move(w->pdu));
break;
}
Expand Down Expand Up @@ -240,7 +240,7 @@ void GtpTask::handleUdpReceive(const udp::NwUdpServerReceive &msg)

if (m_rateLimiter->allowDownlinkPacket(sessionInd, gtp->payload.length()))
{
auto *w = new NwGnbGtpToRls(NwGnbGtpToRls::DATA_PDU_DELIVERY);
auto *w = new NmGnbGtpToRls(NmGnbGtpToRls::DATA_PDU_DELIVERY);
w->ueId = GetUeId(sessionInd);
w->psi = GetPsi(sessionInd);
w->pdu = std::move(gtp->payload);
Expand Down
8 changes: 4 additions & 4 deletions src/gnb/ngap/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void NgapTask::receiveInitialContextSetup(int amfId, ASN_NGAP_InitialContextSetu
if (ie)
deliverDownlinkNas(ue->ctxId, asn::GetOctetString(ie->NAS_PDU));

auto *w = new NwGnbNgapToGtp(NwGnbNgapToGtp::UE_CONTEXT_UPDATE);
auto *w = new NmGnbNgapToGtp(NmGnbNgapToGtp::UE_CONTEXT_UPDATE);
w->update = std::make_unique<GtpUeContextUpdate>(true, ue->ctxId, ue->ueAmbr);
m_base->gtpTask->push(w);
}
Expand All @@ -67,12 +67,12 @@ void NgapTask::receiveContextRelease(int amfId, ASN_NGAP_UEContextReleaseCommand
return;

// Notify RRC task
auto *w1 = new NwGnbNgapToRrc(NwGnbNgapToRrc::AN_RELEASE);
auto *w1 = new NmGnbNgapToRrc(NmGnbNgapToRrc::AN_RELEASE);
w1->ueId = ue->ctxId;
m_base->rrcTask->push(w1);

// Notify GTP task
auto *w2 = new NwGnbNgapToGtp(NwGnbNgapToGtp::UE_CONTEXT_RELEASE);
auto *w2 = new NmGnbNgapToGtp(NmGnbNgapToGtp::UE_CONTEXT_RELEASE);
w2->ueId = ue->ctxId;
m_base->gtpTask->push(w2);

Expand Down Expand Up @@ -108,7 +108,7 @@ void NgapTask::receiveContextModification(int amfId, ASN_NGAP_UEContextModificat
auto *response = asn::ngap::NewMessagePdu<ASN_NGAP_UEContextModificationResponse>({});
sendNgapUeAssociated(ue->ctxId, response);

auto *w = new NwGnbNgapToGtp(NwGnbNgapToGtp::UE_CONTEXT_UPDATE);
auto *w = new NmGnbNgapToGtp(NmGnbNgapToGtp::UE_CONTEXT_UPDATE);
w->update = std::make_unique<GtpUeContextUpdate>(false, ue->ctxId, ue->ueAmbr);
m_base->gtpTask->push(w);
}
Expand Down
6 changes: 3 additions & 3 deletions src/gnb/ngap/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void NgapTask::handleAssociationShutdown(int amfId)

amf->state = EAmfState::NOT_CONNECTED;

auto *w = new NwGnbSctp(NwGnbSctp::CONNECTION_CLOSE);
auto *w = new NmGnbSctp(NmGnbSctp::CONNECTION_CLOSE);
w->clientId = amfId;
m_base->sctpTask->push(w);

Expand Down Expand Up @@ -192,11 +192,11 @@ void NgapTask::receiveNgSetupResponse(int amfId, ASN_NGAP_NGSetupResponse *msg)
{
m_isInitialized = true;

auto *update = new NwGnbStatusUpdate(NwGnbStatusUpdate::NGAP_IS_UP);
auto *update = new NmGnbStatusUpdate(NmGnbStatusUpdate::NGAP_IS_UP);
update->isNgapUp = true;
m_base->appTask->push(update);

m_base->rrcTask->push(new NwGnbNgapToRrc(NwGnbNgapToRrc::RADIO_POWER_ON));
m_base->rrcTask->push(new NmGnbNgapToRrc(NmGnbNgapToRrc::RADIO_POWER_ON));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gnb/ngap/nas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void NgapTask::handleInitialNasTransport(int ueId, const OctetString &nasPdu, lo

void NgapTask::deliverDownlinkNas(int ueId, OctetString &&nasPdu)
{
auto *w = new NwGnbNgapToRrc(NwGnbNgapToRrc::NAS_DELIVERY);
auto *w = new NmGnbNgapToRrc(NmGnbNgapToRrc::NAS_DELIVERY);
w->ueId = ueId;
w->pdu = std::move(nasPdu);
m_base->rrcTask->push(w);
Expand Down
4 changes: 2 additions & 2 deletions src/gnb/ngap/radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace nr::gnb
void NgapTask::handleRadioLinkFailure(int ueId)
{
// Notify GTP task
auto *w2 = new NwGnbNgapToGtp(NwGnbNgapToGtp::UE_CONTEXT_RELEASE);
auto *w2 = new NmGnbNgapToGtp(NmGnbNgapToGtp::UE_CONTEXT_RELEASE);
w2->ueId = ueId;
m_base->gtpTask->push(w2);

Expand All @@ -48,7 +48,7 @@ void NgapTask::receivePaging(int amfId, ASN_NGAP_Paging *msg)
return;
}

auto *w = new NwGnbNgapToRrc(NwGnbNgapToRrc::PAGING);
auto *w = new NmGnbNgapToRrc(NmGnbNgapToRrc::PAGING);
w->uePagingTmsi =
asn::UniqueCopy(*ieUePagingIdentity->UEPagingIdentity.choice.fiveG_S_TMSI, asn_DEF_ASN_NGAP_FiveG_S_TMSI);
w->taiListForPaging = asn::UniqueCopy(ieTaiListForPaging->TAIListForPaging, asn_DEF_ASN_NGAP_TAIListForPaging);
Expand Down
4 changes: 2 additions & 2 deletions src/gnb/ngap/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ std::optional<NgapCause> NgapTask::setupPduSessionResource(PduSessionResource *r
resource->downTunnel.address = utils::IpToOctetString(m_base->config->gtpIp);
resource->downTunnel.teid = ++m_downlinkTeidCounter;

auto *w = new NwGnbNgapToGtp(NwGnbNgapToGtp::SESSION_CREATE);
auto *w = new NmGnbNgapToGtp(NmGnbNgapToGtp::SESSION_CREATE);
w->resource = resource;
m_base->gtpTask->push(w);

Expand Down Expand Up @@ -277,7 +277,7 @@ void NgapTask::receiveSessionResourceReleaseCommand(int amfId, ASN_NGAP_PDUSessi
// Perform release
for (auto &psi : psIds)
{
auto *w = new NwGnbNgapToGtp(NwGnbNgapToGtp::SESSION_RELEASE);
auto *w = new NmGnbNgapToGtp(NmGnbNgapToGtp::SESSION_RELEASE);
w->ueId = ue->ctxId;
w->psi = psi;
m_base->gtpTask->push(w);
Expand Down
18 changes: 9 additions & 9 deletions src/gnb/ngap/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void NgapTask::onStart()

for (auto &amfCtx : m_amfCtx)
{
auto *msg = new NwGnbSctp(NwGnbSctp::CONNECTION_REQUEST);
auto *msg = new NmGnbSctp(NmGnbSctp::CONNECTION_REQUEST);
msg->clientId = amfCtx.second->ctxId;
msg->localAddress = m_base->config->ngapIp;
msg->localPort = 0;
Expand All @@ -51,35 +51,35 @@ void NgapTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::GNB_RRC_TO_NGAP: {
auto *w = dynamic_cast<NwGnbRrcToNgap *>(msg);
auto *w = dynamic_cast<NmGnbRrcToNgap *>(msg);
switch (w->present)
{
case NwGnbRrcToNgap::INITIAL_NAS_DELIVERY: {
case NmGnbRrcToNgap::INITIAL_NAS_DELIVERY: {
handleInitialNasTransport(w->ueId, w->pdu, w->rrcEstablishmentCause);
break;
}
case NwGnbRrcToNgap::UPLINK_NAS_DELIVERY: {
case NmGnbRrcToNgap::UPLINK_NAS_DELIVERY: {
handleUplinkNasTransport(w->ueId, w->pdu);
break;
}
case NwGnbRrcToNgap::RADIO_LINK_FAILURE: {
case NmGnbRrcToNgap::RADIO_LINK_FAILURE: {
handleRadioLinkFailure(w->ueId);
break;
}
}
break;
}
case NtsMessageType::GNB_SCTP: {
auto *w = dynamic_cast<NwGnbSctp *>(msg);
auto *w = dynamic_cast<NmGnbSctp *>(msg);
switch (w->present)
{
case NwGnbSctp::ASSOCIATION_SETUP:
case NmGnbSctp::ASSOCIATION_SETUP:
handleAssociationSetup(w->clientId, w->associationId, w->inStreams, w->outStreams);
break;
case NwGnbSctp::RECEIVE_MESSAGE:
case NmGnbSctp::RECEIVE_MESSAGE:
handleSctpMessage(w->clientId, w->stream, w->buffer);
break;
case NwGnbSctp::ASSOCIATION_SHUTDOWN:
case NmGnbSctp::ASSOCIATION_SHUTDOWN:
handleAssociationShutdown(w->clientId);
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions src/gnb/ngap/transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void NgapTask::sendNgapNonUe(int associatedAmf, ASN_NGAP_NGAP_PDU *pdu)
m_logger->err("NGAP APER encoding failed");
else
{
auto *msg = new NwGnbSctp(NwGnbSctp::SEND_MESSAGE);
auto *msg = new NmGnbSctp(NmGnbSctp::SEND_MESSAGE);
msg->clientId = amf->ctxId;
msg->stream = 0;
msg->buffer = UniqueBuffer{buffer, static_cast<size_t>(encoded)};
Expand Down Expand Up @@ -200,7 +200,7 @@ void NgapTask::sendNgapUeAssociated(int ueId, ASN_NGAP_NGAP_PDU *pdu)
m_logger->err("NGAP APER encoding failed");
else
{
auto *msg = new NwGnbSctp(NwGnbSctp::SEND_MESSAGE);
auto *msg = new NmGnbSctp(NmGnbSctp::SEND_MESSAGE);
msg->clientId = amf->ctxId;
msg->stream = ue->uplinkStream;
msg->buffer = UniqueBuffer{buffer, static_cast<size_t>(encoded)};
Expand Down
Loading

0 comments on commit 0b4389c

Please sign in to comment.