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
Merge "correction in F1AP message based on wireshark logs"
[o-du/l2.git]
/
src
/
cu_stub
/
cu_stub_egtp.c
diff --git
a/src/cu_stub/cu_stub_egtp.c
b/src/cu_stub/cu_stub_egtp.c
index
b8616c0
..
dfdacbb
100644
(file)
--- a/
src/cu_stub/cu_stub_egtp.c
+++ b/
src/cu_stub/cu_stub_egtp.c
@@
-48,7
+48,7
@@
EgtpGlobalCb egtpCb;
S16 egtpActvInit()
{
DU_LOG("\n\nEGTP : Initializing");
S16 egtpActvInit()
{
DU_LOG("\n\nEGTP : Initializing");
-
cmMemset ((U8 *)
&egtpCb, 0, sizeof(EgtpGlobalCb));
+
memset (
&egtpCb, 0, sizeof(EgtpGlobalCb));
protType = CM_INET_PROTO_UDP;
return ROK;
}
protType = CM_INET_PROTO_UDP;
return ROK;
}
@@
-73,9
+73,9
@@
S16 egtpActvInit()
* RFAILED - failure
*
***************************************************************************/
* RFAILED - failure
*
***************************************************************************/
-
S16
egtpInitReq()
+
uint8_t
egtpInitReq()
{
{
-
S16
ret = ROK;
+
uint8_t
ret = ROK;
EgtpTnlEvt tnlEvt;
ret = cuEgtpCfgReq();
EgtpTnlEvt tnlEvt;
ret = cuEgtpCfgReq();
@@
-102,8
+102,7
@@
S16 egtpInitReq()
return RFAILED;
}
return RFAILED;
}
- return (ret);
-
+ return ret;
} /* egtpInitReq */
/**************************************************************************
} /* egtpInitReq */
/**************************************************************************
@@
-124,7
+123,7
@@
S16 cuEgtpCfgReq()
{
U8 ret;
{
U8 ret;
-
cmMemcpy((U8 *)&egtpCb.egtpCfg, (U8 *)&cuCfgParams.egtpParams, (PTR)
sizeof(EgtpParams));
+
memcpy(&egtpCb.egtpCfg, &cuCfgParams.egtpParams,
sizeof(EgtpParams));
egtpCb.recvTptSrvr.addr.address = CM_INET_NTOH_U32(egtpCb.egtpCfg.localIp.ipV4Addr);
egtpCb.recvTptSrvr.addr.port = EGTP_DFLT_PORT;
egtpCb.recvTptSrvr.addr.address = CM_INET_NTOH_U32(egtpCb.egtpCfg.localIp.ipV4Addr);
egtpCb.recvTptSrvr.addr.port = EGTP_DFLT_PORT;
@@
-175,7
+174,7
@@
S16 cuEgtpSrvOpenReq(Pst *pst)
DU_LOG("\nEGTP : Received open server request");
sockType = CM_INET_DGRAM;
DU_LOG("\nEGTP : Received open server request");
sockType = CM_INET_DGRAM;
- if(
ret = (cmInetSocket(sockType, &(egtpCb.recvTptSrvr.sockFd), protType
)) != ROK)
+ if(
(ret = (cmInetSocket(sockType, &(egtpCb.recvTptSrvr.sockFd), protType)
)) != ROK)
{
DU_LOG("\nEGTP : Failed to open UDP socket");
return RFAILED;
{
DU_LOG("\nEGTP : Failed to open UDP socket");
return RFAILED;
@@
-290,7
+289,7
@@
S16 cuEgtpTnlAdd(EgtpTnlEvt tnlEvt)
}
}
-
cmMemset((U8 *)
teidCb, 0, sizeof(EgtpTeIdCb));
+
memset(
teidCb, 0, sizeof(EgtpTeIdCb));
teidCb->teId = tnlEvt.lclTeid;
teidCb->remTeId = tnlEvt.remTeid;
teidCb->teId = tnlEvt.lclTeid;
teidCb->remTeId = tnlEvt.remTeid;
@@
-304,7
+303,7
@@
S16 cuEgtpTnlAdd(EgtpTnlEvt tnlEvt)
egtpCb.dstCb.numTunn++;
/* Encoding pre-defined header */
egtpCb.dstCb.numTunn++;
/* Encoding pre-defined header */
-
cmMemset((U8*)
&preDefHdr, 0, sizeof(EgtpMsgHdr));
+
memset(
&preDefHdr, 0, sizeof(EgtpMsgHdr));
preDefHdr.msgType = EGTPU_MSG_GPDU;
preDefHdr.teId = teidCb->remTeId;
preDefHdr.extHdr.pdcpNmb.pres = FALSE;
preDefHdr.msgType = EGTPU_MSG_GPDU;
preDefHdr.teId = teidCb->remTeId;
preDefHdr.extHdr.pdcpNmb.pres = FALSE;
@@
-513,7
+512,6
@@
S16 cuEgtpHdlRecvMsg(Buffer *mBuf)
S16 cuEgtpDecodeHdr(Buffer *mBuf)
{
EgtpMsg egtpMsg;
S16 cuEgtpDecodeHdr(Buffer *mBuf)
{
EgtpMsg egtpMsg;
- S16 retVal = ROK; /* Holds the return value */
U8 tmpByte[5]; /* Holds one byte of data after Dec */
U8 version = 0; /* Holds the version type, decoded */
MsgLen msgLen = 0; /* Holds the msgLen from the Hdr */
U8 tmpByte[5]; /* Holds one byte of data after Dec */
U8 version = 0; /* Holds the version type, decoded */
MsgLen msgLen = 0; /* Holds the msgLen from the Hdr */
@@
-522,7
+520,7
@@
S16 cuEgtpDecodeHdr(Buffer *mBuf)
U8 extHdrLen = 0; /* Extension hdr length */
Bool extPres = FALSE; /* Flag for indication of S, E or P presense flag */
U8 extHdrLen = 0; /* Extension hdr length */
Bool extPres = FALSE; /* Flag for indication of S, E or P presense flag */
- ODU_
FIND
_MSG_LEN(mBuf, &bufLen);
+ ODU_
GET
_MSG_LEN(mBuf, &bufLen);
/* Decode version */
ODU_REM_PRE_MSG(&tmpByte[0], mBuf);
/* Decode version */
ODU_REM_PRE_MSG(&tmpByte[0], mBuf);
@@
-645,7
+643,7
@@
S16 cuEgtpDatReq()
cnt++;
}
cnt++;
}
- ODU_PUT_MSG(egtpMsg.msg);
+ ODU_PUT_MSG
_BUF
(egtpMsg.msg);
return ROK;
}
return ROK;
}
@@
-658,12
+656,12
@@
S16 BuildAppMsg(EgtpMsg *egtpMsg)
Buffer *mBuf;
Buffer *mBuf;
- if(ODU_GET_MSG(CU_APP_MEM_REG, CU_POOL, &mBuf) == ROK)
+ if(ODU_GET_MSG
_BUF
(CU_APP_MEM_REG, CU_POOL, &mBuf) == ROK)
{
if(ODU_ADD_POST_MSG_MULT((Data *)data, datSize, mBuf) != ROK)
{
DU_LOG("\nEGTP : ODU_ADD_POST_MSG_MULT failed");
{
if(ODU_ADD_POST_MSG_MULT((Data *)data, datSize, mBuf) != ROK)
{
DU_LOG("\nEGTP : ODU_ADD_POST_MSG_MULT failed");
- ODU_PUT_MSG(mBuf);
+ ODU_PUT_MSG
_BUF
(mBuf);
return RFAILED;
}
}
return RFAILED;
}
}
@@
-678,9
+676,9
@@
S16 BuildAppMsg(EgtpMsg *egtpMsg)
MsgLen mLen;
mLen = 0;
MsgLen mLen;
mLen = 0;
- ODU_
FIND
_MSG_LEN(mBuf, &mLen);
+ ODU_
GET
_MSG_LEN(mBuf, &mLen);
-
cmMemset((U8 *)
&ipv4Hdr, 0, sizeof(CmIpv4Hdr));
+
memset(
&ipv4Hdr, 0, sizeof(CmIpv4Hdr));
ipv4Hdr.length = CM_IPV4_HDRLEN + mLen;
ipv4Hdr.hdrVer = 0x45;
ipv4Hdr.proto = 1;
ipv4Hdr.length = CM_IPV4_HDRLEN + mLen;
ipv4Hdr.hdrVer = 0x45;
ipv4Hdr.proto = 1;
@@
-694,8
+692,8
@@
S16 BuildAppMsg(EgtpMsg *egtpMsg)
/* initialize locals */
cnt = 0;
/* initialize locals */
cnt = 0;
-
cmM
emset(revPkArray, 0, CM_IPV4_HDRLEN);
-
cmM
emset(pkArray, 0, CM_IPV4_HDRLEN);
+
m
emset(revPkArray, 0, CM_IPV4_HDRLEN);
+
m
emset(pkArray, 0, CM_IPV4_HDRLEN);
/* Pack Header Version */
pkArray[cnt++] = ipv4Hdr.hdrVer;
/* Pack Header Version */
pkArray[cnt++] = ipv4Hdr.hdrVer;
@@
-750,7
+748,7
@@
S16 BuildAppMsg(EgtpMsg *egtpMsg)
egtpMsg->msgHdr.teId = 10;
egtpMsg->msg = mBuf;
egtpMsg->msgHdr.teId = 10;
egtpMsg->msg = mBuf;
- return
ROK
;
+ return
ret
;
}
}
@@
-787,7
+785,7
@@
S16 BuildEgtpMsg(EgtpMsg *egtpMsg)
teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT3);
}
teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT3);
}
- ODU_
FIND
_MSG_LEN(egtpMsg->msg, &tPduSize);
+ ODU_
GET
_MSG_LEN(egtpMsg->msg, &tPduSize);
/*Adjust the header to fill the correct length*/
msgLen = tPduSize + (EGTP_MAX_HDR_LEN - hdrLen) - 0x08;
/*Adjust the header to fill the correct length*/
msgLen = tPduSize + (EGTP_MAX_HDR_LEN - hdrLen) - 0x08;