NR RRC - RRCReestablishment - Reviewer comments

Changes
1. Passing function argument  by reference.
2. Use a pointer for ue->established_drbs[drb_id - 1] in generateDRB.
parent 5b35523c
...@@ -644,7 +644,7 @@ void fill_DRB_configList(const protocol_ctxt_t *const ctxt_pP, ...@@ -644,7 +644,7 @@ void fill_DRB_configList(const protocol_ctxt_t *const ctxt_pP,
nb_drb_to_setup--; nb_drb_to_setup--;
} else { } else {
generateDRB(ue_p, drb_id, &ue_p->pduSession[i], rrc->configuration.enable_sdap, rrc->security.do_drb_integrity, rrc->security.do_drb_ciphering); generateDRB(ue_p, drb_id, &ue_p->pduSession[i], rrc->configuration.enable_sdap, rrc->security.do_drb_integrity, rrc->security.do_drb_ciphering);
NR_DRB_ToAddMod_t *DRB_config = generateDRB_ASN1(ue_p->established_drbs[drb_id-1]); NR_DRB_ToAddMod_t *DRB_config = generateDRB_ASN1(&ue_p->established_drbs[drb_id-1]);
if (drb_id_to_setup_start == 0) if (drb_id_to_setup_start == 0)
drb_id_to_setup_start = DRB_config->drb_Identity; drb_id_to_setup_start = DRB_config->drb_Identity;
asn1cSeqAdd(&ue_p->DRB_configList->list, DRB_config); asn1cSeqAdd(&ue_p->DRB_configList->list, DRB_config);
...@@ -1374,7 +1374,7 @@ void RRCReestablishmentComplete_fill_DRB_configList(const protocol_ctxt_t *const ...@@ -1374,7 +1374,7 @@ void RRCReestablishmentComplete_fill_DRB_configList(const protocol_ctxt_t *const
for (int i = 0; i < NGAP_MAX_DRBS_PER_UE; i++) { for (int i = 0; i < NGAP_MAX_DRBS_PER_UE; i++) {
if (ue_p->established_drbs[i].status != DRB_INACTIVE) { if (ue_p->established_drbs[i].status != DRB_INACTIVE) {
ue_p->established_drbs[i].reestablishPDCP = NR_DRB_ToAddMod__reestablishPDCP_true; ue_p->established_drbs[i].reestablishPDCP = NR_DRB_ToAddMod__reestablishPDCP_true;
DRB_config = generateDRB_ASN1(ue_p->established_drbs[i]); DRB_config = generateDRB_ASN1(&ue_p->established_drbs[i]);
asn1cCallocOne(DRB_config->reestablishPDCP, NR_DRB_ToAddMod__reestablishPDCP_true); asn1cCallocOne(DRB_config->reestablishPDCP, NR_DRB_ToAddMod__reestablishPDCP_true);
asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config); asn1cSeqAdd(&(*DRB_configList2)->list, DRB_config);
} }
......
...@@ -45,56 +45,56 @@ void generateDRB(gNB_RRC_UE_t *ue, ...@@ -45,56 +45,56 @@ void generateDRB(gNB_RRC_UE_t *ue,
{ {
int i; int i;
int qos_flow_index; int qos_flow_index;
if (ue->established_drbs[drb_id - 1].status == DRB_INACTIVE) { drb_t *est_drb = &ue->established_drbs[drb_id - 1];
if (est_drb->status == DRB_INACTIVE) {
/* DRB Management */ /* DRB Management */
ue->established_drbs[drb_id - 1].drb_id = drb_id; est_drb->drb_id = drb_id;
ue->established_drbs[drb_id - 1].reestablishPDCP = -1; est_drb->reestablishPDCP = -1;
ue->established_drbs[drb_id - 1].recoverPDCP = -1; est_drb->recoverPDCP = -1;
for (i = 0; i < NGAP_MAX_DRBS_PER_UE; i++) { for (i = 0; i < NGAP_MAX_DRBS_PER_UE; i++) {
if ((ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.pdusession_id == 0 if ((est_drb->cnAssociation.sdap_config.pdusession_id == 0
|| ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.pdusession_id == pduSession->param.pdusession_id) || est_drb->cnAssociation.sdap_config.pdusession_id == pduSession->param.pdusession_id)
&& ue->established_drbs[drb_id - 1].defaultDRBid == 0) { && est_drb->defaultDRBid == 0) {
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.defaultDRB = true; est_drb->cnAssociation.sdap_config.defaultDRB = true;
ue->established_drbs[drb_id - 1].defaultDRBid = drb_id; est_drb->defaultDRBid = drb_id;
} }
} }
/* SDAP Configuration */ /* SDAP Configuration */
ue->established_drbs[drb_id - 1].cnAssociation.present = NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config; est_drb->cnAssociation.present = NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config;
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.pdusession_id = pduSession->param.pdusession_id; est_drb->cnAssociation.sdap_config.pdusession_id = pduSession->param.pdusession_id;
if (enable_sdap) { if (enable_sdap) {
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_present; est_drb->cnAssociation.sdap_config.sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_present;
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_present; est_drb->cnAssociation.sdap_config.sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_present;
} else { } else {
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_absent; est_drb->cnAssociation.sdap_config.sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_absent;
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_absent; est_drb->cnAssociation.sdap_config.sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_absent;
} }
for (qos_flow_index = 0; qos_flow_index < pduSession->param.nb_qos; qos_flow_index++) { for (qos_flow_index = 0; qos_flow_index < pduSession->param.nb_qos; qos_flow_index++) {
ue->established_drbs[drb_id - 1].cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] = est_drb->cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] = pduSession->param.qos[qos_flow_index].qfi;
pduSession->param.qos[qos_flow_index].qfi;
if (pduSession->param.qos[qos_flow_index].fiveQI > 5) if (pduSession->param.qos[qos_flow_index].fiveQI > 5)
ue->established_drbs[drb_id - 1].status = DRB_ACTIVE_NONGBR; est_drb->status = DRB_ACTIVE_NONGBR;
else else
ue->established_drbs[drb_id - 1].status = DRB_ACTIVE; est_drb->status = DRB_ACTIVE;
} }
/* PDCP Configuration */ /* PDCP Configuration */
ue->established_drbs[drb_id - 1].pdcp_config.discardTimer = NR_PDCP_Config__drb__discardTimer_infinity; est_drb->pdcp_config.discardTimer = NR_PDCP_Config__drb__discardTimer_infinity;
ue->established_drbs[drb_id - 1].pdcp_config.pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits; est_drb->pdcp_config.pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits;
ue->established_drbs[drb_id - 1].pdcp_config.pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits; est_drb->pdcp_config.pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits;
ue->established_drbs[drb_id - 1].pdcp_config.t_Reordering = NR_PDCP_Config__t_Reordering_ms100; est_drb->pdcp_config.t_Reordering = NR_PDCP_Config__t_Reordering_ms100;
ue->established_drbs[drb_id - 1].pdcp_config.headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed; est_drb->pdcp_config.headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
ue->established_drbs[drb_id - 1].pdcp_config.headerCompression.NotUsed = 0; est_drb->pdcp_config.headerCompression.NotUsed = 0;
if (do_drb_integrity) if (do_drb_integrity)
ue->established_drbs[drb_id - 1].pdcp_config.integrityProtection = NR_PDCP_Config__drb__integrityProtection_enabled; est_drb->pdcp_config.integrityProtection = NR_PDCP_Config__drb__integrityProtection_enabled;
else else
ue->established_drbs[drb_id - 1].pdcp_config.integrityProtection = 1; est_drb->pdcp_config.integrityProtection = 1;
if (do_drb_ciphering) if (do_drb_ciphering)
ue->established_drbs[drb_id - 1].pdcp_config.ext1.cipheringDisabled = 1; est_drb->pdcp_config.ext1.cipheringDisabled = 1;
else else
ue->established_drbs[drb_id - 1].pdcp_config.ext1.cipheringDisabled = NR_PDCP_Config__ext1__cipheringDisabled_true; est_drb->pdcp_config.ext1.cipheringDisabled = NR_PDCP_Config__ext1__cipheringDisabled_true;
} }
} }
NR_DRB_ToAddMod_t *generateDRB_ASN1(drb_t drb_asn1) NR_DRB_ToAddMod_t *generateDRB_ASN1(const drb_t *drb_asn1)
{ {
NR_DRB_ToAddMod_t *DRB_config = CALLOC(1, sizeof(*DRB_config)); NR_DRB_ToAddMod_t *DRB_config = CALLOC(1, sizeof(*DRB_config));
NR_SDAP_Config_t *SDAP_config = CALLOC(1, sizeof(NR_SDAP_Config_t)); NR_SDAP_Config_t *SDAP_config = CALLOC(1, sizeof(NR_SDAP_Config_t));
...@@ -104,39 +104,39 @@ NR_DRB_ToAddMod_t *generateDRB_ASN1(drb_t drb_asn1) ...@@ -104,39 +104,39 @@ NR_DRB_ToAddMod_t *generateDRB_ASN1(drb_t drb_asn1)
asn1cCalloc(DRB_config->pdcp_Config, pdcpConfig); asn1cCalloc(DRB_config->pdcp_Config, pdcpConfig);
asn1cCalloc(pdcpConfig->drb, drb); asn1cCalloc(pdcpConfig->drb, drb);
DRB_config->drb_Identity = drb_asn1.drb_id; DRB_config->drb_Identity = drb_asn1->drb_id;
association->present = drb_asn1.cnAssociation.present; association->present = drb_asn1->cnAssociation.present;
/* SDAP Configuration */ /* SDAP Configuration */
SDAP_config->pdu_Session = drb_asn1.cnAssociation.sdap_config.pdusession_id; SDAP_config->pdu_Session = drb_asn1->cnAssociation.sdap_config.pdusession_id;
SDAP_config->sdap_HeaderDL = drb_asn1.cnAssociation.sdap_config.sdap_HeaderDL; SDAP_config->sdap_HeaderDL = drb_asn1->cnAssociation.sdap_config.sdap_HeaderDL;
SDAP_config->sdap_HeaderUL = drb_asn1.cnAssociation.sdap_config.sdap_HeaderUL; SDAP_config->sdap_HeaderUL = drb_asn1->cnAssociation.sdap_config.sdap_HeaderUL;
SDAP_config->defaultDRB = drb_asn1.cnAssociation.sdap_config.defaultDRB; SDAP_config->defaultDRB = drb_asn1->cnAssociation.sdap_config.defaultDRB;
for (int qos_flow_index = 0; qos_flow_index < QOSFLOW_MAX_VALUE; qos_flow_index++) { for (int qos_flow_index = 0; qos_flow_index < QOSFLOW_MAX_VALUE; qos_flow_index++) {
if (drb_asn1.cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] != 0) { if (drb_asn1->cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index] != 0) {
asn1cSequenceAdd(sdapFlows->list, NR_QFI_t, qfi); asn1cSequenceAdd(sdapFlows->list, NR_QFI_t, qfi);
*qfi = drb_asn1.cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index]; *qfi = drb_asn1->cnAssociation.sdap_config.mappedQoS_FlowsToAdd[qos_flow_index];
} }
} }
association->choice.sdap_Config = SDAP_config; association->choice.sdap_Config = SDAP_config;
/* PDCP Configuration */ /* PDCP Configuration */
asn1cCallocOne(drb->discardTimer, drb_asn1.pdcp_config.discardTimer); asn1cCallocOne(drb->discardTimer, drb_asn1->pdcp_config.discardTimer);
asn1cCallocOne(drb->pdcp_SN_SizeUL, drb_asn1.pdcp_config.pdcp_SN_SizeUL); asn1cCallocOne(drb->pdcp_SN_SizeUL, drb_asn1->pdcp_config.pdcp_SN_SizeUL);
asn1cCallocOne(drb->pdcp_SN_SizeDL, drb_asn1.pdcp_config.pdcp_SN_SizeDL); asn1cCallocOne(drb->pdcp_SN_SizeDL, drb_asn1->pdcp_config.pdcp_SN_SizeDL);
asn1cCallocOne(pdcpConfig->t_Reordering, drb_asn1.pdcp_config.t_Reordering); asn1cCallocOne(pdcpConfig->t_Reordering, drb_asn1->pdcp_config.t_Reordering);
drb->headerCompression.present = drb_asn1.pdcp_config.headerCompression.present; drb->headerCompression.present = drb_asn1->pdcp_config.headerCompression.present;
drb->headerCompression.choice.notUsed = drb_asn1.pdcp_config.headerCompression.NotUsed; drb->headerCompression.choice.notUsed = drb_asn1->pdcp_config.headerCompression.NotUsed;
if (!drb_asn1.pdcp_config.integrityProtection) { if (!drb_asn1->pdcp_config.integrityProtection) {
asn1cCallocOne(drb->integrityProtection, drb_asn1.pdcp_config.integrityProtection); asn1cCallocOne(drb->integrityProtection, drb_asn1->pdcp_config.integrityProtection);
} }
if (!drb_asn1.pdcp_config.ext1.cipheringDisabled) { if (!drb_asn1->pdcp_config.ext1.cipheringDisabled) {
asn1cCalloc(pdcpConfig->ext1, ext1); asn1cCalloc(pdcpConfig->ext1, ext1);
asn1cCallocOne(ext1->cipheringDisabled, drb_asn1.pdcp_config.ext1.cipheringDisabled); asn1cCallocOne(ext1->cipheringDisabled, drb_asn1->pdcp_config.ext1.cipheringDisabled);
} }
return DRB_config; return DRB_config;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
/// @brief Generates an ASN1 DRB-ToAddMod, from the established_drbs in gNB_RRC_UE_t. /// @brief Generates an ASN1 DRB-ToAddMod, from the established_drbs in gNB_RRC_UE_t.
/// @param drb_t drb_asn1 /// @param drb_t drb_asn1
/// @return Returns the ASN1 DRB-ToAddMod structs. /// @return Returns the ASN1 DRB-ToAddMod structs.
NR_DRB_ToAddMod_t *generateDRB_ASN1(drb_t drb_asn1); NR_DRB_ToAddMod_t *generateDRB_ASN1(const drb_t *drb_asn1);
/// @brief Creates and stores a DRB in the gNB_RRC_UE_t struct, it doesn't create the actual entity, /// @brief Creates and stores a DRB in the gNB_RRC_UE_t struct, it doesn't create the actual entity,
/// to create the actual entity use the generateDRB_ASN1. /// to create the actual entity use the generateDRB_ASN1.
/// @param ue The gNB_RRC_UE_t struct that holds information for the UEs /// @param ue The gNB_RRC_UE_t struct that holds information for the UEs
......
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