X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_f1ap_msg_hdl.c;h=713db1c071517cfc4c31257a1765e047cbb6fcad;hb=571b7d1991b8ea5cc64a76f38940d5ac9b4b84e2;hp=65e6725b8c84bda3e53f7fdce666b0f8d23f6fbd;hpb=3235ecfc7414aa0b72d0ad50db63ae8b5626045b;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 65e6725b8..713db1c07 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -19,38 +19,15 @@ /* This file contains F1AP message handler functions */ #include "du_mgr_main.h" -#include "du_cfg_hdl.h" +#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, F1_INTERFACE) != ROK) { DU_LOG("\nF1AP : SCTP Send failed"); SPutMsg(mBuf);