Adopt dynamic seq_arr in PDU Session handling (RRC PDU Session)

The RRC PDU Session struct is converted from a fixed-size array
to a dynamically sized seq_arr. This improves flexibility and
simplifies session management by eliminating arbitrary size limits
and enabling dynamic addition/removal of PDU sessions.

Helper functions and loops have been adapted to use the seq_arr API.
This change is a step toward more robust and maintainable handling
of PDU sessions in the gNB RRC layer.

The "status" state machine remains untouched in this commit and
is refactored in a later commit.

Also:

* add macro to push to seq_arr and return the new element
* move initialization of xid (RRC PDU Session struct) to
  find_pduSession (temporary, will be finalized in a later
  commit) since with the new seq_arr design the initialization
  is no longer possible in the UE context generation (also
  does not belong to it, initialize when adding a new PDU Session)
This commit is contained in:
Guido Casati
2025-09-24 14:38:36 +02:00
parent e4a910f0bb
commit 5bcc9b9e5e
11 changed files with 261 additions and 234 deletions
@@ -27,6 +27,7 @@
#include "openair2/E1AP/e1ap_common.h"
#include "openair2/E2AP/flexric/src/util/time_now_us.h"
#include "openair2/F1AP/f1ap_ids.h"
#include "ds/seq_arr.h"
static pthread_once_t once_kpm_mutex = PTHREAD_ONCE_INIT;
@@ -212,8 +213,8 @@ static arr_ue_id_t filter_ues_by_s_nssai_in_cu(const test_info_lst_t test_info)
/* UE has no AMF UE NGAP ID yet => can't send message */
if (ue->amf_ue_ngap_id >= (1LL << 40))
continue;
for (int p = 0; p < ue->nb_of_pdusessions; ++p) {
pdusession_t *pdu = &ue->pduSession[p].param;
FOR_EACH_SEQ_ARR(rrc_pdu_session_param_t*, item, &ue->pduSessions) {
pdusession_t* pdu = &item->param;
if (nssai_matches(pdu->nssai, sst, sd)) {
arr_ue_id.ue_id[arr_ue_id.sz] = fill_ue_id_data[ngran_gNB_CU](ue, 0, 0);