Commit b26dcc1e authored by Robert Schmidt's avatar Robert Schmidt

Store E1 Setup Request at RRC

parent 23eaea4b
......@@ -405,8 +405,13 @@ static int create_gNB_tasks(ngran_node_t node_type)
instance_t inst = 0;
createE1inst(UPtype, inst, &E1AP_REGISTER_REQ(msg).net_config, NULL);
cuup_init_n3(inst);
itti_free(TASK_UNKNOWN, msg);
RC.nrrrc[gnb_id_start]->e1_inst = inst; // stupid instance !!!*/
/* send E1 Setup Request to RRC */
MessageDef *new_msg = itti_alloc_new_message(TASK_GNB_APP, 0, E1AP_SETUP_REQ);
E1AP_SETUP_REQ(new_msg) = E1AP_REGISTER_REQ(msg).setup_req;
itti_send_msg_to_task(TASK_RRC_GNB, 0 /*unused by callee*/, new_msg);
itti_free(TASK_UNKNOWN, msg);
}
//Use check on x2ap to consider the NSA scenario
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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);
......
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