CuSctpDestCb ricParams;
-/**************************************************************************
- * @brief Task Initiation callback function.
- *
- * @details
- *
- * Function : sctpActvInit
- *
- * Functionality:
- * This function is supplied as one of parameters during SCTP's
- * task registration. SSI will invoke this function once, after
- * it creates and attaches this TAPA Task to a system task.
- *
- * @param[in] Ent entity, the entity ID of this task.
- * @param[in] Inst inst, the instance ID of this task.
- * @param[in] Region region, the region ID registered for memory
- * usage of this task.
- * @param[in] Reason reason.
- * @return ROK - success
- * RFAILED - failure
- ***************************************************************************/
-S16 sctpActvInit()
-{
- DU_LOG("\n\nSCTP : Initializing");
- connUp = FALSE;
- assocId = 0;
- nonblocking = FALSE;
- sctpCfg = cuCfgParams.sctpParams;
- return ROK;
-
-}
-/**************************************************************************
- * @brief Task Activation callback function.
- *
- * @details
- *
- * Function : sctpActvTsk
- *
- * Functionality:
- * This function handles all SCTP messages received
- * This API is registered with SSI during the
- * Task Registration of DU APP.
- *
- * @param[in] Pst *pst, Post structure of the primitive.
- * @param[in] Buffer *mBuf, Packed primitive parameters in the
- * buffer.
- * @return ROK - success
- * RFAILED - failure
- *
- ***************************************************************************/
-S16 sctpActvTsk(Pst *pst, Buffer *mBuf)
-{
-
-//TODO: TBD
- return ROK;
-}
/**************************************************************************
* @brief Function to configure the Sctp Params during config Request
*
* @details
*
- * Function : duSctpCfgReq
+ * Function : sctpCfgReq
*
* Functionality:
* This function configures SCTP Params during the config Request
S16 sctpCfgReq()
{
+ connUp = FALSE;
+ sctpCfg = ricCfgParams.sctpParams;
/* Fill F1 Params */
ricParams.destPort = sctpCfg.duPort;
ricParams.srcPort = sctpCfg.ricPort;
ricParams.bReadFdSet = ROK;
- cmMemset ((U8 *)&ricParams.sockFd, -1, sizeof(CmInetFd));
- cmMemset ((U8 *)&ricParams.lstnSockFd, -1, sizeof(CmInetFd));
+ memset(&ricParams.sockFd, -1, sizeof(CmInetFd));
+ memset(&ricParams.lstnSockFd, -1, sizeof(CmInetFd));
fillDestNetAddr(&ricParams.destIpNetAddr, &sctpCfg.duIpAddr);
- RETVALUE(ROK);
+ return ROK;
}
/*******************************************************************
addrLstPtr->addrs[(addrLstPtr->count - 1)].type = CM_INET_IPV4ADDR_TYPE;
addrLstPtr->addrs[(addrLstPtr->count - 1)].u.ipv4NetAddr = CM_INET_NTOH_U32(ipAddr->ipV4Addr);
- RETVALUE(ROK);
+ return ROK;
}
/******************************************************************************
/* Filling destination address */
destAddrPtr->type = CM_INET_IPV4ADDR_TYPE;
destAddrPtr->u.ipv4NetAddr = CM_INET_NTOH_U32(dstIpPtr->ipV4Addr);
- RETVALUE(ROK);
+ return ROK;
}
/******************************************************************************
}
else if((ret = cmInetSctpBindx(&ricParams.lstnSockFd, &ricParams.localAddrLst, ricParams.srcPort)) != ROK)
{
- DU_LOG("\nSCTP: Binding failed at CU");
+ DU_LOG("\nSCTP: Binding failed at RIC");
}
else if((ret = sctpAccept(&ricParams.lstnSockFd, &ricParams.peerAddr, &ricParams.sockFd)) != ROK)
{
- DU_LOG("\nSCTP: Unable to accept the connection at CU");
+ DU_LOG("\nSCTP: Unable to accept the connection at RIC");
}
else if(sctpSockPoll() != ROK)
{
S16 sctpAccept(CmInetFd *lstnSock_Fd, CmInetAddr *peerAddr, CmInetFd *sock_Fd)
{
U8 ret;
-
- ret = cmInetListen(lstnSock_Fd, 1);;
+
+ ret = cmInetListen(lstnSock_Fd, 1);
if (ret != ROK)
{
DU_LOG("\nSCTP : Listening on socket failed");
cmInetClose(lstnSock_Fd);
- RETVALUE(RFAILED);
+ return RFAILED;
}
DU_LOG("\nSCTP : Connecting");
else if(ret != ROK)
{
DU_LOG("\nSCTP : Failed to accept connection");
- RETVALUE(RFAILED);
+ return RFAILED;
}
else
{
}
DU_LOG("\nSCTP : Connection established");
- RETVALUE(ROK);
+ return ROK;
}
/*******************************************************************
}
sctpNtfyInd(ntfy);
- RETVALUE(ROK);
+ return ROK;
}/* End of sctpNtfyHdlr */
/*******************************************************************
{
if((ret = processPolling(&e2PollParams, &ricParams.sockFd, timeoutPtr, &memInfo)) != ROK)
{
- DU_LOG("\nSCTP : Failed to RecvMsg for E2 at CU \n");
+ DU_LOG("\nSCTP : Failed to RecvMsg for E2 at RIC \n");
}
};
RETVALUE(ret);
{
U16 ret = ROK;
CM_INET_FD_SET(sockFd, &pollParams->readFd);
- ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, &pollParams->numFds);
+ ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, &pollParams->numFd);
if(CM_INET_FD_ISSET(sockFd, &pollParams->readFd))
{
CM_INET_FD_CLR(sockFd, &pollParams->readFd);
}
}
}
- RETVALUE(ROK);
+ return ROK;
}/* End of sctpSockPoll() */
/*******************************************************************
if(ret != ROK && ret != RWOULDBLOCK)
{
DU_LOG("\nSCTP : Send message failed");
- RETVALUE(RFAILED);
+ return RFAILED;
}
- RETVALUE(ROK);
+ return ROK;
} /* End of sctpSend */
/**********************************************************************
End of file