Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
INFO.yaml
[o-du/l2.git]
/
src
/
du_app
/
du_egtp.c
diff --git
a/src/du_app/du_egtp.c
b/src/du_app/du_egtp.c
index
e3d8d2e
..
6d51824
100644
(file)
--- a/
src/du_app/du_egtp.c
+++ b/
src/du_app/du_egtp.c
@@
-17,10
+17,16
@@
*******************************************************************************/
/* This file contains all EGTP related functionality */
*******************************************************************************/
/* This file contains all EGTP related functionality */
-
-#include <stdio.h>
+#include "common_def.h"
+#include "lrg.h"
+#include "lkw.x"
+#include "lrg.x"
+#include "legtp.h"
+#include "du_app_mac_inf.h"
+#include "du_cfg.h"
#include "du_egtp.h"
#include "du_ue_mgr.h"
#include "du_egtp.h"
#include "du_ue_mgr.h"
+#include "du_utils.h"
/* Global variable declaration */
EgtpGlobalCb egtpCb;
/* Global variable declaration */
EgtpGlobalCb egtpCb;
@@
-52,7
+58,7
@@
S16 egtpActvInit(Ent entity, Inst inst, Region region, Reason reason)
cmMemset ((U8 *)&egtpCb, 0, sizeof(EgtpGlobalCb));
protType = CM_INET_PROTO_UDP;
cmMemset ((U8 *)&egtpCb, 0, sizeof(EgtpGlobalCb));
protType = CM_INET_PROTO_UDP;
-
RETVALUE(ROK)
;
+
return ROK
;
}
}
@@
-87,22
+93,22
@@
S16 egtpActvTsk(Pst *pst, Buffer *mBuf)
{
case EVTCFGREQ:
{
{
case EVTCFGREQ:
{
- ret =
cmUnp
kEgtpCfgReq(egtpCfgReq, pst, mBuf);
+ ret =
unpac
kEgtpCfgReq(egtpCfgReq, pst, mBuf);
break;
}
case EVTSRVOPENREQ:
{
break;
}
case EVTSRVOPENREQ:
{
- ret =
cmUnp
kEgtpSrvOpenReq(egtpSrvOpenReq, pst, mBuf);
+ ret =
unpac
kEgtpSrvOpenReq(egtpSrvOpenReq, pst, mBuf);
break;
}
case EVTTNLMGMTREQ:
{
break;
}
case EVTTNLMGMTREQ:
{
- ret =
cmUnp
kEgtpTnlMgmtReq(egtpTnlMgmtReq, pst, mBuf);
+ ret =
unpac
kEgtpTnlMgmtReq(egtpTnlMgmtReq, pst, mBuf);
break;
}
break;
}
- case EVT
TTI
IND:
+ case EVT
SLOT
IND:
{
{
- ret =
cmUnpkEgtpTTIInd(egtpTTI
Ind, pst, mBuf);
+ ret =
unpackEgtpSlotInd(egtpSlot
Ind, pst, mBuf);
SPutMsg(mBuf);
break;
}
SPutMsg(mBuf);
break;
}
@@
-139,7
+145,7
@@
S16 egtpActvTsk(Pst *pst, Buffer *mBuf)
}
}
SExitTsk();
}
}
SExitTsk();
-
RETVALUE(ret)
;
+
return ret
;
}
/**************************************************************************
}
/**************************************************************************
@@
-192,9
+198,9
@@
S16 egtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
egtpFillRspPst(pst, &rspPst);
rspPst.event = EVTCFGCFM;
egtpFillRspPst(pst, &rspPst);
rspPst.event = EVTCFGCFM;
-
cmP
kEgtpCfgCfm(&rspPst, cfgCfm);
+
pac
kEgtpCfgCfm(&rspPst, cfgCfm);
-
RETVALUE(ROK)
;
+
return ROK
;
}
/**************************************************************************
}
/**************************************************************************
@@
-222,10
+228,10
@@
S16 egtpFillRspPst(Pst *pst, Pst *rspPst)
rspPst->dstEnt = pst->srcEnt;
rspPst->dstInst = pst->srcInst;
rspPst->dstProcId = pst->srcProcId;
rspPst->dstEnt = pst->srcEnt;
rspPst->dstInst = pst->srcInst;
rspPst->dstProcId = pst->srcProcId;
- rspPst->selector = DU_SELECTOR_LC;
+ rspPst->selector =
O
DU_SELECTOR_LC;
rspPst->pool= DU_POOL;
rspPst->pool= DU_POOL;
-
RETVALUE(ROK)
;
+
return ROK
;
}
/**************************************************************************
}
/**************************************************************************
@@
-256,19
+262,19
@@
S16 egtpSrvOpenReq(Pst *pst)
DU_LOG("\nEGTP : Received EGTP open server request");
sockType = CM_INET_DGRAM;
DU_LOG("\nEGTP : Received EGTP open server request");
sockType = CM_INET_DGRAM;
-
- /* Opening and Binding receiver socket */
- if(ret
= egtpSrvOpenPrc(sockType, &(egtpCb.recvTptSrvr))
!= ROK)
+ ret = egtpSrvOpenPrc(sockType, &(egtpCb.recvTptSrvr));
+
/* Opening and Binding receiver socket */
+ if(ret != ROK)
{
DU_LOG("\nEGTP : Failed while opening receiver transport server");
{
DU_LOG("\nEGTP : Failed while opening receiver transport server");
-
RETVALUE(RFAILED)
;
+
return ret
;
}
}
-
/* Opening and Binding sender socket */
/* Opening and Binding sender socket */
- if(ret = egtpSrvOpenPrc(sockType, &(egtpCb.dstCb.sendTptSrvr)) != ROK)
+ ret = egtpSrvOpenPrc(sockType, &(egtpCb.dstCb.sendTptSrvr));
+ if(ret != ROK)
{
DU_LOG("\nEGTP : Failed while opening sender transport server");
{
DU_LOG("\nEGTP : Failed while opening sender transport server");
-
RETVALUE(RFAILED)
;
+
return ret
;
}
DU_LOG("\nEGTP : Receiver socket[%d] and Sender socket[%d] open", egtpCb.recvTptSrvr.sockFd.fd, egtpCb.dstCb.sendTptSrvr.sockFd.fd);
}
DU_LOG("\nEGTP : Receiver socket[%d] and Sender socket[%d] open", egtpCb.recvTptSrvr.sockFd.fd, egtpCb.dstCb.sendTptSrvr.sockFd.fd);
@@
-279,9
+285,9
@@
S16 egtpSrvOpenReq(Pst *pst)
egtpFillRspPst(pst, &rspPst);
rspPst.event = EVTSRVOPENCFM;
egtpFillRspPst(pst, &rspPst);
rspPst.event = EVTSRVOPENCFM;
-
cmP
kEgtpSrvOpenCfm(&rspPst, cfm);
+
pac
kEgtpSrvOpenCfm(&rspPst, cfm);
-
RETVALUE(ROK)
;
+
return ret
;
}
/*******************************************************************
}
/*******************************************************************
@@
-303,21
+309,21
@@
S16 egtpSrvOpenReq(Pst *pst)
S16 egtpSrvOpenPrc(U8 sockType, EgtpTptSrvr *server)
{
S16 egtpSrvOpenPrc(U8 sockType, EgtpTptSrvr *server)
{
- S8 ret;
-
-
if(ret = (cmInetSocket(sockType, &(server->sockFd), protType))
!= ROK)
+ S8 ret
=ROK
;
+ ret = cmInetSocket(sockType, &(server->sockFd), protType);
+
if(ret
!= ROK)
{
DU_LOG("\nEGTP : Failed to open UDP socket");
{
DU_LOG("\nEGTP : Failed to open UDP socket");
-
RETVALUE(RFAILED)
;
+
return ret
;
}
}
-
- if(ret
= cmInetBind(&(server->sockFd), &(server->addr))
!= ROK)
+ ret = cmInetBind(&(server->sockFd), &(server->addr));
+ if(ret != ROK)
{
DU_LOG("\nEGTP : Failed to bind socket");
{
DU_LOG("\nEGTP : Failed to bind socket");
-
RETVALUE(RFAILED)
;
+
return ret
;
}
}
-
RETVALUE(ROK)
;
+
return ret
;
}
/**************************************************************************
}
/**************************************************************************
@@
-381,9
+387,9
@@
S16 egtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
DU_LOG("\nEGTP : Sending Tunnel management confirmation");
egtpFillRspPst(pst, &rspPst);
rspPst.event = EVTTNLMGMTCFM;
DU_LOG("\nEGTP : Sending Tunnel management confirmation");
egtpFillRspPst(pst, &rspPst);
rspPst.event = EVTTNLMGMTCFM;
-
cmP
kEgtpTnlMgmtCfm(&rspPst, tnlEvt);
+
pac
kEgtpTnlMgmtCfm(&rspPst, tnlEvt);
-
RETVALUE(ROK)
;
+
return ROK
;
}
/**************************************************************************
}
/**************************************************************************
@@
-409,11
+415,11
@@
S16 egtpTnlAdd(EgtpTnlEvt tnlEvt)
DU_LOG("\nEGTP : Tunnel addition : LocalTeid[%d] Remote Teid[%d]", tnlEvt.lclTeid, tnlEvt.remTeid);
DU_LOG("\nEGTP : Tunnel addition : LocalTeid[%d] Remote Teid[%d]", tnlEvt.lclTeid, tnlEvt.remTeid);
-
ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, (Data **)&teidCb, (Size)
sizeof(EgtpTeIdCb));
- if(
ret != ROK
)
+
DU_ALLOC(teidCb,
sizeof(EgtpTeIdCb));
+ if(
teidCb == NULLP
)
{
DU_LOG("\nEGTP : Memory allocation failed");
{
DU_LOG("\nEGTP : Memory allocation failed");
-
RETVALUE(LCM_REASON_MEM_NOAVAIL)
;
+
return LCM_REASON_MEM_NOAVAIL
;
}
cmMemset((U8 *)teidCb, 0, sizeof(EgtpTeIdCb));
}
cmMemset((U8 *)teidCb, 0, sizeof(EgtpTeIdCb));
@@
-424,8
+430,8
@@
S16 egtpTnlAdd(EgtpTnlEvt tnlEvt)
if(ret != ROK)
{
DU_LOG("\nEGTP : Failed to insert in hash list");
if(ret != ROK)
{
DU_LOG("\nEGTP : Failed to insert in hash list");
-
SPutSBuf(DU_APP_MEM_REGION, DU_POOL, (Data *)teidCb, (Size)
sizeof(EgtpTeIdCb));
-
RETVALUE(LCM_REASON_HASHING_FAILED)
;
+
DU_FREE(teidCb,
sizeof(EgtpTeIdCb));
+
return LCM_REASON_HASHING_FAILED
;
}
egtpCb.dstCb.numTunn++;
}
egtpCb.dstCb.numTunn++;
@@
-439,7
+445,7
@@
S16 egtpTnlAdd(EgtpTnlEvt tnlEvt)
egtpEncodeHdr((U8 *)teidCb->preEncodedHdr.hdr, &preDefHdr, &(teidCb->preEncodedHdr.cnt));
egtpEncodeHdr((U8 *)teidCb->preEncodedHdr.hdr, &preDefHdr, &(teidCb->preEncodedHdr.cnt));
-
RETVALUE(ROK)
;
+
return ROK
;
} /* egtpTnlAdd */
/**************************************************************************
} /* egtpTnlAdd */
/**************************************************************************
@@
-475,7
+481,7
@@
S16 egtpTnlMod(EgtpTnlEvt tnlEvt)
teidCb->teId = tnlEvt.lclTeid;
teidCb->remTeId = tnlEvt.remTeid;
#endif
teidCb->teId = tnlEvt.lclTeid;
teidCb->remTeId = tnlEvt.remTeid;
#endif
-
RETVALUE(ROK)
;
+
return ROK
;
}
/**************************************************************************
}
/**************************************************************************
@@
-503,14
+509,14
@@
S16 egtpTnlDel(EgtpTnlEvt tnlEvt)
if(teidCb == NULLP)
{
DU_LOG("\nEGTP : Tunnel id[%d] not configured", tnlEvt.lclTeid);
if(teidCb == NULLP)
{
DU_LOG("\nEGTP : Tunnel id[%d] not configured", tnlEvt.lclTeid);
-
RETVALUE(LCM_REASON_INVALID_PAR_VAL)
;
+
return LCM_REASON_INVALID_PAR_VAL
;
}
cmHashListDelete(&(egtpCb.dstCb.teIdLst), (PTR)teidCb);
}
cmHashListDelete(&(egtpCb.dstCb.teIdLst), (PTR)teidCb);
-
SPutSBuf(DU_APP_MEM_REGION, DU_POOL, (Data *)teidCb, (Size)
sizeof(EgtpTeIdCb));
+
DU_FREE(teidCb,
sizeof(EgtpTeIdCb));
egtpCb.dstCb.numTunn--;
egtpCb.dstCb.numTunn--;
-
RETVALUE(ROK)
;
+
return ROK
;
}
/*******************************************************************
}
/*******************************************************************
@@
-544,7
+550,7
@@
S16 egtpHdlDatInd(EgtpMsg egtpMsg)
if(teidCb == NULLP)
{
DU_LOG("\nEGTP : Tunnel id[%d] not configured", egtpMsg.msgHdr.teId);
if(teidCb == NULLP)
{
DU_LOG("\nEGTP : Tunnel id[%d] not configured", egtpMsg.msgHdr.teId);
-
RETVALUE(LCM_REASON_INVALID_PAR_VAL)
;
+
return LCM_REASON_INVALID_PAR_VAL
;
}
msgHdr = &(egtpMsg.msgHdr);
}
msgHdr = &(egtpMsg.msgHdr);
@@
-601,7
+607,7
@@
S16 egtpHdlDatInd(EgtpMsg egtpMsg)
egtpSendMsg(egtpMsg.msg);
SPutMsg(egtpMsg.msg);
egtpSendMsg(egtpMsg.msg);
SPutMsg(egtpMsg.msg);
-
RETVALUE(ROK)
;
+
return ROK
;
}/* EgtpHdlDatInd */
/*******************************************************************
}/* EgtpHdlDatInd */
/*******************************************************************
@@
-713,7
+719,7
@@
S16 egtpEncodeHdr(U8 *preEncodedHdr, EgtpMsgHdr *preDefHdr, U8 *hdrIdx)
}
*hdrIdx = cnt;
}
*hdrIdx = cnt;
-
RETVALUE(ROK)
;
+
return ROK
;
} /* egtpEncodeHdr */
/*******************************************************************
} /* egtpEncodeHdr */
/*******************************************************************
@@
-749,21
+755,21
@@
S16 egtpSendMsg(Buffer *mBuf)
if(ret != ROK && ret != RWOULDBLOCK)
{
DU_LOG("\nEGTP : Failed sending the message");
if(ret != ROK && ret != RWOULDBLOCK)
{
DU_LOG("\nEGTP : Failed sending the message");
-
RETVALUE(RFAILED)
;
+
return RFAILED
;
}
DU_LOG("\nEGTP : Message Sent");
}
DU_LOG("\nEGTP : Message Sent");
-
RETVALUE(ROK)
;
+
return ROK
;
}
/*******************************************************************
*
}
/*******************************************************************
*
- * @brief Handles
TTI
Indication from PHY
+ * @brief Handles
Slot
Indication from PHY
*
* @details
*
*
* @details
*
- * Function : egtp
TTI
Ind
+ * Function : egtp
Slot
Ind
*
* Functionality:
* Handles TTI Indication from PHY
*
* Functionality:
* Handles TTI Indication from PHY
@@
-773,10
+779,10
@@
S16 egtpSendMsg(Buffer *mBuf)
* RFAILED - failure
*
* ****************************************************************/
* RFAILED - failure
*
* ****************************************************************/
-S16 egtp
TTI
Ind()
+S16 egtp
Slot
Ind()
{
egtpRecvMsg();
{
egtpRecvMsg();
-
RETVALUE(ROK)
;
+
return ROK
;
}
/*******************************************************************
}
/*******************************************************************
@@
-806,7
+812,7
@@
S16 egtpRecvMsg()
CmInetMemInfo memInfo; /* Buffer allocation info */
CmInetMemInfo memInfo; /* Buffer allocation info */
- DU_LOG("\nEGTP : Received
TTI
Indication");
+ DU_LOG("\nEGTP : Received
Slot
Indication");
nMsg = 0;
memInfo.region = DU_APP_MEM_REGION;
nMsg = 0;
memInfo.region = DU_APP_MEM_REGION;
@@
-828,7
+834,7
@@
S16 egtpRecvMsg()
nMsg++;
}
nMsg++;
}
-
RETVALUE(ROK)
;
+
return ROK
;
}
S16 egtpHdlRecvData(Buffer *mBuf)
}
S16 egtpHdlRecvData(Buffer *mBuf)
@@
-841,7
+847,7
@@
S16 egtpHdlRecvData(Buffer *mBuf)
/* TODO : Send received message to RLC */
duHdlEgtpDlData(&egtpMsg);
/* TODO : Send received message to RLC */
duHdlEgtpDlData(&egtpMsg);
-
RETVALUE(ROK)
;
+
return ROK
;
}
S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg)
}
S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg)
@@
-1004,6
+1010,6
@@
S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg)
/* Forward the data to duApp/RLC */
/* Forward the data to duApp/RLC */
-
RETVALUE(ROK)
;
+
return ROK
;
}
}