From 210b9089b971a6bb58544a0aa3207e114c04156f Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 20 Oct 2025 08:48:58 +0200 Subject: [PATCH 1/7] Fix clang warning: remove extra semicolon in time_meas.h line 36 - Fixed [-Wextra-semi] warning by removing duplicate semicolon --- common/utils/time_meas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/time_meas.h b/common/utils/time_meas.h index 700214b355..10f5308203 100644 --- a/common/utils/time_meas.h +++ b/common/utils/time_meas.h @@ -16,7 +16,7 @@ #include // global var to enable openair performance profiler extern int cpu_meas_enabled; -extern double cpu_freq_GHz __attribute__ ((aligned(32)));; +extern double cpu_freq_GHz __attribute__ ((aligned(32))); // structure to store data to compute cpu measurment #if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__) typedef long long oai_cputime_t; From ca315902822f89ccc8bcbf39e52cebcc6c9bddf1 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 20 Oct 2025 09:01:59 +0200 Subject: [PATCH 2/7] Fix clang warning: unused parameters in ngap_gNB_handlers.c - Fixed [-Wunused-parameter] warnings by adopting UNUSED macro --- openair3/NGAP/ngap_gNB_handlers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 78bc0b3de4..291508bb7b 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -691,6 +691,7 @@ static int ngap_gNB_handle_error_indication(sctp_assoc_t assoc_id, uint32_t stre * Decode the NGAP message and transfer to RRC */ static int ngap_gNB_handle_handover_request(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) { + UNUSED(stream); DevAssert(pdu != NULL); ngap_gNB_amf_data_t *amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0); @@ -851,6 +852,7 @@ static int ngap_gNB_handle_initial_context_request(sctp_assoc_t assoc_id, uint32 static int ngap_gNB_handle_ue_context_release_command(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) { + UNUSED(stream); ngap_gNB_amf_data_t *amf_desc_p = NULL; MessageDef *message_p = NULL; uint64_t amf_ue_ngap_id; From f4c4e02d7823eccbb8eed948c0bed22f4b51588f Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 20 Oct 2025 09:03:58 +0200 Subject: [PATCH 3/7] Fix clang warning: sign comparison in ngap_gNB_handlers.c - Fixed [-Wsign-compare] warning by casting sizeof result to long - Resolves comparison between signed NGAP_ProcedureCode_t and unsigned size_t --- openair3/NGAP/ngap_gNB_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 291508bb7b..71b4b55552 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -1555,7 +1555,7 @@ int ngap_gNB_handle_message(sctp_assoc_t assoc_id, int32_t stream, const uint8_t } /* Checking procedure Code and direction of message */ - if (pdu.choice.initiatingMessage->procedureCode >= sizeof(ngap_messages_callback) / (3 * sizeof(ngap_message_decoded_callback)) || (pdu.present > NGAP_NGAP_PDU_PR_unsuccessfulOutcome)) { + if (pdu.choice.initiatingMessage->procedureCode >= (long)(sizeof(ngap_messages_callback) / (3 * sizeof(ngap_message_decoded_callback))) || (pdu.present > NGAP_NGAP_PDU_PR_unsuccessfulOutcome)) { NGAP_ERROR("[SCTP %u] Either procedureCode %ld or direction %d exceed expected\n", assoc_id, pdu.choice.initiatingMessage->procedureCode, pdu.present); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu); return -1; From 711c632001cbdf2bb1d7ab783031af1771ac2ac6 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 20 Oct 2025 09:10:25 +0200 Subject: [PATCH 4/7] Cleanup dead NGAP code The goal of this commit is to keep the NGAP library tidy and remove all handlers that are not currently implemented and other dead code. --- CMakeLists.txt | 1 - openair2/COMMON/ngap_messages_types.h | 3 --- openair3/NGAP/ngap_gNB_handlers.c | 27 ++++----------------------- openair3/NGAP/ngap_gNB_overload.c | 6 ------ openair3/NGAP/ngap_gNB_overload.h | 11 ----------- openair3/NGAP/ngap_gNB_trace.c | 25 ------------------------- openair3/NGAP/ngap_gNB_trace.h | 21 --------------------- 7 files changed, 4 insertions(+), 90 deletions(-) delete mode 100644 openair3/NGAP/ngap_gNB_trace.c delete mode 100644 openair3/NGAP/ngap_gNB_trace.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d9ca49a4a..703acea459 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -420,7 +420,6 @@ add_library(ngap ${NGAP_DIR}/ngap_gNB_pdu_session_management.c ${NGAP_DIR}/ngap_gNB_nnsf.c ${NGAP_DIR}/ngap_gNB_overload.c - ${NGAP_DIR}/ngap_gNB_trace.c ${NGAP_DIR}/ngap_gNB_ue_context.c ${NGAP_DIR}/ngap_gNB_NRPPa_transport_procedures.c ) diff --git a/openair2/COMMON/ngap_messages_types.h b/openair2/COMMON/ngap_messages_types.h index ab9115125b..5f25e50644 100644 --- a/openair2/COMMON/ngap_messages_types.h +++ b/openair2/COMMON/ngap_messages_types.h @@ -31,9 +31,6 @@ #define NGAP_UE_CTXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.ngap_ue_ctxt_modification_fail #define NGAP_PDUSESSION_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.ngap_pdusession_setup_resp #define NGAP_PDUSESSION_MODIFY_RESP(mSGpTR) (mSGpTR)->ittiMsg.ngap_pdusession_modify_resp -#define NGAP_PATH_SWITCH_REQ(mSGpTR) (mSGpTR)->ittiMsg.ngap_path_switch_req -#define NGAP_PATH_SWITCH_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.ngap_path_switch_req_ack -#define NGAP_PDUSESSION_MODIFICATION_IND(mSGpTR) (mSGpTR)->ittiMsg.ngap_pdusession_modification_ind #define NGAP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.ngap_downlink_nas #define NGAP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.ngap_initial_context_setup_req diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 71b4b55552..17801a7e46 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -30,7 +30,6 @@ #include "ngap_gNB_nas_procedures.h" #include "ngap_gNB_paging.h" #include "ngap_gNB_NRPPa_transport_procedures.h" -#include "ngap_gNB_trace.h" #include "ngap_gNB_ue_context.h" #include "ngap_messages_types.h" #include "oai_asn1.h" @@ -1370,24 +1369,6 @@ static int ngap_gNB_handle_pdusession_release_command(sctp_assoc_t assoc_id, uin return 0; } -static int ngap_gNB_handle_ng_path_switch_request_ack(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) -{ - // TODO - return 0; -} - -static int ngap_gNB_handle_ng_path_switch_request_failure(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) -{ - // TODO - return 0; -} - -static int ngap_gNB_handle_ng_ENDC_pdusession_modification_confirm(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) -{ - LOG_W(NGAP, "Implementation of NGAP Pdusession Modification confirm handler is pending...\n"); - return 0; -} - static int ngap_gNB_handle_dl_ran_status_transfer(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) { DevAssert(pdu != NULL); @@ -1489,7 +1470,7 @@ const ngap_message_decoded_callback ngap_messages_callback[][3] = { {0, 0, 0}, /* AMFConfigurationUpdate */ {0, 0, 0}, /* AMFStatusIndication */ {0, 0, 0}, /* CellTrafficTrace */ - {ngap_gNB_handle_deactivate_trace, 0, 0}, /* DeactivateTrace */ + {0, 0, 0}, /* DeactivateTrace */ {ngap_gNB_handle_nas_downlink, 0, 0}, /* DownlinkNASTransport */ {ngap_gNB_handle_downlink_non_ue_associated_nrppa_transport, 0, 0}, /* DownlinkNonUEAssociatedNRPPaTransport */ {0, 0, 0}, /* DownlinkRANConfigurationTransfer */ @@ -1511,9 +1492,9 @@ const ngap_message_decoded_callback ngap_messages_callback[][3] = { {0, 0, 0}, /* OverloadStart */ {0, 0, 0}, /* OverloadStop */ {ngap_gNB_handle_paging, 0, 0}, /* Paging */ - {0, ngap_gNB_handle_ng_path_switch_request_ack, ngap_gNB_handle_ng_path_switch_request_failure}, /* PathSwitchRequest */ + {0, 0, 0}, /* PathSwitchRequest */ {ngap_gNB_handle_pdusession_modify_request, 0, 0}, /* PDUSessionResourceModify */ - {0, ngap_gNB_handle_ng_ENDC_pdusession_modification_confirm, 0}, /* PDUSessionResourceModifyIndication */ + {0, 0, 0}, /* PDUSessionResourceModifyIndication */ {ngap_gNB_handle_pdusession_release_command, 0, 0}, /* PDUSessionResourceRelease */ {ngap_gNB_handle_pdusession_setup_request, 0, 0}, /* PDUSessionResourceSetup */ {0, 0, 0}, /* PDUSessionResourceNotify */ @@ -1525,7 +1506,7 @@ const ngap_message_decoded_callback ngap_messages_callback[][3] = { {0, 0, 0}, /* RerouteNASRequest */ {0, 0, 0}, /* RRCInactiveTransitionReport */ {0, 0, 0}, /* TraceFailureIndication */ - {ngap_gNB_handle_trace_start, 0, 0}, /* TraceStart */ + {0, 0, 0}, /* TraceStart */ {0, 0, 0}, /* UEContextModification */ {ngap_gNB_handle_ue_context_release_command, 0, 0}, /* UEContextRelease */ {0, 0, 0}, /* UEContextReleaseRequest */ diff --git a/openair3/NGAP/ngap_gNB_overload.c b/openair3/NGAP/ngap_gNB_overload.c index 41955b06e0..42590ea31b 100644 --- a/openair3/NGAP/ngap_gNB_overload.c +++ b/openair3/NGAP/ngap_gNB_overload.c @@ -13,12 +13,6 @@ #include "ngap_gNB_defs.h" #include "ngap_gNB_management_procedures.h" -int ngap_gNB_handle_overload_start(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) -{ - //TODO - return 0; -} - int ngap_gNB_handle_overload_stop(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) { /* We received Overload stop message, meaning that the AMF is no more diff --git a/openair3/NGAP/ngap_gNB_overload.h b/openair3/NGAP/ngap_gNB_overload.h index 9eb9682152..d9083166ee 100644 --- a/openair3/NGAP/ngap_gNB_overload.h +++ b/openair3/NGAP/ngap_gNB_overload.h @@ -14,20 +14,9 @@ #include #include "NGAP_NGAP-PDU.h" -/** - * \brief Handle an overload start message - **/ -// int ngap_gNB_handle_overload_start(gNB_amf_desc_t *gNB_desc_p, -// sctp_queue_item_t *packet_p, -// struct ngap_message_s *message_p); -int ngap_gNB_handle_overload_start(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu); - /** * \brief Handle an overload stop message **/ -// int ngap_gNB_handle_overload_stop(gNB_amf_desc_t *gNB_desc_p, -// sctp_queue_item_t *packet_p, -// struct ngap_message_s *message_p); int ngap_gNB_handle_overload_stop(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu); #endif /* NGAP_GNB_OVERLOAD_H_ */ diff --git a/openair3/NGAP/ngap_gNB_trace.c b/openair3/NGAP/ngap_gNB_trace.c deleted file mode 100644 index 63e164c653..0000000000 --- a/openair3/NGAP/ngap_gNB_trace.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -/*! - * \brief ngap trace procedures for gNB - */ - -#include "ngap_gNB_trace.h" -#include - -int ngap_gNB_handle_trace_start(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) -{ - //TODO - return 0; -} - -int ngap_gNB_handle_deactivate_trace(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *message_p) -{ - // NGAP_DeactivateTraceIEs_t *deactivate_trace_p; - // - // deactivate_trace_p = &message_p->msg.deactivateTraceIEs; - - return 0; -} diff --git a/openair3/NGAP/ngap_gNB_trace.h b/openair3/NGAP/ngap_gNB_trace.h deleted file mode 100644 index 19319f6c7c..0000000000 --- a/openair3/NGAP/ngap_gNB_trace.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SPDX-License-Identifier: LicenseRef-CSSL-1.0 - */ - -/*! - * \brief ngap trace procedures for gNB - */ - -#ifndef NGAP_GNB_TRACE_H_ -#define NGAP_GNB_TRACE_H_ - -#include -#include -#include -#include "NGAP_NGAP-PDU.h" - -int ngap_gNB_handle_trace_start(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu); - -int ngap_gNB_handle_deactivate_trace(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu); - -#endif /* NGAP_GNB_TRACE_H_ */ From 7f6e5ff38e403a4065f8d231cfb8eb985a4f58a6 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 20 Oct 2025 09:21:52 +0200 Subject: [PATCH 5/7] Fix clang warning: unused parameters in ngap_gNB.c - Fixed [-Wunused-parameter] warnings by adopting UNUSED macro --- openair3/NGAP/ngap_gNB.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index f193590b96..5b2c12f210 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -527,7 +527,9 @@ int ngap_gNB_handle_ul_ran_status_transfer(instance_t instance, const ngap_ran_s return 0; } -void *ngap_gNB_process_itti_msg(void *notUsed) { +void *ngap_gNB_process_itti_msg(void *notUsed) +{ + UNUSED(notUsed); MessageDef *received_msg = NULL; int result; itti_receive_msg(TASK_NGAP, &received_msg); @@ -657,8 +659,9 @@ void *ngap_gNB_process_itti_msg(void *notUsed) { return NULL; } - -void *ngap_gNB_task(void *arg) { +void *ngap_gNB_task(void *arg) +{ + UNUSED(arg); ngap_gNB_init(); while (1) { From 4a36f46a384f904ca382677cdb073fd0fcc81c75 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Tue, 21 Apr 2026 17:58:35 +0200 Subject: [PATCH 6/7] NGAP: remove unnecessary void * cast in ngap_gNB_task --- openair3/NGAP/ngap_gNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index 5b2c12f210..ad1dcc376c 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -665,7 +665,7 @@ void *ngap_gNB_task(void *arg) ngap_gNB_init(); while (1) { - (void) ngap_gNB_process_itti_msg(NULL); + ngap_gNB_process_itti_msg(NULL); } return NULL; From 5902635d2da4ecb0587505bd73cde9f363729c90 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Tue, 21 Apr 2026 18:05:08 +0200 Subject: [PATCH 7/7] Remove unused ret variable in ngap_gNB_generate_ng_setup_request --- openair3/NGAP/ngap_gNB.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index ad1dcc376c..746a7b1ad8 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -688,7 +688,6 @@ static int ngap_gNB_generate_ng_setup_request( NGAP_SliceSupportItem_t *ssi = NULL; uint8_t *buffer = NULL; uint32_t len = 0; - int ret = 0; DevAssert(instance_p != NULL); DevAssert(ngap_amf_data_p != NULL); ngap_amf_data_p->state = NGAP_GNB_STATE_WAITING; @@ -790,7 +789,7 @@ static int ngap_gNB_generate_ng_setup_request( /* Non UE-Associated signalling -> stream = 0 */ ngap_gNB_itti_send_sctp_data_req(instance_p->instance, ngap_amf_data_p->assoc_id, buffer, len, 0); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu); - return ret; + return 0; }