Merge remote-tracking branch 'origin/minor-fixes-ngap-lib' into integration_2026_w17 (!4062)

Minor fixes/cleanup in NGAP lib

This MR is about a small NGAP-focused cleanup, mainly to reduce clang
warnings and remove dead code.
- Handle unused input parameters in ngap_gNB.c and ngap_gNB_handlers.c.
- Fix clang warning in common/utils/time_meas.h (extra semicolon).
- Removes unused NGAP trace/overload code and related references
  (ngap_gNB_trace, ngap_gNB_overload).
This commit is contained in:
Jaroslava Fiedlerova
2026-04-22 13:22:59 +02:00
9 changed files with 16 additions and 98 deletions
-1
View File
@@ -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
)
+1 -1
View File
@@ -16,7 +16,7 @@
#include <linux/types.h>
// 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;
-3
View File
@@ -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
+8 -6
View File
@@ -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,12 +659,13 @@ 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) {
(void) ngap_gNB_process_itti_msg(NULL);
ngap_gNB_process_itti_msg(NULL);
}
return NULL;
@@ -685,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;
@@ -787,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;
}
+7 -24
View File
@@ -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"
@@ -691,6 +690,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 +851,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;
@@ -1368,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);
@@ -1487,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 */
@@ -1509,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 */
@@ -1523,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 */
@@ -1553,7 +1536,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;
-6
View File
@@ -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
-11
View File
@@ -14,20 +14,9 @@
#include <stdint.h>
#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_ */
-25
View File
@@ -1,25 +0,0 @@
/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
/*!
* \brief ngap trace procedures for gNB
*/
#include "ngap_gNB_trace.h"
#include <stdint.h>
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;
}
-21
View File
@@ -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 <netinet/in.h>
#include <netinet/sctp.h>
#include <stdint.h>
#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_ */