Commit eee617aa authored by Robert Schmidt's avatar Robert Schmidt

F1AP code for gNB-DU configuration update

parent a09e09ea
...@@ -59,8 +59,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3 ...@@ -59,8 +59,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3
/* /*
* gNB-DU Configuration Update * gNB-DU Configuration Update
*/ */
int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, const f1ap_gnb_du_configuration_update_t *upd);
f1ap_setup_req_t *f1ap_du_data);
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
......
...@@ -170,6 +170,10 @@ void *F1AP_DU_task(void *arg) { ...@@ -170,6 +170,10 @@ void *F1AP_DU_task(void *arg) {
DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(assoc_id, &F1AP_UE_CONTEXT_MODIFICATION_REQUIRED(msg)); DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(assoc_id, &F1AP_UE_CONTEXT_MODIFICATION_REQUIRED(msg));
break; break;
case F1AP_GNB_DU_CONFIGURATION_UPDATE:
DU_send_gNB_DU_CONFIGURATION_UPDATE(assoc_id, &F1AP_GNB_DU_CONFIGURATION_UPDATE(msg));
break;
case TERMINATE_MESSAGE: case TERMINATE_MESSAGE:
LOG_W(F1AP, " *** Exiting F1AP thread\n"); LOG_W(F1AP, " *** Exiting F1AP thread\n");
itti_exit_task(); itti_exit_task();
......
...@@ -102,7 +102,35 @@ static void f1_setup_request_f1ap(const f1ap_setup_req_t *req) ...@@ -102,7 +102,35 @@ static void f1_setup_request_f1ap(const f1ap_setup_req_t *req)
static void gnb_du_configuration_update_f1ap(const f1ap_gnb_du_configuration_update_t *upd) static void gnb_du_configuration_update_f1ap(const f1ap_gnb_du_configuration_update_t *upd)
{ {
AssertFatal(false, "%s() not implemented\n", __func__); MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_GNB_DU_CONFIGURATION_UPDATE);
f1ap_gnb_du_configuration_update_t *f1_upd = &F1AP_GNB_DU_CONFIGURATION_UPDATE(msg);
f1_upd->transaction_id = upd->transaction_id;
AssertFatal(upd->num_cells_to_add == 0, "gNB-DU config update: cells to add not supported\n");
f1_upd->num_cells_to_modify = upd->num_cells_to_modify;
for (int n = 0; n < upd->num_cells_to_modify; ++n) {
f1_upd->cell_to_modify[n].old_plmn = upd->cell_to_modify[n].old_plmn;
f1_upd->cell_to_modify[n].old_nr_cellid = upd->cell_to_modify[n].old_nr_cellid;
f1_upd->cell_to_modify[n].info = upd->cell_to_modify[n].info;
if (upd->cell_to_modify[n].sys_info) {
f1ap_gnb_du_system_info_t *orig_sys_info = upd->cell_to_modify[n].sys_info;
f1ap_gnb_du_system_info_t *copy_sys_info = calloc(1, sizeof(*copy_sys_info));
f1_upd->cell_to_modify[n].sys_info = copy_sys_info;
copy_sys_info->mib = calloc(orig_sys_info->mib_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->mib != NULL, "out of memory\n");
memcpy(copy_sys_info->mib, orig_sys_info->mib, orig_sys_info->mib_length);
copy_sys_info->mib_length = orig_sys_info->mib_length;
if (orig_sys_info->sib1_length > 0) {
copy_sys_info->sib1 = calloc(orig_sys_info->sib1_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->sib1 != NULL, "out of memory\n");
memcpy(copy_sys_info->sib1, orig_sys_info->sib1, orig_sys_info->sib1_length);
copy_sys_info->sib1_length = orig_sys_info->sib1_length;
}
}
}
AssertFatal(upd->num_cells_to_delete == 0, "gNB-DU config update: cells to add not supported\n");
itti_send_msg_to_task(TASK_DU_F1, 0, msg);
} }
static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, const f1ap_ue_context_setup_t *resp) static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, const f1ap_ue_context_setup_t *resp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment