Store E1 Setup Request at RRC

This commit is contained in:
Robert Schmidt
2023-10-25 20:22:32 +02:00
parent 23eaea4b8d
commit b26dcc1ee5
4 changed files with 20 additions and 5 deletions
+3 -4
View File
@@ -305,15 +305,14 @@ void extract_SETUP_REQUEST(const E1AP_E1AP_PDU_t *pdu,
int e1apCUCP_handle_SETUP_REQUEST(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
extract_SETUP_REQUEST(pdu, &inst->setupReq);
/* Create ITTI message and send to queue */
MessageDef *msg_p = itti_alloc_new_message(TASK_CUCP_E1, 0 /*unused by callee*/, E1AP_SETUP_REQ);
memcpy(&E1AP_SETUP_REQ(msg_p), &inst->setupReq, sizeof(e1ap_setup_req_t));
extract_SETUP_REQUEST(pdu, &E1AP_SETUP_REQ(msg_p));
if (inst->setupReq.supported_plmns > 0) {
if (E1AP_SETUP_REQ(msg_p).supported_plmns > 0) {
itti_send_msg_to_task(TASK_RRC_GNB, 0 /*unused by callee*/, msg_p);
} else {
e1apCUCP_send_SETUP_FAILURE(inst->assoc_id, inst->setupReq.transac_id);
e1apCUCP_send_SETUP_FAILURE(inst->assoc_id, E1AP_SETUP_REQ(msg_p).transac_id);
itti_free(TASK_CUCP_E1, msg_p);
return -1;
}
+5
View File
@@ -371,6 +371,10 @@ typedef struct nr_rrc_du_container_t {
NR_SIB1_t *sib1;
} nr_rrc_du_container_t;
typedef struct nr_rrc_cuup_container_t {
e1ap_setup_req_t *setup_req;
} nr_rrc_cuup_container_t;
//---NR---(completely change)---------------------
typedef struct gNB_RRC_INST_s {
@@ -400,6 +404,7 @@ typedef struct gNB_RRC_INST_s {
cucp_cuup_if_t cucp_cuup;
nr_rrc_du_container_t *du;
nr_rrc_cuup_container_t *cuup;
} gNB_RRC_INST;
+6
View File
@@ -26,6 +26,7 @@ int rrc_gNB_process_e1_setup_req(e1ap_setup_req_t *req)
{
AssertFatal(req->supported_plmns <= PLMN_LIST_MAX_SIZE, "Supported PLMNs is more than PLMN_LIST_MAX_SIZE\n");
gNB_RRC_INST *rrc = RC.nrrrc[0];
AssertFatal(rrc->cuup == NULL, "cannot handle multiple CU-UPs\n");
for (int i = 0; i < req->supported_plmns; i++) {
@@ -41,6 +42,11 @@ int rrc_gNB_process_e1_setup_req(e1ap_setup_req_t *req)
}
}
LOG_I(RRC, "Accepting new CU-UP ID %ld name %s\n", req->gNB_cu_up_id, req->gNB_cu_up_name);
rrc->cuup = malloc(sizeof(*rrc->cuup));
AssertFatal(rrc->cuup, "out of memory\n");
rrc->cuup->setup_req = malloc(sizeof(*rrc->cuup->setup_req));
*rrc->cuup->setup_req = *req;
MessageDef *msg_p = itti_alloc_new_message(TASK_RRC_GNB, 0, E1AP_SETUP_RESP);
e1ap_setup_resp_t *resp = &E1AP_SETUP_RESP(msg_p);