- do{
- ret = cmInetSocket(socket_type, &sockFd, IPPROTO_SCTP,(sctpCfg->duIpAddr.ipV4Pres ? CM_INET_IPV4_DOMAIN : CM_INET_IPV6_DOMAIN));
- if (ret != ROK)
- {
- numRetry++;
- if(numRetry >= MAX_RETRY)
- {
- printf("\nAll attempts to open socket failed.");
- /* Send indication to du_app */
- RETVALUE(RFAILED);
- }
- else
- {
- printf("\nRetrying socket opening");
- }
- }
- else
- {
- printf("\nSocket[%d] opened successfully",sockFd.fd);
- break;
- }
- }while(numRetry < MAX_RETRY);
+uint8_t duSctpCfgReq(SctpParams sctpCfg)
+{
+ uint8_t ret = ROK;
+ CmStatus cfm;
+
+#ifdef CALL_FLOW_DEBUG_LOG
+ DU_LOG("\nCall Flow: ENTDUAPP -> ENTSCTP : EVENT_CFG_REQ_TO_SCTP\n");
+#endif
+/* Fill F1 Params */
+ f1Params.destIpAddr.ipV4Pres = sctpCfg.cuIpAddr.ipV4Pres;
+ f1Params.destIpAddr.ipV4Addr = sctpCfg.cuIpAddr.ipV4Addr;
+ f1Params.destPort = sctpCfg.cuPort;
+ f1Params.itfState = DU_SCTP_DOWN;
+ f1Params.srcPort = sctpCfg.duPort[F1_INTERFACE];
+ f1Params.recvMsgSet = ROK;
+ memset (&f1Params.sockFd, -1, sizeof(CmInetFd));
+ fillDestNetAddr(&f1Params.destIpNetAddr, &f1Params.destIpAddr);
+ fillAddrLst(&f1Params.destAddrLst, &f1Params.destIpAddr);
+
+/* Fill RIC Params */
+ ricParams.destIpAddr.ipV4Pres = sctpCfg.ricIpAddr.ipV4Pres;
+ ricParams.destIpAddr.ipV4Addr = sctpCfg.ricIpAddr.ipV4Addr;
+ ricParams.destPort = sctpCfg.ricPort;
+ ricParams.itfState = DU_SCTP_DOWN;
+ ricParams.srcPort = sctpCfg.duPort[E2_INTERFACE];
+ ricParams.recvMsgSet = ROK;
+ memset (&ricParams.sockFd, -1, sizeof(CmInetFd));
+ fillDestNetAddr(&ricParams.destIpNetAddr, &ricParams.destIpAddr);
+ fillAddrLst(&ricParams.destAddrLst, &ricParams.destIpAddr);
+
+/* Fill AddressList */
+ fillAddrLst(&localAddrLst, &sctpCfg.duIpAddr);
+
+/* Set polling to FALSE */
+ pollingState = FALSE;
+
+/* Fill Cfm Status */
+ cfm.status = LCM_PRIM_OK;
+ cfm.reason = LCM_REASON_NOT_APPL;
+
+ ret = duCheckReqStatus(&cfm);
+
+ return (ret);
+}
+
+/*******************************************************************
+ *
+ * @brief Fills the address List of the source Ip Address
+ *
+ * @details
+ *
+ * Function : fillAddrLst
+ *
+ * Functionality:
+ * Fills the address List of source Ip Address
+ *
+ * @params[in] CmInetNetAddrLst *addrLstPtr, Address List pointer
+ * @params[in] F1IpAddr *srcIpAddr, src Ip Adrress to be filled in the Address List
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/