Commit 9c462934 authored by heshanyun's avatar heshanyun

fix compile issue about build ngap asn file

parent 1aac2287
......@@ -451,7 +451,7 @@ set(NGAP_ASN_DIR ${NGAP_DIR}/MESSAGES/ASN1/ASN1_files)
set(NGAP_C_DIR ${asn1_generated_dir}/NGAP_${NGAP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps -findirect-choice
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
......
......@@ -2945,7 +2945,7 @@ AMFName ::= PrintableString (SIZE(1..150, ...))
AMFPagingTarget ::= CHOICE {
globalRANNodeID GlobalRANNodeID,
tAI TAI,
choice-Extensions ProtocolIE-SingleContainer-dummy {{ AMFPagingTarget-ExtIEs }}
choice-Extensions ProtocolIE-SingleContainer { {AMFPagingTarget-ExtIEs} }
}
AMFPagingTarget-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -3121,7 +3121,7 @@ BroadcastCancelledAreaList ::= CHOICE {
cellIDCancelledNR CellIDCancelledNR,
tAICancelledNR TAICancelledNR,
emergencyAreaIDCancelledNR EmergencyAreaIDCancelledNR,
choice-Extensions ProtocolIE-SingleContainer-dummy { {BroadcastCancelledAreaList-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {BroadcastCancelledAreaList-ExtIEs} }
}
BroadcastCancelledAreaList-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -3135,7 +3135,7 @@ BroadcastCompletedAreaList ::= CHOICE {
cellIDBroadcastNR CellIDBroadcastNR,
tAIBroadcastNR TAIBroadcastNR,
emergencyAreaIDBroadcastNR EmergencyAreaIDBroadcastNR,
choice-Extensions ProtocolIE-SingleContainer-dummy { {BroadcastCompletedAreaList-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {BroadcastCompletedAreaList-ExtIEs} }
}
BroadcastCompletedAreaList-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -3220,7 +3220,7 @@ Cause ::= CHOICE {
nas CauseNas,
protocol CauseProtocol,
misc CauseMisc,
choice-Extensions ProtocolIE-SingleContainer-dummy { {Cause-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {Cause-ExtIEs} }
}
Cause-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -3367,7 +3367,7 @@ CellIDCancelledNR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= {
CellIDListForRestart ::= CHOICE {
eUTRA-CGIListforRestart EUTRA-CGIList,
nR-CGIListforRestart NR-CGIList,
choice-Extensions ProtocolIE-SingleContainer-dummy { {CellIDListForRestart-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {CellIDListForRestart-ExtIEs} }
}
CellIDListForRestart-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -3626,7 +3626,7 @@ DRBsSubjectToStatusTransferItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= {
DRBStatusDL ::= CHOICE {
dRBStatusDL12 DRBStatusDL12,
dRBStatusDL18 DRBStatusDL18,
choice-Extensions ProtocolIE-SingleContainer-dummy { {DRBStatusDL-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {DRBStatusDL-ExtIEs} }
}
DRBStatusDL-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -3656,7 +3656,7 @@ DRBStatusDL18-ExtIEs NGAP-PROTOCOL-EXTENSION ::= {
DRBStatusUL ::= CHOICE {
dRBStatusUL12 DRBStatusUL12,
dRBStatusUL18 DRBStatusUL18,
choice-Extensions ProtocolIE-SingleContainer-dummy { {DRBStatusUL-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {DRBStatusUL-ExtIEs} }
}
DRBStatusUL-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -4011,7 +4011,7 @@ GlobalRANNodeID ::= CHOICE {
globalGNB-ID GlobalGNB-ID,
globalNgENB-ID GlobalNgENB-ID,
globalN3IWF-ID GlobalN3IWF-ID,
choice-Extensions ProtocolIE-SingleContainer-dummy { {GlobalRANNodeID-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {GlobalRANNodeID-ExtIEs} }
}
GlobalRANNodeID-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -4020,7 +4020,7 @@ GlobalRANNodeID-ExtIEs NGAP-PROTOCOL-IES ::= {
GNB-ID ::= CHOICE {
gNB-ID BIT STRING (SIZE(22..32)),
choice-Extensions ProtocolIE-SingleContainer-dummy { {GNB-ID-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {GNB-ID-ExtIEs} }
}
GNB-ID-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -4180,7 +4180,7 @@ LastVisitedCellInformation ::= CHOICE {
eUTRANCell LastVisitedEUTRANCellInformation,
uTRANCell LastVisitedUTRANCellInformation,
gERANCell LastVisitedGERANCellInformation,
choice-Extensions ProtocolIE-SingleContainer-dummy { {LastVisitedCellInformation-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {LastVisitedCellInformation-ExtIEs} }
}
LastVisitedCellInformation-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -4280,7 +4280,7 @@ MobilityRestrictionList-ExtIEs NGAP-PROTOCOL-EXTENSION ::= {
N3IWF-ID ::= CHOICE {
n3IWF-ID BIT STRING (SIZE(16)),
choice-Extensions ProtocolIE-SingleContainer-dummy { {N3IWF-ID-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {N3IWF-ID-ExtIEs} }
}
N3IWF-ID-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -4310,7 +4310,7 @@ NgENB-ID ::= CHOICE {
macroNgENB-ID BIT STRING (SIZE(20)),
shortMacroNgENB-ID BIT STRING (SIZE(18)),
longMacroNgENB-ID BIT STRING (SIZE(21)),
choice-Extensions ProtocolIE-SingleContainer-dummy { {NgENB-ID-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {NgENB-ID-ExtIEs} }
}
NgENB-ID-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -4320,7 +4320,7 @@ NgENB-ID-ExtIEs NGAP-PROTOCOL-IES ::= {
NGRAN-CGI ::= CHOICE {
nR-CGI NR-CGI,
eUTRA-CGI EUTRA-CGI,
choice-Extensions ProtocolIE-SingleContainer-dummy { {NGRAN-CGI-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {NGRAN-CGI-ExtIEs} }
}
NGRAN-CGI-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -4406,7 +4406,7 @@ OverloadAction ::= ENUMERATED {
OverloadResponse ::= CHOICE {
overloadAction OverloadAction,
choice-Extensions ProtocolIE-SingleContainer-dummy { {OverloadResponse-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {OverloadResponse-ExtIEs} }
}
OverloadResponse-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -5185,7 +5185,7 @@ PriorityLevelQos ::= INTEGER (1..127, ...)
PWSFailedCellIDList ::= CHOICE {
eUTRA-CGI-PWSFailedList EUTRA-CGIList,
nR-CGI-PWSFailedList NR-CGIList,
choice-Extensions ProtocolIE-SingleContainer-dummy { {PWSFailedCellIDList-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {PWSFailedCellIDList-ExtIEs} }
}
PWSFailedCellIDList-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -5197,7 +5197,7 @@ PWSFailedCellIDList-ExtIEs NGAP-PROTOCOL-IES ::= {
QosCharacteristics ::= CHOICE {
nonDynamic5QI NonDynamic5QIDescriptor,
dynamic5QI Dynamic5QIDescriptor,
choice-Extensions ProtocolIE-SingleContainer-dummy { {QosCharacteristics-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {QosCharacteristics-ExtIEs} }
}
QosCharacteristics-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -5506,7 +5506,7 @@ ResetAll ::= ENUMERATED {
ResetType ::= CHOICE {
nG-Interface ResetAll,
partOfNG-Interface UE-associatedLogicalNG-connectionList,
choice-Extensions ProtocolIE-SingleContainer-dummy { {ResetType-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {ResetType-ExtIEs} }
}
ResetType-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -5692,7 +5692,7 @@ SONConfigurationTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= {
SONInformation ::= CHOICE {
sONInformationRequest SONInformationRequest,
sONInformationReply SONInformationReply,
choice-Extensions ProtocolIE-SingleContainer-dummy { {SONInformation-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {SONInformation-ExtIEs} }
}
SONInformation-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -5896,7 +5896,7 @@ TargeteNB-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= {
TargetID ::= CHOICE {
targetRANNodeID TargetRANNodeID,
targeteNB-ID TargeteNB-ID,
choice-Extensions ProtocolIE-SingleContainer-dummy { {TargetID-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {TargetID-ExtIEs} }
}
TargetID-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -6027,7 +6027,7 @@ UEHistoryInformation ::= SEQUENCE (SIZE(1..maxnoofCellsinUEHistoryInfo)) OF Last
UEIdentityIndexValue ::= CHOICE {
indexLength10 BIT STRING (SIZE(10)),
choice-Extensions ProtocolIE-SingleContainer-dummy { {UEIdentityIndexValue-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {UEIdentityIndexValue-ExtIEs} }
}
UEIdentityIndexValue-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -6037,7 +6037,7 @@ UEIdentityIndexValue-ExtIEs NGAP-PROTOCOL-IES ::= {
UE-NGAP-IDs ::= CHOICE {
uE-NGAP-ID-pair UE-NGAP-ID-pair,
aMF-UE-NGAP-ID AMF-UE-NGAP-ID,
choice-Extensions ProtocolIE-SingleContainer-dummy { {UE-NGAP-IDs-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {UE-NGAP-IDs-ExtIEs} }
}
UE-NGAP-IDs-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -6057,7 +6057,7 @@ UE-NGAP-ID-pair-ExtIEs NGAP-PROTOCOL-EXTENSION ::= {
UEPagingIdentity ::= CHOICE {
fiveG-S-TMSI FiveG-S-TMSI,
choice-Extensions ProtocolIE-SingleContainer-dummy { {UEPagingIdentity-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {UEPagingIdentity-ExtIEs} }
}
UEPagingIdentity-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -6149,7 +6149,7 @@ ULForwarding ::= ENUMERATED {
UPTransportLayerInformation ::= CHOICE {
gTPTunnel GTPTunnel,
choice-Extensions ProtocolIE-SingleContainer-dummy { {UPTransportLayerInformation-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {UPTransportLayerInformation-ExtIEs} }
}
UPTransportLayerInformation-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -6186,7 +6186,7 @@ UserLocationInformation ::= CHOICE {
userLocationInformationEUTRA UserLocationInformationEUTRA,
userLocationInformationNR UserLocationInformationNR,
userLocationInformationN3IWF UserLocationInformationN3IWF,
choice-Extensions ProtocolIE-SingleContainer-dummy { {UserLocationInformation-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {UserLocationInformation-ExtIEs} }
}
UserLocationInformation-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -6267,7 +6267,7 @@ WarningAreaList ::= CHOICE {
nR-CGIListForWarning NR-CGIListForWarning,
tAIListForWarning TAIListForWarning,
emergencyAreaIDList EmergencyAreaIDList,
choice-Extensions ProtocolIE-SingleContainer-dummy { {WarningAreaList-ExtIEs} }
choice-Extensions ProtocolIE-SingleContainer { {WarningAreaList-ExtIEs} }
}
WarningAreaList-ExtIEs NGAP-PROTOCOL-IES ::= {
......@@ -6812,19 +6812,12 @@ ProtocolIE-Container {NGAP-PROTOCOL-IES : IEsSetParam} ::=
ProtocolIE-SingleContainer {NGAP-PROTOCOL-IES : IEsSetParam} ::=
ProtocolIE-Field {{IEsSetParam}}
ProtocolIE-SingleContainer-dummy {NGAP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE {
id NGAP-PROTOCOL-IES.&id ({IEsSetParam}),
criticality NGAP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}),
value NGAP-PROTOCOL-IES.&Value ({IEsSetParam}{@id})
}
ProtocolIE-Field {NGAP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE {
id NGAP-PROTOCOL-IES.&id ({IEsSetParam}),
criticality NGAP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}),
value NGAP-PROTOCOL-IES.&Value ({IEsSetParam}{@id})
}
-- **************************************************************
--
-- Container for Protocol IE Pairs
......
......@@ -79,6 +79,11 @@
#include "NGAP_PDUSessionResourceModifyRequestTransfer.h"
#include "NGAP_QosFlowAddOrModifyRequestItem.h"
#include "NGAP_TAIListForPagingItem.h"
#include "NGAP_GNB-ID.h"
#include "NGAP_GlobalGNB-ID.h"
#include "NGAP_GTPTunnel.h"
#include "NGAP_UE-NGAP-ID-pair.h"
#include "NGAP_UserLocationInformationNR.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
......
......@@ -469,28 +469,30 @@ static int ngap_gNB_generate_ng_setup_request(
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_NGSetup;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_NGSetupRequest;
out = &pdu.choice.initiatingMessage.value.choice.NGSetupRequest;
pdu.choice.initiatingMessage = CALLOC(1, sizeof(struct NGAP_InitiatingMessage));
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_NGSetup;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_NGSetupRequest;
out = &pdu.choice.initiatingMessage->value.choice.NGSetupRequest;
/* mandatory */
ie = (NGAP_NGSetupRequestIEs_t *)calloc(1, sizeof(NGAP_NGSetupRequestIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_GlobalRANNodeID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_NGSetupRequestIEs__value_PR_GlobalRANNodeID;
ie->value.choice.GlobalRANNodeID.present = NGAP_GlobalRANNodeID_PR_globalGNB_ID;
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID = CALLOC(1, sizeof(struct NGAP_GlobalGNB_ID));
MCC_MNC_TO_PLMNID(instance_p->mcc[ngap_amf_data_p->broadcast_plmn_index[0]],
instance_p->mnc[ngap_amf_data_p->broadcast_plmn_index[0]],
instance_p->mnc_digit_length[ngap_amf_data_p->broadcast_plmn_index[0]],
&ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.pLMNIdentity);
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.present = NGAP_GNB_ID_PR_gNB_ID;
&(ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->pLMNIdentity));
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.present = NGAP_GNB_ID_PR_gNB_ID;
MACRO_GNB_ID_TO_BIT_STRING(instance_p->gNB_id,
&ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID);
&ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID);
NGAP_INFO("%u -> %02x%02x%02x%02x\n", instance_p->gNB_id,
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[0],
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[1],
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[2],
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID.gNB_ID.choice.gNB_ID.buf[3]);
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID.buf[0],
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID.buf[1],
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID.buf[2],
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.choice.gNB_ID.buf[3]);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
......
......@@ -84,10 +84,11 @@ int ngap_ue_context_release_complete(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = NGAP_ProcedureCode_id_UEContextRelease;
pdu.choice.successfulOutcome.criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_UEContextReleaseComplete;
out = &pdu.choice.successfulOutcome.value.choice.UEContextReleaseComplete;
pdu.choice.successfulOutcome = CALLOC(1, sizeof(struct NGAP_SuccessfulOutcome));
pdu.choice.successfulOutcome->procedureCode = NGAP_ProcedureCode_id_UEContextRelease;
pdu.choice.successfulOutcome->criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = NGAP_SuccessfulOutcome__value_PR_UEContextReleaseComplete;
out = &pdu.choice.successfulOutcome->value.choice.UEContextReleaseComplete;
/* mandatory */
ie = (NGAP_UEContextReleaseComplete_IEs_t *)calloc(1, sizeof(NGAP_UEContextReleaseComplete_IEs_t));
......@@ -178,10 +179,11 @@ int ngap_ue_context_release_req(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_UEContextReleaseRequest;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_UEContextReleaseRequest;
out = &pdu.choice.initiatingMessage.value.choice.UEContextReleaseRequest;
pdu.choice.initiatingMessage = CALLOC(1, sizeof(struct NGAP_InitiatingMessage));
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_UEContextReleaseRequest;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_UEContextReleaseRequest;
out = &pdu.choice.initiatingMessage->value.choice.UEContextReleaseRequest;
/* mandatory */
ie = (NGAP_UEContextReleaseRequest_IEs_t *)calloc(1, sizeof(NGAP_UEContextReleaseRequest_IEs_t));
......
......@@ -40,7 +40,7 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage.procedureCode) {
switch(pdu->choice.initiatingMessage->procedureCode) {
case NGAP_ProcedureCode_id_DownlinkNASTransport:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
......@@ -88,9 +88,9 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
default:
NGAP_ERROR("Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
(int)pdu->choice.initiatingMessage->procedureCode);
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
(int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
......@@ -101,7 +101,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome.procedureCode) {
switch(pdu->choice.successfulOutcome->procedureCode) {
case NGAP_ProcedureCode_id_NGSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
......@@ -120,7 +120,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) {
default:
NGAP_ERROR("Unknown procedure ID (%d) for successfull outcome message\n",
(int)pdu->choice.successfulOutcome.procedureCode);
(int)pdu->choice.successfulOutcome->procedureCode);
return -1;
}
......@@ -131,7 +131,7 @@ static int ngap_gNB_decode_unsuccessful_outcome(NGAP_NGAP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome.procedureCode) {
switch(pdu->choice.unsuccessfulOutcome->procedureCode) {
case NGAP_ProcedureCode_id_NGSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
......@@ -143,7 +143,7 @@ static int ngap_gNB_decode_unsuccessful_outcome(NGAP_NGAP_PDU_t *pdu) {
default:
NGAP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)pdu->choice.unsuccessfulOutcome.procedureCode);
(int)pdu->choice.unsuccessfulOutcome->procedureCode);
return -1;
}
......
......@@ -82,7 +82,7 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu,
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage.procedureCode) {
switch(pdu->choice.initiatingMessage->procedureCode) {
case NGAP_ProcedureCode_id_NGSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
......@@ -125,7 +125,7 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu,
default:
NGAP_DEBUG("Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
(int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
......@@ -146,7 +146,7 @@ int ngap_gNB_encode_successfull_outcome(NGAP_NGAP_PDU_t *pdu,
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome.procedureCode) {
switch(pdu->choice.successfulOutcome->procedureCode) {
case NGAP_ProcedureCode_id_InitialContextSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
......@@ -177,7 +177,7 @@ int ngap_gNB_encode_successfull_outcome(NGAP_NGAP_PDU_t *pdu,
default:
NGAP_WARN("Unknown procedure ID (%d) for successfull outcome message\n",
(int)pdu->choice.successfulOutcome.procedureCode);
(int)pdu->choice.successfulOutcome->procedureCode);
return -1;
}
......@@ -198,7 +198,7 @@ int ngap_gNB_encode_unsuccessfull_outcome(NGAP_NGAP_PDU_t *pdu,
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome.procedureCode) {
switch(pdu->choice.unsuccessfulOutcome->procedureCode) {
case NGAP_ProcedureCode_id_InitialContextSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
......@@ -206,7 +206,7 @@ int ngap_gNB_encode_unsuccessfull_outcome(NGAP_NGAP_PDU_t *pdu,
default:
NGAP_DEBUG("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)pdu->choice.unsuccessfulOutcome.procedureCode);
(int)pdu->choice.unsuccessfulOutcome->procedureCode);
return -1;
}
......
......@@ -229,11 +229,11 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
}
/* Checking procedure Code and direction of message */
if (pdu.choice.initiatingMessage.procedureCode >= sizeof(ngap_messages_callback) / (3 * sizeof(
if (pdu.choice.initiatingMessage->procedureCode >= sizeof(ngap_messages_callback) / (3 * sizeof(
ngap_message_decoded_callback))
|| (pdu.present > NGAP_NGAP_PDU_PR_unsuccessfulOutcome)) {
NGAP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
assoc_id, pdu.choice.initiatingMessage.procedureCode, pdu.present);
assoc_id, pdu.choice.initiatingMessage->procedureCode, pdu.present);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return -1;
}
......@@ -241,16 +241,16 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
/* No handler present.
* This can mean not implemented or no procedure for gNB (wrong direction).
*/
if (ngap_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1] == NULL) {
if (ngap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) {
NGAP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id, pdu.choice.initiatingMessage.procedureCode,
assoc_id, pdu.choice.initiatingMessage->procedureCode,
ngap_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return -1;
}
/* Calling the right handler */
ret = (*ngap_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1])
ret = (*ngap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])
(assoc_id, stream, &pdu);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return ret;
......@@ -264,7 +264,7 @@ int ngap_gNB_handle_ng_setup_failure(uint32_t assoc_id,
NGAP_NGSetupFailureIEs_t *ie;
ngap_gNB_amf_data_t *amf_desc_p;
DevAssert(pdu != NULL);
container = &pdu->choice.unsuccessfulOutcome.value.choice.NGSetupFailure;
container = &pdu->choice.unsuccessfulOutcome->value.choice.NGSetupFailure;
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
if (stream != 0) {
......@@ -302,7 +302,7 @@ int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id,
ngap_gNB_amf_data_t *amf_desc_p;
int i;
DevAssert(pdu != NULL);
container = &pdu->choice.successfulOutcome.value.choice.NGSetupResponse;
container = &pdu->choice.successfulOutcome->value.choice.NGSetupResponse;
/* NG Setup Response == Non UE-related procedure -> stream 0 */
if (stream != 0) {
......@@ -462,7 +462,7 @@ int ngap_gNB_handle_error_indication(uint32_t assoc_id,
uint64_t amf_ue_ngap_id;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.ErrorIndication;
container = &pdu->choice.initiatingMessage->value.choice.ErrorIndication;
/* NG Setup Failure == Non UE-related procedure -> stream 0 */
if (stream != 0) {
......@@ -845,7 +845,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id,
NGAP_RAN_UE_NGAP_ID_t ran_ue_ngap_id;
uint64_t amf_ue_ngap_id;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.InitialContextSetupRequest;
container = &pdu->choice.initiatingMessage->value.choice.InitialContextSetupRequest;
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
NGAP_ERROR("[SCTP %d] Received initial context setup request for non "
......@@ -977,7 +977,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id,
case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLInformation:
{
NGAP_GTPTunnel_t *gTPTunnel_p;
gTPTunnel_p = &pdusessionTransfer_ies->value.choice.UPTransportLayerInformation.choice.gTPTunnel;
gTPTunnel_p = pdusessionTransfer_ies->value.choice.UPTransportLayerInformation.choice.gTPTunnel;
/* Set the transport layer address */
memcpy(NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].upf_addr.buffer,
......@@ -1164,7 +1164,7 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id,
NGAP_UEContextReleaseCommand_t *container;
NGAP_UEContextReleaseCommand_IEs_t *ie;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.UEContextReleaseCommand;
container = &pdu->choice.initiatingMessage->value.choice.UEContextReleaseCommand;
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
NGAP_ERROR("[SCTP %d] Received UE context release command for non "
......@@ -1178,8 +1178,8 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id,
if (ie != NULL) { /* checked by macro but cppcheck doesn't see it */
switch (ie->value.choice.UE_NGAP_IDs.present) {
case NGAP_UE_NGAP_IDs_PR_uE_NGAP_ID_pair:
gnb_ue_ngap_id = ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair.rAN_UE_NGAP_ID;
asn_INTEGER2ulong(&(ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair.aMF_UE_NGAP_ID), &amf_ue_ngap_id);
gnb_ue_ngap_id = ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair->rAN_UE_NGAP_ID;
asn_INTEGER2ulong(&(ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair->aMF_UE_NGAP_ID), &amf_ue_ngap_id);
MSC_LOG_RX_MESSAGE(
MSC_NGAP_GNB,
MSC_NGAP_AMF,
......@@ -1252,7 +1252,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
NGAP_PDUSessionResourceSetupRequest_t *container;
NGAP_PDUSessionResourceSetupRequestIEs_t *ie;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.PDUSessionResourceSetupRequest;
container = &pdu->choice.initiatingMessage->value.choice.PDUSessionResourceSetupRequest;
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
NGAP_ERROR("[SCTP %d] Received pdu session resource setup request for non "
......@@ -1361,7 +1361,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLInformation:
{
NGAP_GTPTunnel_t *gTPTunnel_p;
gTPTunnel_p = &pdusessionTransfer_ies->value.choice.UPTransportLayerInformation.choice.gTPTunnel;
gTPTunnel_p = pdusessionTransfer_ies->value.choice.UPTransportLayerInformation.choice.gTPTunnel;
/* The transport layer address for the IP packets */
OCTET_STRING_TO_INT32(&gTPTunnel_p->gTP_TEID, NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].gtp_teid);
NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].upf_addr.length =
......@@ -1449,7 +1449,7 @@ int ngap_gNB_handle_paging(uint32_t assoc_id,
NGAP_Paging_t *container;
NGAP_PagingIEs_t *ie;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.Paging;
container = &pdu->choice.initiatingMessage->value.choice.Paging;
// received Paging Message from AMF
NGAP_DEBUG("[SCTP %d] Received Paging Message From AMF\n",assoc_id);
......@@ -1481,9 +1481,9 @@ int ngap_gNB_handle_paging(uint32_t assoc_id,
NGAP_ProtocolIE_ID_id_UEPagingIdentity, true);
if (ie != NULL) { /* checked by macro but cppcheck doesn't see it */
OCTET_STRING_TO_INT16(&ie->value.choice.UEPagingIdentity.choice.fiveG_S_TMSI.aMFSetID, NGAP_PAGING_IND(message_p).ue_paging_identity.s_tmsi.amf_set_id);
OCTET_STRING_TO_INT8(&ie->value.choice.UEPagingIdentity.choice.fiveG_S_TMSI.aMFPointer, NGAP_PAGING_IND(message_p).ue_paging_identity.s_tmsi.amf_pointer);
OCTET_STRING_TO_INT32(&ie->value.choice.UEPagingIdentity.choice.fiveG_S_TMSI.fiveG_TMSI, NGAP_PAGING_IND(message_p).ue_paging_identity.s_tmsi.m_tmsi);
OCTET_STRING_TO_INT16(&ie->value.choice.UEPagingIdentity.choice.fiveG_S_TMSI->aMFSetID, NGAP_PAGING_IND(message_p).ue_paging_identity.s_tmsi.amf_set_id);
OCTET_STRING_TO_INT8(&ie->value.choice.UEPagingIdentity.choice.fiveG_S_TMSI->aMFPointer, NGAP_PAGING_IND(message_p).ue_paging_identity.s_tmsi.amf_pointer);
OCTET_STRING_TO_INT32(&ie->value.choice.UEPagingIdentity.choice.fiveG_S_TMSI->fiveG_TMSI, NGAP_PAGING_IND(message_p).ue_paging_identity.s_tmsi.m_tmsi);
NGAP_DEBUG("[SCTP %d] Received Paging Identity amf_set_id %d, amf_pointer %d, m_tmsi %d\n",
assoc_id,
......@@ -1560,7 +1560,7 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
NGAP_RAN_UE_NGAP_ID_t gnb_ue_ngap_id;
uint64_t amf_ue_ngap_id;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.PDUSessionResourceModifyRequest;
container = &pdu->choice.initiatingMessage->value.choice.PDUSessionResourceModifyRequest;
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
NGAP_ERROR("[SCTP %d] Received PDUSession Resource modify request for non "
......@@ -1763,7 +1763,7 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
NGAP_RAN_UE_NGAP_ID_t gnb_ue_ngap_id;
uint64_t amf_ue_ngap_id;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.PDUSessionResourceReleaseCommand;
container = &pdu->choice.initiatingMessage->value.choice.PDUSessionResourceReleaseCommand;
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
NGAP_ERROR("[SCTP %d] Received E-RAB release command for non existing AMF context\n", assoc_id);
......@@ -1870,7 +1870,7 @@ int ngap_gNB_handle_ng_path_switch_request_ack(uint32_t assoc_id,
NGAP_PDUSESSIONItemIEs_t *e_RABItemIEs;
NGAP_PDUSESSIONItem_t *e_RABItem;
DevAssert(pdu != NULL);
pathSwitchRequestAcknowledge = &pdu->choice.successfulOutcome.value.choice.PathSwitchRequestAcknowledge;
pathSwitchRequestAcknowledge = &pdu->choice.successfulOutcome->value.choice.PathSwitchRequestAcknowledge;
/* Path Switch request == UE-related procedure -> stream !=0 */
if (stream == 0) {
......@@ -2030,7 +2030,7 @@ int ngap_gNB_handle_ng_path_switch_request_failure(uint32_t assoc_
NGAP_PathSwitchRequestFailure_t *pathSwitchRequestFailure;
NGAP_PathSwitchRequestFailureIEs_t *ie;
DevAssert(pdu != NULL);
pathSwitchRequestFailure = &pdu->choice.unsuccessfulOutcome.value.choice.PathSwitchRequestFailure;
pathSwitchRequestFailure = &pdu->choice.unsuccessfulOutcome->value.choice.PathSwitchRequestFailure;
if (stream != 0) {
NGAP_ERROR("[SCTP %d] Received s1 path switch request failure on stream != 0 (%d)\n",
......
......@@ -68,10 +68,10 @@ int ngap_gNB_handle_nas_first_req(
DevAssert(instance_p != NULL);
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_InitialUEMessage;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_InitialUEMessage;
out = &pdu.choice.initiatingMessage.value.choice.InitialUEMessage;
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_InitialUEMessage;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_InitialUEMessage;
out = &pdu.choice.initiatingMessage->value.choice.InitialUEMessage;
/* Select the AMF corresponding to the provided GUAMI. */
if (ngap_nas_first_req_p->ue_identity.presenceMask & NGAP_UE_IDENTITIES_guami) {
......@@ -218,7 +218,7 @@ int ngap_gNB_handle_nas_first_req(
ie->value.choice.UserLocationInformation.present = NGAP_UserLocationInformation_PR_userLocationInformationNR;
userinfo_nr_p = &ie->value.choice.UserLocationInformation.choice.userLocationInformationNR;
userinfo_nr_p = ie->value.choice.UserLocationInformation.choice.userLocationInformationNR;
/* Set nRCellIdentity. default userLocationInformationNR */
MACRO_GNB_ID_TO_CELL_IDENTITY(instance_p->gNB_id,
......@@ -350,7 +350,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id,
ngap_gNB_instance = amf_desc_p->ngap_gNB_instance;
/* Prepare the NGAP message to encode */
container = &pdu->choice.initiatingMessage.value.choice.DownlinkNASTransport;
container = &pdu->choice.initiatingMessage->value.choice.DownlinkNASTransport;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkNASTransport_IEs_t, ie, container,
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID, true);
asn_INTEGER2ulong(&(ie->value.choice.AMF_UE_NGAP_ID), &amf_ue_ngap_id);
......@@ -460,10 +460,10 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_UplinkNASTransport;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_UplinkNASTransport;
out = &pdu.choice.initiatingMessage.value.choice.UplinkNASTransport;
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_UplinkNASTransport;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_UplinkNASTransport;
out = &pdu.choice.initiatingMessage->value.choice.UplinkNASTransport;
/* mandatory */
ie = (NGAP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(NGAP_UplinkNASTransport_IEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......@@ -494,7 +494,7 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_
ie->value.present = NGAP_UplinkNASTransport_IEs__value_PR_UserLocationInformation;
ie->value.choice.UserLocationInformation.present = NGAP_UserLocationInformation_PR_userLocationInformationNR;
userinfo_nr_p = &ie->value.choice.UserLocationInformation.choice.userLocationInformationNR;
userinfo_nr_p = ie->value.choice.UserLocationInformation.choice.userLocationInformationNR;
/* Set nRCellIdentity. default userLocationInformationNR */
MACRO_GNB_ID_TO_CELL_IDENTITY(ngap_gNB_instance_p->gNB_id,
......@@ -570,10 +570,10 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_NASNonDeliveryIndication;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_NASNonDeliveryIndication;
out = &pdu.choice.initiatingMessage.value.choice.NASNonDeliveryIndication;
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_NASNonDeliveryIndication;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_NASNonDeliveryIndication;
out = &pdu.choice.initiatingMessage->value.choice.NASNonDeliveryIndication;
/* mandatory */
ie = (NGAP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(NGAP_NASNonDeliveryIndication_IEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......@@ -676,10 +676,10 @@ int ngap_gNB_initial_ctxt_resp(
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = NGAP_ProcedureCode_id_InitialContextSetup;
pdu.choice.successfulOutcome.criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_InitialContextSetupResponse;
out = &pdu.choice.successfulOutcome.value.choice.InitialContextSetupResponse;
pdu.choice.successfulOutcome->procedureCode = NGAP_ProcedureCode_id_InitialContextSetup;
pdu.choice.successfulOutcome->criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = NGAP_SuccessfulOutcome__value_PR_InitialContextSetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.InitialContextSetupResponse;
/* mandatory */
ie = (NGAP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(NGAP_InitialContextSetupResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......@@ -716,23 +716,23 @@ int ngap_gNB_initial_ctxt_resp(
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.present = NGAP_UPTransportLayerInformation_PR_gTPTunnel;
GTP_TEID_TO_ASN1(initial_ctxt_resp_p->pdusessions[i].gtp_teid, &pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.gTP_TEID);
GTP_TEID_TO_ASN1(initial_ctxt_resp_p->pdusessions[i].gtp_teid, &pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf = malloc(initial_ctxt_resp_p->pdusessions[i].gNB_addr.length);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf = malloc(initial_ctxt_resp_p->pdusessions[i].gNB_addr.length);
memcpy(pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf,
memcpy(pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf,
initial_ctxt_resp_p->pdusessions[i].gNB_addr.buffer,
initial_ctxt_resp_p->pdusessions[i].gNB_addr.length);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.size = initial_ctxt_resp_p->pdusessions[i].gNB_addr.length;
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.bits_unused = 0;
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size = initial_ctxt_resp_p->pdusessions[i].gNB_addr.length;
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.bits_unused = 0;
NGAP_DEBUG("initial_ctxt_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld \n",
item->pDUSessionID,
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[0],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[1],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[2],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[3],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.size);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[0],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[1],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[2],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[3],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size);
/* associatedQosFlowList. number of 1? */
for(int j=0; j < initial_ctxt_resp_p->pdusessions[i].nb_of_qos_flow; j++) {
......@@ -894,10 +894,10 @@ int ngap_gNB_ue_capabilities(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_UERadioCapabilityInfoIndication;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_UERadioCapabilityInfoIndication;
out = &pdu.choice.initiatingMessage.value.choice.UERadioCapabilityInfoIndication;
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_UERadioCapabilityInfoIndication;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_UERadioCapabilityInfoIndication;
out = &pdu.choice.initiatingMessage->value.choice.UERadioCapabilityInfoIndication;
/* mandatory */
ie = (NGAP_UERadioCapabilityInfoIndicationIEs_t *)calloc(1, sizeof(NGAP_UERadioCapabilityInfoIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......@@ -987,10 +987,10 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceSetup;
pdu.choice.successfulOutcome.criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceSetupResponse;
out = &pdu.choice.successfulOutcome.value.choice.PDUSessionResourceSetupResponse;
pdu.choice.successfulOutcome->procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceSetup;
pdu.choice.successfulOutcome->criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceSetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.PDUSessionResourceSetupResponse;
/* mandatory */
ie = (NGAP_PDUSessionResourceSetupResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceSetupResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......@@ -1028,23 +1028,23 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.present = NGAP_UPTransportLayerInformation_PR_gTPTunnel;
GTP_TEID_TO_ASN1(pdusession_setup_resp_p->pdusessions[i].gtp_teid, &pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.gTP_TEID);
GTP_TEID_TO_ASN1(pdusession_setup_resp_p->pdusessions[i].gtp_teid, &pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf = malloc(pdusession_setup_resp_p->pdusessions[i].gNB_addr.length);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf = malloc(pdusession_setup_resp_p->pdusessions[i].gNB_addr.length);
memcpy(pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf,
memcpy(pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf,
pdusession_setup_resp_p->pdusessions[i].gNB_addr.buffer,
pdusession_setup_resp_p->pdusessions[i].gNB_addr.length);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.size = pdusession_setup_resp_p->pdusessions[i].gNB_addr.length;
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.bits_unused = 0;
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size = pdusession_setup_resp_p->pdusessions[i].gNB_addr.length;
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.bits_unused = 0;
NGAP_DEBUG("pdusession_setup_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld \n",
item->pDUSessionID,
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[0],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[1],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[2],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.buf[3],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel.transportLayerAddress.size);
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[0],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[1],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[2],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[3],
pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size);
/* associatedQosFlowList. number of 1? */
for(int j=0; j < pdusession_setup_resp_p->pdusessions[i].nb_of_qos_flow; j++) {
......@@ -1209,10 +1209,10 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceModify;
pdu.choice.successfulOutcome.criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceModifyResponse;
out = &pdu.choice.successfulOutcome.value.choice.PDUSessionResourceModifyResponse;
pdu.choice.successfulOutcome->procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceModify;
pdu.choice.successfulOutcome->criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceModifyResponse;
out = &pdu.choice.successfulOutcome->value.choice.PDUSessionResourceModifyResponse;
/* mandatory */
ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......@@ -1369,10 +1369,10 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceRelease;
pdu.choice.successfulOutcome.criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceReleaseResponse;
out = &pdu.choice.successfulOutcome.value.choice.PDUSessionResourceReleaseResponse;
pdu.choice.successfulOutcome->procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceRelease;
pdu.choice.successfulOutcome->criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceReleaseResponse;
out = &pdu.choice.successfulOutcome->value.choice.PDUSessionResourceReleaseResponse;
/* mandatory */
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......@@ -1524,10 +1524,10 @@ int ngap_gNB_path_switch_req(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_PathSwitchRequest;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_PathSwitchRequest;
out = &pdu.choice.initiatingMessage.value.choice.PathSwitchRequest;
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_PathSwitchRequest;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_PathSwitchRequest;
out = &pdu.choice.initiatingMessage->value.choice.PathSwitchRequest;
/* mandatory */
ie = (NGAP_PathSwitchRequestIEs_t *)calloc(1, sizeof(NGAP_PathSwitchRequestIEs_t));
......@@ -1714,10 +1714,10 @@ int ngap_gNB_generate_PDUSESSION_Modification_Indication(
// Prepare the NGAP message to encode
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_PDUSESSIONModificationIndication;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_PDUSESSIONModificationIndication;
out = &pdu.choice.initiatingMessage.value.choice.PDUSESSIONModificationIndication;
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_PDUSESSIONModificationIndication;
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_PDUSESSIONModificationIndication;
out = &pdu.choice.initiatingMessage->value.choice.PDUSESSIONModificationIndication;
/* mandatory */
ie = (NGAP_PDUSESSIONModificationIndicationIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModificationIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
......
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