Refactor (F1AP): align cell lists definitions with TS 38.473
* Commit applies to Setup Request, CU/DU Configuration Update * Set standard compliant max number of cells per DU * Allocate large lists on the heap to prevent stack overflow due to the large size * Update relevant free functions * Also, fix bug in eq_f1ap_cu_configuration_update Also, improve comments in struct definition.
This commit is contained in:
@@ -74,12 +74,11 @@
|
||||
*/
|
||||
#define F1AP_TRANSPORT_LAYER_ADDRESS_SIZE (160 / 8)
|
||||
|
||||
|
||||
// Note this should be 512 from maxval in 38.473
|
||||
#define F1AP_MAX_NB_CELLS 2
|
||||
/* F1 Setup Request (9.3.1.4 of 3GPP TS 38.473) */
|
||||
#define F1AP_MAX_NB_CELLS 512
|
||||
|
||||
#define F1AP_MAX_NO_OF_TNL_ASSOCIATIONS 32
|
||||
#define F1AP_MAX_NO_UE_ID 1024
|
||||
#define F1AP_MAX_NO_UE_ID 65536
|
||||
|
||||
/* 9.3.1.42 of 3GPP TS 38.473 - gNB-CU System Information */
|
||||
#define F1AP_MAX_NO_SIB_TYPES 32
|
||||
@@ -122,54 +121,53 @@ typedef struct f1ap_tdd_info_t {
|
||||
} f1ap_tdd_info_t;
|
||||
|
||||
typedef struct f1ap_served_cell_info_t {
|
||||
// NR CGI
|
||||
// NR CGI (Mandatory)
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid; // NR Global Cell Id
|
||||
|
||||
// NR Physical Cell Ids
|
||||
// NR PCI (Mandatory)
|
||||
uint16_t nr_pci;
|
||||
|
||||
/* Tracking area code */
|
||||
// 5GS TAC (Optional)
|
||||
uint32_t *tac;
|
||||
|
||||
// Number of slice support items (max 16, could be increased to as much as 1024)
|
||||
// TAI Slice Support List (Optional)
|
||||
uint16_t num_ssi;
|
||||
nssai_t nssai[MAX_NUM_SLICES];
|
||||
|
||||
// NR-Mode-Info (Mandatory)
|
||||
f1ap_mode_t mode;
|
||||
union {
|
||||
f1ap_fdd_info_t fdd;
|
||||
f1ap_tdd_info_t tdd;
|
||||
};
|
||||
|
||||
// Measurement Timing Configuration (Mandatory)
|
||||
uint8_t *measurement_timing_config;
|
||||
int measurement_timing_config_len;
|
||||
} f1ap_served_cell_info_t;
|
||||
|
||||
typedef struct f1ap_gnb_du_system_info_t {
|
||||
// MIB message (Mandatory)
|
||||
uint8_t *mib;
|
||||
int mib_length;
|
||||
// SIB1 message (Mandatory)
|
||||
uint8_t *sib1;
|
||||
int sib1_length;
|
||||
} f1ap_gnb_du_system_info_t;
|
||||
|
||||
typedef struct f1ap_setup_req_s {
|
||||
/// ulong transaction id
|
||||
// Transaction ID (Mandatory)
|
||||
uint64_t transaction_id;
|
||||
|
||||
// F1_Setup_Req payload
|
||||
// gNB-DU ID (Mandatory)
|
||||
uint64_t gNB_DU_id;
|
||||
// gNB-DU Name (Optional)
|
||||
char *gNB_DU_name;
|
||||
|
||||
/// rrc version
|
||||
// gNB-DU RRC version (Mandatory)
|
||||
uint8_t rrc_ver[3];
|
||||
|
||||
/// number of DU cells available
|
||||
uint16_t num_cells_available; //0< num_cells_available <= 512;
|
||||
// gNB-DU Served Cells List (0..1)
|
||||
uint16_t num_cells_available; // (1..512)
|
||||
struct {
|
||||
// Served Cell Information (Mandatory)
|
||||
f1ap_served_cell_info_t info;
|
||||
// gNB-DU System Information (Optional)
|
||||
f1ap_gnb_du_system_info_t *sys_info;
|
||||
} cell[F1AP_MAX_NB_CELLS];
|
||||
} *cell;
|
||||
} f1ap_setup_req_t;
|
||||
|
||||
typedef struct f1ap_du_register_req_t {
|
||||
@@ -203,8 +201,8 @@ typedef struct f1ap_setup_resp_s {
|
||||
/// string holding gNB_CU_name
|
||||
char *gNB_CU_name;
|
||||
/// number of DU cells to activate
|
||||
uint16_t num_cells_to_activate; //0< num_cells_to_activate <= 512;
|
||||
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
|
||||
uint16_t num_cells_to_activate;
|
||||
served_cells_to_activate_t *cells_to_activate;
|
||||
|
||||
/// rrc version
|
||||
uint8_t rrc_ver[3];
|
||||
@@ -215,8 +213,8 @@ typedef struct f1ap_gnb_cu_configuration_update_s {
|
||||
/// Transaction ID
|
||||
uint64_t transaction_id;
|
||||
/// number of DU cells to activate
|
||||
uint16_t num_cells_to_activate; //0< num_cells_to_activate/mod <= 512;
|
||||
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
|
||||
uint16_t num_cells_to_activate;
|
||||
served_cells_to_activate_t *cells_to_activate;
|
||||
} f1ap_gnb_cu_configuration_update_t;
|
||||
|
||||
typedef struct f1ap_setup_failure_s {
|
||||
@@ -236,7 +234,7 @@ typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid;
|
||||
uint16_t cause;
|
||||
} cells_failed_to_be_activated[F1AP_MAX_NB_CELLS];
|
||||
} * cells_failed_to_be_activated;
|
||||
int have_criticality;
|
||||
uint16_t criticality_diagnostics;
|
||||
// gNB-CU TNL Association Setup List
|
||||
@@ -245,14 +243,14 @@ typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
|
||||
// gNB-CU TNL Association Failed to Setup List
|
||||
uint16_t noofTNLAssociations_failed;
|
||||
f1ap_cp_tnl_t tnlAssociations_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
|
||||
// Dedicated SI Delivery Needed UE List
|
||||
// Dedicated SI Delivery Needed UE List (max 65536 UE IDs)
|
||||
uint16_t noofDedicatedSIDeliveryNeededUEs;
|
||||
struct {
|
||||
uint32_t gNB_CU_ue_id;
|
||||
// NR CGI
|
||||
plmn_id_t ue_plmn;
|
||||
uint64_t ue_nr_cellid;
|
||||
} dedicatedSIDeliveryNeededUEs[F1AP_MAX_NO_UE_ID];
|
||||
} * dedicatedSIDeliveryNeededUEs;
|
||||
} f1ap_gnb_cu_configuration_update_acknowledge_t;
|
||||
|
||||
typedef struct f1ap_gnb_cu_configuration_update_failure_s {
|
||||
@@ -279,7 +277,7 @@ typedef struct f1ap_gnb_du_configuration_update_s {
|
||||
struct {
|
||||
f1ap_served_cell_info_t info;
|
||||
f1ap_gnb_du_system_info_t *sys_info;
|
||||
} cell_to_add[F1AP_MAX_NB_CELLS];
|
||||
} * cell_to_add;
|
||||
|
||||
/// int cells_to_modify
|
||||
uint16_t num_cells_to_modify;
|
||||
@@ -288,7 +286,7 @@ typedef struct f1ap_gnb_du_configuration_update_s {
|
||||
uint64_t old_nr_cellid; // NR Global Cell Id
|
||||
f1ap_served_cell_info_t info;
|
||||
f1ap_gnb_du_system_info_t *sys_info;
|
||||
} cell_to_modify[F1AP_MAX_NB_CELLS];
|
||||
} * cell_to_modify;
|
||||
|
||||
/// int cells_to_delete
|
||||
uint16_t num_cells_to_delete;
|
||||
@@ -296,9 +294,9 @@ typedef struct f1ap_gnb_du_configuration_update_s {
|
||||
// NR CGI
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid; // NR Global Cell Id
|
||||
} cell_to_delete[F1AP_MAX_NB_CELLS];
|
||||
} * cell_to_delete;
|
||||
|
||||
f1ap_cell_status_t status[F1AP_MAX_NB_CELLS];
|
||||
f1ap_cell_status_t *status;
|
||||
int num_status;
|
||||
|
||||
/// gNB-DU unique ID, at least within a gNB-CU (0 .. 2^36 - 1)
|
||||
@@ -310,7 +308,7 @@ typedef struct f1ap_gnb_du_configuration_update_acknowledge_s {
|
||||
uint64_t transaction_id;
|
||||
/// number of DU cells to activate
|
||||
uint16_t num_cells_to_activate; // 0< num_cells_to_activate <= 512;
|
||||
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
|
||||
served_cells_to_activate_t *cells_to_activate;
|
||||
} f1ap_gnb_du_configuration_update_acknowledge_t;
|
||||
|
||||
typedef struct f1ap_gnb_du_configuration_update_failure_s {
|
||||
|
||||
@@ -842,8 +842,9 @@ bool decode_f1ap_setup_request(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_req_t *out
|
||||
/* GNB_DU_Served_Cells_List */
|
||||
out->num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
|
||||
AssertError(out->num_cells_available > 0, return false, "at least 1 cell must be present");
|
||||
out->cell = calloc_or_fail(out->num_cells_available, sizeof(*out->cell));
|
||||
/* Loop over gNB-DU Served Cells Items */
|
||||
for (int i = 0; i < out->num_cells_available; i++) {
|
||||
for (int i = 0; i < out->num_cells_available && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
F1AP_GNB_DU_Served_Cells_Item_t *served_cells_item =
|
||||
&(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])
|
||||
->value.choice.GNB_DU_Served_Cells_Item);
|
||||
@@ -952,7 +953,9 @@ f1ap_setup_req_t cp_f1ap_setup_request(const f1ap_setup_req_t *msg)
|
||||
cp.transaction_id = msg->transaction_id;
|
||||
/* num_cells_available */
|
||||
cp.num_cells_available = msg->num_cells_available;
|
||||
for (int n = 0; n < msg->num_cells_available; n++) {
|
||||
if (cp.num_cells_available > 0)
|
||||
cp.cell = calloc_or_fail(cp.num_cells_available, sizeof(*cp.cell));
|
||||
for (int n = 0; n < msg->num_cells_available && n < F1AP_MAX_NB_CELLS; n++) {
|
||||
/* cell.info */
|
||||
cp.cell[n].info = copy_f1ap_served_cell_info(&msg->cell[n].info);
|
||||
/* cell.sys_info */
|
||||
@@ -972,7 +975,7 @@ bool eq_f1ap_setup_request(const f1ap_setup_req_t *a, const f1ap_setup_req_t *b)
|
||||
_F1_EQ_CHECK_STR(a->gNB_DU_name, b->gNB_DU_name);
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_F1_EQ_CHECK_INT(a->num_cells_available, b->num_cells_available);
|
||||
for (int i = 0; i < a->num_cells_available; i++) {
|
||||
for (int i = 0; i < a->num_cells_available && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_cell_info(&a->cell[i].info, &b->cell[i].info))
|
||||
return false;
|
||||
if (!eq_f1ap_sys_info(a->cell[i].sys_info, b->cell[i].sys_info))
|
||||
@@ -992,8 +995,11 @@ void free_f1ap_setup_request(const f1ap_setup_req_t *msg)
|
||||
{
|
||||
DevAssert(msg != NULL);
|
||||
free(msg->gNB_DU_name);
|
||||
for (int i = 0; i < msg->num_cells_available; i++) {
|
||||
free_f1ap_cell(&msg->cell[i].info, msg->cell[i].sys_info);
|
||||
if (msg->cell != NULL) {
|
||||
for (int i = 0; i < msg->num_cells_available; i++) {
|
||||
free_f1ap_cell(&msg->cell[i].info, msg->cell[i].sys_info);
|
||||
}
|
||||
free(msg->cell);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1032,15 +1038,16 @@ F1AP_F1AP_PDU_t *encode_f1ap_setup_response(const f1ap_setup_resp_t *msg)
|
||||
OCTET_STRING_fromBuf(&ie2->value.choice.GNB_CU_Name, msg->gNB_CU_name, strlen(msg->gNB_CU_name));
|
||||
}
|
||||
// Cells to be Activated List (O)
|
||||
for (int i = 0; i < msg->num_cells_to_activate; i++) {
|
||||
if (msg->num_cells_to_activate > 0) {
|
||||
DevAssert(msg->num_cells_to_activate <= F1AP_MAX_NB_CELLS);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie3);
|
||||
ie3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
|
||||
ie3->criticality = F1AP_Criticality_reject;
|
||||
ie3->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
|
||||
asn1cSequenceAdd(ie3->value.choice.Cells_to_be_Activated_List.list,
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t,
|
||||
cells_to_be_activated_ies);
|
||||
encode_cells_to_activate(&msg->cells_to_activate[i], cells_to_be_activated_ies);
|
||||
for (int i = 0; i < msg->num_cells_to_activate; i++) {
|
||||
asn1cSequenceAdd(ie3->value.choice.Cells_to_be_Activated_List.list, F1AP_Cells_to_be_Activated_List_ItemIEs_t, cells);
|
||||
encode_cells_to_activate(&msg->cells_to_activate[i], cells);
|
||||
}
|
||||
}
|
||||
// gNB-CU RRC version (M)
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie4);
|
||||
@@ -1131,7 +1138,8 @@ bool decode_f1ap_setup_response(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_resp_t *o
|
||||
out->num_cells_to_activate = Cells_to_be_Activated_List->list.count;
|
||||
// Loop Cells to be Activated List Items (count >= 1)
|
||||
AssertError(out->num_cells_to_activate > 0, return false, "At least 1 cell must be present");
|
||||
for (int i = 0; i < out->num_cells_to_activate; i++) {
|
||||
out->cells_to_activate = calloc_or_fail(out->num_cells_to_activate, sizeof(*out->cells_to_activate));
|
||||
for (int i = 0; i < out->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
const F1AP_Cells_to_be_Activated_List_ItemIEs_t *itemIEs
|
||||
= (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)Cells_to_be_Activated_List->list.array[i];
|
||||
if (!decode_cells_to_activate(&out->cells_to_activate[i], itemIEs))
|
||||
@@ -1157,7 +1165,7 @@ bool eq_f1ap_setup_response(const f1ap_setup_resp_t *a, const f1ap_setup_resp_t
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
if (a->num_cells_to_activate) {
|
||||
for (int i = 0; i < a->num_cells_to_activate; i++) {
|
||||
for (int i = 0; i < a->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
const served_cells_to_activate_t *a_cell = &a->cells_to_activate[i];
|
||||
const served_cells_to_activate_t *b_cell = &b->cells_to_activate[i];
|
||||
_F1_EQ_CHECK_LONG(a_cell->nr_cellid, b_cell->nr_cellid);
|
||||
@@ -1197,7 +1205,8 @@ f1ap_setup_resp_t cp_f1ap_setup_response(const f1ap_setup_resp_t *msg)
|
||||
cp.transaction_id = msg->transaction_id;
|
||||
/* num_cells_available */
|
||||
cp.num_cells_to_activate = msg->num_cells_to_activate;
|
||||
for (int n = 0; n < msg->num_cells_to_activate; n++) {
|
||||
cp.cells_to_activate = calloc_or_fail(cp.num_cells_to_activate, sizeof(*cp.cells_to_activate));
|
||||
for (int n = 0; n < msg->num_cells_to_activate && n < F1AP_MAX_NB_CELLS; n++) {
|
||||
/* cell.info */
|
||||
served_cells_to_activate_t *cp_cell = &cp.cells_to_activate[n];
|
||||
const served_cells_to_activate_t *msg_cell = &msg->cells_to_activate[n];
|
||||
@@ -1230,6 +1239,7 @@ void free_f1ap_setup_response(const f1ap_setup_resp_t *msg)
|
||||
for (int j = 0; j < msg->cells_to_activate[i].num_SI; j++)
|
||||
if (msg->cells_to_activate[i].SI_msg[j].SI_container_length > 0)
|
||||
free(msg->cells_to_activate[i].SI_msg[j].SI_container);
|
||||
free(msg->cells_to_activate);
|
||||
}
|
||||
|
||||
/* ====================================
|
||||
@@ -1373,6 +1383,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configura
|
||||
/* mandatory */
|
||||
/* c2. Served_Cells_To_Add */
|
||||
if (msg->num_cells_to_add > 0) {
|
||||
DevAssert(msg->num_cells_to_add <= F1AP_MAX_NB_CELLS);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie2);
|
||||
ie2->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_List;
|
||||
ie2->criticality = F1AP_Criticality_reject;
|
||||
@@ -1397,6 +1408,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configura
|
||||
/* mandatory */
|
||||
/* c3. Served_Cells_To_Modify */
|
||||
if (msg->num_cells_to_modify > 0) {
|
||||
DevAssert(msg->num_cells_to_modify <= F1AP_MAX_NB_CELLS);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie3);
|
||||
ie3->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_List;
|
||||
ie3->criticality = F1AP_Criticality_reject;
|
||||
@@ -1426,6 +1438,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configura
|
||||
/* mandatory */
|
||||
/* c4. Served_Cells_To_Delete */
|
||||
if (msg->num_cells_to_delete > 0) {
|
||||
DevAssert(msg->num_cells_to_delete <= F1AP_MAX_NB_CELLS);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie4);
|
||||
ie4->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_List;
|
||||
ie4->criticality = F1AP_Criticality_reject;
|
||||
@@ -1447,6 +1460,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configura
|
||||
}
|
||||
|
||||
if (msg->num_status > 0) {
|
||||
DevAssert(msg->num_status <= F1AP_MAX_NB_CELLS);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBDUConfigurationUpdateIEs_t, ie4);
|
||||
ie4->id = F1AP_ProtocolIE_ID_id_Cells_Status_List;
|
||||
ie4->criticality = F1AP_Criticality_reject;
|
||||
@@ -1507,7 +1521,8 @@ bool decode_f1ap_du_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_du
|
||||
/* Served Cells To Add List */
|
||||
out->num_cells_to_add = ie->value.choice.Served_Cells_To_Add_List.list.count;
|
||||
AssertError(out->num_cells_to_add > 0, return false, "at least 1 cell to add shall to be present");
|
||||
for (int i = 0; i < out->num_cells_to_add; i++) {
|
||||
out->cell_to_add = calloc_or_fail(out->num_cells_to_add, sizeof(*out->cell_to_add));
|
||||
for (int i = 0; i < out->num_cells_to_add && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
F1AP_Served_Cells_To_Add_Item_t *served_cells_item =
|
||||
&((F1AP_Served_Cells_To_Add_ItemIEs_t *)ie->value.choice.Served_Cells_To_Add_List.list.array[i])
|
||||
->value.choice.Served_Cells_To_Add_Item;
|
||||
@@ -1525,7 +1540,8 @@ bool decode_f1ap_du_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_du
|
||||
/* Served Cells To Modify List (O) */
|
||||
out->num_cells_to_modify = ie->value.choice.Served_Cells_To_Modify_List.list.count;
|
||||
AssertError(out->num_cells_to_modify > 0, return false, "at least 1 cell to modify shall to be present");
|
||||
for (int i = 0; i < out->num_cells_to_modify; i++) {
|
||||
out->cell_to_modify = calloc_or_fail(out->num_cells_to_modify, sizeof(*out->cell_to_modify));
|
||||
for (int i = 0; i < out->num_cells_to_modify && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
/* Served Cells To Modify List item (count >= 1) */
|
||||
F1AP_Served_Cells_To_Modify_Item_t *served_cells_item =
|
||||
&((F1AP_Served_Cells_To_Modify_ItemIEs_t *)ie->value.choice.Served_Cells_To_Modify_List.list.array[i])
|
||||
@@ -1550,7 +1566,8 @@ bool decode_f1ap_du_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_du
|
||||
/* Served Cells To Delete List */
|
||||
out->num_cells_to_delete = ie->value.choice.Served_Cells_To_Delete_List.list.count;
|
||||
AssertError(out->num_cells_to_delete > 0, return false, "at least 1 cell to delete shall to be present");
|
||||
for (int i = 0; i < out->num_cells_to_delete; i++) {
|
||||
out->cell_to_delete = calloc_or_fail(out->num_cells_to_delete, sizeof(*out->cell_to_delete));
|
||||
for (int i = 0; i < out->num_cells_to_delete && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
F1AP_Served_Cells_To_Delete_Item_t *served_cells_item =
|
||||
&((F1AP_Served_Cells_To_Delete_ItemIEs_t *)ie->value.choice.Served_Cells_To_Delete_List.list.array[i])
|
||||
->value.choice.Served_Cells_To_Delete_Item;
|
||||
@@ -1565,7 +1582,8 @@ bool decode_f1ap_du_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_du
|
||||
case F1AP_ProtocolIE_ID_id_Cells_Status_List:
|
||||
/* Cells Status List (O) */
|
||||
out->num_status = ie->value.choice.Cells_Status_List.list.count;
|
||||
for (int i = 0; i < out->num_status; ++i) {
|
||||
out->status = calloc_or_fail(out->num_status, sizeof(*out->status));
|
||||
for (int i = 0; i < out->num_status && i < F1AP_MAX_NB_CELLS; ++i) {
|
||||
const F1AP_Cells_Status_ItemIEs_t *csi_ie =
|
||||
(F1AP_Cells_Status_ItemIEs_t *)ie->value.choice.Cells_Status_List.list.array[i];
|
||||
AssertError(csi_ie->value.present == F1AP_Cells_Status_ItemIEs__value_PR_Cells_Status_Item,
|
||||
@@ -1604,11 +1622,14 @@ void free_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t
|
||||
for (int i = 0; i < msg->num_cells_to_add; i++) {
|
||||
free_f1ap_cell(&msg->cell_to_add[i].info, msg->cell_to_add[i].sys_info);
|
||||
}
|
||||
free(msg->cell_to_add);
|
||||
for (int i = 0; i < msg->num_cells_to_modify; i++) {
|
||||
free_f1ap_cell(&msg->cell_to_modify[i].info, msg->cell_to_modify[i].sys_info);
|
||||
}
|
||||
free(msg->cell_to_modify);
|
||||
free(msg->cell_to_delete);
|
||||
free(msg->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief F1 gNB-DU Configuration Update check
|
||||
*/
|
||||
@@ -1621,7 +1642,7 @@ bool eq_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *a
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
/* to add */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_add, b->num_cells_to_add);
|
||||
for (int i = 0; i < a->num_cells_to_add; i++) {
|
||||
for (int i = 0; i < a->num_cells_to_add && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_cell_info(&a->cell_to_add[i].info, &b->cell_to_add[i].info))
|
||||
return false;
|
||||
if (!eq_f1ap_sys_info(a->cell_to_add[i].sys_info, b->cell_to_add[i].sys_info))
|
||||
@@ -1629,14 +1650,14 @@ bool eq_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *a
|
||||
}
|
||||
/* to delete */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_delete, b->num_cells_to_delete);
|
||||
for (int i = 0; i < a->num_cells_to_delete; i++) {
|
||||
for (int i = 0; i < a->num_cells_to_delete && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
_F1_EQ_CHECK_LONG(a->cell_to_delete[i].nr_cellid, b->cell_to_delete[i].nr_cellid);
|
||||
if (!eq_f1ap_plmn(&a->cell_to_delete[i].plmn, &b->cell_to_delete[i].plmn))
|
||||
return false;
|
||||
}
|
||||
/* to modify */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_modify, b->num_cells_to_modify);
|
||||
for (int i = 0; i < a->num_cells_to_modify; i++) {
|
||||
for (int i = 0; i < a->num_cells_to_modify && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_plmn(&a->cell_to_modify[i].old_plmn, &b->cell_to_modify[i].old_plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_LONG(a->cell_to_modify[i].old_nr_cellid, b->cell_to_modify[i].old_nr_cellid);
|
||||
@@ -1647,7 +1668,7 @@ bool eq_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *a
|
||||
}
|
||||
/* cell status */
|
||||
_F1_EQ_CHECK_INT(a->num_status, b->num_status);
|
||||
for (int i = 0; i < a->num_status; ++i) {
|
||||
for (int i = 0; i < a->num_status && i < F1AP_MAX_NB_CELLS; ++i) {
|
||||
const f1ap_cell_status_t *astatus = &a->status[i];
|
||||
const f1ap_cell_status_t *bstatus = &b->status[i];
|
||||
if (!eq_f1ap_plmn(&astatus->plmn, &bstatus->plmn))
|
||||
@@ -1673,19 +1694,22 @@ f1ap_gnb_du_configuration_update_t cp_f1ap_du_configuration_update(const f1ap_gn
|
||||
cp.transaction_id = msg->transaction_id;
|
||||
/* to add */
|
||||
cp.num_cells_to_add = msg->num_cells_to_add;
|
||||
for (int i = 0; i < cp.num_cells_to_add; ++i) {
|
||||
cp.cell_to_add = calloc_or_fail(cp.num_cells_to_add, sizeof(*cp.cell_to_add));
|
||||
for (int i = 0; i < cp.num_cells_to_add && i < F1AP_MAX_NB_CELLS; ++i) {
|
||||
cp.cell_to_add[i].info = copy_f1ap_served_cell_info(&msg->cell_to_add[i].info);
|
||||
cp.cell_to_add[i].sys_info = copy_f1ap_gnb_du_system_info(msg->cell_to_add[i].sys_info);
|
||||
}
|
||||
/* to delete */
|
||||
cp.num_cells_to_delete = msg->num_cells_to_delete;
|
||||
for (int i = 0; i < cp.num_cells_to_delete; i++) {
|
||||
cp.cell_to_delete = calloc_or_fail(cp.num_cells_to_delete, sizeof(*cp.cell_to_delete));
|
||||
for (int i = 0; i < cp.num_cells_to_delete && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
cp.cell_to_delete[i].nr_cellid = msg->cell_to_delete[i].nr_cellid;
|
||||
cp.cell_to_delete[i].plmn = msg->cell_to_delete[i].plmn;
|
||||
}
|
||||
/* to modify */
|
||||
cp.num_cells_to_modify = msg->num_cells_to_modify;
|
||||
for (int i = 0; i < cp.num_cells_to_modify; i++) {
|
||||
cp.cell_to_modify = calloc_or_fail(cp.num_cells_to_modify, sizeof(*cp.cell_to_modify));
|
||||
for (int i = 0; i < cp.num_cells_to_modify && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
cp.cell_to_modify[i].old_plmn = msg->cell_to_modify[i].old_plmn;
|
||||
cp.cell_to_modify[i].old_nr_cellid = msg->cell_to_modify[i].old_nr_cellid;
|
||||
cp.cell_to_modify[i].info = copy_f1ap_served_cell_info(&msg->cell_to_modify[i].info);
|
||||
@@ -1693,7 +1717,8 @@ f1ap_gnb_du_configuration_update_t cp_f1ap_du_configuration_update(const f1ap_gn
|
||||
}
|
||||
/* cell status */
|
||||
cp.num_status = msg->num_status;
|
||||
for (int i = 0; i < cp.num_status; ++i)
|
||||
cp.status = calloc_or_fail(cp.num_status, sizeof(*cp.status));
|
||||
for (int i = 0; i < cp.num_status && i < F1AP_MAX_NB_CELLS; ++i)
|
||||
cp.status[i] = msg->status[i];
|
||||
return cp;
|
||||
}
|
||||
@@ -1725,15 +1750,16 @@ F1AP_F1AP_PDU_t *encode_f1ap_cu_configuration_update(const f1ap_gnb_cu_configura
|
||||
ieC1->value.choice.TransactionID = msg->transaction_id;
|
||||
/* optional
|
||||
c2. Cells_to_be_Activated_List (O) */
|
||||
for (int i = 0; i < msg->num_cells_to_activate; i++) {
|
||||
if (msg->num_cells_to_activate > 0) {
|
||||
asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC3);
|
||||
ieC3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
|
||||
ieC3->criticality = F1AP_Criticality_reject;
|
||||
ieC3->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
|
||||
asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Activated_List.list,
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t,
|
||||
cells_to_be_activated_ies);
|
||||
encode_cells_to_activate(&msg->cells_to_activate[i], cells_to_be_activated_ies);
|
||||
DevAssert(msg->num_cells_to_activate <= F1AP_MAX_NB_CELLS);
|
||||
for (int i = 0; i < msg->num_cells_to_activate; i++) {
|
||||
asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Activated_List.list, F1AP_Cells_to_be_Activated_List_ItemIEs_t, cells);
|
||||
encode_cells_to_activate(&msg->cells_to_activate[i], cells);
|
||||
}
|
||||
}
|
||||
return pdu;
|
||||
}
|
||||
@@ -1768,7 +1794,8 @@ bool decode_f1ap_cu_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_cu
|
||||
F1AP_Cells_to_be_Activated_List_t *Cells_to_be_Activated_List = &ie->value.choice.Cells_to_be_Activated_List;
|
||||
out->num_cells_to_activate = Cells_to_be_Activated_List->list.count;
|
||||
AssertError(out->num_cells_to_activate > 0, return false, "At least 1 cell to activate must be present");
|
||||
for (int i = 0; i < out->num_cells_to_activate; i++) {
|
||||
out->cells_to_activate = calloc_or_fail(out->num_cells_to_activate, sizeof(*out->cells_to_activate));
|
||||
for (int i = 0; i < out->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!decode_cells_to_activate(&out->cells_to_activate[i],
|
||||
(F1AP_Cells_to_be_Activated_List_ItemIEs_t *)Cells_to_be_Activated_List->list.array[i]))
|
||||
return false;
|
||||
@@ -1786,8 +1813,9 @@ bool decode_f1ap_cu_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_cu
|
||||
void free_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t *msg)
|
||||
{
|
||||
for (int i = 0; i < msg->num_cells_to_activate; i++)
|
||||
for (int j = 0; j < msg->cells_to_activate[j].num_SI; j++)
|
||||
for (int j = 0; j < msg->cells_to_activate[i].num_SI; j++)
|
||||
free(msg->cells_to_activate[i].SI_msg[j].SI_container);
|
||||
free(msg->cells_to_activate);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1798,16 +1826,18 @@ bool eq_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t *a
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
/* to activate */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
for (int i = 0; i < a->num_cells_to_activate; i++) {
|
||||
for (int i = 0; i < a->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
_F1_EQ_CHECK_LONG(a->cells_to_activate[i].nr_cellid, b->cells_to_activate[i].nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].nrpci, b->cells_to_activate[i].nrpci);
|
||||
if (!eq_f1ap_plmn(&a->cells_to_activate[i].plmn, &b->cells_to_activate[i].plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].num_SI, b->cells_to_activate[i].num_SI);
|
||||
for (int s = 0; s < a->cells_to_activate[i].num_SI; s++) {
|
||||
_F1_EQ_CHECK_INT(*a->cells_to_activate[i].SI_msg[s].SI_container, *a->cells_to_activate[i].SI_msg[s].SI_container);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].SI_msg[s].SI_container_length, a->cells_to_activate[i].SI_msg[s].SI_container_length);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].SI_msg[s].SI_type, a->cells_to_activate[i].SI_msg[s].SI_type);
|
||||
f1ap_sib_msg_t *a_sib_msg = &a->cells_to_activate[i].SI_msg[s];
|
||||
f1ap_sib_msg_t *b_sib_msg = &b->cells_to_activate[i].SI_msg[s];
|
||||
_F1_EQ_CHECK_INT(*a_sib_msg->SI_container, *b_sib_msg->SI_container);
|
||||
_F1_EQ_CHECK_INT(a_sib_msg->SI_container_length, b_sib_msg->SI_container_length);
|
||||
_F1_EQ_CHECK_INT(a_sib_msg->SI_type, b_sib_msg->SI_type);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1822,7 +1852,8 @@ f1ap_gnb_cu_configuration_update_t cp_f1ap_cu_configuration_update(const f1ap_gn
|
||||
/* transaction_id */
|
||||
cp.transaction_id = msg->transaction_id;
|
||||
cp.num_cells_to_activate = msg->num_cells_to_activate;
|
||||
for (int i = 0; i < cp.num_cells_to_activate; i++) {
|
||||
cp.cells_to_activate = calloc_or_fail(cp.num_cells_to_activate, sizeof(*cp.cells_to_activate));
|
||||
for (int i = 0; i < cp.num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
cp.cells_to_activate[i] = msg->cells_to_activate[i];
|
||||
for (int s = 0; s < cp.cells_to_activate[i].num_SI; s++) {
|
||||
cp.cells_to_activate[i].SI_msg[s] = msg->cells_to_activate[i].SI_msg[s];
|
||||
@@ -1862,6 +1893,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_
|
||||
ie1->value.choice.TransactionID = msg->transaction_id;
|
||||
// Cells Failed to be Activated List (0..1)
|
||||
if (msg->num_cells_failed_to_be_activated > 0) {
|
||||
DevAssert(msg->num_cells_failed_to_be_activated <= F1AP_MAX_NB_CELLS);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t, ie2);
|
||||
ie2->id = F1AP_ProtocolIE_ID_id_Cells_Failed_to_be_Activated_List;
|
||||
ie2->criticality = F1AP_Criticality_reject;
|
||||
@@ -1878,9 +1910,8 @@ F1AP_F1AP_PDU_t *encode_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_
|
||||
p1->cause.choice.radioNetwork = msg->cells_failed_to_be_activated[i].cause;
|
||||
// NR CGI (M)
|
||||
const plmn_id_t *plmn = &msg->cells_failed_to_be_activated[i].plmn;
|
||||
MCC_MNC_TO_PLMNID(plmn->mcc, plmn->mnc, plmn->mnc_digit_length, &(p1->nRCGI.pLMN_Identity));
|
||||
printf("plmn->mcc %d %d %d %ld \n",
|
||||
p1->nRCGI.pLMN_Identity.buf[0], p1->nRCGI.pLMN_Identity.buf[1], p1->nRCGI.pLMN_Identity.buf[2], p1->nRCGI.pLMN_Identity.size);
|
||||
F1AP_PLMN_Identity_t *p2 = &p1->nRCGI.pLMN_Identity;
|
||||
MCC_MNC_TO_PLMNID(plmn->mcc, plmn->mnc, plmn->mnc_digit_length, p2);
|
||||
NR_CELL_ID_TO_BIT_STRING(msg->cells_failed_to_be_activated[i].nr_cellid, &(p1->nRCGI.nRCellIdentity));
|
||||
}
|
||||
}
|
||||
@@ -1919,7 +1950,9 @@ bool decode_f1ap_cu_configuration_update_acknowledge(const F1AP_F1AP_PDU_t *pdu,
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_Cells_Failed_to_be_Activated_List);
|
||||
F1AP_Cells_Failed_to_be_Activated_List_t *cell_fail_list = &ie->value.choice.Cells_Failed_to_be_Activated_List;
|
||||
out->num_cells_failed_to_be_activated = cell_fail_list->list.count;
|
||||
for (int j = 0; j < out->num_cells_failed_to_be_activated; j++) {
|
||||
out->cells_failed_to_be_activated =
|
||||
calloc_or_fail(out->num_cells_failed_to_be_activated, sizeof(*out->cells_failed_to_be_activated));
|
||||
for (int j = 0; j < out->num_cells_failed_to_be_activated && j < F1AP_MAX_NB_CELLS; j++) {
|
||||
const F1AP_Cells_Failed_to_be_Activated_List_ItemIEs_t *itemIE =
|
||||
(F1AP_Cells_Failed_to_be_Activated_List_ItemIEs_t *)cell_fail_list->list.array[j];
|
||||
const F1AP_Cells_Failed_to_be_Activated_List_Item_t *item = &itemIE->value.choice.Cells_Failed_to_be_Activated_List_Item;
|
||||
@@ -1966,7 +1999,7 @@ bool eq_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
// number of cells failed to be activated
|
||||
_F1_EQ_CHECK_INT(a->num_cells_failed_to_be_activated, b->num_cells_failed_to_be_activated);
|
||||
for (int i = 0; i < a->num_cells_failed_to_be_activated; i++) {
|
||||
for (int i = 0; i < a->num_cells_failed_to_be_activated && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_plmn(&a->cells_failed_to_be_activated[i].plmn, &b->cells_failed_to_be_activated[i].plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_LONG(a->cells_failed_to_be_activated[i].nr_cellid, b->cells_failed_to_be_activated[i].nr_cellid);
|
||||
@@ -1974,21 +2007,21 @@ bool eq_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration
|
||||
}
|
||||
// TNL Associations to setup
|
||||
_F1_EQ_CHECK_INT(a->noofTNLAssociations_to_setup, b->noofTNLAssociations_to_setup);
|
||||
for (int i = 0; i < a->noofTNLAssociations_to_setup; i++) {
|
||||
for (int i = 0; i < a->noofTNLAssociations_to_setup && i < F1AP_MAX_NO_OF_TNL_ASSOCIATIONS; i++) {
|
||||
// Explicit comparison of TNL Association fields
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_to_setup[i].tl_address, b->tnlAssociations_to_setup[i].tl_address);
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_to_setup[i].port, b->tnlAssociations_to_setup[i].port);
|
||||
}
|
||||
// TNL Associations failed to setup
|
||||
_F1_EQ_CHECK_INT(a->noofTNLAssociations_failed, b->noofTNLAssociations_failed);
|
||||
for (int i = 0; i < a->noofTNLAssociations_failed; i++) {
|
||||
for (int i = 0; i < a->noofTNLAssociations_failed && i < F1AP_MAX_NO_OF_TNL_ASSOCIATIONS; i++) {
|
||||
// Explicit comparison of TNL Association fields
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_failed[i].tl_address, b->tnlAssociations_failed[i].tl_address);
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_failed[i].port, b->tnlAssociations_failed[i].port);
|
||||
}
|
||||
// Dedicated SI Delivery Needed UE List
|
||||
_F1_EQ_CHECK_INT(a->noofDedicatedSIDeliveryNeededUEs, b->noofDedicatedSIDeliveryNeededUEs);
|
||||
for (int i = 0; i < a->noofDedicatedSIDeliveryNeededUEs; i++) {
|
||||
for (int i = 0; i < a->noofDedicatedSIDeliveryNeededUEs && i < F1AP_MAX_NO_UE_ID; i++) {
|
||||
_F1_EQ_CHECK_INT(a->dedicatedSIDeliveryNeededUEs[i].gNB_CU_ue_id, b->dedicatedSIDeliveryNeededUEs[i].gNB_CU_ue_id);
|
||||
if (!eq_f1ap_plmn(&a->dedicatedSIDeliveryNeededUEs[i].ue_plmn, &b->dedicatedSIDeliveryNeededUEs[i].ue_plmn))
|
||||
return false;
|
||||
@@ -2008,23 +2041,34 @@ f1ap_gnb_cu_configuration_update_acknowledge_t cp_f1ap_cu_configuration_update_a
|
||||
cp.transaction_id = msg->transaction_id;
|
||||
// number of cells failed to be activated
|
||||
cp.num_cells_failed_to_be_activated = msg->num_cells_failed_to_be_activated;
|
||||
for (int i = 0; i < cp.num_cells_failed_to_be_activated; i++)
|
||||
cp.cells_failed_to_be_activated = calloc_or_fail(cp.num_cells_failed_to_be_activated, sizeof(*cp.cells_failed_to_be_activated));
|
||||
for (int i = 0; i < cp.num_cells_failed_to_be_activated && i < F1AP_MAX_NB_CELLS; i++)
|
||||
cp.cells_failed_to_be_activated[i] = msg->cells_failed_to_be_activated[i];
|
||||
// TNL Associations to setup
|
||||
cp.noofTNLAssociations_to_setup = msg->noofTNLAssociations_to_setup;
|
||||
for (int i = 0; i < cp.noofTNLAssociations_to_setup; i++)
|
||||
for (int i = 0; i < cp.noofTNLAssociations_to_setup && i < F1AP_MAX_NO_OF_TNL_ASSOCIATIONS; i++)
|
||||
cp.tnlAssociations_to_setup[i] = msg->tnlAssociations_to_setup[i];
|
||||
// TNL Associations failed to setup
|
||||
cp.noofTNLAssociations_failed = msg->noofTNLAssociations_failed;
|
||||
for (int i = 0; i < cp.noofTNLAssociations_failed; i++)
|
||||
for (int i = 0; i < cp.noofTNLAssociations_failed && i < F1AP_MAX_NO_OF_TNL_ASSOCIATIONS; i++)
|
||||
cp.tnlAssociations_failed[i] = msg->tnlAssociations_failed[i];
|
||||
// Dedicated SI Delivery Needed UE List
|
||||
cp.noofDedicatedSIDeliveryNeededUEs = msg->noofDedicatedSIDeliveryNeededUEs;
|
||||
for (int i = 0; i < cp.noofDedicatedSIDeliveryNeededUEs; i++)
|
||||
cp.dedicatedSIDeliveryNeededUEs = calloc_or_fail(cp.noofDedicatedSIDeliveryNeededUEs, sizeof(*cp.dedicatedSIDeliveryNeededUEs));
|
||||
for (int i = 0; i < cp.noofDedicatedSIDeliveryNeededUEs && i < F1AP_MAX_NO_UE_ID; i++)
|
||||
cp.dedicatedSIDeliveryNeededUEs[i] = msg->dedicatedSIDeliveryNeededUEs[i];
|
||||
return cp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief F1 gNB-CU Configuration Update Acknowledge memory management
|
||||
*/
|
||||
void free_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration_update_acknowledge_t *msg)
|
||||
{
|
||||
free(msg->cells_failed_to_be_activated);
|
||||
free(msg->dedicatedSIDeliveryNeededUEs);
|
||||
}
|
||||
|
||||
/* ==================================
|
||||
* F1AP gNB-DU Configuration Ack
|
||||
* ================================== */
|
||||
@@ -2094,10 +2138,11 @@ bool decode_f1ap_du_configuration_update_acknowledge(const F1AP_F1AP_PDU_t *pdu,
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_Cells_to_be_Activated_List);
|
||||
F1AP_Cells_to_be_Activated_List_t *list = &ie->value.choice.Cells_to_be_Activated_List;
|
||||
out->num_cells_to_activate = list->list.count;
|
||||
for (int j = 0; j < out->num_cells_to_activate; j++) {
|
||||
out->cells_to_activate = calloc_or_fail(out->num_cells_to_activate, sizeof(*out->cells_to_activate));
|
||||
for (int j = 0; j < out->num_cells_to_activate && j < F1AP_MAX_NB_CELLS; j++) {
|
||||
const F1AP_Cells_to_be_Activated_List_ItemIEs_t *itemIE =
|
||||
(F1AP_Cells_to_be_Activated_List_ItemIEs_t *)list->list.array[j];
|
||||
decode_cells_to_activate(&out->cells_to_activate[0], itemIE);
|
||||
decode_cells_to_activate(&out->cells_to_activate[j], itemIE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2120,7 +2165,7 @@ bool eq_f1ap_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration
|
||||
// number of cells to activate
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
// loop over cells to activate
|
||||
for (int i = 0; i < a->num_cells_to_activate; i++) {
|
||||
for (int i = 0; i < a->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
_F1_EQ_CHECK_LONG(a->cells_to_activate[i].nr_cellid, b->cells_to_activate[i].nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].nrpci, b->cells_to_activate[i].nrpci);
|
||||
if (!eq_f1ap_plmn(&a->cells_to_activate[i].plmn, &b->cells_to_activate[i].plmn))
|
||||
@@ -2148,7 +2193,8 @@ f1ap_gnb_du_configuration_update_acknowledge_t cp_f1ap_du_configuration_update_a
|
||||
// number of cells to activate
|
||||
cp.num_cells_to_activate = msg->num_cells_to_activate;
|
||||
// Loop through cells to activate
|
||||
for (int i = 0; i < cp.num_cells_to_activate; i++) {
|
||||
cp.cells_to_activate = calloc_or_fail(cp.num_cells_to_activate, sizeof(*cp.cells_to_activate));
|
||||
for (int i = 0; i < cp.num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
cp.cells_to_activate[i] = msg->cells_to_activate[i];
|
||||
for (int s = 0; s < cp.cells_to_activate[i].num_SI; s++) {
|
||||
f1ap_sib_msg_t *cp_sib = &cp.cells_to_activate[i].SI_msg[s];
|
||||
@@ -2175,4 +2221,5 @@ void free_f1ap_du_configuration_update_acknowledge(const f1ap_gnb_du_configurati
|
||||
}
|
||||
}
|
||||
}
|
||||
free(msg->cells_to_activate);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ bool eq_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration
|
||||
const f1ap_gnb_cu_configuration_update_acknowledge_t *b);
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t cp_f1ap_cu_configuration_update_acknowledge(
|
||||
const f1ap_gnb_cu_configuration_update_acknowledge_t *msg);
|
||||
void free_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration_update_acknowledge_t *msg);
|
||||
|
||||
/* F1 gNB-DU Configuration Update Acknowledge */
|
||||
struct F1AP_F1AP_PDU *encode_f1ap_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration_update_acknowledge_t *msg);
|
||||
|
||||
@@ -244,8 +244,9 @@ static void test_f1ap_setup_request(void)
|
||||
.rrc_ver[0] = 12,
|
||||
.rrc_ver[1] = 34,
|
||||
.rrc_ver[2] = 56,
|
||||
.cell[0].info = info,
|
||||
};
|
||||
orig.cell = calloc_or_fail(orig.num_cells_available, sizeof(*orig.cell));
|
||||
orig.cell[0].info = info;
|
||||
orig.cell[0].sys_info = calloc_or_fail(1, sizeof(*orig.cell[0].sys_info));
|
||||
*orig.cell[0].sys_info = sys_info;
|
||||
// encode
|
||||
@@ -322,12 +323,14 @@ static void test_f1ap_setup_response(void)
|
||||
.rrc_ver[1] = 34,
|
||||
.rrc_ver[2] = 56,
|
||||
.num_cells_to_activate = 1,
|
||||
.cells_to_activate[0].nr_cellid = 123456,
|
||||
.cells_to_activate[0].nrpci = 1,
|
||||
.cells_to_activate[0].plmn.mcc = 12,
|
||||
.cells_to_activate[0].plmn.mnc = 123,
|
||||
.cells_to_activate[0].plmn.mnc_digit_length = 3,
|
||||
};
|
||||
/* Allocate memory for cells_to_activate array */
|
||||
orig.cells_to_activate = calloc_or_fail(orig.num_cells_to_activate, sizeof(*orig.cells_to_activate));
|
||||
orig.cells_to_activate[0].nr_cellid = 123456;
|
||||
orig.cells_to_activate[0].nrpci = 1;
|
||||
orig.cells_to_activate[0].plmn.mcc = 12;
|
||||
orig.cells_to_activate[0].plmn.mnc = 123;
|
||||
orig.cells_to_activate[0].plmn.mnc_digit_length = 3;
|
||||
/* Cells to activate */
|
||||
if (orig.num_cells_to_activate) {
|
||||
/* SI_container */
|
||||
@@ -556,30 +559,37 @@ static void test_f1ap_du_configuration_update(void)
|
||||
f1ap_gnb_du_configuration_update_t orig = {
|
||||
.transaction_id = 2,
|
||||
.num_cells_to_add = 1,
|
||||
.cell_to_add[0].info = info2,
|
||||
.num_cells_to_modify = 1,
|
||||
.cell_to_modify[0].info = info,
|
||||
.cell_to_modify[0].old_nr_cellid = 1235UL,
|
||||
.cell_to_modify[0].old_plmn.mcc = 208,
|
||||
.cell_to_modify[0].old_plmn.mnc = 88,
|
||||
.cell_to_modify[0].old_plmn.mnc_digit_length = 2,
|
||||
.num_cells_to_delete = 1,
|
||||
.cell_to_delete[0].nr_cellid = 1234UL,
|
||||
.cell_to_delete[0].plmn.mcc = 1,
|
||||
.cell_to_delete[0].plmn.mnc = 1,
|
||||
.cell_to_delete[0].plmn.mnc_digit_length = 3,
|
||||
.num_status = 2,
|
||||
.status[0].nr_cellid = 542UL,
|
||||
.status[0].plmn.mcc = 1,
|
||||
.status[0].plmn.mnc = 2,
|
||||
.status[0].plmn.mnc_digit_length = 3,
|
||||
.status[0].service_state = F1AP_STATE_IN_SERVICE,
|
||||
.status[1].nr_cellid = 33UL,
|
||||
.status[1].plmn.mcc = 5,
|
||||
.status[1].plmn.mnc = 13,
|
||||
.status[1].plmn.mnc_digit_length = 2,
|
||||
.status[1].service_state = F1AP_STATE_OUT_OF_SERVICE,
|
||||
};
|
||||
/* Allocate memory for arrays */
|
||||
orig.cell_to_add = calloc_or_fail(orig.num_cells_to_add, sizeof(*orig.cell_to_add));
|
||||
orig.cell_to_modify = calloc_or_fail(orig.num_cells_to_modify, sizeof(*orig.cell_to_modify));
|
||||
orig.cell_to_delete = calloc_or_fail(orig.num_cells_to_delete, sizeof(*orig.cell_to_delete));
|
||||
orig.status = calloc_or_fail(orig.num_status, sizeof(*orig.status));
|
||||
|
||||
/* Fill in the data */
|
||||
orig.cell_to_add[0].info = info2;
|
||||
orig.cell_to_modify[0].info = info;
|
||||
orig.cell_to_modify[0].old_nr_cellid = 1235UL;
|
||||
orig.cell_to_modify[0].old_plmn.mcc = 208;
|
||||
orig.cell_to_modify[0].old_plmn.mnc = 88;
|
||||
orig.cell_to_modify[0].old_plmn.mnc_digit_length = 2;
|
||||
orig.cell_to_delete[0].nr_cellid = 1234UL;
|
||||
orig.cell_to_delete[0].plmn.mcc = 1;
|
||||
orig.cell_to_delete[0].plmn.mnc = 1;
|
||||
orig.cell_to_delete[0].plmn.mnc_digit_length = 3;
|
||||
orig.status[0].nr_cellid = 542UL;
|
||||
orig.status[0].plmn.mcc = 1;
|
||||
orig.status[0].plmn.mnc = 2;
|
||||
orig.status[0].plmn.mnc_digit_length = 3;
|
||||
orig.status[0].service_state = F1AP_STATE_IN_SERVICE;
|
||||
orig.status[1].nr_cellid = 33UL;
|
||||
orig.status[1].plmn.mcc = 5;
|
||||
orig.status[1].plmn.mnc = 13;
|
||||
orig.status[1].plmn.mnc_digit_length = 2;
|
||||
orig.status[1].service_state = F1AP_STATE_OUT_OF_SERVICE;
|
||||
orig.cell_to_modify[0].sys_info = calloc_or_fail(1, sizeof(*orig.cell_to_modify[0].sys_info));
|
||||
*orig.cell_to_modify[0].sys_info = sys_info;
|
||||
orig.gNB_DU_ID = malloc_or_fail(sizeof(*orig.gNB_DU_ID));
|
||||
@@ -614,18 +624,18 @@ static void test_f1ap_du_configuration_update_acknowledge(void)
|
||||
f1ap_gnb_du_configuration_update_acknowledge_t orig = {
|
||||
.transaction_id = 5,
|
||||
.num_cells_to_activate = 1,
|
||||
.cells_to_activate = {{
|
||||
.nr_cellid = 987654321,
|
||||
.nrpci = 50,
|
||||
.plmn = {.mcc = 001, .mnc = 01, .mnc_digit_length = 2},
|
||||
.num_SI = 1,
|
||||
.SI_msg = {{
|
||||
.SI_type = 7,
|
||||
.SI_container_length = 10,
|
||||
.SI_container = malloc(sizeof(uint8_t) * 10),
|
||||
}},
|
||||
}},
|
||||
};
|
||||
// Allocate memory for cells_to_activate array
|
||||
orig.cells_to_activate = calloc_or_fail(orig.num_cells_to_activate, sizeof(*orig.cells_to_activate));
|
||||
orig.cells_to_activate[0].nr_cellid = 987654321;
|
||||
orig.cells_to_activate[0].nrpci = 50;
|
||||
orig.cells_to_activate[0].plmn.mcc = 001;
|
||||
orig.cells_to_activate[0].plmn.mnc = 01;
|
||||
orig.cells_to_activate[0].plmn.mnc_digit_length = 2;
|
||||
orig.cells_to_activate[0].num_SI = 1;
|
||||
orig.cells_to_activate[0].SI_msg[0].SI_type = 7;
|
||||
orig.cells_to_activate[0].SI_msg[0].SI_container_length = 10;
|
||||
orig.cells_to_activate[0].SI_msg[0].SI_container = malloc(sizeof(uint8_t) * 10);
|
||||
for (int i = 0; i < orig.cells_to_activate[0].SI_msg[0].SI_container_length; i++) {
|
||||
orig.cells_to_activate[0].SI_msg[0].SI_container[i] = i;
|
||||
}
|
||||
@@ -657,17 +667,21 @@ static void test_f1ap_du_configuration_update_acknowledge(void)
|
||||
static void test_f1ap_cu_configuration_update(void)
|
||||
{
|
||||
/* create message */
|
||||
f1ap_gnb_cu_configuration_update_t orig = {.transaction_id = 2,
|
||||
.num_cells_to_activate = 1,
|
||||
.cells_to_activate = {{.nr_cellid = 123456789,
|
||||
.nrpci = 100,
|
||||
.plmn = {.mcc = 001, .mnc = 01, .mnc_digit_length = 2},
|
||||
.num_SI = 1,
|
||||
.SI_msg = {{
|
||||
.SI_type = 7,
|
||||
.SI_container_length = 10,
|
||||
.SI_container = malloc(sizeof(uint8_t) * 10),
|
||||
}}}}};
|
||||
f1ap_gnb_cu_configuration_update_t orig = {
|
||||
.transaction_id = 2,
|
||||
.num_cells_to_activate = 1,
|
||||
};
|
||||
// Allocate memory for cells_to_activate array
|
||||
orig.cells_to_activate = calloc_or_fail(orig.num_cells_to_activate, sizeof(*orig.cells_to_activate));
|
||||
orig.cells_to_activate[0].nr_cellid = 123456789;
|
||||
orig.cells_to_activate[0].nrpci = 100;
|
||||
orig.cells_to_activate[0].plmn.mcc = 001;
|
||||
orig.cells_to_activate[0].plmn.mnc = 01;
|
||||
orig.cells_to_activate[0].plmn.mnc_digit_length = 2;
|
||||
orig.cells_to_activate[0].num_SI = 1;
|
||||
orig.cells_to_activate[0].SI_msg[0].SI_type = 7;
|
||||
orig.cells_to_activate[0].SI_msg[0].SI_container_length = 10;
|
||||
orig.cells_to_activate[0].SI_msg[0].SI_container = malloc(sizeof(uint8_t) * 10);
|
||||
F1AP_F1AP_PDU_t *f1enc = encode_f1ap_cu_configuration_update(&orig);
|
||||
F1AP_F1AP_PDU_t *f1dec = f1ap_encode_decode(f1enc);
|
||||
f1ap_msg_free(f1enc);
|
||||
@@ -697,10 +711,14 @@ static void test_f1ap_cu_configuration_update_acknowledge(void)
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t orig = {
|
||||
.transaction_id = 2,
|
||||
.num_cells_failed_to_be_activated = 1,
|
||||
.cells_failed_to_be_activated = {{.nr_cellid = 123456789,
|
||||
.plmn = {.mcc = 001, .mnc = 01, .mnc_digit_length = 2},
|
||||
.cause = F1AP_CAUSE_RADIO_NETWORK}}
|
||||
};
|
||||
};
|
||||
// Allocate memory for cells_failed_to_be_activated array
|
||||
orig.cells_failed_to_be_activated = calloc_or_fail(orig.num_cells_failed_to_be_activated, sizeof(*orig.cells_failed_to_be_activated));
|
||||
orig.cells_failed_to_be_activated[0].nr_cellid = 123456789;
|
||||
orig.cells_failed_to_be_activated[0].plmn.mcc = 001;
|
||||
orig.cells_failed_to_be_activated[0].plmn.mnc = 01;
|
||||
orig.cells_failed_to_be_activated[0].plmn.mnc_digit_length = 2;
|
||||
orig.cells_failed_to_be_activated[0].cause = F1AP_CAUSE_RADIO_NETWORK;
|
||||
// F1AP Enc/dec
|
||||
F1AP_F1AP_PDU_t *f1enc = encode_f1ap_cu_configuration_update_acknowledge(&orig);
|
||||
F1AP_F1AP_PDU_t *f1dec = f1ap_encode_decode(f1enc);
|
||||
@@ -713,13 +731,14 @@ static void test_f1ap_cu_configuration_update_acknowledge(void)
|
||||
// Equality check
|
||||
ret = eq_f1ap_cu_configuration_update_acknowledge(&orig, &decoded);
|
||||
AssertFatal(ret, "eq_f1ap_cu_configuration_update_acknowledge(): decoded message doesn't match\n");
|
||||
// No free needed
|
||||
free_f1ap_cu_configuration_update_acknowledge(&decoded);
|
||||
// Deep copy
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t cp = cp_f1ap_cu_configuration_update_acknowledge(&orig);
|
||||
// Equality check
|
||||
ret = eq_f1ap_cu_configuration_update_acknowledge(&orig, &cp);
|
||||
AssertFatal(ret, "eq_f1ap_cu_configuration_update_acknowledge(): copied message doesn't match\n");
|
||||
// No free needed
|
||||
free_f1ap_cu_configuration_update_acknowledge(&cp);
|
||||
free_f1ap_cu_configuration_update_acknowledge(&orig);
|
||||
}
|
||||
|
||||
static byte_array_t get_test_ba(const char *s)
|
||||
|
||||
@@ -1161,6 +1161,7 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
|
||||
req->gNB_DU_id = id;
|
||||
req->gNB_DU_name = strdup(name);
|
||||
req->num_cells_available = 1;
|
||||
req->cell = calloc_or_fail(req->num_cells_available, sizeof(*req->cell));
|
||||
req->cell[0].info = *info;
|
||||
LOG_I(GNB_APP,
|
||||
"F1AP: gNB idx %d gNB_DU_id %ld, gNB_DU_name %s, TAC %d MCC/MNC/length %d/%d/%d cellID %ld\n",
|
||||
|
||||
@@ -1093,14 +1093,17 @@ void prepare_du_configuration_update(gNB_MAC_INST *mac,
|
||||
{
|
||||
/* send gNB-DU configuration update to RRC */
|
||||
f1ap_gnb_du_configuration_update_t update = {
|
||||
.transaction_id = 1,
|
||||
.num_status = 1,
|
||||
.status[0].plmn = info->plmn,
|
||||
.status[0].nr_cellid = info->nr_cellid,
|
||||
.status[0].service_state = F1AP_STATE_IN_SERVICE,
|
||||
.transaction_id = 1,
|
||||
.num_status = 1,
|
||||
.status = calloc_or_fail(1, sizeof(f1ap_cell_status_t)),
|
||||
};
|
||||
update.status[0].plmn = info->plmn;
|
||||
update.status[0].nr_cellid = info->nr_cellid;
|
||||
update.status[0].service_state = F1AP_STATE_IN_SERVICE;
|
||||
|
||||
if (mib && sib1) {
|
||||
update.num_cells_to_modify = 1,
|
||||
update.num_cells_to_modify = 1;
|
||||
update.cell_to_modify = calloc_or_fail(1, sizeof(*update.cell_to_modify));
|
||||
update.cell_to_modify[0].old_nr_cellid = info->nr_cellid;
|
||||
update.cell_to_modify[0].info = *info;
|
||||
update.cell_to_modify[0].sys_info = get_sys_info(mib, sib1, NULL);
|
||||
|
||||
@@ -436,7 +436,8 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
|
||||
|
||||
f1ap_setup_resp_t resp = {.transaction_id = req->transaction_id,
|
||||
.num_cells_to_activate = 1,
|
||||
.cells_to_activate[0] = cell};
|
||||
.cells_to_activate = calloc_or_fail(1, sizeof(*resp.cells_to_activate))};
|
||||
resp.cells_to_activate[0] = cell;
|
||||
int num = read_version(TO_STRING(NR_RRC_VERSION), &resp.rrc_ver[0], &resp.rrc_ver[1], &resp.rrc_ver[2]);
|
||||
AssertFatal(num == 3, "could not read RRC version string %s\n", TO_STRING(NR_RRC_VERSION));
|
||||
if (rrc->node_name != NULL)
|
||||
|
||||
Reference in New Issue
Block a user