memset (&egtpCb, 0, sizeof(EgtpGlobalCb));
protType = CM_INET_PROTO_UDP;
+ gDlDataRcvdCnt = 0;
return ROK;
}
+/**************************************************************************
+* @brief Function prints the src dest and msg reached to egtp.
+*
+* @details
+*
+* Function : callFlowEgtpActvTsk
+*
+* Functionality:
+* Function prints the src dest and msg reached to egtp.
+*
+* @param[in] Pst *pst, Post structure of the primitive.
+*
+* @return void
+*
+***************************************************************************/
+
+void callFlowEgtpActvTsk(Pst *pst)
+{
+
+ char sourceTask[50];
+ char destTask[50]="ENTEGTP";
+ char message[100];
+
+ switch(pst->srcEnt)
+ {
+ case ENTDUAPP:
+ {
+ strcpy(sourceTask,"ENTDUAPP");
+ switch(pst->event)
+ {
+ case EVTCFGREQ:
+ {
+ strcpy(message,"EVTCFGREQ");
+ break;
+ }
+ case EVTSRVOPENREQ:
+ {
+ strcpy(message,"EVTSRVOPENREQ");
+ break;
+ }
+ case EVTTNLMGMTREQ:
+ {
+ strcpy(message,"EVTTNLMGMTREQ");
+ break;
+ }
+ default:
+ {
+ strcpy(message,"Invalid Event");
+ break;
+ }
+ }
+ break;
+ }
+ case ENTEGTP:
+ {
+ strcpy(sourceTask,"ENTEGTP");
+ switch(pst->event)
+ {
+ case EVTSTARTPOLL:
+ {
+ strcpy(message,"EVTSTARTPOLL");
+ break;
+ }
+ default:
+ {
+ strcpy(message,"Invalid Event");
+ break;
+ }
+ }
+ break;
+ }
+ case ENTRLC:
+ {
+ strcpy(sourceTask,"ENTRLC");
+ switch(pst->event)
+ {
+ case EVTDATIND:
+ {
+ strcpy(message,"EVTDATIND");
+ break;
+ }
+ default:
+ {
+ strcpy(message,"Invalid Event");
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ strcpy(sourceTask,"Invalid Source Entity Id");
+ }
+ }
+ DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);
+}
/**************************************************************************
* @brief Task Activation callback function.
uint8_t egtpActvTsk(Pst *pst, Buffer *mBuf)
{
uint8_t ret = ROK;
+
+#ifdef CALL_FLOW_DEBUG_LOG
+ callFlowEgtpActvTsk(pst);
+#endif
switch(pst->srcEnt)
{
* ***************************************************************************/
uint8_t egtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
{
- S8 ret;
+ uint8_t ret = ROK;
+
+#ifdef CALL_FLOW_DEBUG_LOG
+ DU_LOG("\nCall Flow: ENTDUAPP -> ENTEGTP : TNL_MGMT\n");
+#endif
DU_LOG("\nDEBUG --> EGTP : Received tunnel management request");
switch(tnlEvt.action)
DU_LOG("\nDEBUG --> EGTP : Sending Tunnel management confirmation");
duHdlEgtpTnlMgmtCfm(tnlEvt);
- return ROK;
+ return ret;
}
/**************************************************************************
* ***************************************************************************/
uint8_t egtpTnlMod(EgtpTnlEvt tnlEvt)
{
-#if 0
- uint8_t ret;
EgtpTeIdCb *teidCb = NULLP;
- DU_LOG("\nINFO --> Tunnel modification : LocalTeid[%d] Remote Teid[%d]", tnlEvt.lclTeid, tnlEvt.remTeid);
+ DU_LOG("\nINFO --> EGTP : Tunnel modification : LocalTeid[%d] Remote Teid[%d]", tnlEvt.lclTeid, tnlEvt.remTeid);
- cmHashListFind(&(egtpCb.dstCb.teIdLst), (uint8_t *)&(tnlEvt.teId), sizeof(uint32_t), 0, (PTR *)&teidCb);
+ cmHashListFind(&(egtpCb.dstCb.teIdLst), (uint8_t *)&(tnlEvt.lclTeid), sizeof(uint32_t), 0, (PTR *)&teidCb);
if(teidCb == NULLP)
{
- DU_LOG("\nERROR --> Tunnel id not found");
+ DU_LOG("\nERROR --> EGTP : Tunnel id not found");
return RFAILED;
}
-
- teidCb->teId = tnlEvt.lclTeid;
- DU_LOG("\nINFO --> Tunnel id is" , teidCb->teId);
+ teidCb->teId = tnlEvt.remTeid;
teidCb->remTeId = tnlEvt.remTeid;
-#endif
return ROK;
}
cmHashListDelete(&(egtpCb.dstCb.teIdLst), (PTR)teidCb);
DU_FREE(teidCb, sizeof(EgtpTeIdCb));
egtpCb.dstCb.numTunn--;
-
return ROK;
}
uint32_t msgLen;
EgtpMsgHdr *msgHdr;
+#ifdef CALL_FLOW_DEBUG_LOG
+ DU_LOG("\nCall Flow: ENTDUAPP -> ENTEGTP : DATA_INDICATION\n");
+#endif
+
DU_LOG("\nDEBUG --> EGTP : Received Data Indication");
cmHashListFind(&(egtpCb.dstCb.teIdLst), (uint8_t *)&(egtpMsg.msgHdr.teId), sizeof(uint32_t), 0, (PTR *)&teidCb);
uint8_t egtpRecvMsg()
{
uint8_t ret; /* Return value */
- uint8_t nMsg; /* Number of messages to read from UDP socked */
uint16_t bufLen; /* Length of received buffer */
Buffer *recvBuf; /* Received buffer */
CmInetAddr fromAddr; /* Egtp data sender address */
CmInetMemInfo memInfo; /* Buffer allocation info */
- nMsg = 0;
memInfo.region = DU_APP_MEM_REGION;
memInfo.pool = DU_POOL;
&recvBuf, (int16_t *)&bufLen, CM_INET_NO_FLAG);
if(ret == ROK && recvBuf != NULLP)
{
- DU_LOG("\nDEBUG --> EGTP : Received DL Message[%d]\n", nMsg+1);
- ODU_PRINT_MSG(recvBuf, 0 ,0);
+ //DU_LOG("\nDEBUG --> EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1);
+ //ODU_PRINT_MSG(recvBuf, 0 ,0);
egtpHdlRecvData(recvBuf);
+ gDlDataRcvdCnt++;
}
- nMsg++;
}
return ROK;
/* Extracting version fro 1st byte */
version = tmpByte[0] >> 5;
- DU_LOG("\nDEBUG --> EGTP : Version %d", version);
+ //DU_LOG("\nDEBUG --> EGTP : Version %d", version);
/* Decode message type */
ODU_REM_PRE_MSG((Data*)&(egtpMsg->msgHdr.msgType), mBuf);
- DU_LOG("\nDEBUG --> EGTP : msgType %d", egtpMsg->msgHdr.msgType);
+ //DU_LOG("\nDEBUG --> EGTP : msgType %d", egtpMsg->msgHdr.msgType);
/****************************************************************************
* Message length param is 2 bytes. So decode next 2 bytes from msg hdr and
ODU_REM_PRE_MSG(&tmpByte[1], mBuf);
ODU_REM_PRE_MSG(&tmpByte[2], mBuf);
msgLen = (tmpByte[1] << 8) | tmpByte[2];
- DU_LOG("\nDEBUG --> EGTP : msgLen %d", msgLen);
+ UNUSED(msgLen);
+ UNUSED(version);
+ //DU_LOG("\nDEBUG --> EGTP : msgLen %d", msgLen);
/****************************************************************************
ODU_REM_PRE_MSG(&tmpByte[3], mBuf);
ODU_REM_PRE_MSG(&tmpByte[4], mBuf);
egtpMsg->msgHdr.teId = (tmpByte[1] << 24) | (tmpByte[2] << 16) | (tmpByte[3] << 8) | tmpByte[4];
- DU_LOG("\nDEBUG --> EGTP : teId %d",egtpMsg->msgHdr.teId);
+ //DU_LOG("\nDEBUG --> EGTP : teId %d",egtpMsg->msgHdr.teId);
/* If any one of S, E or PN flag is set, set extension present as true. */
egtpMsg->msg = mBuf;
- DU_LOG("\nDEBUG --> EGTP : DL Data Buffer after decoding header ");
- ODU_PRINT_MSG(mBuf, 0, 0);
+ //DU_LOG("\nDEBUG --> EGTP : DL Data Buffer after decoding header ");
+ //ODU_PRINT_MSG(mBuf, 0, 0);
/* Forward the data to duApp/RLC */