/* This file contains F1AP message handler functions */
+#include "du_mgr.h"
#include "du_mgr_main.h"
-#include "du_cfg.h"
#include "du_cell_mgr.h"
#include "du_f1ap_msg_hdl.h"
#include "GNB-DU-System-Information.h"
dlnrfreq->freqBandListNr.list.array[idx]->supportedSULBandList.list.count = SUL_BAND_COUNT;
RETVALUE(ROK);
}
-/*******************************************************************
- *
- * @brief Builds PLMN ID
- *
- * @details
- *
- * Function : BuildPlmn
- *
- * Functionality: Building the PLMN ID
- *
- * @params[in] PLMNID plmn
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-S16 BuildPlmn(PlmnId plmn, OCTET_STRING_t *plmnid)
-{
- U8 mncCnt;
- plmnid->size = 3;
- DU_ALLOC(plmnid->buf, plmnid->size * sizeof(U8));
- if(plmnid->buf == NULLP)
- {
- RETVALUE(RFAILED);
- }
- mncCnt = 2;
- plmnid->buf[0] = ((plmn.mcc[1] << 4) | (plmn.mcc[0]));
- if(mncCnt == 2)
- {
- plmnid->buf[1] = ((0xf0) | (plmn.mcc[2]));
- plmnid->buf[2] = ((plmn.mnc[1] << 4) | (plmn.mnc[0]));
- }
- else
- {
- plmnid->buf[1] = ((plmn.mnc[0] << 4) | (plmn.mcc[2]));
- plmnid->buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1]));
- }
- RETVALUE(ROK);
-}
-/*******************************************************************
- *
- * @brief Builds NRCell ID
- *
- * @details
- *
- * Function : BuildNrCellId
- *
- * Functionality: Building the NR Cell ID
- *
- * @params[in] BIT_STRING_t *nrcell
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-S16 BuildNrCellId(BIT_STRING_t *nrcell)
-{
- U8 tmp;
- nrcell->size = 5;
- DU_ALLOC(nrcell->buf, nrcell->size * sizeof(U8));
- if(nrcell->buf == NULLP)
- {
- RETVALUE(RFAILED);
- }
- for (tmp = 0 ; tmp < nrcell->size-1; tmp++)
- {
- nrcell->buf[tmp] = 0;
- }
- nrcell->buf[4] = 16;//change this
- nrcell->bits_unused = 4;
- RETVALUE(ROK);
-}
/*******************************************************************
*
* @brief Builds Nrcgi
S16 BuildNrcgi(NRCGI_t *nrcgi)
{
S16 ret;
+ U8 unused = 4;
+ U8 byteSize = 5;
+ U8 val = 16;
+
GNB_DU_Served_Cells_Item_t *srvCellItem;
- ret = BuildPlmn(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+ /* Allocate Buffer Memory */
+ nrcgi->pLMN_Identity.size = PLMN_SIZE * sizeof(U8);
+ DU_ALLOC(nrcgi->pLMN_Identity.buf, nrcgi->pLMN_Identity.size);
+ ret = buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
&nrcgi->pLMN_Identity); // Building PLMN function
if(ret != ROK)
{
RETVALUE(RFAILED);
}
/*nrCellIdentity*/
- ret = BuildNrCellId(&nrcgi->nRCellIdentity);
+ //ret = BuildNrCellId(&nrcgi->nRCellIdentity);
+ nrcgi->nRCellIdentity.size = byteSize * sizeof(U8);
+ DU_ALLOC(nrcgi->nRCellIdentity.buf, nrcgi->nRCellIdentity.size);
+ ret = fillBitString(&nrcgi->nRCellIdentity, unused, byteSize, val);
+
if(ret != ROK)
{
DU_FREE(srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
RETVALUE(RFAILED);
}
}
- ret = BuildPlmn(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+ /* Allocate Memory to Buffer */
+ srvplmn->list.array[0]->pLMN_Identity.size = PLMN_SIZE * sizeof(U8);
+ DU_ALLOC(srvplmn->list.array[0]->pLMN_Identity.buf, srvplmn->list.array[0]->pLMN_Identity.size);
+ ret = buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
&srvplmn->list.array[0]->pLMN_Identity);
if(ret!= ROK)
{
{
SPrntMsg(mBuf, 0,0);
- if(sctpSend(mBuf) != ROK)
+ if(sctpSend(mBuf, F1_INTERFACE) != ROK)
{
DU_LOG("\nF1AP : SCTP Send failed");
SPutMsg(mBuf);
RETVALUE(ROK);
}/* End of BuildAndSendF1SetupReq */
-/*******************************************************************
- *
- * @brief Builds the PLMN Id
- *
- * @details
- *
- * Function : plmnBuild
- *
- * Functionality: Builds the PLMN Id
- *
- * @params[in] PlmnId plmn
- * @params[in] OCTET_STRING_t *octe
- *
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-void plmnBuild(PlmnId plmn, OCTET_STRING_t *octe)
-{
- U8 mncCnt;
- mncCnt = 2;
- octe->buf[0] = ((plmn.mcc[1] << 4) | (plmn.mcc[0]));
- if(mncCnt == 2)
- {
- octe->buf[1] = ((0xf0) | (plmn.mcc[2]));
- octe->buf[2] = ((plmn.mnc[1] << 4) | (plmn.mnc[0]));
- }
- else
- {
- octe->buf[1] = ((plmn.mnc[0] << 4) | (plmn.mcc[2]));
- octe->buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1]));
- }
-}
-
/*******************************************************************
*
* @brief Builds and sends the DUConfigUpdate
RETVALUE(RFAILED);
}
}
- plmnBuild(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+ buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
&modifyItem->oldNRCGI.pLMN_Identity);
/*nRCellIdentity*/
modifyItem->oldNRCGI.nRCellIdentity.size = 5;
DU_FREE(f1apDuCfg, sizeof(F1AP_PDU_t));
RETVALUE(RFAILED);
}
- plmnBuild(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+ buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
&modifyItem->served_Cell_Information.nRCGI.pLMN_Identity);
modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size = 5;
DU_ALLOC(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
DU_FREE(f1apDuCfg, sizeof(F1AP_PDU_t));
RETVALUE(RFAILED);
}
- plmnBuild(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.plmn[0],\
+ buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.plmn[0],\
&modifyItem->served_Cell_Information.servedPLMNs.list.array[0]->pLMN_Identity);
DU_ALLOC(modifyItem->served_Cell_Information.servedPLMNs.list.\
array[0]->iE_Extensions,sizeof(struct ProtocolExtensionContainer_4624P3));