X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_egtp.c;h=3b7799622176e77f1b37e12e665decb66f4e8537;hb=fdf994581c1b672158c911a9a5f7a4191832c695;hp=0a64c01ba3e13611a45f8474b693206d6eab3e42;hpb=14136d98405a2fb8d8c078b755efb63b95cdc7a3;p=o-du%2Fl2.git diff --git a/src/du_app/du_egtp.c b/src/du_app/du_egtp.c index 0a64c01ba..3b7799622 100644 --- a/src/du_app/du_egtp.c +++ b/src/du_app/du_egtp.c @@ -58,6 +58,7 @@ uint8_t egtpActvInit(Ent entity, Inst inst, Region region, Reason reason) memset (&egtpCb, 0, sizeof(EgtpGlobalCb)); protType = CM_INET_PROTO_UDP; + gDlDataRcvdCnt = 0; return ROK; } @@ -374,7 +375,7 @@ uint8_t egtpSrvOpenPrc(uint8_t sockType, EgtpTptSrvr *server) * ***************************************************************************/ uint8_t egtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt) { - S8 ret; + uint8_t ret = ROK; DU_LOG("\nDEBUG --> EGTP : Received tunnel management request"); switch(tnlEvt.action) @@ -415,7 +416,7 @@ uint8_t egtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt) DU_LOG("\nDEBUG --> EGTP : Sending Tunnel management confirmation"); duHdlEgtpTnlMgmtCfm(tnlEvt); - return ROK; + return ret; } /************************************************************************** @@ -491,23 +492,18 @@ uint8_t egtpTnlAdd(EgtpTnlEvt tnlEvt) * ***************************************************************************/ 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; } @@ -542,7 +538,6 @@ uint8_t egtpTnlDel(EgtpTnlEvt tnlEvt) cmHashListDelete(&(egtpCb.dstCb.teIdLst), (PTR)teidCb); DU_FREE(teidCb, sizeof(EgtpTeIdCb)); egtpCb.dstCb.numTunn--; - return ROK; } @@ -811,13 +806,11 @@ uint8_t egtpSendMsg(Buffer *mBuf) uint8_t egtpRecvMsg() { uint8_t ret; /* Return value */ - uint16_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; @@ -831,10 +824,10 @@ uint8_t egtpRecvMsg() &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); - nMsg++; + gDlDataRcvdCnt++; } } @@ -902,11 +895,11 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg) /* 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 @@ -915,7 +908,9 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg) 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); /**************************************************************************** @@ -927,7 +922,7 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg) 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. */ @@ -1039,8 +1034,8 @@ uint8_t egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg) 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 */