X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_f1ap_msg_hdl.c;h=3e78cfc3d1f2e8b4e8abb2fc3b3bef8d4628311e;hb=8660dd47a5ef27b62300fabf6b027852f1d5d026;hp=2dd414b8a1becc4b9db849b3f8da118c27863f05;hpb=958e8b2edbd1e0681419ad86aa0775c88981282c;p=o-du%2Fl2.git diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 2dd414b8a..3e78cfc3d 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -22,35 +22,12 @@ #include "du_cfg.h" #include "du_cell_mgr.h" #include "du_f1ap_msg_hdl.h" +#include "GNB-DU-System-Information.h" -char encBuf[ENC_BUF_MAX_LEN]; +extern char encBuf[ENC_BUF_MAX_LEN]; extern DuCfgParams duCfgParam; -/******************************************************************* - * - * @brief Writes the encoded chunks into a buffer - * - * @details - * - * Function : PrepFinalEncBuf - * - * Functionality:Fills the encoded buffer - * - * @params[in] void *buffer,initial encoded data - * @params[in] size_t size,size of buffer - * @params[in] void *encodedBuf,final buffer - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -static int PrepFinalEncBuf(const void *buffer, size_t size, void *encodedBuf) -{ - memcpy(encodedBuf + encBufSize, buffer, size); - encBufSize += size; - return 0; -} /* PrepFinalEncBuf */ - /******************************************************************* * * @brief Builds Uplink Info for NR @@ -861,7 +838,48 @@ S16 BuildServedCellList(GNB_DU_Served_Cells_List_t *duServedCell) RETVALUE(RFAILED); } srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf[0] = \ - duCfgParam.srvdCellLst[0].duCellInfo.measTimeCfg; + duCfgParam.srvdCellLst[0].duCellInfo.measTimeCfg; + + /* GNB DU System Information */ + DU_ALLOC(srvCellItem->gNB_DU_System_Information, + sizeof(GNB_DU_System_Information_t)); + if(!srvCellItem->gNB_DU_System_Information) + { + DU_LOG("\nF1AP: Memory allocation failure for GNB_DU_System_Information"); + return RFAILED; + } + /* MIB */ + srvCellItem->gNB_DU_System_Information->mIB_message.size =\ + strlen(duCfgParam.srvdCellLst[0].duSysInfo.mibMsg); + DU_ALLOC(srvCellItem->gNB_DU_System_Information->mIB_message.buf, + srvCellItem->gNB_DU_System_Information->mIB_message.size); + if(!srvCellItem->gNB_DU_System_Information->mIB_message.buf) + { + DU_LOG("\nF1AP: Memory allocation failure for mIB message"); + return RFAILED; + } + strcpy(srvCellItem->gNB_DU_System_Information->mIB_message.buf, + duCfgParam.srvdCellLst[0].duSysInfo.mibMsg); + + /* SIB1 */ + srvCellItem->gNB_DU_System_Information->sIB1_message.size =\ + encBufSize; + DU_ALLOC(srvCellItem->gNB_DU_System_Information->sIB1_message.buf, + srvCellItem->gNB_DU_System_Information->sIB1_message.size); + if(!srvCellItem->gNB_DU_System_Information->sIB1_message.buf) + { + DU_LOG("\nF1AP: Memory allocation failure for SIB1 message"); + return RFAILED; + } + for(int x=0; xgNB_DU_System_Information->sIB1_message.size; x++) + { + srvCellItem->gNB_DU_System_Information->sIB1_message.buf[x]=\ + duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg[x]; + } + /* Free memory */ + DU_FREE(duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, encBufSize); + DU_FREE(duCfgParam.srvdCellLst[0].duSysInfo.mibMsg, + strlen(duCfgParam.srvdCellLst[0].duSysInfo.mibMsg)); RETVALUE(ROK); } /******************************************************************* @@ -976,7 +994,7 @@ S16 SendF1APMsg(Region region, Pool pool) { SPrntMsg(mBuf, 0,0); - if(sctpSend(mBuf) != ROK) + if(sctpSend(mBuf, duCfgParam.sctpParams.itfType.f1Itf) != ROK) { DU_LOG("\nF1AP : SCTP Send failed"); SPutMsg(mBuf);