From 32e5f972e95368b7d6f96c6e06ff5ac9ad38382d Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Tue, 13 May 2025 21:57:25 +0200 Subject: [PATCH] Refactor f1u_tunnel_t into gtpu_tunnel_t This struct is used in different layers, e.g. RRC, NGAP: therefore it has been moved to platform_types.h. Also, the struct holds the tunnel endpoint configuration for any GTP-U tunnel, therefore the f1u prefix is not accurate and was updated to a more generic gtpu. --- common/platform_types.h | 8 ++++++++ openair2/RRC/NR/nr_rrc_defs.h | 14 ++------------ openair2/RRC/NR/rrc_gNB.c | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/common/platform_types.h b/common/platform_types.h index 8a8868226a..b31474d475 100644 --- a/common/platform_types.h +++ b/common/platform_types.h @@ -216,6 +216,14 @@ typedef struct transport_layer_addr_s { uint8_t buffer[20]; } transport_layer_addr_t; +/** @brief GTP tunnel configuration */ +typedef struct { + // Tunnel endpoint identifier + uint32_t teid; + // Transport layer address + transport_layer_addr_t addr; +} gtpu_tunnel_t; + //----------------------------------------------------------------------------- // GTPV1U TYPES //----------------------------------------------------------------------------- diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index f2434eceaf..9998562b61 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -106,16 +106,6 @@ typedef struct pdu_session_param_s { ngap_cause_t cause; } rrc_pdu_session_param_t; -/** - * @brief F1-U tunnel configuration -*/ -typedef struct f1u_tunnel_s { - /* F1-U Tunnel Endpoint Identifier (on DU side) */ - uint32_t teid; - /* Downlink F1-U Transport Layer (on DU side) */ - transport_layer_addr_t addr; -} f1u_tunnel_t; - typedef struct drb_s { int status; int drb_id; @@ -145,9 +135,9 @@ typedef struct drb_s { } ext1; } pdcp_config; // F1-U Downlink Tunnel Config (on DU side) - f1u_tunnel_t du_tunnel_config; + gtpu_tunnel_t du_tunnel_config; // F1-U Uplink Tunnel Config (on CU-UP side) - f1u_tunnel_t cuup_tunnel_config; + gtpu_tunnel_t cuup_tunnel_config; } drb_t; typedef enum { diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index f69e03b810..f47700ae9a 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -2007,7 +2007,7 @@ static void fill_e1_bearer_modif(DRB_nGRAN_to_mod_t *drb_e1, const f1ap_drb_to_b /** * @brief Store F1-U DL TL and TEID in RRC */ -static void f1u_dl_gtp_update(f1u_tunnel_t *f1u, const f1ap_up_tnl_t *p) +static void f1u_dl_gtp_update(gtpu_tunnel_t *f1u, const f1ap_up_tnl_t *p) { f1u->teid = p->teid; memcpy(&f1u->addr.buffer, &p->tl_address, sizeof(uint8_t) * 4); @@ -2031,7 +2031,7 @@ static void store_du_f1u_tunnel(const f1ap_drb_to_be_setup_t *drbs, int n, gNB_R /* * @brief Store F1-U UL TEID and address in RRC */ -static void f1u_ul_gtp_update(f1u_tunnel_t *f1u, const up_params_t *p) +static void f1u_ul_gtp_update(gtpu_tunnel_t *f1u, const up_params_t *p) { f1u->teid = p->tl_info.teId; memcpy(&f1u->addr.buffer, &p->tl_info.tlAddress, sizeof(uint8_t) * 4);