/* This file contains all SCTP related functionality */
#include "common_def.h"
+#include "du_tmr.h"
#include "lrg.h"
#include "legtp.h"
#include "lrg.x"
#include "cm_inet.h"
#include "cm_inet.x"
#include "du_app_mac_inf.h"
+#include "du_e2ap_mgr.h"
#include "du_cfg.h"
#include "du_sctp.h"
#include "lsctp.h"
+#include "du_app_rlc_inf.h"
+#include "du_mgr.h"
#include "du_utils.h"
+/* Global variable declaration */
+uint8_t socket_type; /* Socket type */
+bool nonblocking; /* Blocking/Non-blocking socket */
+bool connUp; /* Is connection up */
+bool pollingState;
+CmInetNetAddrLst localAddrLst;
+CmInetNetAddrLst remoteAddrLst;
+/* Global variable declaration */
+DuSctpDestCb f1Params; /* SCTP configurations at DU */
+DuSctpDestCb ricParams; /* SCTP configurations at DU */
/**************************************************************************
* @brief Task Initiation callback function.
*
* @return void
***************************************************************************/
-uint8_t callFlowSctpActvTsk(Pst *pst)
+void callFlowSctpActvTsk(Pst *pst)
{
char sourceTask[50];
char destTask[50]="ENTSCTP";
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);
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);
* RFAILED - failure
*
* ****************************************************************/
-uint8_t sctpNtfyHdlr(CmInetSctpNotification *ntfy, uint8_t *itfState)
+uint8_t sctpNtfyHdlr(CmInetSctpNotification *ntfy, uint8_t *itfState, uint8_t interface)
{
Pst pst;
DU_LOG("\nINFO --> SCTP : Send Failed notification received\n");
break;
case CM_INET_SCTP_SHUTDOWN_EVENT : /* peer socket gracefully closed */
- DU_LOG("\nINFO --> SCTP : Shutdown Event notification received\n");
- *itfState = DU_SCTP_DOWN;
- exit(0);
- break;
+ {
+ DU_LOG("\nINFO --> SCTP : Shutdown Event notification received\n");
+ *itfState = DU_SCTP_DOWN;
+ switch(interface)
+ {
+ case F1_INTERFACE:
+ break;
+ case E2_INTERFACE:
+ removeE2NodeInformation();
+ break;
+ default:
+ exit(0);
+ }
+ break;
+ }
case CM_INET_SCTP_ADAPTATION_INDICATION :
DU_LOG("\nINFO --> SCTP : Adaptation Indication received\n");
break;
* @params[in] Params required for polling
* @params[in] SockFd for file descriptor
* @params[in] timeoutPtr indicates the timeout value
- * @params[in] MemInfo, recvMsgSet
+ * @params[in] MemInfo
*
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32_t *timeoutPtr, CmInetMemInfo *memInfo, bool recvMsgSet)
+uint8_t processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32_t *timeoutPtr, CmInetMemInfo *memInfo)
{
uint8_t ret = ROK;
CM_INET_FD_SET(sockFd, &pollParams->readFd);
if(ret != ROK)
{
DU_LOG("\nERROR --> SCTP: Failed to receive sctp msg for sockFd[%d]\n", sockFd->fd);
- recvMsgSet = RFAILED;
}
else
{
{
f1Params.assocId = pollParams->ntfy.u.assocChange.assocId;
DU_LOG("\nDEBUG --> SCTP : AssocId assigned to F1Params from PollParams [%d]\n", f1Params.assocId);
- ret = sctpNtfyHdlr(&pollParams->ntfy, &f1Params.itfState);
+ ret = sctpNtfyHdlr(&pollParams->ntfy, &f1Params.itfState, F1_INTERFACE);
}
else if(pollParams->port == ricParams.destPort)
{
ricParams.assocId = pollParams->ntfy.u.assocChange.assocId;
DU_LOG("\nDEBUG --> SCTP : AssocId assigned to ricParams from PollParams [%d]\n", ricParams.assocId);
- ret = sctpNtfyHdlr(&pollParams->ntfy, &ricParams.itfState);
+ ret = sctpNtfyHdlr(&pollParams->ntfy, &ricParams.itfState, E2_INTERFACE);
}
else
{
}
}
}
- return ROK;
+ return ret;
}
/*******************************************************************
*
{
if(f1Params.itfState)
{
- if((ret = processPolling(&f1PollParams, &f1Params.sockFd, timeout_Ptr, &memInfo, f1Params.recvMsgSet)) != ROK)
+ if((ret = processPolling(&f1PollParams, &f1Params.sockFd, timeout_Ptr, &memInfo)) != ROK)
{
DU_LOG("\nERROR --> SCTP : Failed to RecvMsg for F1\n");
}
}
if(ricParams.itfState)
{
- if((ret = processPolling(&e2PollParams, &ricParams.sockFd, timeout_Ptr, &memInfo, ricParams.recvMsgSet)) != ROK)
+ if((ret = processPolling(&e2PollParams, &ricParams.sockFd, timeout_Ptr, &memInfo)) != ROK)
{
DU_LOG("\nERROR --> SCTP : Failed to RecvMsg for E2\n");
}
if(itfType == F1_INTERFACE)
{
- DU_LOG("\nDEBUG --> SCTP : sending the message to CU");
+ DU_LOG("\nDEBUG --> SCTP : sending the message to CU");
#ifdef CALL_FLOW_DEBUG_LOG
DU_LOG("\nCall Flow: ENTSCTP -> CU : EVENT_F1AP_MSG_TO_CU\n");
#endif
if(itfType == E2_INTERFACE)
{
- DU_LOG("\nDEBUG --> SCTP : sending the message to ric");
+ DU_LOG("\nDEBUG --> SCTP : sending the message to ric");
#ifdef CALL_FLOW_DEBUG_LOG
DU_LOG("\nCall Flow: ENTSCTP -> RIC : EVENT_E2AP_MSG_TO_RIC\n");
#endif