Commit bdf89837 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Temporary fix for UserLocationInformation Criticality

parent 6ac06161
...@@ -53,7 +53,13 @@ HandoverNotifyMsg::HandoverNotifyMsg() { ...@@ -53,7 +53,13 @@ HandoverNotifyMsg::HandoverNotifyMsg() {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
HandoverNotifyMsg::~HandoverNotifyMsg(){}; HandoverNotifyMsg::~HandoverNotifyMsg() {
if (amfUeNgapId) free(amfUeNgapId);
if (ranUeNgapId) free(ranUeNgapId);
if (userLocationInformation) free(userLocationInformation);
if (handoverNotifyPdu) free(handoverNotifyPdu);
if (handoverNotifyIEs) free(handoverNotifyIEs);
};
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
unsigned long HandoverNotifyMsg::getAmfUeNgapId() { unsigned long HandoverNotifyMsg::getAmfUeNgapId() {
...@@ -106,11 +112,11 @@ bool HandoverNotifyMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) { ...@@ -106,11 +112,11 @@ bool HandoverNotifyMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) {
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID( if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(
handoverNotifyIEs->protocolIEs.list.array[i] handoverNotifyIEs->protocolIEs.list.array[i]
->value.choice.AMF_UE_NGAP_ID)) { ->value.choice.AMF_UE_NGAP_ID)) {
Logger::ngap().error("Decoded ngap AMF_UE_NGAP_ID IE error"); Logger::ngap().error("Decoded NGAP AMF_UE_NGAP_ID IE error");
return false; return false;
} }
} else { } else {
Logger::ngap().error("Decoded ngap AMF_UE_NGAP_ID IE error"); Logger::ngap().error("Decoded NGAP AMF_UE_NGAP_ID IE error");
return false; return false;
} }
} break; } break;
...@@ -123,29 +129,33 @@ bool HandoverNotifyMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) { ...@@ -123,29 +129,33 @@ bool HandoverNotifyMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) {
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID( if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(
handoverNotifyIEs->protocolIEs.list.array[i] handoverNotifyIEs->protocolIEs.list.array[i]
->value.choice.RAN_UE_NGAP_ID)) { ->value.choice.RAN_UE_NGAP_ID)) {
Logger::ngap().error("Decoded ngap RAN_UE_NGAP_ID IE error"); Logger::ngap().error("Decoded NGAP RAN_UE_NGAP_ID IE error");
return false; return false;
} }
} else { } else {
Logger::ngap().error("Decoded ngap RAN_UE_NGAP_ID IE error"); Logger::ngap().error("Decoded NGAP RAN_UE_NGAP_ID IE error");
return false; return false;
} }
} break; } break;
case Ngap_ProtocolIE_ID_id_UserLocationInformation: { case Ngap_ProtocolIE_ID_id_UserLocationInformation: {
if (handoverNotifyIEs->protocolIEs.list.array[i]->criticality == // TODO: Temporarily disable Criticality check to be tested with dsTest
/*if (handoverNotifyIEs->protocolIEs.list.array[i]->criticality ==
Ngap_Criticality_ignore && Ngap_Criticality_ignore &&
handoverNotifyIEs->protocolIEs.list.array[i]->value.present == handoverNotifyIEs->protocolIEs.list.array[i]->value.present ==
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation) { Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation) {
*/
if (handoverNotifyIEs->protocolIEs.list.array[i]->value.present ==
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation) {
userLocationInformation = new UserLocationInformation(); userLocationInformation = new UserLocationInformation();
if (!userLocationInformation->decodefromUserLocationInformation( if (!userLocationInformation->decodefromUserLocationInformation(
&handoverNotifyIEs->protocolIEs.list.array[i] &handoverNotifyIEs->protocolIEs.list.array[i]
->value.choice.UserLocationInformation)) { ->value.choice.UserLocationInformation)) {
Logger::ngap().error( Logger::ngap().error(
"Decoded ngap UserLocationInformation IE error"); "Decoded NGAP UserLocationInformation IE error");
return false; return false;
} }
} else { } else {
Logger::ngap().error("Decoded ngap UserLocationInformation IE error"); Logger::ngap().error("Decoded NGAP UserLocationInformation IE error");
return false; return false;
} }
} break; } break;
...@@ -164,8 +174,6 @@ void HandoverNotifyMsg::setUserLocationInfoNR( ...@@ -164,8 +174,6 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
if (!userLocationInformation) if (!userLocationInformation)
userLocationInformation = new UserLocationInformation(); userLocationInformation = new UserLocationInformation();
// userLocationInformation->setInformation(UserLocationInformationEUTRA *
// informationEUTRA);
UserLocationInformationNR* informationNR = new UserLocationInformationNR(); UserLocationInformationNR* informationNR = new UserLocationInformationNR();
NR_CGI* nR_CGI = new NR_CGI(); NR_CGI* nR_CGI = new NR_CGI();
PlmnId* plmnId_cgi = new PlmnId(); PlmnId* plmnId_cgi = new PlmnId();
...@@ -216,24 +224,32 @@ bool HandoverNotifyMsg::getUserLocationInfoNR( ...@@ -216,24 +224,32 @@ bool HandoverNotifyMsg::getUserLocationInfoNR(
struct NrCgi_s& cig, struct Tai_s& tai) { struct NrCgi_s& cig, struct Tai_s& tai) {
if (!userLocationInformation) return false; if (!userLocationInformation) return false;
UserLocationInformationNR* informationNR; UserLocationInformationNR* informationNR = nullptr;
userLocationInformation->getInformation(informationNR); userLocationInformation->getInformation(informationNR);
if (!informationNR) return false;
if (userLocationInformation->getChoiceOfUserLocationInformation() != if (userLocationInformation->getChoiceOfUserLocationInformation() !=
Ngap_UserLocationInformation_PR_userLocationInformationNR) Ngap_UserLocationInformation_PR_userLocationInformationNR)
return false; return false;
NR_CGI* nR_CGI;
TAI* nR_TAI; NR_CGI* nR_CGI = nullptr;
TAI* nR_TAI = nullptr;
informationNR->getInformationNR(nR_CGI, nR_TAI); informationNR->getInformationNR(nR_CGI, nR_TAI);
PlmnId* cgi_plmnId; if (!nR_CGI or !nR_TAI) return false;
NRCellIdentity* nRCellIdentity;
PlmnId* cgi_plmnId = nullptr;
NRCellIdentity* nRCellIdentity = nullptr;
nR_CGI->getNR_CGI(cgi_plmnId, nRCellIdentity); nR_CGI->getNR_CGI(cgi_plmnId, nRCellIdentity);
if (!cgi_plmnId or !nRCellIdentity) return false;
cgi_plmnId->getMcc(cig.mcc); cgi_plmnId->getMcc(cig.mcc);
cgi_plmnId->getMnc(cig.mnc); cgi_plmnId->getMnc(cig.mnc);
cig.nrCellID = nRCellIdentity->getNRCellIdentity(); cig.nrCellID = nRCellIdentity->getNRCellIdentity();
PlmnId* tai_plmnId; PlmnId* tai_plmnId = nullptr;
TAC* tac; TAC* tac = nullptr;
nR_TAI->getTAI(tai_plmnId, tac); nR_TAI->getTAI(tai_plmnId, tac);
if (!tai_plmnId or !tac) return false;
tai_plmnId->getMcc(tai.mcc); tai_plmnId->getMcc(tai.mcc);
tai_plmnId->getMnc(tai.mnc); tai_plmnId->getMnc(tai.mnc);
tai.tac = tac->getTac(); tai.tac = tac->getTac();
......
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