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.
This commit is contained in:
Guido Casati
2025-06-18 10:52:15 +02:00
parent 93936ffd9b
commit 32e5f972e9
3 changed files with 12 additions and 14 deletions
+8
View File
@@ -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
//-----------------------------------------------------------------------------
+2 -12
View File
@@ -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 {
+2 -2
View File
@@ -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);