From 9c94203e49cb6d74c0dcc2a7dbf52358eb138d4f Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 24 Oct 2024 09:58:07 +0200 Subject: [PATCH 01/13] Move transport_layer_addr_t to platform_types.h * tunnel address is the same for NR and LTE and used in both * Remove LTE dependency in gtpv1_u_messages_types.h --- common/platform_types.h | 14 ++++++++++++++ openair2/COMMON/gtpv1_u_messages_types.h | 3 --- openair2/COMMON/s1ap_messages_types.h | 10 ---------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/common/platform_types.h b/common/platform_types.h index 888a812465..cb3d872804 100644 --- a/common/platform_types.h +++ b/common/platform_types.h @@ -193,6 +193,20 @@ typedef struct nsa_msg_t { uint8_t msg_buffer[MAX_MESSAGE_SIZE]; } nsa_msg_t; +typedef struct transport_layer_addr_s { + /** + * Transport Layer Address as a bitstring: + * - 32 bits for IPv4 (RFC 791), + * - 128 bits for IPv6 (RFC 2460), + * - 160 bits for both IPv4 and IPv6, with IPv4 in the first 32 bits. + * The S1AP/NGAP layer forwards this address (bitstring<1..160>) + * to S1-U/NG-U without interpreting it. + */ + uint8_t length; + /// Buffer: address in network byte order + uint8_t buffer[20]; +} transport_layer_addr_t; + //----------------------------------------------------------------------------- // GTPV1U TYPES //----------------------------------------------------------------------------- diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h index 77e92f39bb..c4a7f7bb18 100644 --- a/openair2/COMMON/gtpv1_u_messages_types.h +++ b/openair2/COMMON/gtpv1_u_messages_types.h @@ -170,13 +170,10 @@ typedef struct { typedef struct gtpv1u_gnb_create_tunnel_req_s { ue_id_t ue_id; int num_tunnels; - //teid_t upf_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier teid_t outgoing_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; int outgoing_qfi[NR_GTPV1U_MAX_BEARERS_PER_UE]; pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE]; ebi_t incoming_rb_id[NR_GTPV1U_MAX_BEARERS_PER_UE]; - //ebi_t outgoing_rb_id[NR_GTPV1U_MAX_BEARERS_PER_UE]; - //transport_layer_addr_t upf_addr[NR_GTPV1U_MAX_BEARERS_PER_UE]; transport_layer_addr_t dst_addr[NR_GTPV1U_MAX_BEARERS_PER_UE]; } gtpv1u_gnb_create_tunnel_req_t; diff --git a/openair2/COMMON/s1ap_messages_types.h b/openair2/COMMON/s1ap_messages_types.h index 7537d7c6d7..e7bbfc7989 100644 --- a/openair2/COMMON/s1ap_messages_types.h +++ b/openair2/COMMON/s1ap_messages_types.h @@ -224,16 +224,6 @@ typedef struct nas_pdu_s { uint32_t length; } nas_pdu_t, ue_radio_cap_t; -typedef struct transport_layer_addr_s { - /* Length of the transport layer address buffer in bits. S1AP layer received a - * bit string<1..160> containing one of the following addresses: ipv4, - * ipv6, or ipv4 and ipv6. The layer doesn't interpret the buffer but - * silently forward it to S1-U. - */ - uint8_t length; - uint8_t buffer[20]; // in network byte order -} transport_layer_addr_t; - #define TRANSPORT_LAYER_ADDR_COPY(dEST,sOURCE) \ do { \ AssertFatal(sOURCE.len <= 20); \ From 69df3598f3af8b7c46b7c8594bb5871147cd630a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 28 Oct 2024 11:06:20 +0100 Subject: [PATCH 02/13] Redefine NGAP_MAX_PDUSESSION and removed LTE dependency * limit to 16 instead of specs value 256 --- openair2/COMMON/ngap_messages_types.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/openair2/COMMON/ngap_messages_types.h b/openair2/COMMON/ngap_messages_types.h index 0f1555cfdf..cdba1c5e2d 100644 --- a/openair2/COMMON/ngap_messages_types.h +++ b/openair2/COMMON/ngap_messages_types.h @@ -32,11 +32,9 @@ #include "common/platform_constants.h" #include "common/platform_types.h" #include "common/5g_platform_types.h" -#include "LTE_asn_constant.h" #include "s1ap_messages_types.h" -//-------------------------------------------------------------------------------------------// -// Defines to access message fields. +// Defines to access message fields. #define NGAP_REGISTER_GNB_REQ(mSGpTR) (mSGpTR)->ittiMsg.ngap_register_gnb_req #define NGAP_REGISTER_GNB_CNF(mSGpTR) (mSGpTR)->ittiMsg.ngap_register_gnb_cnf @@ -72,10 +70,9 @@ #define NGAP_PDUSESSION_RELEASE_RESPONSE(mSGpTR) (mSGpTR)->ittiMsg.ngap_pdusession_release_resp //-------------------------------------------------------------------------------------------// -/* Maximum number of e-rabs to be setup/deleted in a single message. - * Even if only one bearer will be modified by message. - */ -#define NGAP_MAX_PDUSESSION (LTE_maxDRB + 3) + +// maxnoofPDUSessions in 3GPP TS 38.413 +#define NGAP_MAX_PDUSESSION 16 // 256 according to specs /* Length of the transport layer address string * 160 bits / 8 bits by char. From e8f9d577cd76ad6ceb870e2d630755dee30d2910 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 30 Oct 2024 12:52:29 +0100 Subject: [PATCH 03/13] Use DL_SCH_LCID_DCCH in NR and remove dependency from mac.h --- openair2/RRC/NR/rrc_gNB.c | 26 +++++++++++++------------- openair2/RRC/NR/rrc_gNB_NGAP.c | 3 ++- openair2/RRC/NR/rrc_gNB_mobility.c | 5 +++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index c018b8030a..87c05e134d 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -568,7 +568,7 @@ static void rrc_gNB_generate_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_ DevAssert(size > 0 && size <= sizeof(buffer)); LOG_UE_DL_EVENT(ue_p, "Generate RRCReconfiguration (bytes %d, xid %d)\n", size, xid); - nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size); + nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size); } void rrc_gNB_modify_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p) @@ -677,7 +677,7 @@ void rrc_gNB_modify_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t clear_nas_pdu(&ue_p->pduSession[i].param.nas_pdu); LOG_I(NR_RRC, "UE %d: Generate RRCReconfiguration (bytes %d)\n", ue_p->rrc_ue_id, size); - nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size); + nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size); } //----------------------------------------------------------------------------- @@ -729,7 +729,7 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration_release(gNB_RRC_INST *rrc, } LOG_I(NR_RRC, "UE %d: Generate NR_RRCReconfiguration (bytes %d)\n", ue_p->rrc_ue_id, size); - nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size); + nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size); } /* \brief find existing PDU session inside E1AP Bearer Modif message, or @@ -860,10 +860,10 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context uint32_t old_gNB_DU_ue_id = old_rnti; f1ap_dl_rrc_message_t dl_rrc = {.gNB_CU_ue_id = ue_p->rrc_ue_id, .gNB_DU_ue_id = ue_data.secondary_ue, - .srb_id = DCCH, + .srb_id = DL_SCH_LCID_DCCH, .old_gNB_DU_ue_id = &old_gNB_DU_ue_id}; deliver_dl_rrc_message_data_t data = {.rrc = rrc, .dl_rrc = &dl_rrc, .assoc_id = ue_data.du_assoc_id}; - nr_pdcp_data_req_srb(ue_p->rrc_ue_id, DCCH, rrc_gNB_mui++, size, (unsigned char *const)buffer, rrc_deliver_dl_rrc_message, &data); + nr_pdcp_data_req_srb(ue_p->rrc_ue_id, DL_SCH_LCID_DCCH, rrc_gNB_mui++, size, (unsigned char *const)buffer, rrc_deliver_dl_rrc_message, &data); /* RRCReestablishment has been generated, let's enable ciphering now. */ security_parameters.ciphering_algorithm = ue_p->ciphering_algorithm; @@ -965,7 +965,7 @@ static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RR ue_p->rrc_ue_id, ue_p->rnti, size); - nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size); + nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size); } //----------------------------------------------------------------------------- @@ -986,7 +986,7 @@ int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int uint8_t buffer[NR_RRC_BUF_SIZE]; int size = do_RRCReconfiguration(ue_p, buffer, NR_RRC_BUF_SIZE, xid, NULL, NULL, NULL, NULL, NULL, NULL, masterCellGroup); - nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size); + nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size); return 0; } @@ -1406,7 +1406,7 @@ void rrc_forward_ue_nas_message(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) unsigned int xid = rrc_gNB_get_next_transaction_identifier(rrc->module_id); uint32_t length = do_NR_DLInformationTransfer(buffer, sizeof(buffer), xid, UE->nas_pdu.length, UE->nas_pdu.buffer); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, buffer, length, "[MSG] RRC DL Information Transfer\n"); - rb_id_t srb_id = UE->Srb[2].Active ? DCCH1 : DCCH; + rb_id_t srb_id = UE->Srb[2].Active ? DL_SCH_LCID_DCCH1 : DL_SCH_LCID_DCCH; nr_rrc_transfer_protected_rrc_message(rrc, UE, srb_id, buffer, length); // no need to free UE->nas_pdu.buffer, do_NR_DLInformationTransfer() did that UE->nas_pdu.buffer = NULL; @@ -1654,7 +1654,7 @@ static void rrc_gNB_generate_UECapabilityEnquiry(gNB_RRC_INST *rrc, gNB_RRC_UE_t AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n"); - nr_rrc_transfer_protected_rrc_message(rrc, ue, DCCH, buffer, size); + nr_rrc_transfer_protected_rrc_message(rrc, ue, DL_SCH_LCID_DCCH, buffer, size); } static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *msg) @@ -2001,7 +2001,7 @@ static void rrc_CU_process_ue_context_release_request(MessageDef *msg_p, sctp_as .gNB_DU_ue_id = source_ctx->du_ue_id, .cause = F1AP_CAUSE_RADIO_NETWORK, .cause_value = 5, // 5 = F1AP_CauseRadioNetwork_interaction_with_other_procedure - .srb_id = DCCH, + .srb_id = DL_SCH_LCID_DCCH, }; rrc->mac_rrc.ue_context_release_command(assoc_id, &cmd); nr_rrc_finalize_ho(UE); @@ -2649,7 +2649,7 @@ void rrc_gNB_generate_SecurityModeCommand(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p) LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Security Mode Command\n"); LOG_I(NR_RRC, "UE %u Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d)\n", ue_p->rrc_ue_id, size); - nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size); + nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size); } typedef struct deliver_ue_ctxt_release_data_t { @@ -2684,10 +2684,10 @@ void rrc_gNB_generate_RRCRelease(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) .gNB_DU_ue_id = ue_data.secondary_ue, .cause = F1AP_CAUSE_RADIO_NETWORK, .cause_value = 10, // 10 = F1AP_CauseRadioNetwork_normal_release - .srb_id = DCCH, + .srb_id = DL_SCH_LCID_DCCH, }; deliver_ue_ctxt_release_data_t data = {.rrc = rrc, .release_cmd = &ue_context_release_cmd, .assoc_id = ue_data.du_assoc_id}; - nr_pdcp_data_req_srb(UE->rrc_ue_id, DCCH, rrc_gNB_mui++, size, buffer, rrc_deliver_ue_ctxt_release_cmd, &data); + nr_pdcp_data_req_srb(UE->rrc_ue_id, DL_SCH_LCID_DCCH, rrc_gNB_mui++, size, buffer, rrc_deliver_ue_ctxt_release_cmd, &data); } int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint32_t tmsi, uint8_t paging_drx) diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 6a35f61b3f..cd47fbc8bc 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -32,6 +32,7 @@ #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "rrc_eNB_S1AP.h" #include "gnb_config.h" +#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h" #include "common/ran_context.h" #include "oai_asn1.h" @@ -140,7 +141,7 @@ void nr_rrc_pdcp_config_security(gNB_RRC_UE_t *UE, bool enable_ciphering) } } - nr_pdcp_config_set_security(UE->rrc_ue_id, DCCH, true, &security_parameters); + nr_pdcp_config_set_security(UE->rrc_ue_id, DL_SCH_LCID_DCCH, true, &security_parameters); } //------------------------------------------------------------------------------ diff --git a/openair2/RRC/NR/rrc_gNB_mobility.c b/openair2/RRC/NR/rrc_gNB_mobility.c index 137e7010c2..22e86c5120 100644 --- a/openair2/RRC/NR/rrc_gNB_mobility.c +++ b/openair2/RRC/NR/rrc_gNB_mobility.c @@ -29,6 +29,7 @@ #include "rrc_gNB_du.h" #include "rrc_gNB_radio_bearers.h" #include "rrc_gNB_UE_context.h" +#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h" #include "openair2/F1AP/f1ap_ids.h" #include "MESSAGES/asn1_msg.h" #include "nr_pdcp/nr_pdcp_oai_api.h" @@ -286,7 +287,7 @@ static void nr_rrc_f1_ho_complete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) .gNB_DU_ue_id = source_ctx->du_ue_id, .cause = F1AP_CAUSE_RADIO_NETWORK, // better .cause_value = 5, // 5 = F1AP_CauseRadioNetwork_interaction_with_other_procedure - .srb_id = DCCH, + .srb_id = DL_SCH_LCID_DCCH, }; rrc->mac_rrc.ue_context_release_command(source_ctx->du->assoc_id, &cmd); LOG_I(NR_RRC, "UE %d Handover: trigger release on DU assoc_id %d\n", UE->rrc_ue_id, source_ctx->du->assoc_id); @@ -302,7 +303,7 @@ static void nr_rrc_cancel_f1_ho(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) .gNB_DU_ue_id = target_ctx->du_ue_id, .cause = F1AP_CAUSE_RADIO_NETWORK, // better .cause_value = 5, // 5 = F1AP_CauseRadioNetwork_interaction_with_other_procedure - .srb_id = DCCH, + .srb_id = DL_SCH_LCID_DCCH, }; rrc->mac_rrc.ue_context_release_command(target_ctx->du->assoc_id, &cmd); } From 4957f446e95c871329ed12cc175c006b46d85ce7 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 18 Nov 2024 11:19:50 +0100 Subject: [PATCH 04/13] Refactor includes in NGAP files * used open source IWYU tool --- openair3/NGAP/ngap_common.c | 8 -- openair3/NGAP/ngap_common.h | 54 +------------ openair3/NGAP/ngap_gNB.c | 49 ++++++------ openair3/NGAP/ngap_gNB.h | 1 - .../ngap_gNB_context_management_procedures.c | 24 +++--- .../ngap_gNB_context_management_procedures.h | 3 + openair3/NGAP/ngap_gNB_decoder.c | 19 ++--- openair3/NGAP/ngap_gNB_decoder.h | 1 + openair3/NGAP/ngap_gNB_encoder.c | 21 +++--- openair3/NGAP/ngap_gNB_encoder.h | 3 + openair3/NGAP/ngap_gNB_handlers.c | 39 +++++----- openair3/NGAP/ngap_gNB_handlers.h | 3 + openair3/NGAP/ngap_gNB_itti_messaging.c | 8 +- openair3/NGAP/ngap_gNB_itti_messaging.h | 4 + .../NGAP/ngap_gNB_management_procedures.c | 14 ++-- openair3/NGAP/ngap_gNB_nas_procedures.c | 32 +++++--- openair3/NGAP/ngap_gNB_nas_procedures.h | 5 ++ openair3/NGAP/ngap_gNB_nnsf.c | 12 +-- openair3/NGAP/ngap_gNB_nnsf.h | 4 + openair3/NGAP/ngap_gNB_overload.c | 19 +---- openair3/NGAP/ngap_gNB_overload.h | 5 ++ openair3/NGAP/ngap_gNB_trace.c | 17 +---- openair3/NGAP/ngap_gNB_trace.h | 5 ++ openair3/NGAP/ngap_gNB_ue_context.c | 18 ++--- openair3/NGAP/ngap_gNB_ue_context.h | 5 +- openair3/NGAP/ngap_msg_includes.h | 75 +++++++++++++++++++ 26 files changed, 239 insertions(+), 209 deletions(-) create mode 100644 openair3/NGAP/ngap_msg_includes.h diff --git a/openair3/NGAP/ngap_common.c b/openair3/NGAP/ngap_common.c index 53b04e09eb..bded329570 100644 --- a/openair3/NGAP/ngap_common.c +++ b/openair3/NGAP/ngap_common.c @@ -28,14 +28,6 @@ */ #include - #include "ngap_common.h" -#include "NGAP_NGAP-PDU.h" - int asn1_xer_print = 0; - - -void ngap_handle_criticality(NGAP_Criticality_t criticality) -{ -} diff --git a/openair3/NGAP/ngap_common.h b/openair3/NGAP/ngap_common.h index 3c060eac03..f83414e2bb 100644 --- a/openair3/NGAP/ngap_common.h +++ b/openair3/NGAP/ngap_common.h @@ -36,55 +36,10 @@ #ifndef NGAP_COMMON_H_ #define NGAP_COMMON_H_ - +#include #include "common/utils/LOG/log.h" #include "oai_asn1.h" - -#include "NGAP_ProtocolIE-Field.h" -#include "NGAP_NGAP-PDU.h" -#include "NGAP_InitiatingMessage.h" -#include "NGAP_SuccessfulOutcome.h" -#include "NGAP_UnsuccessfulOutcome.h" -#include "NGAP_ProtocolIE-Field.h" -#include "NGAP_ProtocolIE-FieldPair.h" -#include "NGAP_ProtocolIE-ContainerPair.h" -#include "NGAP_ProtocolExtensionField.h" -#include "NGAP_ProtocolExtensionContainer.h" -#include "NGAP_asn_constant.h" -#include "NGAP_SupportedTAItem.h" -#include "NGAP_ServedGUAMIItem.h" -#include "NGAP_BroadcastPLMNItem.h" -#include "NGAP_SliceSupportItem.h" -#include "NGAP_PLMNSupportItem.h" -#include "NGAP_PDUSessionResourceSetupResponseTransfer.h" -#include "NGAP_PDUSessionResourceSetupUnsuccessfulTransfer.h" -#include "NGAP_PDUSessionResourceSetupItemCxtRes.h" -#include "NGAP_PDUSessionResourceFailedToSetupItemCxtRes.h" -#include "NGAP_PDUSessionResourceSetupItemSUReq.h" -#include "NGAP_PDUSessionResourceSetupItemSURes.h" -#include "NGAP_PDUSessionResourceFailedToSetupItemSURes.h" -#include "NGAP_AssociatedQosFlowItem.h" -#include "NGAP_PDUSessionResourceSetupRequestTransfer.h" -#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" -#include "NGAP_PDUSessionResourceToReleaseItemRelCmd.h" -#include "NGAP_PDUSessionResourceModifyItemModReq.h" -#include "NGAP_PDUSessionResourceModifyRequestTransfer.h" -#include "NGAP_QosFlowAddOrModifyRequestItem.h" -#include "NGAP_PDUSessionResourceModifyResponseTransfer.h" -#include "NGAP_QosFlowAddOrModifyResponseList.h" -#include "NGAP_QosFlowAddOrModifyResponseItem.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" +#include "ngap_msg_includes.h" /* Checking version of ASN1C compiler */ #if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION) @@ -129,11 +84,6 @@ extern int asn1_xer_print; **/ typedef int (*ngap_message_decoded_callback)(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu); -/** \brief Handle criticality - \param criticality Criticality of the IE - @returns void - **/ -void ngap_handle_criticality(NGAP_Criticality_t criticality); /** @}*/ #endif /* NGAP_COMMON_H_ */ diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index 70f6bd5e49..9c328c37c7 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -28,38 +28,41 @@ * @ingroup _ngap */ - -#include +#include +#include #include #include -#include -#include "openair3/SECU/kdf.h" - -#include "tree.h" -#include "queue.h" - +#include +#include +#include "BIT_STRING.h" +#include "ngap_msg_includes.h" +#include "OCTET_STRING.h" +#include "PHY/defs_common.h" +#include "T.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/utils/T/T.h" +#include "conversions.h" +#include "ds/byte_array.h" #include "intertask_interface.h" - -#include "ngap_gNB_default_values.h" - #include "ngap_common.h" - -#include "ngap_gNB_defs.h" #include "ngap_gNB.h" +#include "ngap_gNB_context_management_procedures.h" +#include "ngap_gNB_default_values.h" +#include "ngap_gNB_defs.h" #include "ngap_gNB_encoder.h" #include "ngap_gNB_handlers.h" -#include "ngap_gNB_nnsf.h" - -#include "ngap_gNB_nas_procedures.h" -#include "ngap_gNB_management_procedures.h" -#include "ngap_gNB_context_management_procedures.h" - #include "ngap_gNB_itti_messaging.h" +#include "ngap_gNB_management_procedures.h" +#include "ngap_gNB_nas_procedures.h" +#include "ngap_messages_types.h" +#include "oai_asn1.h" +#include "openair3/SECU/kdf.h" +#include "queue.h" +#include "s1ap_messages_types.h" +#include "sctp_messages_types.h" +#include "tree.h" -#include "ngap_gNB_ue_context.h" // test, to be removed - -#include "assertions.h" -#include "conversions.h" #if defined(TEST_S1C_AMF) #include "oaisim_amf_test_s1c.h" #endif diff --git a/openair3/NGAP/ngap_gNB.h b/openair3/NGAP/ngap_gNB.h index 9a838009c6..b3ca6acfa5 100644 --- a/openair3/NGAP/ngap_gNB.h +++ b/openair3/NGAP/ngap_gNB.h @@ -28,7 +28,6 @@ * @ingroup _ngap */ -#include #include /** @defgroup _ngap_impl_ NGAP Layer Reference Implementation diff --git a/openair3/NGAP/ngap_gNB_context_management_procedures.c b/openair3/NGAP/ngap_gNB_context_management_procedures.c index 242da7a257..524fcee6c4 100644 --- a/openair3/NGAP/ngap_gNB_context_management_procedures.c +++ b/openair3/NGAP/ngap_gNB_context_management_procedures.c @@ -27,30 +27,24 @@ * \version 1.0 * @ingroup _ngap */ - +#include "ngap_gNB_context_management_procedures.h" +#include #include #include -#include - +#include "INTEGER.h" +#include "T.h" #include "assertions.h" -#include "conversions.h" - +#include "common/utils/T/T.h" #include "intertask_interface.h" - +#include "ngap_msg_includes.h" #include "ngap_common.h" #include "ngap_gNB_defs.h" - -#include "ngap_gNB_itti_messaging.h" - #include "ngap_gNB_encoder.h" -#include "ngap_gNB_nnsf.h" -#include "ngap_gNB_ue_context.h" -#include "ngap_gNB_nas_procedures.h" +#include "ngap_gNB_itti_messaging.h" #include "ngap_gNB_management_procedures.h" -#include "ngap_gNB_context_management_procedures.h" -#include "NGAP_PDUSessionResourceItemCxtRelReq.h" -#include "NGAP_PDUSessionResourceItemCxtRelCpl.h" +#include "ngap_gNB_ue_context.h" +#include "oai_asn1.h" int ngap_ue_context_release_complete(instance_t instance, ngap_ue_release_complete_t *ue_release_complete_p) diff --git a/openair3/NGAP/ngap_gNB_context_management_procedures.h b/openair3/NGAP/ngap_gNB_context_management_procedures.h index 5eca34e56d..273b246d95 100644 --- a/openair3/NGAP/ngap_gNB_context_management_procedures.h +++ b/openair3/NGAP/ngap_gNB_context_management_procedures.h @@ -28,6 +28,9 @@ * @ingroup _ngap */ +#include "assertions.h" +#include "ngap_messages_types.h" + #ifndef NGAP_GNB_CONTEXT_MANAGEMENT_PROCEDURES_H_ #define NGAP_GNB_CONTEXT_MANAGEMENT_PROCEDURES_H_ diff --git a/openair3/NGAP/ngap_gNB_decoder.c b/openair3/NGAP/ngap_gNB_decoder.c index 4ea3f69fec..4b76abecbb 100644 --- a/openair3/NGAP/ngap_gNB_decoder.c +++ b/openair3/NGAP/ngap_gNB_decoder.c @@ -26,16 +26,17 @@ * \date 2020 * \version 0.1 */ - - -#include - -#include "assertions.h" - -#include "intertask_interface.h" - -#include "ngap_common.h" #include "ngap_gNB_decoder.h" +#include +#include +#include "ngap_msg_includes.h" +#include "T.h" +#include "aper_decoder.h" +#include "asn_application.h" +#include "asn_codecs.h" +#include "assertions.h" +#include "common/utils/T/T.h" +#include "ngap_common.h" static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) { asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} }; diff --git a/openair3/NGAP/ngap_gNB_decoder.h b/openair3/NGAP/ngap_gNB_decoder.h index 9fc8d433c4..d75f069c50 100644 --- a/openair3/NGAP/ngap_gNB_decoder.h +++ b/openair3/NGAP/ngap_gNB_decoder.h @@ -27,6 +27,7 @@ */ #include +#include "NGAP_NGAP-PDU.h" #ifndef NGAP_GNB_DECODER_H_ #define NGAP_GNB_DECODER_H_ diff --git a/openair3/NGAP/ngap_gNB_encoder.c b/openair3/NGAP/ngap_gNB_encoder.c index e85ae4c8eb..ee3b37e07d 100644 --- a/openair3/NGAP/ngap_gNB_encoder.c +++ b/openair3/NGAP/ngap_gNB_encoder.c @@ -27,16 +27,19 @@ * \version 0.1 */ - -#include -#include -#include - -#include "assertions.h" -#include "conversions.h" -#include "intertask_interface.h" -#include "ngap_common.h" #include "ngap_gNB_encoder.h" +#include +#include +#include "ngap_msg_includes.h" +#include "T.h" +#include "asn_application.h" +#include "asn_codecs.h" +#include "assertions.h" +#include "common/utils/T/T.h" +#include "constr_TYPE.h" +#include "ngap_common.h" +#include "utils.h" +#include "xer_encoder.h" static inline int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) { diff --git a/openair3/NGAP/ngap_gNB_encoder.h b/openair3/NGAP/ngap_gNB_encoder.h index bd151405ff..4c015d352a 100644 --- a/openair3/NGAP/ngap_gNB_encoder.h +++ b/openair3/NGAP/ngap_gNB_encoder.h @@ -30,6 +30,9 @@ #ifndef NGAP_GNB_ENCODER_H_ #define NGAP_GNB_ENCODER_H_ +#include +#include "NGAP_NGAP-PDU.h" + int ngap_gNB_encode_pdu(NGAP_NGAP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) __attribute__ ((warn_unused_result)); diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 59b2792602..2916967b83 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -27,26 +27,31 @@ * \version 0.1 */ -#include - -#include "intertask_interface.h" - -#include "ngap_common.h" -// #include "ngap_gNB.h" -#include "ngap_gNB_defs.h" #include "ngap_gNB_handlers.h" -#include "ngap_gNB_decoder.h" - -#include "ngap_gNB_ue_context.h" -#include "ngap_gNB_trace.h" -#include "ngap_gNB_nas_procedures.h" -#include "ngap_gNB_management_procedures.h" - -#include "ngap_gNB_default_values.h" - +#include +#include +#include +#include +#include "INTEGER.h" +#include "ngap_msg_includes.h" +#include "OCTET_STRING.h" +#include "PHY/defs_common.h" +#include "T.h" #include "assertions.h" +#include "common/utils/T/T.h" +#include "constr_TYPE.h" #include "conversions.h" -#include "NGAP_NonDynamic5QIDescriptor.h" +#include "intertask_interface.h" +#include "ngap_common.h" +#include "ngap_gNB_decoder.h" +#include "ngap_gNB_defs.h" +#include "ngap_gNB_management_procedures.h" +#include "ngap_gNB_nas_procedures.h" +#include "ngap_gNB_trace.h" +#include "ngap_gNB_ue_context.h" +#include "ngap_messages_types.h" +#include "oai_asn1.h" +#include "queue.h" static void allocCopy(ngap_pdu_t *out, OCTET_STRING_t in) { diff --git a/openair3/NGAP/ngap_gNB_handlers.h b/openair3/NGAP/ngap_gNB_handlers.h index 5291b78fa8..d39b6df443 100644 --- a/openair3/NGAP/ngap_gNB_handlers.h +++ b/openair3/NGAP/ngap_gNB_handlers.h @@ -30,6 +30,9 @@ #ifndef NGAP_GNB_HANDLERS_H_ #define NGAP_GNB_HANDLERS_H_ +#include +#include "ngap_gNB_defs.h" + void ngap_handle_ng_setup_message(ngap_gNB_amf_data_t *amf_desc_p, int sctp_shutdown); int ngap_gNB_handle_message(sctp_assoc_t assoc_id, int32_t stream, const uint8_t *const data, const uint32_t data_length); diff --git a/openair3/NGAP/ngap_gNB_itti_messaging.c b/openair3/NGAP/ngap_gNB_itti_messaging.c index 4f4a3b2654..87eb93c8f6 100644 --- a/openair3/NGAP/ngap_gNB_itti_messaging.c +++ b/openair3/NGAP/ngap_gNB_itti_messaging.c @@ -26,10 +26,12 @@ * \date 2020 * \version 0.1 */ - -#include "intertask_interface.h" -#include "ngap_gNB_itti_messaging.h" +#include +#include +#include "intertask_interface.h" +#include "ngap_messages_types.h" +#include "sctp_messages_types.h" void ngap_gNB_itti_send_sctp_data_req(instance_t instance, sctp_assoc_t assoc_id, diff --git a/openair3/NGAP/ngap_gNB_itti_messaging.h b/openair3/NGAP/ngap_gNB_itti_messaging.h index 362c9a0266..67054761e3 100644 --- a/openair3/NGAP/ngap_gNB_itti_messaging.h +++ b/openair3/NGAP/ngap_gNB_itti_messaging.h @@ -30,6 +30,10 @@ #ifndef NGAP_GNB_ITTI_MESSAGING_H_ #define NGAP_GNB_ITTI_MESSAGING_H_ +#include +#include +#include + void ngap_gNB_itti_send_sctp_data_req(instance_t instance, sctp_assoc_t assoc_id, uint8_t *buffer, diff --git a/openair3/NGAP/ngap_gNB_management_procedures.c b/openair3/NGAP/ngap_gNB_management_procedures.c index 6ed06d9324..0c6c513af4 100644 --- a/openair3/NGAP/ngap_gNB_management_procedures.c +++ b/openair3/NGAP/ngap_gNB_management_procedures.c @@ -28,18 +28,16 @@ * @ingroup _ngap */ +#include +#include +#include #include #include -#include - -#include "intertask_interface.h" - +#include #include "assertions.h" -#include "conversions.h" - -#include "ngap_common.h" #include "ngap_gNB_defs.h" -#include "ngap_gNB.h" +#include "queue.h" +#include "tree.h" ngap_gNB_internal_data_t ngap_gNB_internal_data; diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.c b/openair3/NGAP/ngap_gNB_nas_procedures.c index 29541d8acf..6cce5b695e 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.c +++ b/openair3/NGAP/ngap_gNB_nas_procedures.c @@ -28,26 +28,36 @@ * @ingroup _ngap */ - +#include "ngap_gNB_nas_procedures.h" +#include +#include +#include #include #include -#include - +#include +#include "BIT_STRING.h" +#include "INTEGER.h" +#include "ngap_msg_includes.h" +#include "OCTET_STRING.h" +#include "PHY/defs_common.h" +#include "T.h" +#include "aper_encoder.h" +#include "asn_application.h" +#include "asn_codecs.h" #include "assertions.h" +#include "common/utils/T/T.h" +#include "constr_TYPE.h" #include "conversions.h" - -#include "intertask_interface.h" - #include "ngap_common.h" #include "ngap_gNB_defs.h" - -#include "ngap_gNB_itti_messaging.h" - #include "ngap_gNB_encoder.h" +#include "ngap_gNB_itti_messaging.h" +#include "ngap_gNB_management_procedures.h" #include "ngap_gNB_nnsf.h" #include "ngap_gNB_ue_context.h" -#include "ngap_gNB_nas_procedures.h" -#include "ngap_gNB_management_procedures.h" +#include "oai_asn1.h" +#include "s1ap_messages_types.h" +#include "xer_encoder.h" static void allocCopy(OCTET_STRING_t *out, ngap_pdu_t in) { diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.h b/openair3/NGAP/ngap_gNB_nas_procedures.h index da55a349ed..f977bf3a69 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.h +++ b/openair3/NGAP/ngap_gNB_nas_procedures.h @@ -31,6 +31,11 @@ #ifndef NGAP_GNB_NAS_PROCEDURES_H_ #define NGAP_GNB_NAS_PROCEDURES_H_ +#include +#include "assertions.h" +#include "ngap_messages_types.h" +#include "ngap_msg_includes.h" + int ngap_gNB_handle_nas_downlink(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu); int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_p); diff --git a/openair3/NGAP/ngap_gNB_nnsf.c b/openair3/NGAP/ngap_gNB_nnsf.c index 0d002e9836..a04474669c 100644 --- a/openair3/NGAP/ngap_gNB_nnsf.c +++ b/openair3/NGAP/ngap_gNB_nnsf.c @@ -27,15 +27,11 @@ * \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com) */ -#include -#include - -#include "intertask_interface.h" - -#include "ngap_common.h" - -#include "ngap_gNB_defs.h" #include "ngap_gNB_nnsf.h" +#include +#include "ngap_gNB_defs.h" +#include "queue.h" +#include "tree.h" struct ngap_gNB_amf_data_s * ngap_gNB_nnsf_select_amf(ngap_gNB_instance_t *instance_p, diff --git a/openair3/NGAP/ngap_gNB_nnsf.h b/openair3/NGAP/ngap_gNB_nnsf.h index 7d43a890ea..bf6c309af0 100644 --- a/openair3/NGAP/ngap_gNB_nnsf.h +++ b/openair3/NGAP/ngap_gNB_nnsf.h @@ -30,6 +30,10 @@ #ifndef NGAP_GNB_NNSF_H_ #define NGAP_GNB_NNSF_H_ +#include +#include "ngap_gNB_defs.h" +#include "ngap_messages_types.h" + struct ngap_gNB_amf_data_s * ngap_gNB_nnsf_select_amf(ngap_gNB_instance_t *instance_p, ngap_rrc_establishment_cause_t cause); diff --git a/openair3/NGAP/ngap_gNB_overload.c b/openair3/NGAP/ngap_gNB_overload.c index d8512c0695..cc5cd997cf 100644 --- a/openair3/NGAP/ngap_gNB_overload.c +++ b/openair3/NGAP/ngap_gNB_overload.c @@ -27,23 +27,12 @@ * \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com) */ - -#include -#include -#include - -#include "intertask_interface.h" - -#include "ngap_common.h" -#include "ngap_gNB_defs.h" - -#include "ngap_gNB.h" -#include "ngap_gNB_ue_context.h" -#include "ngap_gNB_encoder.h" #include "ngap_gNB_overload.h" -#include "ngap_gNB_management_procedures.h" - +#include +#include #include "assertions.h" +#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) { diff --git a/openair3/NGAP/ngap_gNB_overload.h b/openair3/NGAP/ngap_gNB_overload.h index b893194a4b..8f0644e5b0 100644 --- a/openair3/NGAP/ngap_gNB_overload.h +++ b/openair3/NGAP/ngap_gNB_overload.h @@ -30,6 +30,11 @@ #ifndef NGAP_GNB_OVERLOAD_H_ #define NGAP_GNB_OVERLOAD_H_ +#include +#include +#include +#include "NGAP_NGAP-PDU.h" + /** * \brief Handle an overload start message **/ diff --git a/openair3/NGAP/ngap_gNB_trace.c b/openair3/NGAP/ngap_gNB_trace.c index 8fc0968ccd..679fa354fc 100644 --- a/openair3/NGAP/ngap_gNB_trace.c +++ b/openair3/NGAP/ngap_gNB_trace.c @@ -27,23 +27,8 @@ * \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com) */ -#include - -#include "assertions.h" - -#include "intertask_interface.h" - -#include "ngap_gNB_default_values.h" - -#include "ngap_common.h" -#include "ngap_gNB_defs.h" - -#include "ngap_gNB.h" -#include "ngap_gNB_ue_context.h" -#include "ngap_gNB_encoder.h" #include "ngap_gNB_trace.h" -#include "ngap_gNB_itti_messaging.h" -#include "ngap_gNB_management_procedures.h" +#include int ngap_gNB_handle_trace_start(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu) { diff --git a/openair3/NGAP/ngap_gNB_trace.h b/openair3/NGAP/ngap_gNB_trace.h index b35354a16f..566172cbcd 100644 --- a/openair3/NGAP/ngap_gNB_trace.h +++ b/openair3/NGAP/ngap_gNB_trace.h @@ -30,6 +30,11 @@ #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); diff --git a/openair3/NGAP/ngap_gNB_ue_context.c b/openair3/NGAP/ngap_gNB_ue_context.c index 0be4fc480e..894491ebbe 100644 --- a/openair3/NGAP/ngap_gNB_ue_context.c +++ b/openair3/NGAP/ngap_gNB_ue_context.c @@ -27,18 +27,14 @@ * \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com) */ -#include -#include -#include -#include - -#include "tree.h" - -#include "intertask_interface.h" - -#include "ngap_common.h" -#include "ngap_gNB_defs.h" #include "ngap_gNB_ue_context.h" +#include +#include +#include "PHY/defs_common.h" +#include "T.h" +#include "common/utils/T/T.h" +#include "ngap_common.h" +#include "tree.h" /* Tree of UE ordered by gNB_ue_ngap_id's * NO INSTANCE, the 32 bits id is large enough to handle all UEs, regardless the cell, gNB, ... diff --git a/openair3/NGAP/ngap_gNB_ue_context.h b/openair3/NGAP/ngap_gNB_ue_context.h index 8de03b63ba..2ca75141ef 100644 --- a/openair3/NGAP/ngap_gNB_ue_context.h +++ b/openair3/NGAP/ngap_gNB_ue_context.h @@ -26,11 +26,10 @@ * \version 0.1 * \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com) */ - -#include "tree.h" -#include "queue.h" +#include #include "ngap_gNB_defs.h" +#include "tree.h" #ifndef NGAP_GNB_UE_CONTEXT_H_ #define NGAP_GNB_UE_CONTEXT_H_ diff --git a/openair3/NGAP/ngap_msg_includes.h b/openair3/NGAP/ngap_msg_includes.h new file mode 100644 index 0000000000..c7ef77be6a --- /dev/null +++ b/openair3/NGAP/ngap_msg_includes.h @@ -0,0 +1,75 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file ngap_msg_includes.h + * \brief NGAP ASN.1 message includes + * \author Guido Casati + * \date 2024 + * \email: hello@guidocasati.com + * \version 1.0 + * @ingroup _ngap + * + * This header file contains the includes for the NGAP ASN.1 messages, + * generated from the ASN.1 specifications. + */ + +#ifndef NGAP_MSG_INCLUDES_H +#define NGAP_MSG_INCLUDES_H + +#include "NGAP_AllowedNSSAI-Item.h" +#include "NGAP_AssociatedQosFlowItem.h" +#include "NGAP_BroadcastPLMNItem.h" +#include "NGAP_GlobalGNB-ID.h" +#include "NGAP_GTPTunnel.h" +#include "NGAP_InitiatingMessage.h" +#include "NGAP_NGAP-PDU.h" +#include "NGAP_PDUSessionResourceFailedToModifyItemModRes.h" +#include "NGAP_PDUSessionResourceFailedToSetupItemCxtRes.h" +#include "NGAP_PDUSessionResourceFailedToSetupItemSURes.h" +#include "NGAP_PDUSessionResourceItemCxtRelCpl.h" +#include "NGAP_PDUSessionResourceItemCxtRelReq.h" +#include "NGAP_PDUSessionResourceModifyItemModReq.h" +#include "NGAP_PDUSessionResourceModifyItemModRes.h" +#include "NGAP_PDUSessionResourceModifyResponseTransfer.h" +#include "NGAP_PDUSessionResourceModifyUnsuccessfulTransfer.h" +#include "NGAP_PDUSessionResourceReleasedItemRelRes.h" +#include "NGAP_PDUSessionResourceSetupItemCxtReq.h" +#include "NGAP_PDUSessionResourceSetupItemCxtRes.h" +#include "NGAP_PDUSessionResourceSetupItemSUReq.h" +#include "NGAP_PDUSessionResourceSetupItemSURes.h" +#include "NGAP_PDUSessionResourceSetupResponseTransfer.h" +#include "NGAP_PDUSessionResourceSetupUnsuccessfulTransfer.h" +#include "NGAP_PDUSessionResourceToReleaseItemRelCmd.h" +#include "NGAP_PLMNSupportItem.h" +#include "NGAP_ProtocolIE-Field.h" +#include "NGAP_QosFlowAddOrModifyResponseItem.h" +#include "NGAP_QosFlowAddOrModifyResponseList.h" +#include "NGAP_ServedGUAMIItem.h" +#include "NGAP_SliceSupportItem.h" +#include "NGAP_SuccessfulOutcome.h" +#include "NGAP_SupportedTAItem.h" +#include "NGAP_TAIListForPagingItem.h" +#include "NGAP_UE-NGAP-ID-pair.h" +#include "NGAP_UnsuccessfulOutcome.h" +#include "NGAP_UserLocationInformationNR.h" +#include "NGAP_asn_constant.h" + +#endif // NGAP_MSG_INCLUDES_H From eb39836b0a764647c33da2859a10ee588e92e58a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Fri, 27 Sep 2024 11:56:55 +0200 Subject: [PATCH 05/13] Refactor includes in RRC files * used open source IWYU tool + manual review * deleted unused nr_rrc_common.c --- openair2/COMMON/gtpv1_u_messages_types.h | 1 + openair2/LAYER2/NR_MAC_gNB/main.c | 1 + openair2/RRC/NR/MESSAGES/asn1_msg.h | 33 +++-- openair2/RRC/NR/cucp_cuup_direct.c | 4 +- openair2/RRC/NR/cucp_cuup_e1ap.c | 9 +- openair2/RRC/NR/mac_rrc_dl_direct.c | 8 +- openair2/RRC/NR/mac_rrc_dl_f1ap.c | 9 +- openair2/RRC/NR/nr_rrc_common.h | 2 - openair2/RRC/NR/nr_rrc_config.c | 29 +++-- openair2/RRC/NR/nr_rrc_config.h | 13 +- openair2/RRC/NR/nr_rrc_defs.h | 26 +--- openair2/RRC/NR/nr_rrc_proto.h | 7 +- openair2/RRC/NR/rrc_gNB.c | 117 ++++++++---------- openair2/RRC/NR/rrc_gNB_GTPV1U.c | 20 ++- openair2/RRC/NR/rrc_gNB_GTPV1U.h | 4 + openair2/RRC/NR/rrc_gNB_NGAP.c | 91 +++++++------- openair2/RRC/NR/rrc_gNB_NGAP.h | 12 +- openair2/RRC/NR/rrc_gNB_UE_context.c | 11 +- openair2/RRC/NR/rrc_gNB_UE_context.h | 5 +- openair2/RRC/NR/rrc_gNB_cuup.c | 15 +++ openair2/RRC/NR/rrc_gNB_du.c | 30 ++++- openair2/RRC/NR/rrc_gNB_du.h | 1 - openair2/RRC/NR/rrc_gNB_internode.c | 24 ++-- openair2/RRC/NR/rrc_gNB_nsa.c | 57 ++++++--- openair2/RRC/NR/rrc_gNB_radio_bearers.c | 11 +- openair2/RRC/NR/rrc_gNB_radio_bearers.h | 9 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 23 ++-- openair2/RRC/NR_UE/rrc_UE.c | 1 + .../ESM/MSG/PduSessionEstablishmentAccept.c | 1 + 29 files changed, 333 insertions(+), 241 deletions(-) diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h index c4a7f7bb18..0a2691e643 100644 --- a/openair2/COMMON/gtpv1_u_messages_types.h +++ b/openair2/COMMON/gtpv1_u_messages_types.h @@ -24,6 +24,7 @@ #include "LTE_asn_constant.h" #include "NR_asn_constant.h" +#include "s1ap_messages_types.h" #define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity #define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index a663ed522c..add3b6589a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -41,6 +41,7 @@ #include "common/ran_context.h" #include "executables/softmodem-common.h" +#include "openair2/RRC/NR/MESSAGES/asn1_msg.h" extern RAN_CONTEXT_t RC; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 2f0b4febf8..d7642ca663 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -31,17 +31,30 @@ #ifndef __RRC_NR_MESSAGES_ASN1_MSG__H__ #define __RRC_NR_MESSAGES_ASN1_MSG__H__ +#include +#include #include -#include -#include /* for atoi(3) */ -#include /* for getopt(3) */ -#include /* for strerror(3) */ -#include /* for EX_* exit codes */ -#include /* for errno */ - -#include - -#include "RRC/NR/nr_rrc_config.h" +#include "NR_ARFCN-ValueNR.h" +#include "NR_CellGroupConfig.h" +#include "NR_CipheringAlgorithm.h" +#include "NR_DRB-ToAddModList.h" +#include "NR_DRB-ToReleaseList.h" +#include "NR_IntegrityProtAlgorithm.h" +#include "NR_LogicalChannelConfig.h" +#include "NR_MeasConfig.h" +#include "NR_MeasTiming.h" +#include "NR_RLC-BearerConfig.h" +#include "NR_RLC-Config.h" +#include "NR_RRC-TransactionIdentifier.h" +#include "NR_RadioBearerConfig.h" +#include "NR_ReestablishmentCause.h" +#include "NR_SRB-ToAddModList.h" +#include "NR_SecurityConfig.h" +#include "RRC/NR/nr_rrc_defs.h" +#include "ds/seq_arr.h" +#include "rrc_messages_types.h" +struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList; +struct asn_TYPE_descriptor_s; /* * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) diff --git a/openair2/RRC/NR/cucp_cuup_direct.c b/openair2/RRC/NR/cucp_cuup_direct.c index 97763d65d7..2e8bbfa428 100644 --- a/openair2/RRC/NR/cucp_cuup_direct.c +++ b/openair2/RRC/NR/cucp_cuup_direct.c @@ -19,8 +19,10 @@ * contact@openairinterface.org */ +#include +#include +#include "assertions.h" #include "cucp_cuup_if.h" - #include "nr_rrc_defs.h" #include "openair2/COMMON/e1ap_messages_types.h" #include "openair2/LAYER2/nr_pdcp/cucp_cuup_handler.h" diff --git a/openair2/RRC/NR/cucp_cuup_e1ap.c b/openair2/RRC/NR/cucp_cuup_e1ap.c index b567fd76d4..69cb92f50a 100644 --- a/openair2/RRC/NR/cucp_cuup_e1ap.c +++ b/openair2/RRC/NR/cucp_cuup_e1ap.c @@ -19,13 +19,14 @@ * contact@openairinterface.org */ +#include +#include +#include "assertions.h" #include "cucp_cuup_if.h" +#include "e1ap_messages_types.h" +#include "intertask_interface.h" #include "nr_rrc_defs.h" -#include "nr_rrc_proto.h" -#include "nr_rrc_extern.h" -#include "cucp_cuup_if.h" - static void cucp_cuup_bearer_context_setup_e1ap(sctp_assoc_t assoc_id, const e1ap_bearer_setup_req_t *req) { AssertFatal(assoc_id > 0, "illegal assoc_id %d\n", assoc_id); diff --git a/openair2/RRC/NR/mac_rrc_dl_direct.c b/openair2/RRC/NR/mac_rrc_dl_direct.c index 54ec7c8e4c..77113f6c8b 100644 --- a/openair2/RRC/NR/mac_rrc_dl_direct.c +++ b/openair2/RRC/NR/mac_rrc_dl_direct.c @@ -19,9 +19,13 @@ * contact@openairinterface.org */ -#include "nr_rrc_defs.h" - +#include +#include +#include +#include "assertions.h" +#include "f1ap_messages_types.h" #include "mac_rrc_dl.h" +#include "nr_rrc_defs.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h" static void f1_reset_cu_initiated_direct(sctp_assoc_t assoc_id, const f1ap_reset_t *reset) diff --git a/openair2/RRC/NR/mac_rrc_dl_f1ap.c b/openair2/RRC/NR/mac_rrc_dl_f1ap.c index 70d36a144f..8593ff816a 100644 --- a/openair2/RRC/NR/mac_rrc_dl_f1ap.c +++ b/openair2/RRC/NR/mac_rrc_dl_f1ap.c @@ -19,8 +19,15 @@ * contact@openairinterface.org */ +#include +#include +#include +#include #include - +#include +#include "assertions.h" +#include "f1ap_messages_types.h" +#include "intertask_interface.h" #include "mac_rrc_dl.h" #include "nr_rrc_defs.h" #include "openair2/F1AP/lib/f1ap_rrc_message_transfer.h" diff --git a/openair2/RRC/NR/nr_rrc_common.h b/openair2/RRC/NR/nr_rrc_common.h index f81a57f5ad..f3bc3681a9 100644 --- a/openair2/RRC/NR/nr_rrc_common.h +++ b/openair2/RRC/NR/nr_rrc_common.h @@ -22,8 +22,6 @@ #ifndef __NR_RRC_COMMON_H__ #define __NR_RRC_COMMON_H__ -#include -#include #include #define NR_NUM_SRB 4 /* Number of Signalling Radio Bearers according to clause 4.2.2 of 3GPP TS 38.331 */ diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 6966394667..72ea552601 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -28,18 +28,33 @@ * \email: raymond.knopp@eurecom.fr, kroempa@gmail.com */ -#include "openair3/UTILS/conversions.h" #include "nr_rrc_config.h" +#include +#include +#include +#include +#include "BIT_STRING.h" +#include "NULL.h" +#include "RRC/NR/MESSAGES/asn1_msg.h" +#include "RRC/NR/nr_rrc_proto.h" +#include "SIMULATION/TOOLS/sim.h" +#include "T.h" +#include "asn_SET_OF.h" +#include "asn_codecs.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/openairinterface5g_limits.h" +#include "common/utils/T/T.h" #include "common/utils/nr/nr_common.h" -#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" +#include "constr_TYPE.h" #include "executables/softmodem-common.h" #include "oai_asn1.h" -#include "SIMULATION/TOOLS/sim.h" // for taus(); - -#include "NR_MeasurementTimingConfiguration.h" - +#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" +#include "openair3/UTILS/conversions.h" #include "uper_decoder.h" #include "uper_encoder.h" +#include "utils.h" +#include "xer_encoder.h" const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; @@ -3090,8 +3105,6 @@ NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid, return cellGroupConfig; } -#include "common/ran_context.h" -#include "nr_rrc_defs.h" void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, const int uid, NR_UE_NR_Capability_t *uecap, diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index ff94f2ab7e..b9f030e897 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -31,8 +31,17 @@ #ifndef __NR_RRC_CONFIG_H__ #define __NR_RRC_CONFIG_H__ -#include "nr_rrc_defs.h" -#include "openair2/RRC/NR/MESSAGES/asn1_msg.h" +#include +#include +#include "NR_BCCH-BCH-Message.h" +#include "NR_BCCH-DL-SCH-Message.h" +#include "NR_CellGroupConfig.h" +#include "NR_UE-NR-Capability.h" +#include "NR_UL-CCCH-Message.h" +#include "PHY/defs_common.h" +#include "f1ap_messages_types.h" +struct NR_MeasurementTimingConfiguration; +struct NR_PDSCH_TimeDomainResourceAllocationList; // forward declaration of MAC configuration parameters, definition is included in C file struct nr_mac_config_t; diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 7650718e66..b33b2c158c 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -34,39 +34,25 @@ #include #include #include - #include "collection/tree.h" #include "collection/linear_alloc.h" #include "common/utils/ds/seq_arr.h" #include "nr_rrc_common.h" #include "ds/byte_array.h" - #include "common/platform_constants.h" #include "common/platform_types.h" #include "mac_rrc_dl.h" #include "cucp_cuup_if.h" - -#include "NR_SIB1.h" -#include "NR_RRCReconfigurationComplete.h" -#include "NR_RRCReconfiguration.h" -#include "NR_RRCReestablishmentRequest.h" #include "NR_BCCH-BCH-Message.h" #include "NR_BCCH-DL-SCH-Message.h" -#include "NR_BCCH-BCH-Message.h" -#include "NR_PLMN-IdentityInfo.h" -#include "NR_MCC-MNC-Digit.h" -#include "NR_NG-5G-S-TMSI.h" - -#include "NR_UE-NR-Capability.h" -#include "NR_UE-MRDC-Capability.h" -#include "NR_MeasResults.h" #include "NR_CellGroupConfig.h" -#include "NR_ServingCellConfigCommon.h" -#include "NR_EstablishmentCause.h" +#include "NR_MeasurementReport.h" #include "NR_MeasurementTimingConfiguration.h" - -//------------------- - +#include "NR_RRCReconfiguration.h" +#include "NR_UE-CapabilityRAT-ContainerList.h" +#include "NR_UL-CCCH-Message.h" +#include "NR_UE-MRDC-Capability.h" +#include "NR_UE-NR-Capability.h" #include "intertask_interface.h" // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 576a1f636a..ab2a95ecde 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -35,14 +35,9 @@ #define __NR_RRC_PROTO_H__ #include "RRC/NR/nr_rrc_defs.h" -#include "NR_RRCReconfiguration.h" -#include "NR_UE-NR-Capability.h" -#include "NR_UE-CapabilityRAT-ContainerList.h" -#include "LTE_UE-CapabilityRAT-ContainerList.h" #include "NR_CG-Config.h" #include "NR_CG-ConfigInfo.h" -#include "NR_SecurityConfig.h" -#include "NR_CellGroupConfig.h" +#include "NR_RRCReconfiguration.h" #define NR_MAX_SUPPORTED_DL_LAYERS 4 diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 87c05e134d..5a7f0099aa 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -30,79 +30,70 @@ #define RRC_GNB_C #define RRC_GNB_C -#include #include -#include +#include +#include +#include +#include +#include +#include #include - -#include "nr_rrc_config.h" -#include "nr_rrc_defs.h" -#include "nr_rrc_extern.h" -#include "assertions.h" -#include "common/ran_context.h" -#include "oai_asn1.h" -#include "rrc_gNB_radio_bearers.h" - -#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" -#include "LAYER2/NR_MAC_gNB/mac_proto.h" -#include "common/utils/LOG/log.h" +#include "openair2/RRC/NR/nr_rrc_proto.h" +#include "openair2/RRC/NR/rrc_gNB_UE_context.h" +#include "openair3/SECU/key_nas_deriver.h" +#include "openair3/ocp-gtpu/gtp_itf.h" +#include "BIT_STRING.h" +#include "F1AP_CauseProtocol.h" +#include "F1AP_CauseRadioNetwork.h" +#include "NGAP_CauseRadioNetwork.h" +#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h" +#include "OCTET_STRING.h" +#include "PHY/defs_common.h" #include "RRC/NR/MESSAGES/asn1_msg.h" -#include "openair2/E1AP/e1ap_asnc.h" - -#include "NR_BCCH-BCH-Message.h" -#include "NR_UL-DCCH-Message.h" -#include "NR_DL-DCCH-Message.h" -#include "NR_DL-CCCH-Message.h" -#include "NR_UL-CCCH-Message.h" -#include "NR_RRCReject.h" -#include "NR_RejectWaitTime.h" -#include "NR_RRCSetup.h" - -#include "NR_CellGroupConfig.h" -#include "NR_MeasResults.h" -#include "NR_UL-CCCH-Message.h" -#include "NR_RRCSetupRequest-IEs.h" -#include "NR_RRCSetupComplete-IEs.h" -#include "NR_RRCReestablishmentRequest-IEs.h" -#include "NR_MIB.h" -#include "uper_encoder.h" -#include "uper_decoder.h" - -#include "common/platform_types.h" -#include "common/utils/LOG/vcd_signal_dumper.h" - +#include "RRC/NR/mac_rrc_dl.h" +#include "RRC/NR/nr_rrc_common.h" +#include "SIMULATION/TOOLS/sim.h" #include "T.h" - -#include "openair3/SECU/secu_defs.h" - -#include "rrc_gNB_NGAP.h" -#include "rrc_gNB_du.h" -#include "rrc_gNB_mobility.h" - -#include "rrc_gNB_GTPV1U.h" - +#include "asn_codecs.h" +#include "asn_internal.h" +#include "assertions.h" +#include "byte_array.h" +#include "common/ngran_types.h" +#include "common/openairinterface5g_limits.h" +#include "common/platform_constants.h" +#include "common/ran_context.h" +#include "common_lib.h" +#include "constr_SEQUENCE.h" +#include "constr_TYPE.h" +#include "cucp_cuup_if.h" +#include "e1ap_messages_types.h" +#include "executables/softmodem-common.h" +#include "f1ap_messages_types.h" +#include "gtpv1_u_messages_types.h" +#include "intertask_interface.h" +#include "linear_alloc.h" +#include "ngap_messages_types.h" #include "nr_pdcp/nr_pdcp_entity.h" #include "nr_pdcp/nr_pdcp_oai_api.h" - -#include "intertask_interface.h" -#include "SIMULATION/TOOLS/sim.h" // for taus - -#include "executables/softmodem-common.h" -#include -#include -#include -#include -#include +#include "nr_rrc_defs.h" +#include "nr_rrc_extern.h" +#include "oai_asn1.h" #include "openair2/F1AP/f1ap_common.h" #include "openair2/F1AP/f1ap_ids.h" #include "openair2/F1AP/lib/f1ap_lib_extern.h" -#include "openair2/SDAP/nr_sdap/nr_sdap_entity.h" -#include "openair2/E1AP/e1ap.h" -#include "cucp_cuup_if.h" #include "lib/f1ap_interface_management.h" - -#include "BIT_STRING.h" -#include "assertions.h" +#include "rrc_gNB_NGAP.h" +#include "rrc_gNB_du.h" +#include "rrc_gNB_mobility.h" +#include "rrc_gNB_radio_bearers.h" +#include "rrc_messages_types.h" +#include "seq_arr.h" +#include "tree.h" +#include "uper_decoder.h" +#include "uper_encoder.h" +#include "utils.h" +#include "x2ap_messages_types.h" +#include "xer_encoder.h" #ifdef E2_AGENT #include "openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_extern.h" diff --git a/openair2/RRC/NR/rrc_gNB_GTPV1U.c b/openair2/RRC/NR/rrc_gNB_GTPV1U.c index e5412778bc..6bf64a27a9 100644 --- a/openair2/RRC/NR/rrc_gNB_GTPV1U.c +++ b/openair2/RRC/NR/rrc_gNB_GTPV1U.c @@ -27,20 +27,14 @@ * \email: lionel.gauthier@eurecom.fr, panagiotis.matzakos@eurecom.fr */ -# include "rrc_defs.h" -# include "rrc_extern.h" -# include "RRC/LTE/MESSAGES/asn1_msg.h" -# include "rrc_eNB_GTPV1U.h" -# include "rrc_eNB_UE_context.h" -# include "openair2/RRC/NR/rrc_gNB_UE_context.h" - -//# if defined(ENABLE_ITTI) -# include "oai_asn1.h" -# include "intertask_interface.h" -//#endif - -# include "common/ran_context.h" #include "openair2/RRC/NR/rrc_gNB_GTPV1U.h" +#include "LOG/log.h" +#include "RRC/NR/nr_rrc_defs.h" +#include "common/ran_context.h" +#include "openair2/RRC/NR/rrc_gNB_UE_context.h" +#include "rrc_defs.h" +#include "rrc_eNB_GTPV1U.h" +#include "s1ap_messages_types.h" extern RAN_CONTEXT_t RC; diff --git a/openair2/RRC/NR/rrc_gNB_GTPV1U.h b/openair2/RRC/NR/rrc_gNB_GTPV1U.h index 85ad11105e..60a6c0c5b5 100644 --- a/openair2/RRC/NR/rrc_gNB_GTPV1U.h +++ b/openair2/RRC/NR/rrc_gNB_GTPV1U.h @@ -30,6 +30,10 @@ #ifndef RRC_GNB_GTPV1U_H_ #define RRC_GNB_GTPV1U_H_ +#include +#include "openair2/RRC/NR/nr_rrc_defs.h" +#include "gtpv1_u_messages_types.h" + int rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(gNB_RRC_UE_t *ue, const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP, uint8_t *inde_list); diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index cd47fbc8bc..c2a641db32 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -29,57 +29,64 @@ */ #include "rrc_gNB_NGAP.h" -#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" -#include "rrc_eNB_S1AP.h" -#include "gnb_config.h" -#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h" -#include "common/ran_context.h" - -#include "oai_asn1.h" -#include "intertask_interface.h" -#include "nr_pdcp/nr_pdcp_oai_api.h" -#include "pdcp_primitives.h" -#include "SDAP/nr_sdap/nr_sdap.h" - -#include "openair3/ocp-gtpu/gtp_itf.h" +#include +#include #include -#include "RRC/LTE/rrc_eNB_GTPV1U.h" -#include "RRC/NR/rrc_gNB_GTPV1U.h" - -#include "S1AP_NAS-PDU.h" -#include "executables/softmodem-common.h" -#include "openair3/SECU/key_nas_deriver.h" - -#include "ngap_gNB_defs.h" -#include "ngap_gNB_ue_context.h" -#include "ngap_gNB_management_procedures.h" -#include "NR_ULInformationTransfer.h" -#include "RRC/NR/MESSAGES/asn1_msg.h" -#include "NR_UERadioAccessCapabilityInformation.h" -#include "NR_UE-CapabilityRAT-ContainerList.h" +#include +#include +#include +#include +#include "E1AP_ConfidentialityProtectionIndication.h" +#include "E1AP_IntegrityProtectionIndication.h" #include "NGAP_CauseRadioNetwork.h" -#include "f1ap_messages_types.h" -#include "openair2/F1AP/f1ap_ids.h" -#include "openair2/E1AP/e1ap_asnc.h" -#include "openair2/E1AP/e1ap.h" -#include "NGAP_asn_constant.h" -#include "NGAP_PDUSessionResourceSetupRequestTransfer.h" -#include "NGAP_PDUSessionResourceModifyRequestTransfer.h" -#include "NGAP_ProtocolIE-Field.h" -#include "NGAP_GTPTunnel.h" -#include "NGAP_QosFlowSetupRequestItem.h" -#include "NGAP_QosFlowAddOrModifyRequestItem.h" -#include "NGAP_NonDynamic5QIDescriptor.h" #include "NGAP_Dynamic5QIDescriptor.h" -#include "conversions.h" +#include "NGAP_GTPTunnel.h" +#include "NGAP_NonDynamic5QIDescriptor.h" +#include "NGAP_PDUSessionResourceModifyRequestTransfer.h" +#include "NGAP_PDUSessionResourceSetupRequestTransfer.h" +#include "NGAP_QosFlowAddOrModifyRequestItem.h" +#include "NGAP_QosFlowSetupRequestItem.h" +#include "NGAP_asn_constant.h" +#include "NGAP_ProtocolIE-Field.h" +#include "NR_UE-NR-Capability.h" +#include "NR_UERadioAccessCapabilityInformation.h" +#include "MAC/mac.h" +#include "OCTET_STRING.h" +#include "PHY/defs_common.h" +#include "RRC/NR/MESSAGES/asn1_msg.h" +#include "RRC/NR/nr_rrc_common.h" +#include "RRC/NR/nr_rrc_defs.h" +#include "RRC/NR/nr_rrc_proto.h" +#include "RRC/NR/rrc_gNB_UE_context.h" #include "RRC/NR/rrc_gNB_radio_bearers.h" +#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h" +#include "T.h" +#include "aper_decoder.h" +#include "asn_codecs.h" +#include "assertions.h" +#include "common/ngran_types.h" +#include "common/platform_constants.h" +#include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "constr_TYPE.h" +#include "conversions.h" +#include "e1ap_messages_types.h" +#include "f1ap_messages_types.h" +#include "gtpv1_u_messages_types.h" +#include "intertask_interface.h" +#include "nr_pdcp/nr_pdcp_entity.h" +#include "nr_pdcp/nr_pdcp_oai_api.h" +#include "oai_asn1.h" +#include "openair2/F1AP/f1ap_ids.h" +#include "openair3/SECU/key_nas_deriver.h" +#include "rrc_messages_types.h" +#include "s1ap_messages_types.h" +#include "uper_encoder.h" #ifdef E2_AGENT #include "openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_extern.h" #endif -#include "uper_encoder.h" - extern RAN_CONTEXT_t RC; /* Masks for NGAP Encryption algorithms, NEA0 is always supported (not coded) */ diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.h b/openair2/RRC/NR/rrc_gNB_NGAP.h index 9d83f28c3c..235a175954 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.h +++ b/openair2/RRC/NR/rrc_gNB_NGAP.h @@ -31,14 +31,14 @@ #ifndef RRC_GNB_NGAP_H_ #define RRC_GNB_NGAP_H_ -#include "rrc_gNB_UE_context.h" -#include "nr_rrc_defs.h" -#include "nr_rrc_extern.h" - +#include +#include #include "NR_RRCSetupComplete-IEs.h" -#include "NR_RegisteredAMF.h" +#include "NR_UECapabilityInformation.h" #include "NR_UL-DCCH-Message.h" -#include "NGAP_CauseRadioNetwork.h" +#include "intertask_interface.h" +#include "ngap_messages_types.h" +#include "nr_rrc_defs.h" void rrc_gNB_send_NGAP_NAS_FIRST_REQ(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, NR_RRCSetupComplete_IEs_t *rrcSetupComplete); diff --git a/openair2/RRC/NR/rrc_gNB_UE_context.c b/openair2/RRC/NR/rrc_gNB_UE_context.c index 15f644955d..eae5c0706e 100644 --- a/openair2/RRC/NR/rrc_gNB_UE_context.c +++ b/openair2/RRC/NR/rrc_gNB_UE_context.c @@ -28,15 +28,18 @@ * \email: lionel.gauthier@eurecom.fr */ +#include "rrc_gNB_UE_context.h" #include #include -#include -#include #include - +#include "RRC/NR/nr_rrc_defs.h" +#include "T.h" +#include "assertions.h" +#include "common/platform_constants.h" #include "common/utils/LOG/log.h" -#include "rrc_gNB_UE_context.h" +#include "linear_alloc.h" #include "openair2/F1AP/f1ap_ids.h" +#include "tree.h" static void rrc_gNB_ue_context_update_time(rrc_gNB_ue_context_t *ctxt) { diff --git a/openair2/RRC/NR/rrc_gNB_UE_context.h b/openair2/RRC/NR/rrc_gNB_UE_context.h index 37d71f9c29..9485672463 100644 --- a/openair2/RRC/NR/rrc_gNB_UE_context.h +++ b/openair2/RRC/NR/rrc_gNB_UE_context.h @@ -30,8 +30,11 @@ #ifndef __RRC_GNB_UE_CONTEXT_H__ #define __RRC_GNB_UE_CONTEXT_H__ +#include +#include +#include +#include #include "collection/tree.h" -#include "common/platform_types.h" #include "nr_rrc_defs.h" int rrc_gNB_compare_ue_rnti_id(rrc_gNB_ue_context_t* c1_pP, rrc_gNB_ue_context_t* c2_pP); diff --git a/openair2/RRC/NR/rrc_gNB_cuup.c b/openair2/RRC/NR/rrc_gNB_cuup.c index 729f5f28b4..621ebca56e 100644 --- a/openair2/RRC/NR/rrc_gNB_cuup.c +++ b/openair2/RRC/NR/rrc_gNB_cuup.c @@ -19,9 +19,24 @@ * contact@openairinterface.org */ +#include +#include +#include +#include +#include +#include "PHY/defs_common.h" +#include "RRC/NR/nr_rrc_proto.h" +#include "T.h" +#include "as_message.h" +#include "assertions.h" #include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "e1ap_messages_types.h" +#include "intertask_interface.h" #include "nr_rrc_defs.h" #include "openair2/F1AP/f1ap_ids.h" +#include "rrc_messages_types.h" +#include "tree.h" static int cuup_compare(const nr_rrc_cuup_container_t *a, const nr_rrc_cuup_container_t *b) { diff --git a/openair2/RRC/NR/rrc_gNB_du.c b/openair2/RRC/NR/rrc_gNB_du.c index 98cdb313df..639c279d4d 100644 --- a/openair2/RRC/NR/rrc_gNB_du.c +++ b/openair2/RRC/NR/rrc_gNB_du.c @@ -20,17 +20,37 @@ */ #include "rrc_gNB_du.h" -#include "rrc_gNB_NGAP.h" +#include +#include +#include +#include "F1AP_CauseMisc.h" +#include "F1AP_CauseProtocol.h" +#include "F1AP_CauseRadioNetwork.h" +#include "PHY/defs_common.h" +#include "T.h" +#include "asn_codecs.h" +#include "assertions.h" #include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "common/utils/alg/foreach.h" +#include "common/utils/ds/seq_arr.h" +#include "constr_TYPE.h" +#include "executables/softmodem-common.h" +#include "f1ap_messages_types.h" +#include "ngap_messages_types.h" #include "nr_rrc_defs.h" -#include "rrc_gNB_UE_context.h" #include "rrc_gNB_mobility.h" #include "openair2/F1AP/f1ap_common.h" #include "openair2/F1AP/f1ap_ids.h" -#include "executables/softmodem-common.h" -#include "common/utils/ds/seq_arr.h" -#include "common/utils/alg/foreach.h" #include "lib/f1ap_interface_management.h" +#include "rrc_gNB_NGAP.h" +#include "rrc_gNB_UE_context.h" +#include "rrc_messages_types.h" +#include "s1ap_messages_types.h" +#include "tree.h" +#include "uper_decoder.h" +#include "utils.h" +#include "xer_encoder.h" int get_dl_band(const struct f1ap_served_cell_info_t *cell_info) { diff --git a/openair2/RRC/NR/rrc_gNB_du.h b/openair2/RRC/NR/rrc_gNB_du.h index bd3c4f6443..aadac0845a 100644 --- a/openair2/RRC/NR/rrc_gNB_du.h +++ b/openair2/RRC/NR/rrc_gNB_du.h @@ -26,7 +26,6 @@ #include #include #include - struct f1ap_setup_req_s; struct f1ap_lost_connection_t; struct gNB_RRC_INST_s; diff --git a/openair2/RRC/NR/rrc_gNB_internode.c b/openair2/RRC/NR/rrc_gNB_internode.c index 6b001e16fd..4fbca5f8f0 100644 --- a/openair2/RRC/NR/rrc_gNB_internode.c +++ b/openair2/RRC/NR/rrc_gNB_internode.c @@ -30,16 +30,22 @@ #ifndef RRC_GNB_INTERNODE_C #define RRC_GNB_INTERNODE_C -#include "nr_rrc_defs.h" -#include "NR_RRCReconfiguration.h" -#include "NR_UE-NR-Capability.h" -#include "NR_CG-ConfigInfo.h" -#include "NR_UE-CapabilityRAT-ContainerList.h" -#include "LTE_UE-CapabilityRAT-ContainerList.h" -#include "NR_CG-Config.h" -#include "uper_encoder.h" -#include "uper_decoder.h" +#include +#include +#include +#include "OCTET_STRING.h" +#include "PHY/defs_common.h" +#include "RRC/NR/nr_rrc_proto.h" +#include "T.h" +#include "asn_codecs.h" +#include "assertions.h" +#include "common/utils/T/T.h" +#include "constr_TYPE.h" #include "executables/softmodem-common.h" +#include "nr_rrc_defs.h" +#include "uper_decoder.h" +#include "uper_encoder.h" +#include "x2ap_messages_types.h" int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2ap_ENDC_sgnb_addition_req_t *m) { if (CG_ConfigInfo->criticalExtensions.present == NR_CG_ConfigInfo__criticalExtensions_PR_c1) { diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 73509f6d72..bae7c45180 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -28,30 +28,49 @@ * \email: raymond.knopp@eurecom.fr */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "MESSAGES/asn1_msg.h" +#include "OCTET_STRING.h" +#include "PHY/defs_common.h" +#include "RRC/NR/nr_rrc_config.h" +#include "T.h" +#include "asn_codecs.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/ngran_types.h" +#include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "constr_TYPE.h" +#include "executables/nr-softmodem.h" +#include "executables/softmodem-common.h" +#include "gtpv1_u_messages_types.h" +#include "intertask_interface.h" +#include "ngap_messages_types.h" +#include "nr_pdcp/nr_pdcp_entity.h" +#include "nr_pdcp/nr_pdcp_oai_api.h" #include "nr_rrc_defs.h" -#include "NR_RRCReconfiguration.h" -#include "NR_UE-NR-Capability.h" -//#include "NR_UE-CapabilityRAT-ContainerList.h" -#include "LTE_UE-CapabilityRAT-ContainerList.h" -#include "NR_CellGroupConfig.h" -#include "NR_CG-Config.h" -//#include "NR_SRB-ToAddModList.h" -#include "uper_encoder.h" -#include "uper_decoder.h" +#include "openair2/F1AP/f1ap_ids.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h" #include "openair2/RRC/NR/rrc_gNB_GTPV1U.h" -#include "openair2/F1AP/f1ap_ids.h" -#include "executables/softmodem-common.h" -#include "executables/nr-softmodem.h" -#include -#include -#include "openair3/SECU/secu_defs.h" #include "openair3/SECU/key_nas_deriver.h" - -#include -#include "nr_pdcp/nr_pdcp_oai_api.h" -#include "MESSAGES/asn1_msg.h" +#include "rlc.h" +#include "s1ap_messages_types.h" +#include "tree.h" +#include "uper_decoder.h" +#include "uper_encoder.h" +#include "x2ap_messages_types.h" +#include "xer_decoder.h" +#include "xer_encoder.h" void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) { diff --git a/openair2/RRC/NR/rrc_gNB_radio_bearers.c b/openair2/RRC/NR/rrc_gNB_radio_bearers.c index aec7865a1c..ce6eb40bbe 100644 --- a/openair2/RRC/NR/rrc_gNB_radio_bearers.c +++ b/openair2/RRC/NR/rrc_gNB_radio_bearers.c @@ -20,8 +20,17 @@ */ #include "rrc_gNB_radio_bearers.h" +#include +#include "E1AP_RLC-Mode.h" +#include "PHY/defs_common.h" +#include "RRC/NR/nr_rrc_defs.h" +#include "T.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/platform_constants.h" +#include "common/utils/T/T.h" +#include "ngap_messages_types.h" #include "oai_asn1.h" -#include "openair2/E1AP/e1ap.h" rrc_pdu_session_param_t *find_pduSession(gNB_RRC_UE_t *ue, int id, bool create) { diff --git a/openair2/RRC/NR/rrc_gNB_radio_bearers.h b/openair2/RRC/NR/rrc_gNB_radio_bearers.h index 29fead6bea..37ddbdd431 100644 --- a/openair2/RRC/NR/rrc_gNB_radio_bearers.h +++ b/openair2/RRC/NR/rrc_gNB_radio_bearers.h @@ -22,12 +22,11 @@ #ifndef _RRC_GNB_DRBS_H_ #define _RRC_GNB_DRBS_H_ -#include "nr_rrc_defs.h" -#include "NR_SDAP-Config.h" +#include +#include #include "NR_DRB-ToAddMod.h" -#include "NR_SRB-ToAddMod.h" - -#include "common/platform_constants.h" +#include "e1ap_messages_types.h" +#include "nr_rrc_defs.h" #define DRB_ACTIVE_NONGBR (2) /* DRB is used for Non-GBR Flows */ #define DRB_ACTIVE (1) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index d8e9593e08..1f94e21d6c 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -30,24 +30,15 @@ #ifndef RRC_GNB_NSA_C #define RRC_GNB_NSA_C -#include "NR_ServingCellConfigCommon.h" -#include "NR_ServingCellConfig.h" -#include "NR_RRCReconfiguration.h" -#include "NR_RRCReconfiguration-IEs.h" -#include "NR_CellGroupConfig.h" -#include "NR_MAC-CellGroupConfig.h" -#include "NR_BSR-Config.h" -#include "NR_PDSCH-ServingCellConfig.h" -#include "NR_RLC-BearerConfig.h" -#include "BOOLEAN.h" -#include "uper_encoder.h" +#include + +#include "OCTET_STRING.h" +#include "RRC/NR/nr_rrc_proto.h" +#include "asn_codecs.h" #include "assertions.h" +#include "constr_TYPE.h" #include "oai_asn1.h" -#include "common/utils/nr/nr_common.h" -#include "executables/softmodem-common.h" -#include "LAYER2/nr_rlc/nr_rlc_oai_api.h" -#include "nr_rrc_config.h" -#include "MESSAGES/asn1_msg.h" +#include "uper_encoder.h" NR_RRCReconfiguration_IEs_t *get_default_reconfig(const NR_CellGroupConfig_t *secondaryCellGroup) { diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 53364b0768..675d8988a4 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -47,6 +47,7 @@ #include "rrc_defs.h" #include "rrc_proto.h" +#include "openair2/RRC/LTE/rrc_defs.h" #include "L2_interface_ue.h" #include "LAYER2/NR_MAC_UE/mac_proto.h" diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 2872ba3d5e..aa19cae2e4 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -19,6 +19,7 @@ * contact@openairinterface.org */ +#include #include "PduSessionEstablishmentAccept.h" #include "common/utils/LOG/log.h" #include "nr_nas_msg.h" From 1c9bcf40042cee4e2ae54e7f502554a234fa9afc Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Fri, 27 Sep 2024 13:52:06 +0200 Subject: [PATCH 06/13] Refactor includes in unitary simulators * prachsim, ulsim, dlsim * used open source IWYU tool + manual review --- openair1/SIMULATION/NR_PHY/dlsim.c | 100 ++++++++++++++++---------- openair1/SIMULATION/NR_PHY/prachsim.c | 64 ++++++++++------- openair1/SIMULATION/NR_PHY/ulsim.c | 90 ++++++++++++++--------- 3 files changed, 158 insertions(+), 96 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index a67c5be9da..c445bfb6a0 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -19,59 +19,81 @@ * contact@openairinterface.org */ -#include +#include +#include #include +#include +#include +#include +#include #include -#include -#include -#include -#include "common/ran_context.h" -#include "common/config/config_userapi.h" +#include "common/utils/assertions.h" #include "common/utils/nr/nr_common.h" #include "common/utils/var_array.h" -#include "common/utils/LOG/log.h" -#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" +#include "executables/nr-uesoftmodem.h" +#include "executables/softmodem-common.h" #include "LAYER2/NR_MAC_UE/mac_defs.h" -#include "LAYER2/NR_MAC_UE/mac_extern.h" -#include "PHY/defs_gNB.h" -#include "PHY/defs_nr_common.h" -#include "PHY/defs_nr_UE.h" -#include "PHY/phy_vars_nr_ue.h" -#include "PHY/types.h" +#include "LAYER2/NR_MAC_UE/mac_proto.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h" +#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" +#include "NR_BCCH-BCH-Message.h" +#include "NR_BWP-Downlink.h" +#include "NR_CellGroupConfig.h" +#include "NR_MAC_COMMON/nr_mac.h" +#include "NR_MAC_COMMON/nr_mac_common.h" +#include "NR_PHY_INTERFACE/NR_IF_Module.h" +#include "NR_ReconfigurationWithSync.h" +#include "NR_ServingCellConfig.h" +#include "NR_SetupRelease.h" +#include "NR_UE_PHY_INTERFACE/NR_IF_Module.h" +#include "PHY/CODING/nrLDPC_extern.h" #include "PHY/INIT/nr_phy_init.h" -#include "PHY/MODULATION/modulation_eNB.h" -#include "PHY/MODULATION/nr_modulation.h" -#include "PHY/MODULATION/modulation_UE.h" -#include "PHY/NR_REFSIG/refsig_defs_ue.h" +#include "PHY/MODULATION/modulation_common.h" +#include "PHY/NR_REFSIG/ptrs_nr.h" #include "PHY/NR_TRANSPORT/nr_dlsch.h" -#include "PHY/NR_TRANSPORT/nr_transport_proto.h" -#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" +#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" +#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" +#include "PHY/TOOLS/tools_defs.h" +#include "PHY/defs_RU.h" +#include "PHY/defs_common.h" +#include "PHY/defs_gNB.h" +#include "PHY/defs_nr_UE.h" +#include "PHY/defs_nr_common.h" +#include "PHY/impl_defs_nr.h" +#include "PHY/phy_vars_nr_ue.h" +#include "RRC/NR/nr_rrc_config.h" +#include "RRC/NR/nr_rrc_proto.h" #include "SCHED_NR/fapi_nr_l1.h" #include "SCHED_NR/sched_nr.h" #include "SCHED_NR_UE/defs.h" #include "SCHED_NR_UE/fapi_nr_ue_l1.h" -#include "NR_PHY_INTERFACE/NR_IF_Module.h" -#include "NR_UE_PHY_INTERFACE/NR_IF_Module.h" - -#include "LAYER2/NR_MAC_UE/mac_proto.h" -#include "LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h" -#include "LAYER2/NR_MAC_gNB/mac_proto.h" -#include "NR_asn_constant.h" -#include "RRC/NR/nr_rrc_config.h" -#include "openair1/SIMULATION/RF/rf.h" -#include "openair1/SIMULATION/TOOLS/sim.h" +#include "T.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/config/config_load_configmodule.h" +#include "common/ngran_types.h" +#include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "common/utils/nr/nr_common.h" +#include "common/utils/var_array.h" +#include "common_lib.h" +#include "e1ap_messages_types.h" +#include "fapi_nr_ue_interface.h" +#include "nfapi_interface.h" +#include "nfapi_nr_interface.h" +#include "nfapi_nr_interface_scf.h" +#include "nr_ue_phy_meas.h" +#include "oai_asn1.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" -#include "PHY/NR_REFSIG/ptrs_nr.h" -#include "NR_RRCReconfiguration.h" +#include "openair1/SIMULATION/TOOLS/sim.h" +#include "openair2/RRC/LTE/rrc_vars.h" +#include "softmodem-bits.h" +#include "thread-pool.h" +#include "time_meas.h" +#include "utils.h" #define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) #include "SIMULATION/LTE_PHY/common_sim.h" -#include "PHY/NR_REFSIG/dmrs_nr.h" - -#include - -#include -#include -#include const char *__asan_default_options() { diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 76b5d979b3..08bf2e8fe6 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -19,40 +19,54 @@ * contact@openairinterface.org */ -#include + #include -#include -#include - +#include +#include +#include +#include +#include "common/utils/assertions.h" +#include "executables/softmodem-common.h" +#include "common/platform_types.h" +#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h" +#include "NR_PHY_INTERFACE/NR_IF_Module.h" #include "common/config/config_userapi.h" -#include "common/utils/load_module_shlib.h" -#include "common/utils/LOG/log.h" -#include "common/ran_context.h" - -#include "SIMULATION/TOOLS/sim.h" -#include "SIMULATION/RF/rf.h" -#include "PHY/types.h" -#include "PHY/defs_gNB.h" #include "PHY/defs_nr_UE.h" -#include "SCHED_NR/sched_nr.h" -#include "SCHED_NR_UE/phy_frame_config_nr.h" -#include "PHY/phy_vars_nr_ue.h" -#include "PHY/NR_REFSIG/refsig_defs_ue.h" -#include "PHY/MODULATION/nr_modulation.h" -#include "PHY/MODULATION/modulation_eNB.h" -#include "PHY/MODULATION/modulation_UE.h" #include "PHY/INIT/nr_phy_init.h" -#include "PHY/NR_TRANSPORT/nr_transport_proto.h" +#include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" +#include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "nr_unitary_defs.h" -#include -#include -#include -#include -#include +#include "openair2/RRC/LTE/rrc_vars.h" +#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" +#include "PHY/TOOLS/tools_defs.h" +#include "PHY/defs_RU.h" +#include "PHY/defs_common.h" +#include "PHY/defs_gNB.h" +#include "PHY/defs_nr_UE.h" +#include "PHY/defs_nr_common.h" +#include "PHY/impl_defs_nr.h" +#include "PHY/phy_vars_nr_ue.h" +#include "SCHED_NR/phy_frame_config_nr.h" +#include "SCHED_NR/sched_nr.h" +#include "SIMULATION/TOOLS/sim.h" +#include "T.h" +#include "assertions.h" +#include "common/config/config_load_configmodule.h" +#include "common/ran_context.h" +#include "common/utils/LOG/log.h" +#include "common/utils/T/T.h" +#include "common/utils/load_module_shlib.h" +#include "common_lib.h" +#include "defs.h" #include "executables/nr-uesoftmodem.h" +#include "fapi_nr_ue_interface.h" #include "nfapi/oai_integration/vendor_ext.h" +#include "nfapi_interface.h" +#include "nfapi_nr_interface_scf.h" +#include "nr_common.h" +#include "time_meas.h" #define NR_PRACH_DEBUG 1 #define PRACH_WRITE_OUTPUT_DEBUG 1 diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 431e4875fc..66f0333f46 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -19,54 +19,80 @@ * contact@openairinterface.org */ -#include +#include #include -#include -#include -#include -#include -#include "common/ran_context.h" -#include "common/config/config_userapi.h" -#include "common/utils/LOG/log.h" +#include +#include +#include +#include +#include +#include +#include #include "common/utils/nr/nr_common.h" #include "common/utils/var_array.h" -#include "PHY/defs_gNB.h" -#include "PHY/defs_nr_common.h" -#include "PHY/defs_nr_UE.h" -#include "PHY/phy_vars_nr_ue.h" -#include "PHY/types.h" +#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) +#include "SIMULATION/LTE_PHY/common_sim.h" +#include "openair2/RRC/LTE/rrc_vars.h" +#include "common/utils/assertions.h" +#include "executables/softmodem-common.h" +#include "NR_BCCH-BCH-Message.h" +#include "NR_IF_Module.h" +#include "NR_MAC_COMMON/nr_mac.h" +#include "NR_MAC_COMMON/nr_mac_common.h" +#include "NR_MAC_UE/mac_defs.h" +#include "NR_MAC_gNB/nr_mac_gNB.h" +#include "NR_PHY_INTERFACE/NR_IF_Module.h" +#include "NR_ReconfigurationWithSync.h" +#include "NR_ServingCellConfig.h" +#include "NR_UE-NR-Capability.h" +#include "PHY/CODING/nrLDPC_extern.h" #include "PHY/INIT/nr_phy_init.h" -#include "PHY/MODULATION/modulation_UE.h" #include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_REFSIG/dmrs_nr.h" -#include "PHY/NR_REFSIG/refsig_defs_ue.h" -#include "PHY/NR_TRANSPORT/nr_dlsch.h" -#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h" -#include "PHY/NR_TRANSPORT/nr_transport_proto.h" +#include "PHY/NR_REFSIG/ptrs_nr.h" +#include "PHY/NR_REFSIG/ul_ref_seq_nr.h" +#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include "PHY/NR_TRANSPORT/nr_ulsch.h" -#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" +#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/TOOLS/tools_defs.h" +#include "PHY/defs_RU.h" +#include "PHY/defs_common.h" +#include "PHY/defs_gNB.h" +#include "PHY/defs_nr_UE.h" +#include "PHY/defs_nr_common.h" +#include "PHY/impl_defs_nr.h" +#include "PHY/phy_vars_nr_ue.h" #include "SCHED_NR/fapi_nr_l1.h" #include "SCHED_NR/sched_nr.h" #include "SCHED_NR_UE/defs.h" #include "SCHED_NR_UE/fapi_nr_ue_l1.h" -#include "openair1/SIMULATION/TOOLS/sim.h" -#include "openair1/SIMULATION/RF/rf.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/config/config_load_configmodule.h" +#include "common/ngran_types.h" +#include "common/openairinterface5g_limits.h" +#include "common/ran_context.h" +#include "common/utils/LOG/log.h" +#include "common/utils/T/T.h" +#include "common/utils/nr/nr_common.h" +#include "common/utils/threadPool/thread-pool.h" +#include "common/utils/var_array.h" +#include "common_lib.h" +#include "e1ap_messages_types.h" +#include "executables/nr-uesoftmodem.h" +#include "fapi_nr_ue_constants.h" +#include "fapi_nr_ue_interface.h" +#include "nfapi_interface.h" +#include "nfapi_nr_interface_scf.h" +#include "nr_ue_phy_meas.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" -#include "openair2/RRC/NR/nr_rrc_config.h" +#include "openair1/SIMULATION/TOOLS/sim.h" #include "openair2/LAYER2/NR_MAC_UE/mac_proto.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" -#include "common/utils/threadPool/thread-pool.h" -#include "PHY/NR_REFSIG/ptrs_nr.h" -#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) -#include "SIMULATION/LTE_PHY/common_sim.h" +#include "openair2/RRC/NR/nr_rrc_config.h" +#include "time_meas.h" +#include "utils.h" -#include - -#include -#include "PHY/NR_REFSIG/ul_ref_seq_nr.h" -#include -#include "executables/nr-uesoftmodem.h" //#define DEBUG_ULSIM const char *__asan_default_options() From 893102a104cf9dbf1f425d1ebf13198f615f69cb Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 17 Oct 2024 16:51:36 +0200 Subject: [PATCH 07/13] Refactor includes in nr-softmodem.c --- executables/nr-softmodem.c | 106 ++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index e449e6c33e..48011f8d17 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -21,66 +21,13 @@ #define _GNU_SOURCE /* See feature_test_macros(7) */ -#include - -#include "T.h" - -#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all -#include -#include "common/oai_version.h" - -#include "PHY/types.h" -#include "common/ran_context.h" - -#include "PHY/defs_gNB.h" -#include "PHY/defs_common.h" #include "common/config/config_userapi.h" -#include "common/utils/load_module_shlib.h" -#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all -//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all - -#include "radio/COMMON/common_lib.h" -#include "radio/ETHERNET/if_defs.h" - -//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all - -#include "PHY/phy_vars.h" #include "RRC/LTE/rrc_vars.h" -#include "PHY_INTERFACE/phy_interface_vars.h" -#include "gnb_config.h" -#include "SIMULATION/TOOLS/sim.h" - #ifdef SMBV #include "PHY/TOOLS/smbv.h" unsigned short config_frames[4] = {2,9,11,13}; #endif - -#include "common/utils/LOG/log.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "UTIL/OPT/opt.h" -#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h" - -#include "intertask_interface.h" - -#include "PHY/INIT/nr_phy_init.h" - -#include "system.h" -#include -#include "PHY/TOOLS/phy_scope_interface.h" -#include "PHY/TOOLS/nr_phy_scope.h" -#include "nr-softmodem.h" -#include "executables/softmodem-common.h" -#include "executables/thread-common.h" -#include "NB_IoT_interface.h" -#include "x2ap_eNB.h" -#include "ngap_gNB.h" -#include "gnb_paramdef.h" -#include -#include "nfapi/oai_integration/vendor_ext.h" -#include "gnb_config.h" -#include "openair2/E1AP/e1ap_common.h" -#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #ifdef ENABLE_AERIAL #include "nfapi/oai_integration/aerial/fapi_nvIPC.h" #endif @@ -88,6 +35,58 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "openair2/E2AP/flexric/src/agent/e2_agent_api.h" #include "openair2/E2AP/RAN_FUNCTION/init_ran_func.h" #endif +#include "nr-softmodem.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h" +#include "NR_MAC_COMMON/nr_mac_extern.h" +#include "NR_PHY_INTERFACE/NR_IF_Module.h" +#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" +#include "PHY/INIT/nr_phy_init.h" +#include "PHY/TOOLS/phy_scope_interface.h" +#include "PHY/defs_common.h" +#include "PHY/defs_gNB.h" +#include "PHY/defs_nr_common.h" +#include "PHY/phy_vars.h" +#include "RRC/NR/nr_rrc_defs.h" +#include "RRC/NR/nr_rrc_proto.h" +#include "RRC_nr_paramsvalues.h" +#include "SIMULATION/TOOLS/sim.h" +#include "T.h" +#include "UTIL/OPT/opt.h" +#include "common/config/config_userapi.h" +#include "common/ngran_types.h" +#include "common/oai_version.h" +#include "common/ran_context.h" +#include "common/utils/LOG/log.h" +#include "e1ap_messages_types.h" +#include "executables/softmodem-common.h" +#include "gnb_config.h" +#include "gnb_paramdef.h" +#include "intertask_interface.h" +#include "nfapi/oai_integration/vendor_ext.h" +#include "nfapi_interface.h" +#include "nfapi_nr_interface_scf.h" +#include "ngap_gNB.h" +#include "nr-softmodem-common.h" +#include "openair2/E1AP/e1ap_common.h" +#include "pdcp.h" +#include "radio/COMMON/common_lib.h" +#include "s1ap_eNB.h" +#include "sctp_eNB_task.h" +#include "softmodem-bits.h" +#include "system.h" +#include "time_meas.h" +#include "utils.h" +#include "x2ap_eNB.h" pthread_cond_t nfapi_sync_cond; pthread_mutex_t nfapi_sync_mutex; @@ -424,7 +423,6 @@ void init_pdcp(void) { } #ifdef E2_AGENT -#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" // need to get info from MAC static void initialize_agent(ngran_node_t node_type, e2_agent_args_t oai_args) { AssertFatal(oai_args.sm_dir != NULL , "Please, specify the directory where the SMs are located in the config file, i.e., add in config file the next line: e2_agent = {near_ric_ip_addr = \"127.0.0.1\"; sm_dir = \"/usr/local/lib/flexric/\");} "); From b7c1b4d761b314be41dca829c1a1e2b8d6956cc7 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Fri, 27 Sep 2024 13:32:05 +0200 Subject: [PATCH 08/13] Refactor includes in NR_MAC_gNB/main.c * used open source IWYU tool + manual review --- openair2/LAYER2/NR_MAC_gNB/main.c | 43 ++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index add3b6589a..f8e6d120de 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -30,18 +30,47 @@ */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "NR_DRB-ToAddMod.h" +#include "NR_DRB-ToAddModList.h" +#include "NR_MAC_COMMON/nr_mac.h" +#include "NR_MAC_COMMON/nr_mac_common.h" #include "NR_MAC_gNB/mac_proto.h" -#include "NR_MAC_COMMON/nr_mac_extern.h" +#include "NR_MAC_gNB/mac_rrc_ul.h" +#include "NR_MAC_gNB/nr_mac_gNB.h" +#include "NR_PHY_INTERFACE/NR_IF_Module.h" +#include "NR_RLC-BearerConfig.h" +#include "NR_RadioBearerConfig.h" +#include "NR_ServingCellConfig.h" +#include "NR_ServingCellConfigCommon.h" +#include "NR_TAG.h" +#include "PHY/defs_common.h" +#include "RRC/NR/MESSAGES/asn1_msg.h" +#include "RRC/NR/nr_rrc_config.h" #include "assertions.h" +#include "common/ngran_types.h" +#include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "executables/softmodem-common.h" +#include "linear_alloc.h" +#include "nr_pdcp/nr_pdcp_entity.h" #include "nr_pdcp/nr_pdcp_oai_api.h" - -#include "common/utils/LOG/log.h" #include "nr_rlc/nr_rlc_oai_api.h" #include "openair2/F1AP/f1ap_ids.h" - -#include "common/ran_context.h" -#include "executables/softmodem-common.h" -#include "openair2/RRC/NR/MESSAGES/asn1_msg.h" +#include "rlc.h" +#include "seq_arr.h" +#include "system.h" +#include "time_meas.h" +#include "utils.h" extern RAN_CONTEXT_t RC; From bfe7b803fe30353dd9ac6b94e3a644336a508f31 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Fri, 27 Sep 2024 13:14:53 +0200 Subject: [PATCH 09/13] Refactor includes in SDAP and PDCP API * used open source IWYU tool + manual review --- executables/nr-uesoftmodem.c | 1 + openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c | 33 ++++++++---- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 59 ++++++++++++++------- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h | 11 +++- openair2/SDAP/nr_sdap/nr_sdap.c | 4 ++ openair2/SDAP/nr_sdap/nr_sdap.h | 4 +- openair2/SDAP/nr_sdap/nr_sdap_entity.c | 12 +++-- openair2/SDAP/nr_sdap/nr_sdap_entity.h | 9 ++-- 8 files changed, 94 insertions(+), 39 deletions(-) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index ac5235b108..c53f3547a0 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -87,6 +87,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "nr_nas_msg.h" #include #include "openair2/GNB_APP/gnb_paramdef.h" +#include "pdcp.h" extern const char *duplex_mode[]; THREAD_STRUCT thread_struct; diff --git a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c index e0ac130279..ab2756c3cd 100644 --- a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c +++ b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c @@ -20,20 +20,33 @@ */ #include "cucp_cuup_handler.h" - +#include +#include +#include +#include +#include "NR_DRB-ToAddMod.h" #include "NR_DRB-ToAddModList.h" - -#include "common/platform_types.h" -#include "intertask_interface.h" -#include "openair2/COMMON/e1ap_messages_types.h" -#include "openair3/ocp-gtpu/gtp_itf.h" -#include "openair2/F1AP/f1ap_ids.h" -#include "nr_pdcp_oai_api.h" -#include "cuup_cucp_if.h" +#include "NR_PDCP-Config.h" +#include "NR_QFI.h" +#include "NR_SDAP-Config.h" +#include "PHY/defs_common.h" +#include "RRC/NR/nr_rrc_common.h" +#include "SDAP/nr_sdap/nr_sdap_entity.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/utils/T/T.h" #include "common/utils/oai_asn1.h" -#include "openair2/SDAP/nr_sdap/nr_sdap.h" +#include "constr_TYPE.h" +#include "cuup_cucp_if.h" +#include "gtpv1_u_messages_types.h" +#include "nr_pdcp/nr_pdcp_entity.h" +#include "nr_pdcp_oai_api.h" +#include "openair2/COMMON/e1ap_messages_types.h" #include "openair2/E1AP/e1ap_common.h" #include "openair2/F1AP/f1ap_common.h" +#include "openair2/F1AP/f1ap_ids.h" +#include "openair2/SDAP/nr_sdap/nr_sdap.h" +#include "openair3/ocp-gtpu/gtp_itf.h" static void fill_DRB_configList_e1(NR_DRB_ToAddModList_t *DRB_configList, const pdu_session_to_setup_t *pdu) { diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index a416ddd617..cb80ec99ce 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -22,27 +22,50 @@ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif -#include "nr_pdcp_asn1_utils.h" -#include "nr_pdcp_ue_manager.h" -#include "nr_pdcp_timer_thread.h" -#include "NR_RadioBearerConfig.h" -#include "NR_RLC-BearerConfig.h" -#include "NR_RLC-Config.h" -#include "NR_CellGroupConfig.h" -#include "openair2/RRC/NR/nr_rrc_proto.h" -#include "common/utils/mem/oai_memory.h" -#include - -/* from OAI */ -#include "oai_asn1.h" #include "nr_pdcp_oai_api.h" -#include "LAYER2/nr_rlc/nr_rlc_oai_api.h" -#include "openair2/F1AP/f1ap_ids.h" +#include +#include #include -#include "openair2/SDAP/nr_sdap/nr_sdap.h" -#include "gnb_config.h" -#include "executables/softmodem-common.h" +#include +#include +#include +#include +#include +#include "LAYER2/MAC/mac_extern.h" +#include "LTE_DRB-ToAddModList.h" +#include "LTE_DRB-ToReleaseList.h" +#include "LTE_PMCH-InfoList-r9.h" +#include "LTE_SRB-ToAddModList.h" +#include "NR_DRB-ToAddMod.h" +#include "NR_QFI.h" +#include "NR_SDAP-Config.h" +#include "NR_SRB-ToAddMod.h" +#include "SDAP/nr_sdap/nr_sdap_entity.h" +#include "assertions.h" +#include "common/ngran_types.h" +#include "common/platform_constants.h" +#include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "common/utils/tun_if.h" #include "cuup_cucp_if.h" +#include "executables/lte-softmodem.h" +#include "executables/softmodem-common.h" +#include "f1ap_messages_types.h" +#include "gnb_config.h" +#include "gtpv1_u_messages_types.h" +#include "hashtable.h" +#include "intertask_interface.h" +#include "common/utils/LOG/log.h" +#include "nfapi/oai_integration/vendor_ext.h" +#include "nr_pdcp_asn1_utils.h" +#include "nr_pdcp_timer_thread.h" +#include "nr_pdcp_ue_manager.h" +#include "openair2/F1AP/f1ap_ids.h" +#include "openair2/SDAP/nr_sdap/nr_sdap.h" +#include "pdcp.h" +#include "pdcp_messages_types.h" +#include "rlc.h" +#include "utils.h" #define TODO do { \ printf("%s:%d:%s: todo\n", __FILE__, __LINE__, __FUNCTION__); \ diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h index 967a2719ee..bdeb01fff1 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h @@ -22,8 +22,17 @@ #ifndef NR_PDCP_OAI_API_H #define NR_PDCP_OAI_API_H -#include "pdcp.h" +#include +#include +#include +#include "NR_DRB-ToAddModList.h" +#include "NR_PDCP-Config.h" +#include "NR_SRB-ToAddModList.h" +#include "nr_pdcp/nr_pdcp_entity.h" +#include "nr_pdcp/nr_pdcp_integrity_data.h" #include "nr_pdcp_ue_manager.h" +struct NR_DRB_ToAddMod; +struct NR_SRB_ToAddMod; void nr_pdcp_layer_init(void); uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id); diff --git a/openair2/SDAP/nr_sdap/nr_sdap.c b/openair2/SDAP/nr_sdap/nr_sdap.c index 783ca5a914..d1a82310e5 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap.c +++ b/openair2/SDAP/nr_sdap/nr_sdap.c @@ -20,6 +20,10 @@ */ #include "nr_sdap.h" +#include +#include +#include "nr_sdap_entity.h" +#include "common/utils/LOG/log.h" uint8_t nas_qfi; uint8_t nas_pduid; diff --git a/openair2/SDAP/nr_sdap/nr_sdap.h b/openair2/SDAP/nr_sdap/nr_sdap.h index 8fb313a340..ec2d7ad185 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap.h +++ b/openair2/SDAP/nr_sdap/nr_sdap.h @@ -22,9 +22,9 @@ #ifndef _NR_SDAP_GNB_H_ #define _NR_SDAP_GNB_H_ +#include +#include #include "common/platform_types.h" -#include "common/utils/LOG/log.h" -#include "nr_sdap_entity.h" /* * TS 37.324 4.4 Functions diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.c b/openair2/SDAP/nr_sdap/nr_sdap_entity.c index 1a1d28782f..bcc93c87dc 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap_entity.c +++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.c @@ -20,14 +20,18 @@ */ #include "nr_sdap_entity.h" -#include "common/utils/LOG/log.h" #include #include -#include "openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.h" - #include #include -#include +#include +#include "PHY/defs_common.h" +#include "T.h" +#include "assertions.h" +#include "common/utils/T/T.h" +#include "gtpv1_u_messages_types.h" +#include "intertask_interface.h" +#include "rlc.h" typedef struct { nr_sdap_entity_t *sdap_entity_llist; diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.h b/openair2/SDAP/nr_sdap/nr_sdap_entity.h index 3768d60f6a..bff1c49281 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap_entity.h +++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.h @@ -22,11 +22,12 @@ #ifndef _NR_SDAP_ENTITY_H_ #define _NR_SDAP_ENTITY_H_ -#include +#include #include -#include "common/platform_types.h" -#include "openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h" -#include "NR_RadioBearerConfig.h" +#include +#include "NR_QFI.h" +#include "NR_SDAP-Config.h" +#include "common/platform_constants.h" #define SDAP_BITMASK_DC (0x80) #define SDAP_BITMASK_R (0x40) From ca96ea70029b80ed1a35cd766d86b0ab6e4f4208 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 17 Oct 2024 16:30:27 +0200 Subject: [PATCH 10/13] Updated iwyu/README.md --- tools/iwyu/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/iwyu/README.md b/tools/iwyu/README.md index 30b573747a..16775dcf1c 100644 --- a/tools/iwyu/README.md +++ b/tools/iwyu/README.md @@ -3,6 +3,10 @@ IWYU - [include what you use](https://github.com/include-what-you-use/include-what-you-use) is a tool that can detect and correct C/C++ include errors +# Pre-requisites + +The image ran-base:latest needs to be built. Please refer to [docker/README.md](../../docker/README.md) + # Usage ``` From 37e856a7fd9faaa58cb3289d87a37473d61cf03b Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 17 Oct 2024 17:43:37 +0200 Subject: [PATCH 11/13] Add include for MAX_ANT * to defs_gNB.h, nr_dlsch_demodulation.c --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 2 ++ openair1/PHY/defs_gNB.h | 1 + 2 files changed, 3 insertions(+) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 9bc764fa35..c0019fb3ec 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -28,6 +28,8 @@ * \note * \warning */ + +#include "common/platform_constants.h" #include "nr_phy_common.h" #include "PHY/defs_nr_UE.h" #include "PHY/phy_extern.h" diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7022ad8b23..a1c5cbcb10 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -33,6 +33,7 @@ #ifndef __PHY_DEFS_GNB__H__ #define __PHY_DEFS_GNB__H__ +#include "common/platform_constants.h" #include "defs_nr_common.h" #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" From 83a4b4df6423d6367d153e11f9ddf5af60f0c10d Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 17 Oct 2024 17:47:10 +0200 Subject: [PATCH 12/13] Refactor includes in NR_PHY_INTERFACE * used open source IWYU tool + manual review --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 14 ++++++++++---- openair2/NR_PHY_INTERFACE/NR_IF_Module.h | 3 +-- openair2/NR_PHY_INTERFACE/nr_sched_response.c | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 455deb1eac..fd392ceae8 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -31,14 +31,20 @@ */ #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" -#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" +#include +#include +#include #include "LAYER2/NR_MAC_gNB/mac_proto.h" -#include "common/ran_context.h" +#include "PHY/defs_common.h" +#include "common/platform_constants.h" +#include "common/utils/T/T.h" #include "executables/softmodem-common.h" -#include "nfapi/oai_integration/vendor_ext.h" #include "nfapi/oai_integration/gnb_ind_vars.h" -#include "openair2/PHY_INTERFACE/queue_t.h" +#include "nfapi/oai_integration/vendor_ext.h" +#include "nfapi_interface.h" #include "openair2/NR_PHY_INTERFACE/nr_sched_response.h" +#include "openair2/PHY_INTERFACE/queue_t.h" +#include "utils.h" #define MAX_IF_MODULES 100 diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index 82ccdb782f..261ead1ba0 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -35,9 +35,8 @@ #include #include +#include "assertions.h" #include "nfapi_nr_interface_scf.h" -#include "common/platform_constants.h" -#include "common/platform_types.h" #define MAX_NUM_DL_PDU 100 #define MAX_NUM_UL_PDU 100 diff --git a/openair2/NR_PHY_INTERFACE/nr_sched_response.c b/openair2/NR_PHY_INTERFACE/nr_sched_response.c index 17b6c56c29..9c66b21536 100644 --- a/openair2/NR_PHY_INTERFACE/nr_sched_response.c +++ b/openair2/NR_PHY_INTERFACE/nr_sched_response.c @@ -38,10 +38,10 @@ */ #include "nr_sched_response.h" - #include +#include #include - +#include "NR_PHY_INTERFACE/NR_IF_Module.h" #include "common/utils/LOG/log.h" #include "common/utils/assertions.h" From 1679be6a146ee5498d5aef0268ab3f7222d09869 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 17 Oct 2024 17:50:15 +0200 Subject: [PATCH 13/13] Refactor includes in gNB config * used open source IWYU tool + manual review --- openair2/GNB_APP/gnb_config.c | 63 +++++++++++++++++++++++------ openair2/GNB_APP/gnb_config.h | 22 +++------- openair2/LAYER2/NR_MAC_gNB/config.c | 43 ++++++++++++-------- 3 files changed, 83 insertions(+), 45 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 44c402fb8a..4fe421d3bc 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -27,27 +27,64 @@ EMAIL : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr, kroempa@gmail.com */ -#include "executables/softmodem-common.h" #include "gnb_config.h" -#include "enb_paramdef.h" -#include "UTIL/OTG/otg.h" -#include "sctp_default_values.h" -#include "f1ap_common.h" -#include "PHY/INIT/nr_phy_init.h" -#include "radio/ETHERNET/ethernet_lib.h" -#include "nfapi_vnf.h" -#include "nfapi_pnf.h" -#include "prs_nr_paramdef.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "BIT_STRING.h" #include "L1_nr_paramdef.h" #include "MACRLC_nr_paramdef.h" -#include "gnb_paramdef.h" -#include "NR_MAC_gNB/mac_proto.h" +#include "PHY/INIT/nr_phy_init.h" +#include "PHY/defs_common.h" +#include "PHY/defs_gNB.h" +#include "PHY/defs_nr_common.h" +#include "RRC/NR/nr_rrc_config.h" #include "RRC/NR/nr_rrc_extern.h" +#include "RRC_nr_paramsvalues.h" +#include "T.h" +#include "asn_SEQUENCE_OF.h" +#include "asn_codecs.h" +#include "asn_internal.h" +#include "NR_MAC_gNB/nr_mac_gNB.h" +#include "NR_MAC_gNB/mac_proto.h" +#include "common/5g_platform_types.h" +#include "common/config/config_paramdesc.h" +#include "common/config/config_userapi.h" +#include "common/openairinterface5g_limits.h" +#include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "common_lib.h" +#include "constr_TYPE.h" +#include "enb_paramdef.h" +#include "executables/softmodem-common.h" +#include "f1ap_common.h" +#include "gnb_paramdef.h" +#include "lib/f1ap_interface_management.h" #include "nfapi/oai_integration/vendor_ext.h" +#include "nfapi_pnf.h" +#include "nfapi_vnf.h" +#include "ngap_gNB.h" +#include "ngap_messages_types.h" +#include "nr_common.h" +#include "oai_asn1.h" +#include "openair1/PHY/defs_common.h" +#include "prs_nr_paramdef.h" +#include "radio/ETHERNET/if_defs.h" +#include "rrc_messages_types.h" +#include "s1ap_messages_types.h" +#include "sctp_default_values.h" +#include "seq_arr.h" +#include "uper_encoder.h" +#include "utils.h" +#include "x2ap_messages_types.h" #ifdef ENABLE_AERIAL #include "nfapi/oai_integration/aerial/fapi_vnf_p5.h" #endif -#include "lib/f1ap_interface_management.h" static int DEFBANDS[] = {7}; static int DEFENBS[] = {0}; diff --git a/openair2/GNB_APP/gnb_config.h b/openair2/GNB_APP/gnb_config.h index 0a52684612..aaa945509c 100644 --- a/openair2/GNB_APP/gnb_config.h +++ b/openair2/GNB_APP/gnb_config.h @@ -29,23 +29,13 @@ #ifndef GNB_CONFIG_H_ #define GNB_CONFIG_H_ -#include -#include -#include -#include - -#include "commonDef.h" -#include "common/platform_types.h" -#include "common/platform_constants.h" -#include "PHY/defs_eNB.h" -#include "s1ap_messages_types.h" -#include "ngap_messages_types.h" -#include "f1ap_messages_types.h" -#include "e1ap_messages_types.h" - -#include "rrc_messages_types.h" -#include "intertask_interface.h" +#include #include "RRC/NR/nr_rrc_defs.h" +#include "assertions.h" +#include "common/config/config_load_configmodule.h" +#include "common/ngran_types.h" +#include "f1ap_messages_types.h" +#include "intertask_interface.h" #define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\ struct in_addr inp;\ diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index bed7f2c961..81d10ad4ec 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -30,26 +30,37 @@ */ -#include "common/platform_types.h" -#include "common/platform_constants.h" -#include "common/ran_context.h" -#include "common/utils/nr/nr_common.h" -#include "common/utils/LOG/log.h" -#include "common/utils/LOG/vcd_signal_dumper.h" - +#include +#include +#include +#include +#include +#include "BIT_STRING.h" +#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "NR_MIB.h" +#include "NR_MAC_COMMON/nr_mac_extern.h" +#include "NR_MAC_gNB/nr_mac_gNB.h" #include "NR_BCCH-BCH-Message.h" #include "NR_ServingCellConfigCommon.h" -#include "uper_encoder.h" - -#include "LAYER2/NR_MAC_gNB/mac_proto.h" -#include "SCHED_NR/phy_frame_config_nr.h" - #include "NR_MIB.h" -#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" -#include "nfapi/oai_integration/vendor_ext.h" -/* Softmodem params */ +#include "PHY/TOOLS/tools_defs.h" +#include "PHY/defs_common.h" +#include "RRC/NR/nr_rrc_config.h" +#include "SCHED_NR/phy_frame_config_nr.h" +#include "T.h" +#include "asn_internal.h" +#include "assertions.h" +#include "common/ran_context.h" +#include "common/utils/T/T.h" +#include "common/utils/nr/nr_common.h" #include "executables/softmodem-common.h" -#include +#include "f1ap_messages_types.h" +#include "nfapi/oai_integration/vendor_ext.h" +#include "nfapi_interface.h" +#include "nfapi_nr_interface.h" +#include "nfapi_nr_interface_scf.h" +#include "utils.h" extern RAN_CONTEXT_t RC; //extern int l2_init_gNB(void);