Commit 5689cf90 authored by zhenghuangkun's avatar zhenghuangkun

Add PDUSessionResourceModifyResponse

Add PDUSessionResourceReleaseResponse
Add NASNonDeliveryIndication
parent 679b6be9
dev 1 256_QAM_demod 512-dataplane-bug-in-l2nfapi_nos1 FR2_NSA Fix_SA_SIB1 NR-PHY-MAC-IF-multi-UE NRPRACH_highSpeed_saankhya NRUE_usedlschparallel NR_10MHz NR_2port_CSIRS NR_CSIRS_tomerge NR_DLUL_PF NR_DLUL_PF_4UL NR_DLUL_PF_rebased NR_DL_MIMO NR_F1C_F1U_extensions NR_FAPI_beamindex_SSB_RO NR_FAPI_beamindex_SSB_RO_SEMPROJ NR_FDD_FIX NR_FR2_RA NR_FR2_RRC_SSB NR_FR2_initsync_fixes NR_MAC_Multi_Rach_GlobalEdge NR_MAC_Multi_Rach_GlobalEdge-old NR_MAC_SSB NR_MAC_TCI_UCI_GlobalEdge NR_MCS_BLER NR_PUCCH_MultiUE NR_RA_cleanup NR_SA_F1AP_5GRECORDS NR_SA_F1AP_5GRECORDS-USIM NR_SA_F1AP_5GRECORDS-wf-0623 NR_SA_F1AP_5GRECORDS_lts NR_SA_F1AP_RFSIMULATOR NR_SA_F1AP_RFSIMULATOR2 NR_SA_F1AP_RFSIMULATOR2_SRB NR_SA_F1AP_RFSIMULATOR3 NR_SA_F1AP_RFSIMULATOR3_tmp NR_SA_F1AP_RFSIMULATOR3_wf NR_SA_F1AP_RFSIMULATOR_w5GCN NR_SA_F1AP_dev NR_SA_NGAP_RRC NR_SA_NGAP_RRC_wk42 NR_SA_itti_sim_wk48 NR_SA_itti_sim_wk48_hs NR_SA_itti_sim_wk48_hs1 NR_SA_w5GCN_new_gtpu NR_SCHED_HARQ NR_SCHED_PDCCH_PUCCH_HARQ NR_SCHED_PDCCH_PUCCH_HARQ_rebased NR_SCHED_fixes NR_SRB_Config NR_UE_CONFIG_REQ_FIXES NR_UE_PUCCH_bugfixes NR_UE_SA NR_UE_dlsch_bugfix NR_UE_rework_test NR_UE_reworking_UCI_procedures NR_UL_SCFDMA_100MHz NR_UL_scheduler NR_UL_scheduler_rebased NR_Wireshark NR_beam_simulation NR_cleanup_PUCCH_resources NR_gNB_initial_MIB_fix NR_multiplexing_HARQ_CSI_PUCCH NR_phytest_bugfixes NR_reworking_UL_antennaports NR_scheduling_CSIRS NR_scheduling_request NR_scheduling_request2 NR_scheduling_request3 PBCHNRTCFIX RFquality Saankhya_NRPRACH_HighSpeed Test_SA_5GREC add-dmrs-test add-ru-docker-image avxllr bandwidth-testing benetel_config_file_fix benetel_dpdk20 benetel_driver_uldl_pf_merge benetel_driver_update benetel_fixes bsr-fix bugfix-free-ra-process bugfix-nr-pdcp-sn-size bugfix-nr-t-reordering bugfix-x2-SgNBAdditionRequest bugfix_gnb_rt_stats_html bupt-sa-merge ci-deploy-asterix ci-deploy-docker-compose ci-fix-module-ul-iperf ci-new-docker-pipeline ci-reduce-nb-vms ci-test ci_benetel_longrun_limits ci_benetel_test ci_fix_iperf_for_module ci_hotfix_module_ue_ip_address ci_improve_module_ctl ci_nsa_benetel ci_nsa_fixes ci_nsa_pipes_improve ci_nsa_test_integration_2021_wk19 ci_nsa_traces ci_nsa_uplink ci_phytest ci_quectel_support ci_sa_rfsim_test ci_solve_ul_for_module ci_test_5GREC ci_test_nsa_fix_quectel_nic ci_test_nsa_on_develop ci_test_ra_fr2 ci_testinfra_as_code ci_vm_resource_fix cleanup_softmodem_main constant_power debug-UL-5GRECORDS debug_UL_signal detached-w16-test develop develop-CBRA-v3 develop-CCE develop-NR_SA_F1AP_5GRECORDS develop-NR_SA_F1AP_5GRECORDS-abs develop-NR_SA_F1AP_5GRECORDS-hs develop-NR_SA_F1AP_5GRECORDS-hs1 develop-NR_SA_F1AP_5GRECORDS-lts develop-NR_SA_F1AP_5GRECORDS-lts-wf develop-NR_SA_F1AP_5GRECORDS-v3 develop-NR_SA_F1AP_5GRECORDS_100M develop-NR_SA_F1AP_5GRECORDS_LDPC_FPGA develop-NR_SA_F1AP_5GRECORDS_lfq_0607 develop-SA-CBRA develop-SA-CBRA-CUDU develop-SA-CBRA-Msg5 develop-SA-CBRA-lts develop-SA-CBRA-ulsch-lts develop-SA-RA develop-SnT develop-aw2sori develop-oriecpriupdates develop-sib1 develop-sib1-local develop-sib1-lts develop-sib1-update develop-sib1-update-test1 develop-sib1-update-ue develop-wf-du develop_stable disable_CSI_measrep dlsch_parallel docker-improvements-2021-april docker-no-cache-option dongzhanyi-zte-develop1 enhance-rfsim episys-merge episys/nsa_baseline episys/nsa_development fedora-gen-kernel-fix fft_bench_hotfix fix-check fix-compile fix-nr-pdcp-timer fix-nr-rlc-range-nack fix-physim-deploy fix-quectel fix-realtime fix-retransmission-rbg fix-x2-without-gnb fix_NR_DLUL_PF fix_NR_DLUL_PF_benchmark fix_coreset_dmrs_idx fix_do_ra_data fix_nr_ulsim fix_rb_corruption fix_reestablishment fixes-CE-RLC-PDU-size fixgtpu flexran-repair-mme-mgmt flexran-rtc-repo-is-public git-dashboard gnb-freerun-txru gnb-n300-fixes gnb-only-test gnb-realtime-hotfix gnb-realtime-quickfix gnb-threadpool hack-bch-no-sched-sf-0 hack-exit-gnb-when-no-enb-nsa integ-w13-test-rt-issue integration_2020_wk15 integration_2020_wk48 integration_2020_wk48_2 integration_2020_wk49 integration_2020_wk50 integration_2020_wk50_1 integration_2020_wk51 integration_2020_wk51_2 integration_2021_wk02 integration_2021_wk02_wMR988 integration_2021_wk04 integration_2021_wk05 integration_2021_wk06 integration_2021_wk06_MR978 integration_2021_wk06_b integration_2021_wk06_c integration_2021_wk08 integration_2021_wk08_2 integration_2021_wk08_MR963 integration_2021_wk09 integration_2021_wk09_b integration_2021_wk10 integration_2021_wk10_b integration_2021_wk11 integration_2021_wk12 integration_2021_wk12_b integration_2021_wk13_a integration_2021_wk13_b integration_2021_wk13_b_fix_tdas integration_2021_wk13_b_fixed integration_2021_wk13_c integration_2021_wk14_a integration_2021_wk15_a integration_2021_wk16 integration_2021_wk17_a integration_2021_wk17_b integration_2021_wk18_a integration_2021_wk18_b integration_2021_wk19 integration_2021_wk20_a integration_2021_wk22 integration_2021_wk23 integration_2021_wk27 integration_w5GC_CBRA_test inter-RRU-final itti-enhancement ldpc_offload_t1 ldpc_short_codeword_fixes lte-ulsch-bugfix lte_uplink_improvement migrate-cpp-check-container migrate-vm-pipeline-to-bionic minor-fix-doc-basic-sim mosaic5g-oai-ran msg4_phy_0303_lfq multiple_ssb_sib1_bugfix nasmesh_kernel_5.8 new-gtpu nfapi_nr_arch_mod nfapi_nr_develop nfapi_nr_develop_new ngap-dlul ngap-w48-merge2 ngap-wf ngap-wf-1120 ngap-wf-1120-srb ngap-wf-1120-srb-gtp ngap-wf-1120-srb-gtp-hs ngap-wf-1120-srb-gtp-hs1 ngap-wf-1120-srb-gtp-hs2 ngap-wf-1120-srb-gtp-yhz ngap-wf-1203-yunsdr ngap-wf-liuyu ngap_lfq_1120 ngap_merge nr-bsr-fix nr-dl-mimo-2layer nr-dmrs-fixes nr-pdcp-benchmarking nr-pdcp-improvements nr-pdcp-nea2-security nr-pdcp-nia2-integrity nr-pdcp-small-bugfixes nr-pdcp-srb-integrity nr-ra-fix nr-stats-print nrPBCHTCFix nrPbchTcFix nrUE nrUE-hs nrUE-upper-layer nr_bsr nr_dl_pf nr_dl_ul_ptrs nr_improve_chanest nr_power_measurement_fixes nr_ue_pdcp_fix nr_ul_pf nr_ul_scfdma oairu oairu-dockerfile-support openxg/develop phy-asan-fixes physim-build-deploy physim-deploy-handle-error-cases prb_based_dl_channel_estimation ptrs_rrc_config pusch-retrans-fix-ue recursive-cmake remove_nos1_hack_pdcp rh-ci-add-ue-parallelization rh_ci_add_runtime_stats rh_ci_add_uldlharq_stats rh_ci_gsheet_rt_monitoring rh_ci_nsa2jenkins rh_ci_nsa_test_n310 rh_ci_phy_test_improve rh_ci_ra_fr2 rh_ci_test_benetel rh_ci_test_nsa rh_ci_test_nsa_wk16 rh_ci_test_nsa_wk17_b rh_ci_test_nsa_wk17b rh_ci_test_rfsim_sa rh_ci_ue_parallel rh_fr1_newjenkins rh_gnb_compile_fix rh_wk50_debug rlc-v2-bugfix-status-reporting rlc-v2-tick rohan_ulsim2RxFix s1-subnormal_rewrite s1_subnormal s1_subnormal-robert sa-demo sa-demo-hs sa-merge-rrc-srb sa-msg4 sa-msg4-rrc sa-msg4-rrc-yihz sa-msg4-rrc-yihz-hs sa_rrc_yihz sanitize-address sanitize-v1 sanitize-v1-tmp sarma_pvnp_oai scs_60_iisc sim-channels small-config-change small_nr_bugfixes t-gnb-tracer test-5GREC test-nsa-benetel test-panos test_nsa_gtpu_fix test_rt-fix_phy-test ue-dci-false-detection ue-fixes ue-pdsch-pusch-parallel ue-race-fix ue_beam_selection usrp_stop_cleanly usrp_x400 wf-sa-rrc wf_testc wireshark-T-hack-ueid wireshark-log-scheduling-requests wk11-with-phytest x2_handle_sctp_shutdown xiangwab xiangwan xw2 yihongzheng_srb 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0
No related merge requests found
......@@ -638,7 +638,7 @@ typedef struct ngap_pdusession_setup_req_s {
} ngap_pdusession_setup_req_t;
typedef struct ngap_pdusession_setup_resp_s {
uint32_t gNB_ue_ngap_id:24;
uint32_t gNB_ue_ngap_id;
/* Number of pdusession setup-ed in the list */
uint8_t nb_of_pdusessions;
......
......@@ -70,7 +70,10 @@
#include "NGAP_PDUSessionResourceSetupItemCxtReq.h"
#include "NGAP_QosFlowSetupRequestItem.h"
#include "NGAP_AllowedNSSAI-Item.h"
#include "NGAP_PDUSessionResourceModifyItemModRes.h"
#include "NGAP_PDUSessionResourceFailedToModifyItemModRes.h"
#include "NGAP_PDUSessionResourceModifyUnsuccessfulTransfer.h"
#include "NGAP_PDUSessionResourceReleasedItemRelRes.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
......
......@@ -1257,7 +1257,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
if ( ue_desc_p->amf_ue_ngap_id != amf_ue_ngap_id) {
NGAP_WARN("UE context amf_ue_ngap_id is different form that of the message (%lu != %lu)",
ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id);
(uint64_t)ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id);
}
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_PDUSESSION_SETUP_REQ);
......
......@@ -544,7 +544,6 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
ngap_nas_non_delivery_ind_t *ngap_nas_non_delivery_ind)
//------------------------------------------------------------------------------
{
#if 0
struct ngap_gNB_ue_context_s *ue_context_p;
ngap_gNB_instance_t *ngap_gNB_instance_p;
NGAP_NGAP_PDU_t pdu;
......@@ -559,11 +558,11 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p, ngap_nas_non_delivery_ind->gNB_ue_ngap_id)) == NULL) {
/* The context for this gNB ue ngap id doesn't exist in the map of gNB UEs */
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: %06x\n",
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: %08x\n",
ngap_nas_non_delivery_ind->gNB_ue_ngap_id);
MSC_LOG_EVENT(
MSC_NGAP_GNB,
MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to AMF failed, no context for gNB_ue_ngap_id %06x",
MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to AMF failed, no context for gNB_ue_ngap_id %08x",
ngap_nas_non_delivery_ind->gNB_ue_ngap_id);
return -1;
}
......@@ -580,14 +579,14 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_NASNonDeliveryIndication_IEs__value_PR_AMF_UE_NGAP_ID;
ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id;
asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (NGAP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(NGAP_NASNonDeliveryIndication_IEs_t));
ie->id = NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID;
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_NASNonDeliveryIndication_IEs__value_PR_GNB_UE_NGAP_ID;
ie->value.choice.GNB_UE_NGAP_ID = ue_context_p->gNB_ue_ngap_id;
ie->value.present = NGAP_NASNonDeliveryIndication_IEs__value_PR_RAN_UE_NGAP_ID;
ie->value.choice.RAN_UE_NGAP_ID = ue_context_p->gNB_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (NGAP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(NGAP_NASNonDeliveryIndication_IEs_t));
......@@ -621,7 +620,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
MSC_NGAP_AMF,
(const char *)buffer,
length,
MSC_AS_TIME_FMT" NASNonDeliveryIndication initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %u",
MSC_AS_TIME_FMT" NASNonDeliveryIndication initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %lu",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_p->gNB_ue_ngap_id,
ue_context_p->amf_ue_ngap_id);
......@@ -629,7 +628,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream);
#endif
return 0;
}
......@@ -1077,7 +1076,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
/* optional */
if (pdusession_setup_resp_p->nb_of_pdusessions_failed > 0) {
ie = (NGAP_PDUSessionResourceFailedToSetupListSURes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceFailedToSetupListSURes_t));
ie = (NGAP_PDUSessionResourceSetupResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceSetupResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceFailedToSetupListSURes;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSessionResourceSetupResponseIEs__value_PR_PDUSessionResourceFailedToSetupListSURes;
......@@ -1145,13 +1144,6 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* NGAP_PDUSESSIONSetupListBearerSURes_t e_RABSetupListBearerSURes;
memset(&e_RABSetupListBearerSURes, 0, sizeof(NGAP_PDUSESSIONSetupListBearerSURes_t));
if (ngap_encode_ngap_pdusessionsetuplistbearersures(&e_RABSetupListBearerSURes, &initial_ies_p->e_RABSetupListBearerSURes.ngap_PDUSESSIONSetupItemBearerSURes) < 0 )
return -1;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSESSIONSetupListBearerSURes, &e_RABSetupListBearerSURes);
*/
fprintf(stderr, "start encode\n");
if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) {
NGAP_ERROR("Failed to encode uplink transport\n");
......@@ -1164,7 +1156,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
MSC_NGAP_AMF,
(const char *)buffer,
length,
MSC_AS_TIME_FMT" E_RAN Setup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u",
MSC_AS_TIME_FMT" PduSession Setup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
pdusession_setup_resp_p->gNB_ue_ngap_id,
ue_context_p->amf_ue_ngap_id);
......@@ -1180,15 +1172,16 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
ngap_pdusession_modify_resp_t *pdusession_modify_resp_p)
//------------------------------------------------------------------------------
{
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu;
NGAP_PDUSESSIONModifyResponse_t *out;
NGAP_PDUSESSIONModifyResponseIEs_t *ie;
NGAP_PDUSessionResourceModifyResponse_t *out;
NGAP_PDUSessionResourceModifyResponseIEs_t *ie;
uint8_t *buffer = NULL;
uint32_t length;
int i;
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
/* Retrieve the NGAP gNB instance associated with Mod_id */
ngap_gNB_instance_p = ngap_gNB_get_instance(instance);
DevAssert(pdusession_modify_resp_p != NULL);
......@@ -1197,7 +1190,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p,
pdusession_modify_resp_p->gNB_ue_ngap_id)) == NULL) {
/* The context for this gNB ue ngap id doesn't exist in the map of gNB UEs */
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: 0x%06x\n",
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: 0x%08x\n",
pdusession_modify_resp_p->gNB_ue_ngap_id);
return -1;
}
......@@ -1208,7 +1201,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
if (!(ue_context_p->ue_state == NGAP_UE_CONNECTED ||
ue_context_p->ue_state == NGAP_UE_WAITING_CSR)) {
NGAP_WARN("You are attempting to send NAS data over non-connected "
"gNB ue ngap id: %06x, current state: %d\n",
"gNB ue ngap id: %08x, current state: %d\n",
pdusession_modify_resp_p->gNB_ue_ngap_id, ue_context_p->ue_state);
return -1;
}
......@@ -1216,41 +1209,40 @@ 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_PDUSESSIONModify;
pdu.choice.successfulOutcome.procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceModify;
pdu.choice.successfulOutcome.criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_PDUSESSIONModifyResponse;
out = &pdu.choice.successfulOutcome.value.choice.PDUSESSIONModifyResponse;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceModifyResponse;
out = &pdu.choice.successfulOutcome.value.choice.PDUSessionResourceModifyResponse;
/* mandatory */
ie = (NGAP_PDUSESSIONModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModifyResponseIEs_t));
ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONModifyResponseIEs__value_PR_AMF_UE_NGAP_ID;
ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id;
ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_AMF_UE_NGAP_ID;
asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (NGAP_PDUSESSIONModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID;
ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONModifyResponseIEs__value_PR_GNB_UE_NGAP_ID;
ie->value.choice.GNB_UE_NGAP_ID = pdusession_modify_resp_p->gNB_ue_ngap_id;
ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_RAN_UE_NGAP_ID;
ie->value.choice.RAN_UE_NGAP_ID = pdusession_modify_resp_p->gNB_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
if (pdusession_modify_resp_p->nb_of_pdusessions > 0) {
ie = (NGAP_PDUSESSIONModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSESSIONModifyListBearerModRes;
ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceModifyListModRes;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONModifyResponseIEs__value_PR_PDUSESSIONModifyListBearerModRes;
ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_PDUSessionResourceModifyListModRes;
for (i = 0; i < pdusession_modify_resp_p->nb_of_pdusessions; i++) {
NGAP_PDUSESSIONModifyItemBearerModResIEs_t *item;
item = (NGAP_PDUSESSIONModifyItemBearerModResIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModifyItemBearerModResIEs_t));
item->id = NGAP_ProtocolIE_ID_id_PDUSESSIONModifyItemBearerModRes;
item->criticality = NGAP_Criticality_ignore;
item->value.present = NGAP_PDUSESSIONModifyItemBearerModResIEs__value_PR_PDUSESSIONModifyItemBearerModRes;
item->value.choice.PDUSESSIONModifyItemBearerModRes.e_RAB_ID = pdusession_modify_resp_p->pdusessions[i].pdusession_id;
NGAP_DEBUG("pdusession_modify_resp: modified pdusession ID %ld\n", item->value.choice.PDUSESSIONModifyItemBearerModRes.e_RAB_ID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSESSIONModifyListBearerModRes.list, item);
NGAP_PDUSessionResourceModifyItemModRes_t *item;
item = (NGAP_PDUSessionResourceModifyItemModRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyItemModRes_t));
item->pDUSessionID = pdusession_modify_resp_p->pdusessions[i].pdusession_id;
NGAP_DEBUG("pdusession_modify_resp: modified pdusession ID %ld\n", item->pDUSessionID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceModifyListModRes.list, item);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......@@ -1258,39 +1250,40 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
/* optional */
if (pdusession_modify_resp_p->nb_of_pdusessions_failed > 0) {
ie = (NGAP_PDUSESSIONModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSESSIONFailedToModifyList;
ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceFailedToModifyListModRes;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONModifyResponseIEs__value_PR_PDUSESSIONList;
ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_PDUSessionResourceFailedToModifyListModRes;
for (i = 0; i < pdusession_modify_resp_p->nb_of_pdusessions_failed; i++) {
NGAP_PDUSESSIONItemIEs_t *item;
item = (NGAP_PDUSESSIONItemIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONItemIEs_t));
item->id = NGAP_ProtocolIE_ID_id_PDUSESSIONItem;
item->criticality = NGAP_Criticality_ignore;
item->value.present = NGAP_PDUSESSIONItemIEs__value_PR_PDUSESSIONItem;
item->value.choice.PDUSESSIONItem.e_RAB_ID = pdusession_modify_resp_p->pdusessions_failed[i].pdusession_id;
item->value.choice.PDUSESSIONItem.cause.present = pdusession_modify_resp_p->pdusessions_failed[i].cause;
switch(item->value.choice.PDUSESSIONItem.cause.present) {
NGAP_PDUSessionResourceFailedToModifyItemModRes_t *item;
NGAP_PDUSessionResourceModifyUnsuccessfulTransfer_t *pdusessionTransfer_p = NULL;
item = (NGAP_PDUSessionResourceFailedToModifyItemModRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceFailedToModifyItemModRes_t));
item->pDUSessionID = pdusession_modify_resp_p->pdusessions_failed[i].pdusession_id;
pdusessionTransfer_p = (NGAP_PDUSessionResourceModifyUnsuccessfulTransfer_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyUnsuccessfulTransfer_t));
pdusessionTransfer_p->cause.present = pdusession_modify_resp_p->pdusessions_failed[i].cause;
switch(pdusessionTransfer_p->cause.present) {
case NGAP_Cause_PR_radioNetwork:
item->value.choice.PDUSESSIONItem.cause.choice.radioNetwork = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
pdusessionTransfer_p->cause.choice.radioNetwork = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_transport:
item->value.choice.PDUSESSIONItem.cause.choice.transport = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
pdusessionTransfer_p->cause.choice.transport = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_nas:
item->value.choice.PDUSESSIONItem.cause.choice.nas = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
pdusessionTransfer_p->cause.choice.nas = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_protocol:
item->value.choice.PDUSESSIONItem.cause.choice.protocol = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
pdusessionTransfer_p->cause.choice.protocol = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_misc:
item->value.choice.PDUSESSIONItem.cause.choice.misc = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
pdusessionTransfer_p->cause.choice.misc = pdusession_modify_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_NOTHING:
......@@ -1298,8 +1291,16 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
break;
}
NGAP_DEBUG("pdusession_modify_resp: failed pdusession ID %ld\n", item->value.choice.PDUSESSIONItem.e_RAB_ID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSESSIONList.list, item);
memset(&res, 0, sizeof(res));
res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NGAP_PDUSessionResourceModifyUnsuccessfulTransfer, pdusessionTransfer_p);
item->pDUSessionResourceModifyUnsuccessfulTransfer.buf = res.buffer;
item->pDUSessionResourceModifyUnsuccessfulTransfer.size = res.result.encoded;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceModifyUnsuccessfulTransfer, pdusessionTransfer_p);
NGAP_DEBUG("pdusession_modify_resp: failed pdusession ID %ld\n", item->pDUSessionID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceFailedToModifyListModRes.list, item);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......@@ -1307,10 +1308,10 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
/* optional */
if (0) {
ie = (NGAP_PDUSESSIONModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModifyResponseIEs_t));
ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONModifyResponseIEs__value_PR_CriticalityDiagnostics;
ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_CriticalityDiagnostics;
// ie->value.choice.CriticalityDiagnostics = ;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
......@@ -1336,7 +1337,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream);
#endif
return 0;
}
//------------------------------------------------------------------------------
......@@ -1344,12 +1345,11 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
ngap_pdusession_release_resp_t *pdusession_release_resp_p)
//------------------------------------------------------------------------------
{
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu;
NGAP_PDUSESSIONReleaseResponse_t *out;
NGAP_PDUSESSIONReleaseResponseIEs_t *ie;
NGAP_PDUSessionResourceReleaseResponse_t *out;
NGAP_PDUSessionResourceReleaseResponseIEs_t *ie;
uint8_t *buffer = NULL;
uint32_t length;
int i;
......@@ -1361,7 +1361,7 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p,
pdusession_release_resp_p->gNB_ue_ngap_id)) == NULL) {
/* The context for this gNB ue ngap id doesn't exist in the map of gNB UEs */
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: %u\n",
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: 0x%08x\n",
pdusession_release_resp_p->gNB_ue_ngap_id);
return -1;
}
......@@ -1369,96 +1369,45 @@ 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_PDUSESSIONRelease;
pdu.choice.successfulOutcome.procedureCode = NGAP_ProcedureCode_id_PDUSessionResourceRelease;
pdu.choice.successfulOutcome.criticality = NGAP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_PDUSESSIONReleaseResponse;
out = &pdu.choice.successfulOutcome.value.choice.PDUSESSIONReleaseResponse;
pdu.choice.successfulOutcome.value.present = NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceReleaseResponse;
out = &pdu.choice.successfulOutcome.value.choice.PDUSessionResourceReleaseResponse;
/* mandatory */
ie = (NGAP_PDUSESSIONReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONReleaseResponseIEs_t));
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONReleaseResponseIEs__value_PR_AMF_UE_NGAP_ID;
ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id;
ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_AMF_UE_NGAP_ID;
asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (NGAP_PDUSESSIONReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONReleaseResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID;
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONReleaseResponseIEs__value_PR_GNB_UE_NGAP_ID;
ie->value.choice.GNB_UE_NGAP_ID = pdusession_release_resp_p->gNB_ue_ngap_id;
ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_RAN_UE_NGAP_ID;
ie->value.choice.RAN_UE_NGAP_ID = pdusession_release_resp_p->gNB_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
if (pdusession_release_resp_p->nb_of_pdusessions_released > 0) {
ie = (NGAP_PDUSESSIONReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONReleaseResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSESSIONReleaseListBearerRelComp;
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceReleasedListRelRes;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONReleaseResponseIEs__value_PR_PDUSESSIONReleaseListBearerRelComp;
ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_PDUSessionResourceReleasedListRelRes;
for (i = 0; i < pdusession_release_resp_p->nb_of_pdusessions_released; i++) {
NGAP_PDUSESSIONReleaseItemBearerRelCompIEs_t *item;
item = (NGAP_PDUSESSIONReleaseItemBearerRelCompIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONReleaseItemBearerRelCompIEs_t));
item->id = NGAP_ProtocolIE_ID_id_PDUSESSIONReleaseItemBearerRelComp;
item->criticality = NGAP_Criticality_ignore;
item->value.present = NGAP_PDUSESSIONReleaseItemBearerRelCompIEs__value_PR_PDUSESSIONReleaseItemBearerRelComp;
item->value.choice.PDUSESSIONReleaseItemBearerRelComp.e_RAB_ID = pdusession_release_resp_p->pdusession_release[i].pdusession_id;
NGAP_DEBUG("pdusession_release_resp: pdusession ID %ld\n", item->value.choice.PDUSESSIONReleaseItemBearerRelComp.e_RAB_ID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSESSIONReleaseListBearerRelComp.list, item);
}
NGAP_PDUSessionResourceReleasedItemRelRes_t *item;
item = (NGAP_PDUSessionResourceReleasedItemRelRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleasedItemRelRes_t));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
if (pdusession_release_resp_p->nb_of_pdusessions_failed > 0) {
ie = (NGAP_PDUSESSIONReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONReleaseResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSESSIONFailedToReleaseList;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSESSIONReleaseResponseIEs__value_PR_PDUSESSIONList;
for (i = 0; i < pdusession_release_resp_p->nb_of_pdusessions_failed; i++) {
NGAP_PDUSESSIONItemIEs_t *item;
item = (NGAP_PDUSESSIONItemIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONItemIEs_t));
item->id = NGAP_ProtocolIE_ID_id_PDUSESSIONItem;
item->criticality = NGAP_Criticality_ignore;
item->value.present = NGAP_PDUSESSIONItemIEs__value_PR_PDUSESSIONItem;
item->value.choice.PDUSESSIONItem.e_RAB_ID = pdusession_release_resp_p->pdusessions_failed[i].pdusession_id;
item->value.choice.PDUSESSIONItem.cause.present = pdusession_release_resp_p->pdusessions_failed[i].cause;
switch(item->value.choice.PDUSESSIONItem.cause.present) {
case NGAP_Cause_PR_radioNetwork:
item->value.choice.PDUSESSIONItem.cause.choice.radioNetwork = pdusession_release_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_transport:
item->value.choice.PDUSESSIONItem.cause.choice.transport = pdusession_release_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_nas:
item->value.choice.PDUSESSIONItem.cause.choice.nas = pdusession_release_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_protocol:
item->value.choice.PDUSESSIONItem.cause.choice.protocol = pdusession_release_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_misc:
item->value.choice.PDUSESSIONItem.cause.choice.misc = pdusession_release_resp_p->pdusessions_failed[i].cause_value;
break;
case NGAP_Cause_PR_NOTHING:
default:
break;
}
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSESSIONList.list, item);
item->pDUSessionID = pdusession_release_resp_p->pdusession_release[i].pdusession_id;
NGAP_DEBUG("pdusession_release_resp: pdusession ID %ld\n", item->pDUSessionID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceReleasedListRelRes.list, item);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) {
NGAP_ERROR("Failed to encode release response\n");
/* Encode procedure has failed... */
......@@ -1470,17 +1419,17 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
MSC_NGAP_AMF,
(const char *)buffer,
length,
MSC_AS_TIME_FMT" E_RAN Release successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u",
MSC_AS_TIME_FMT" E_RAN Release successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %lu",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
pdusession_release_resp_p->gNB_ue_ngap_id,
ue_context_p->amf_ue_ngap_id);
(uint64_t)ue_context_p->amf_ue_ngap_id);
/* UE associated signalling -> use the allocated stream */
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream);
NGAP_INFO("pdusession_release_response sended gNB_UE_NGAP_ID %d amf_ue_ngap_id %d nb_of_pdusessions_released %d nb_of_pdusessions_failed %d\n",
pdusession_release_resp_p->gNB_ue_ngap_id, ue_context_p->amf_ue_ngap_id,pdusession_release_resp_p->nb_of_pdusessions_released,pdusession_release_resp_p->nb_of_pdusessions_failed);
#endif
NGAP_INFO("pdusession_release_response sended gNB_UE_NGAP_ID %u amf_ue_ngap_id %lu nb_of_pdusessions_released %d nb_of_pdusessions_failed %d\n",
pdusession_release_resp_p->gNB_ue_ngap_id, (uint64_t)ue_context_p->amf_ue_ngap_id,pdusession_release_resp_p->nb_of_pdusessions_released,pdusession_release_resp_p->nb_of_pdusessions_failed);
return 0;
}
......@@ -1723,164 +1672,6 @@ int ngap_gNB_path_switch_req(instance_t instance,
return 0;
}
//-----------------------------------------------------------------------------
/*
* gNB generate a S1 PDUSESSION Modification Indication towards AMF
*/
/*int ngap_gNB_generate_PDUSESSION_Modification_Indication(
instance_t instance,
ngap_pdusession_modification_ind_t *pdusession_modification_ind)
//-----------------------------------------------------------------------------
{
struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu;
NGAP_PDUSESSIONModificationIndication_t *out = NULL;
NGAP_PDUSESSIONModificationIndicationIEs_t *ie = NULL;
NGAP_PDUSESSIONToBeModifiedItemBearerModInd_t *PDUSESSION_ToBeModifiedItem_BearerModInd = NULL;
NGAP_PDUSESSIONToBeModifiedItemBearerModIndIEs_t *PDUSESSION_ToBeModifiedItem_BearerModInd_IEs = NULL;
NGAP_PDUSESSIONNotToBeModifiedItemBearerModInd_t *PDUSESSION_NotToBeModifiedItem_BearerModInd = NULL;
NGAP_PDUSESSIONNotToBeModifiedItemBearerModIndIEs_t *PDUSESSION_NotToBeModifiedItem_BearerModInd_IEs = NULL;
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
ngap_gNB_instance_p = ngap_gNB_get_instance(instance);
uint8_t *buffer = NULL;
uint32_t len = 0;
int ret = 0;
DevAssert(ngap_gNB_instance_p != NULL);
DevAssert(pdusession_modification_ind != NULL);
int num_pdusessions_tobemodified = pdusession_modification_ind->nb_of_pdusessions_tobemodified;
int num_pdusessions_nottobemodified = pdusession_modification_ind->nb_of_pdusessions_nottobemodified;
uint32_t CSG_id = 0;
if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p,
pdusession_modification_ind->gNB_ue_ngap_id)) == NULL) {
// The context for this gNB ue ngap id doesn't exist in the map of gNB UEs
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: 0x%06x\n",
pdusession_modification_ind->gNB_ue_ngap_id);
return -1;
}
// 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;
// mandatory
ie = (NGAP_PDUSESSIONModificationIndicationIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModificationIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_PDUSESSIONModificationIndicationIEs__value_PR_AMF_UE_NGAP_ID;
ie->value.choice.AMF_UE_NGAP_ID = pdusession_modification_ind->amf_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ie = (NGAP_PDUSESSIONModificationIndicationIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModificationIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_PDUSESSIONModificationIndicationIEs__value_PR_GNB_UE_NGAP_ID;
ie->value.choice.GNB_UE_NGAP_ID = pdusession_modification_ind->gNB_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
//E-RABs to be modified list
ie = (NGAP_PDUSESSIONModificationIndicationIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModificationIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSESSIONToBeModifiedListBearerModInd;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_PDUSESSIONModificationIndicationIEs__value_PR_PDUSESSIONToBeModifiedListBearerModInd;
//The following two for-loops here will probably need to change. We should do a different type of search
for(int i=0; i<num_pdusessions_tobemodified; i++){
PDUSESSION_ToBeModifiedItem_BearerModInd_IEs = (NGAP_PDUSESSIONToBeModifiedItemBearerModIndIEs_t *)calloc(1,sizeof(NGAP_PDUSESSIONToBeModifiedItemBearerModIndIEs_t));
PDUSESSION_ToBeModifiedItem_BearerModInd_IEs->id = NGAP_ProtocolIE_ID_id_PDUSESSIONToBeModifiedItemBearerModInd;
PDUSESSION_ToBeModifiedItem_BearerModInd_IEs->criticality = NGAP_Criticality_reject;
PDUSESSION_ToBeModifiedItem_BearerModInd_IEs->value.present = NGAP_PDUSESSIONToBeModifiedItemBearerModIndIEs__value_PR_PDUSESSIONToBeModifiedItemBearerModInd;
PDUSESSION_ToBeModifiedItem_BearerModInd = &PDUSESSION_ToBeModifiedItem_BearerModInd_IEs->value.choice.PDUSESSIONToBeModifiedItemBearerModInd;
{
PDUSESSION_ToBeModifiedItem_BearerModInd->e_RAB_ID = pdusession_modification_ind->pdusessions_tobemodified[i].pdusession_id;
PDUSESSION_ToBeModifiedItem_BearerModInd->transportLayerAddress.size = pdusession_modification_ind->pdusessions_tobemodified[i].gNB_addr.length/8;
PDUSESSION_ToBeModifiedItem_BearerModInd->transportLayerAddress.bits_unused = pdusession_modification_ind->pdusessions_tobemodified[i].gNB_addr.length%8;
PDUSESSION_ToBeModifiedItem_BearerModInd->transportLayerAddress.buf = calloc(1, PDUSESSION_ToBeModifiedItem_BearerModInd->transportLayerAddress.size);
memcpy (PDUSESSION_ToBeModifiedItem_BearerModInd->transportLayerAddress.buf, pdusession_modification_ind->pdusessions_tobemodified[i].gNB_addr.buffer,
PDUSESSION_ToBeModifiedItem_BearerModInd->transportLayerAddress.size);
INT32_TO_OCTET_STRING(pdusession_modification_ind->pdusessions_tobemodified[i].gtp_teid, &PDUSESSION_ToBeModifiedItem_BearerModInd->dL_GTP_TEID);
}
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSESSIONToBeModifiedListBearerModInd.list, PDUSESSION_ToBeModifiedItem_BearerModInd_IEs);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
//E-RABs NOT to be modified list
ie = (NGAP_PDUSESSIONModificationIndicationIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModificationIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSESSIONNotToBeModifiedListBearerModInd;
ie->criticality = NGAP_Criticality_reject;
if(num_pdusessions_nottobemodified > 0) {
ie->value.present = NGAP_PDUSESSIONModificationIndicationIEs__value_PR_PDUSESSIONNotToBeModifiedListBearerModInd;
for(int i=0; i<num_pdusessions_nottobemodified; i++){
PDUSESSION_NotToBeModifiedItem_BearerModInd_IEs = (NGAP_PDUSESSIONNotToBeModifiedItemBearerModIndIEs_t *)calloc(1,sizeof(NGAP_PDUSESSIONNotToBeModifiedItemBearerModIndIEs_t));
PDUSESSION_NotToBeModifiedItem_BearerModInd_IEs->id = NGAP_ProtocolIE_ID_id_PDUSESSIONNotToBeModifiedItemBearerModInd;
PDUSESSION_NotToBeModifiedItem_BearerModInd_IEs->criticality = NGAP_Criticality_reject;
PDUSESSION_NotToBeModifiedItem_BearerModInd_IEs->value.present = NGAP_PDUSESSIONNotToBeModifiedItemBearerModIndIEs__value_PR_PDUSESSIONNotToBeModifiedItemBearerModInd;
PDUSESSION_NotToBeModifiedItem_BearerModInd = &PDUSESSION_NotToBeModifiedItem_BearerModInd_IEs->value.choice.PDUSESSIONNotToBeModifiedItemBearerModInd;
{
PDUSESSION_NotToBeModifiedItem_BearerModInd->e_RAB_ID = pdusession_modification_ind->pdusessions_nottobemodified[i].pdusession_id;
PDUSESSION_NotToBeModifiedItem_BearerModInd->transportLayerAddress.size = pdusession_modification_ind->pdusessions_nottobemodified[i].gNB_addr.length/8;
PDUSESSION_NotToBeModifiedItem_BearerModInd->transportLayerAddress.bits_unused = pdusession_modification_ind->pdusessions_nottobemodified[i].gNB_addr.length%8;
PDUSESSION_NotToBeModifiedItem_BearerModInd->transportLayerAddress.buf =
calloc(1, PDUSESSION_NotToBeModifiedItem_BearerModInd->transportLayerAddress.size);
memcpy (PDUSESSION_NotToBeModifiedItem_BearerModInd->transportLayerAddress.buf, pdusession_modification_ind->pdusessions_nottobemodified[i].gNB_addr.buffer,
PDUSESSION_NotToBeModifiedItem_BearerModInd->transportLayerAddress.size);
INT32_TO_OCTET_STRING(pdusession_modification_ind->pdusessions_nottobemodified[i].gtp_teid, &PDUSESSION_NotToBeModifiedItem_BearerModInd->dL_GTP_TEID);
}
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSESSIONNotToBeModifiedListBearerModInd.list, PDUSESSION_NotToBeModifiedItem_BearerModInd_IEs);
}
}
else{
ie->value.present = NGAP_PDUSESSIONModificationIndicationIEs__value_PR_PDUSESSIONNotToBeModifiedListBearerModInd;
ie->value.choice.PDUSESSIONNotToBeModifiedListBearerModInd.list.size = 0;
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ie = (NGAP_PDUSESSIONModificationIndicationIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModificationIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_CSGMembershipInfo;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_PDUSESSIONModificationIndicationIEs__value_PR_CSGMembershipInfo;
ie->value.choice.CSGMembershipInfo.cSGMembershipStatus = NGAP_CSGMembershipStatus_member;
INT32_TO_BIT_STRING(CSG_id, &ie->value.choice.CSGMembershipInfo.cSG_Id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (ngap_gNB_encode_pdu(&pdu, &buffer, &len) < 0) {
NGAP_ERROR("Failed to encode S1 E-RAB modification indication \n");
return -1;
}
// Non UE-Associated signalling -> stream = 0
NGAP_INFO("Size of encoded message: %d \n", len);
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer,
len, ue_context_p->tx_stream);
//ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, len, 0);
return ret;
}*/
int ngap_gNB_generate_PDUSESSION_Modification_Indication(
instance_t instance,
ngap_pdusession_modification_ind_t *pdusession_modification_ind)
......
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