+/*******************************************************************
+ *
+ * @brief checks for valid readFd and process the InetSctpRecvMsg
+ * during polling
+ *
+ * @details
+ *
+ * Function : processPolling
+ *
+ * Functionality:
+ * checks for valid readFd and process the InetSctpRecvMsg
+ * during polling
+ *
+ * @params[in] Params required for polling
+ * @params[in] SockFd for file descriptor
+ * @params[in] timeoutPtr indicates the timeout value
+ * @params[in] MemInfo, recvMsgSet
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, U32 *timeoutPtr, CmInetMemInfo *memInfo, Bool recvMsgSet)
+{
+ U16 ret = ROK;
+ CM_INET_FD_SET(sockFd, &pollParams->readFd);
+ ret = cmInetSelect(&pollParams->readFd, NULLP, timeoutPtr, &pollParams->numFds);
+ if(CM_INET_FD_ISSET(sockFd, &pollParams->readFd))
+ {
+ CM_INET_FD_CLR(sockFd, &pollParams->readFd);
+ ret = cmInetSctpRecvMsg(sockFd, &pollParams->addr, &pollParams->port, memInfo, &(pollParams->mBuf), &pollParams->bufLen, &pollParams->info, &pollParams->flag, &pollParams->ntfy);
+
+ if(connUp && ret != ROK)
+ {
+ DU_LOG("\n SCTP: Failed to receive sctp msg for sockFd[%d]\n", sockFd->fd);
+ recvMsgSet = RFAILED;
+ }
+ else
+ {
+ if((((pollParams->flag & CM_INET_SCTP_MSG_NOTIFICATION) != 0)) && ret == ROK)
+ {
+ if(pollParams->port == f1Params.destPort)
+ {
+ f1Params.assocId = pollParams->ntfy.u.assocChange.assocId;
+ DU_LOG("\nSCTP : AssocId assigned to F1Params from PollParams [%d]\n", f1Params.assocId);
+ }
+ else if(pollParams->port == ricParams.destPort)
+ {
+ ricParams.assocId = pollParams->ntfy.u.assocChange.assocId;
+ DU_LOG("\nSCTP : AssocId assigned to ricParams from PollParams [%d]\n", ricParams.assocId);
+ }
+ else
+ {
+ DU_LOG("\nSCTP : Failed to fill AssocId\n");
+ }
+ ret = sctpNtfyHdlr(&pollParams->ntfy);
+ if(ret != ROK)
+ {
+ DU_LOG("\nSCTP : Failed to process sctp notify msg\n");
+ }
+ }
+ else if(connUp & (pollParams->port == f1Params.destPort))
+ {
+ sendToDuApp(pollParams->mBuf, EVTSCTPDATA);
+ }
+ else if(connUp & (pollParams->port == ricParams.destPort))
+ {
+ sendToDuApp(pollParams->mBuf, EVTRICDATA);
+ }
+
+ else
+ {
+ SPutMsg(pollParams->mBuf);
+ }
+ }
+ }
+ RETVALUE(ROK);
+}