X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcu_stub%2Fcu_stub.c;h=11b7a4e755939afb3c7394dc76aeba49da52de25;hb=18d42ac8b0075fbb0a1bb3f6aaff17d447e95204;hp=8dafe67d28001412b9f63d0c59a8799506a8b61f;hpb=c548e17125cafaa528acd0f040f93c188b00a488;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_stub.c b/src/cu_stub/cu_stub.c index 8dafe67d2..11b7a4e75 100644 --- a/src/cu_stub/cu_stub.c +++ b/src/cu_stub/cu_stub.c @@ -20,6 +20,8 @@ #include "common_def.h" #include "cu_stub_sctp.h" #include "cu_stub_egtp.h" +#include "OCTET_STRING.h" +#include "cu_f1ap_msg_hdl.h" #include "cu_stub.h" #ifdef O1_ENABLE @@ -28,11 +30,62 @@ #ifdef O1_ENABLE - extern StartupConfig g_cfg; - #endif +/******************************************************************* + * + * @brief Fetches pointer to DU Database + * + * @details + * + * Function : getDuDb + * + * Functionality: + * Searches and returns pointer to DU structure based on DU Id + * + * @params[in] DU Id + * @return Pointer to DU Db + * + ******************************************************************/ +DuDb* getDuDb(uint32_t duId) +{ + uint8_t duIdx; + for(duIdx=0; duIdx < cuCb.numDu; duIdx++) + { + if(cuCb.duInfo[duIdx].duId == duId) + return (&cuCb.duInfo[duIdx]); + } + return NULLP; +} + +/******************************************************************* + * + * @brief Fetches pointer to Cell Cb + * + * @details + * + * Function : getCellCb + * + * Functionality: + * Searches for a cell within a DU based on NR cell Id + * Returns pointer to this cell Cb structure + * + * @params[in] Pointer to DU Db + * NR Cell ID + * @return Pointer to cell Cb + * + ******************************************************************/ +CuCellCb* getCellCb(DuDb *duDb, uint32_t cellId) +{ + uint8_t cellIdx; + for(cellIdx=0; cellIdx < duDb->numCells; cellIdx++) + { + if(duDb->cellCb[cellIdx].nrCellId == cellId) + return &(duDb->cellCb[cellIdx]); + } + return NULLP; +} /******************************************************************* *