diff --git a/src/gnb/ngap/management.cpp b/src/gnb/ngap/management.cpp index f40abfba8..2b0ec9416 100644 --- a/src/gnb/ngap/management.cpp +++ b/src/gnb/ngap/management.cpp @@ -33,7 +33,7 @@ void NgapTask::createAmfContext(const GnbAmfConfig &conf) m_amfCtx[ctx->ctxId] = ctx; } -void NgapTask::createUeContext(int ueId, const int32_t &requestedSliceType) +void NgapTask::createUeContext(int ueId, int32_t &requestedSliceType) { auto *ctx = new NgapUeContext(ueId); ctx->amfUeNgapId = -1; diff --git a/src/gnb/ngap/nas.cpp b/src/gnb/ngap/nas.cpp index 4f8879201..6bd6beb88 100644 --- a/src/gnb/ngap/nas.cpp +++ b/src/gnb/ngap/nas.cpp @@ -30,8 +30,9 @@ namespace nr::gnb int32_t extractSliceInfoAndModifyPdu(OctetString &nasPdu) { nas::RegistrationRequest *regRequest = nullptr; int32_t requestedSliceType = -1; - auto m_data = nasPdu.getData(); - OctetView octetView(m_data.data(), m_data.size()); + const uint8_t *m_data = nasPdu.data(); + size_t m_dataLength = nasPdu.length(); + OctetView octetView(m_data, m_dataLength); auto nasMessage = nas::DecodeNasMessage(octetView); if (nasMessage->epd == nas::EExtendedProtocolDiscriminator::MOBILITY_MANAGEMENT_MESSAGES) { @@ -46,7 +47,7 @@ int32_t extractSliceInfoAndModifyPdu(OctetString &nasPdu) { { auto sz = regRequest->requestedNSSAI->sNssais.size(); if (sz > 0) { - requestedSliceType = static_cast(regRequest->requestedNSSAI->sNssais[0].sst.getValue()); + requestedSliceType = static_cast(regRequest->requestedNSSAI->sNssais[0].sst); } } } diff --git a/src/gnb/ngap/nnsf.cpp b/src/gnb/ngap/nnsf.cpp index 0e1912f0b..84ae61548 100644 --- a/src/gnb/ngap/nnsf.cpp +++ b/src/gnb/ngap/nnsf.cpp @@ -11,12 +11,12 @@ namespace nr::gnb { -NgapAmfContext *NgapTask::selectAmf(int ueId, const int32_t &requestedSliceType) +NgapAmfContext *NgapTask::selectAmf(int ueId, int32_t &requestedSliceType) { for (auto &amf : m_amfCtx) { - for (const auto &PlmnSupport : amf.second->plmnSupportList) { - for (const auto &SingleSlice : PlmnSupport->sliceSupportList.slices) { - int32_t supportedSliceType = static_cast(SingleSlice.sst.getValue()); + for (const auto &plmnSupport : amf.second->plmnSupportList) { + for (const auto &singleSlice : plmnSupport->sliceSupportList.slices) { + int32_t supportedSliceType = static_cast(singleSlice.sst); if (supportedSliceType == requestedSliceType) { return amf.second; } diff --git a/src/gnb/ngap/task.hpp b/src/gnb/ngap/task.hpp index 4082ce0ac..14ea9563a 100644 --- a/src/gnb/ngap/task.hpp +++ b/src/gnb/ngap/task.hpp @@ -71,7 +71,7 @@ class NgapTask : public NtsTask /* Utility functions */ void createAmfContext(const GnbAmfConfig &config); NgapAmfContext *findAmfContext(int ctxId); - void createUeContext(int ueId, const int32_t &requestedSliceType); + void createUeContext(int ueId, int32_t &requestedSliceType); NgapUeContext *findUeContext(int ctxId); NgapUeContext *findUeByRanId(int64_t ranUeNgapId); NgapUeContext *findUeByAmfId(int64_t amfUeNgapId); @@ -118,7 +118,7 @@ class NgapTask : public NtsTask void sendContextRelease(int ueId, NgapCause cause); /* NAS Node Selection */ - NgapAmfContext *selectAmf(int ueId, const int32_t &requestedSliceType); + NgapAmfContext *selectAmf(int ueId, int32_t &requestedSliceType); NgapAmfContext *selectNewAmfForReAllocation(int ueId, int initiatedAmfId, int amfSetId); /* Radio resource control */ diff --git a/src/utils/octet.hpp b/src/utils/octet.hpp index 0141f6872..2e9c2de37 100644 --- a/src/utils/octet.hpp +++ b/src/utils/octet.hpp @@ -25,11 +25,6 @@ struct octet { } - inline uint8_t getValue() const - { - return value; - } - /* no explicit */ octet(int32_t value) noexcept : value(static_cast(value & 0xFF)) { } diff --git a/src/utils/octet_string.hpp b/src/utils/octet_string.hpp index dc4e84678..59b380363 100644 --- a/src/utils/octet_string.hpp +++ b/src/utils/octet_string.hpp @@ -25,11 +25,6 @@ class OctetString { } - const std::vector& getData() const - { - return m_data; - } - explicit OctetString(std::vector &&data) : m_data(std::move(data)) { }