Commit 02d99edf authored by Robert Schmidt's avatar Robert Schmidt

Fix cppcheck errors: RRC, F1AP

parent ede37e56
...@@ -965,7 +965,10 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, ...@@ -965,7 +965,10 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
struct rrc_eNB_ue_context_s *ue_context_p = struct rrc_eNB_ue_context_s *ue_context_p =
rrc_eNB_get_ue_context(RC.rrc[instance], rnti); rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, instance, ENB_FLAG_YES, rnti, 0, 0, instance);
if (ue_context_p) {
/* The following is normally done in the function rrc_rx_tx() */ /* The following is normally done in the function rrc_rx_tx() */
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance, rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance,
ue_context_p->ue_context.eNB_ue_s1ap_id); ue_context_p->ue_context.eNB_ue_s1ap_id);
...@@ -985,15 +988,13 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, ...@@ -985,15 +988,13 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
if (rrc_ue_s1ap_ids) if (rrc_ue_s1ap_ids)
rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids); rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids);
/* The following is normally done in the function release_UE_in_freeList() */
/* remove PDCP entry */
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, instance, ENB_FLAG_YES, rnti, 0, 0, instance);
pdcp_remove_UE(&ctxt);
/* trigger UE release in RRC */ /* trigger UE release in RRC */
if (ue_context_p)
rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p); rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p);
} else {
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
}
pdcp_remove_UE(&ctxt);
/* notify the agent */ /* notify the agent */
if (flexran_agent_get_rrc_xface(instance)) if (flexran_agent_get_rrc_xface(instance))
......
...@@ -563,7 +563,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, ...@@ -563,7 +563,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
//void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { //void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
instance_t du_mod_idP, instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data) { f1ap_setup_req_t *f1ap_setup_req) {
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_GNBDUConfigurationUpdate_t *out; F1AP_GNBDUConfigurationUpdate_t *out;
F1AP_GNBDUConfigurationUpdateIEs_t *ie; F1AP_GNBDUConfigurationUpdateIEs_t *ie;
...@@ -619,22 +619,22 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -619,22 +619,22 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &nRCGI.pLMN_Identity);
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n", LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
nRCGI.nRCellIdentity.buf[0], nRCGI.nRCellIdentity.buf[0],
nRCGI.nRCellIdentity.buf[1], nRCGI.nRCellIdentity.buf[1],
nRCGI.nRCellIdentity.buf[2], nRCGI.nRCellIdentity.buf[2],
nRCGI.nRCellIdentity.buf[3], nRCGI.nRCellIdentity.buf[3],
nRCGI.nRCellIdentity.buf[4]); nRCGI.nRCellIdentity.buf[4]);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
served_cell_information.nRCGI = nRCGI; served_cell_information.nRCGI = nRCGI;
/* - nRPCI */ /* - nRPCI */
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007 served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
(const char *) &f1ap_du_data->tac[i], (const char *) &f1ap_setup_req->tac[i],
3); 3);
/* - Configured_EPS_TAC */ /* - Configured_EPS_TAC */
...@@ -653,14 +653,14 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -653,14 +653,14 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* > PLMN BroadcastPLMNs Item */ /* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t)); F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t)); //memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item); ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
} }
// // /* - CHOICE NR-MODE-Info */ // // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info; F1AP_NR_Mode_Info_t nR_Mode_Info;
if ("FDD") { if (f1ap_setup_req->fdd_flag) {
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD; nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */ /* > FDD >> FDD Info */
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t)); F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
...@@ -778,9 +778,9 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -778,9 +778,9 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI; F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity);
served_cells_to_modify_item.oldNRCGI = oldNRCGI; served_cells_to_modify_item.oldNRCGI = oldNRCGI;
...@@ -790,17 +790,17 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -790,17 +790,17 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
served_cell_information.nRCGI = nRCGI; served_cell_information.nRCGI = nRCGI;
/* - nRPCI */ /* - nRPCI */
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007 served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
(const char *) &f1ap_du_data->tac[i], (const char *) &f1ap_setup_req->tac[i],
3); 3);
/* - Configured_EPS_TAC */ /* - Configured_EPS_TAC */
...@@ -819,14 +819,14 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -819,14 +819,14 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* > PLMN BroadcastPLMNs Item */ /* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t)); F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t)); //memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item); ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
} }
// // /* - CHOICE NR-MODE-Info */ // // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info; F1AP_NR_Mode_Info_t nR_Mode_Info;
if ("FDD") { if (f1ap_setup_req->fdd_flag) {
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD; nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */ /* > FDD >> FDD Info */
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t)); F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
...@@ -944,9 +944,9 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -944,9 +944,9 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI; F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity);
served_cells_to_delete_item.oldNRCGI = oldNRCGI; served_cells_to_delete_item.oldNRCGI = oldNRCGI;
/* ADD */ /* ADD */
...@@ -980,9 +980,9 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -980,9 +980,9 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
active_cells_item.nRCGI = nRCGI; active_cells_item.nRCGI = nRCGI;
/* ADD */ /* ADD */
......
...@@ -522,8 +522,6 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -522,8 +522,6 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
boolean_t ret = TRUE; boolean_t ret = TRUE;
mem_block_t *pdcp_pdu_p = NULL; mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(rrc_dl_sdu_len, __func__); pdcp_pdu_p = get_free_mem_block(rrc_dl_sdu_len, __func__);
memset(pdcp_pdu_p->data, 0, rrc_dl_sdu_len);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, rrc_dl_sdu_len);
//LOG_I(F1AP, "PRRCContainer size %lu:", ie->value.choice.RRCContainer.size); //LOG_I(F1AP, "PRRCContainer size %lu:", ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++) //for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
...@@ -535,6 +533,8 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -535,6 +533,8 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
if (pdcp_pdu_p != NULL) { if (pdcp_pdu_p != NULL) {
memset(pdcp_pdu_p->data, 0, rrc_dl_sdu_len);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, rrc_dl_sdu_len);
rlc_status = rlc_data_req(&ctxt rlc_status = rlc_data_req(&ctxt
, 1 , 1
, MBMS_FLAG_NO , MBMS_FLAG_NO
......
...@@ -301,8 +301,8 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) { ...@@ -301,8 +301,8 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) {
/* OPTIONAL */ /* OPTIONAL */
/* lCID */ /* lCID */
drbs_setup_item.lCID = (F1AP_LCID_t *)calloc(1, sizeof(F1AP_LCID_t)); //drbs_setup_item.lCID = (F1AP_LCID_t *)calloc(1, sizeof(F1AP_LCID_t));
drbs_setup_item.lCID = 0L; //drbs_setup_item.lCID = 1L;
for (j=0; for (j=0;
j<1; j<1;
......
...@@ -1179,7 +1179,7 @@ rrc_eNB_generate_SecurityModeCommand( ...@@ -1179,7 +1179,7 @@ rrc_eNB_generate_SecurityModeCommand(
rrc_eNB_mui, rrc_eNB_mui,
size); size);
if ((RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_DU) || if ((RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_DU) &&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_DU)) { (RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_DU)) {
LOG_I(RRC,"calling rrc_data_req :securityModeCommand\n"); LOG_I(RRC,"calling rrc_data_req :securityModeCommand\n");
...@@ -6507,8 +6507,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -6507,8 +6507,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
/* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE, /* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE); (ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
*/ */
if ( (RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) || if ( (RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) &&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU) || (RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU) &&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) { (RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
rrc_rlc_config_req(ctxt_pP, rrc_rlc_config_req(ctxt_pP,
SRB_FLAG_NO, SRB_FLAG_NO,
...@@ -7210,8 +7210,8 @@ rrc_eNB_decode_ccch( ...@@ -7210,8 +7210,8 @@ rrc_eNB_decode_ccch(
if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) { if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) {
LOG_I(RRC," S-TMSI exists, ue_context_p %p, old rnti %x => %x\n",ue_context_p,ue_context_p->ue_context.rnti,ctxt_pP->rnti); LOG_I(RRC," S-TMSI exists, ue_context_p %p, old rnti %x => %x\n",ue_context_p,ue_context_p->ue_context.rnti,ctxt_pP->rnti);
if ((RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) || if ((RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) &&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU) || (RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU) &&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) { (RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
rrc_mac_remove_ue(ctxt_pP->module_id, ue_context_p->ue_context.rnti); rrc_mac_remove_ue(ctxt_pP->module_id, ue_context_p->ue_context.rnti);
} }
......
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