*******************************************************************************/
/* 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"
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
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;
return RFAILED;
}
- numOctets = (bitString->size + 7 )/8;
- for(idx=0; idx< numOctets; idx++)
+ for(idx=0; idx<bitString->size-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;
}