X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_cfg.c;h=cbebd467706c5f19a6aa365afe26a8f4432b98fe;hb=ef711b0830aedde36f4a1beceed146d08e77ce58;hp=8113ccabdff451431c2fc0fc502d29e7cbdd59e9;hpb=d1ead035ab3b543810f1838b2519904bf84477ec;p=o-du%2Fl2.git diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index 8113ccabd..cbebd4677 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -17,7 +17,7 @@ *******************************************************************************/ /* This file contains all utility functions */ -#include "du_cfg.h" +#include "du_mgr.h" #include "MIB.h" #include "PLMN-IdentityInfo.h" #include "odu_common_codec.h" @@ -184,6 +184,32 @@ S16 readMacCfg() RETVALUE(ROK); } + +/******************************************************************* + * + * @brief Configures the DU Parameters + * + * @details + * + * Function : fillDuPort + * + * Functionality: + * - fills the DU Ports. + * + * @params[in] duPort array to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ + +S16 fillDuPort(U16 *duPort) +{ + duPort[F1_INTERFACE] = DU_PORT; /* DU Port idx 0 38472 */ + duPort[E2_INTERFACE] = RIC_PORT; /* RIC Port idx 1 38482 */ + + RETVALUE(ROK); +} + /******************************************************************* * * @brief Configures the DU Parameters @@ -205,23 +231,26 @@ S16 readMacCfg() S16 readCfg() { U8 i,j,k; - U32 ipv4_du, ipv4_cu; + U32 ipv4_du, ipv4_cu, ipv4_ric; MibParams mib; Sib1Params sib1; cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du); cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu); + cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric); + fillDuPort(duCfgParam.sctpParams.duPort); /* F1 DU IP Address and Port*/ - duCfgParam.sctpParams.duIpAddr.ipV4Pres = TRUE; duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du; - duCfgParam.sctpParams.duPort = DU_PORT; /* F1 CU IP Address and Port*/ - duCfgParam.sctpParams.cuIpAddr.ipV4Pres = TRUE; duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu; duCfgParam.sctpParams.cuPort = CU_PORT; + /* Fill RIC Params */ + duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric; + duCfgParam.sctpParams.ricPort = RIC_PORT; + /* EGTP Parameters */ duCfgParam.egtpParams.localIp.ipV4Pres = TRUE; @@ -509,15 +538,14 @@ S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val) return RFAILED; } - numOctets = (bitString->size + 7 )/8; - for(idx=0; idx< numOctets; idx++) + for(idx=0; idxsize-1; idx++) { *val |= bitString->buf[idx]; *val <<= 8; } - *val |= bitString->buf[numOctets -1]; - *val >>= ((numOctets * 8) - bitString->size); + *val |= bitString->buf[idx]; + *val >>= bitString->bits_unused; return ROK; }