Commit fee7dfd3 authored by aligungr's avatar aligungr

RRC paging handling

parent 46aa9088
...@@ -38,20 +38,25 @@ void NgapTask::receivePaging(int amfId, ASN_NGAP_Paging *msg) ...@@ -38,20 +38,25 @@ void NgapTask::receivePaging(int amfId, ASN_NGAP_Paging *msg)
if (amf == nullptr) if (amf == nullptr)
return; return;
auto *w = new NwGnbNgapToRrc(NwGnbNgapToRrc::PAGING);
auto *ieUePagingIdentity = asn::ngap::GetProtocolIe(msg, ASN_NGAP_ProtocolIE_ID_id_UEPagingIdentity); auto *ieUePagingIdentity = asn::ngap::GetProtocolIe(msg, ASN_NGAP_ProtocolIE_ID_id_UEPagingIdentity);
if (ieUePagingIdentity) auto *ieTaiListForPaging = asn::ngap::GetProtocolIe(msg, ASN_NGAP_ProtocolIE_ID_id_TAIListForPaging);
if (ieUePagingIdentity == nullptr || ieTaiListForPaging == nullptr ||
ieUePagingIdentity->UEPagingIdentity.present != ASN_NGAP_UEPagingIdentity_PR_fiveG_S_TMSI)
{ {
if (ieUePagingIdentity->UEPagingIdentity.present == ASN_NGAP_UEPagingIdentity_PR_fiveG_S_TMSI) m_logger->err("Invalid parameters received in Paging message");
w->uePagingTmsi = asn::UniqueCopy(*ieUePagingIdentity->UEPagingIdentity.choice.fiveG_S_TMSI, return;
asn_DEF_ASN_NGAP_FiveG_S_TMSI);
} }
auto *ieTaiListForPaging = asn::ngap::GetProtocolIe(msg, ASN_NGAP_ProtocolIE_ID_id_TAIListForPaging); auto *w = new NwGnbNgapToRrc(NwGnbNgapToRrc::PAGING);
if (ieTaiListForPaging) w->uePagingTmsi =
ngap_encode::EncodeS(asn_DEF_ASN_NGAP_FiveG_S_TMSI, ieUePagingIdentity->UEPagingIdentity.choice.fiveG_S_TMSI);
w->taiListForPaging = asn::UniqueCopy(ieTaiListForPaging->TAIListForPaging, asn_DEF_ASN_NGAP_TAIListForPaging);
if (w->uePagingTmsi.length() == 0)
{ {
w->taiListForPaging = asn::UniqueCopy(ieTaiListForPaging->TAIListForPaging, asn_DEF_ASN_NGAP_TAIListForPaging); m_logger->err("FiveG-S-TMSI encoding failed");
delete w;
return;
} }
m_base->rrcTask->push(w); m_base->rrcTask->push(w);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <utils/octet_string.hpp> #include <utils/octet_string.hpp>
#include <utils/unique_buffer.hpp> #include <utils/unique_buffer.hpp>
extern "C" struct ASN_NGAP_FiveG_S_TMSI;
extern "C" struct ASN_NGAP_TAIListForPaging; extern "C" struct ASN_NGAP_TAIListForPaging;
namespace nr::gnb namespace nr::gnb
...@@ -117,7 +116,7 @@ struct NwGnbNgapToRrc : NtsMessage ...@@ -117,7 +116,7 @@ struct NwGnbNgapToRrc : NtsMessage
OctetString pdu{}; OctetString pdu{};
// PAGING // PAGING
asn::Unique<ASN_NGAP_FiveG_S_TMSI> uePagingTmsi{}; OctetString uePagingTmsi{};
asn::Unique<ASN_NGAP_TAIListForPaging> taiListForPaging{}; asn::Unique<ASN_NGAP_TAIListForPaging> taiListForPaging{};
explicit NwGnbNgapToRrc(PR present) : NtsMessage(NtsMessageType::GNB_NGAP_TO_RRC), present(present) explicit NwGnbNgapToRrc(PR present) : NtsMessage(NtsMessageType::GNB_NGAP_TO_RRC), present(present)
......
...@@ -70,8 +70,7 @@ class GnbRrcTask : public NtsTask ...@@ -70,8 +70,7 @@ class GnbRrcTask : public NtsTask
void deliverUplinkNas(int ueId, OctetString &&nasPdu); void deliverUplinkNas(int ueId, OctetString &&nasPdu);
void releaseConnection(int ueId); void releaseConnection(int ueId);
void handleRadioLinkFailure(int ueId); void handleRadioLinkFailure(int ueId);
void handlePaging(const asn::Unique<ASN_NGAP_FiveG_S_TMSI> &tmsi, void handlePaging(const OctetString &tmsi, const asn::Unique<ASN_NGAP_TAIListForPaging> &taiList);
const asn::Unique<ASN_NGAP_TAIListForPaging> &taiList);
void receiveUplinkInformationTransfer(int ueId, const ASN_RRC_ULInformationTransfer &msg); void receiveUplinkInformationTransfer(int ueId, const ASN_RRC_ULInformationTransfer &msg);
void receiveRrcSetupRequest(int ueId, const ASN_RRC_RRCSetupRequest &msg); void receiveRrcSetupRequest(int ueId, const ASN_RRC_RRCSetupRequest &msg);
......
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