X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Flegtp.c;h=8407e3812c2df91f2f4e097abd44c926bcfaaeb2;hb=f73456bd55152c329601f8286ae67fe9875025bc;hp=5e676741aa8299edd510ab0fc375ada9bdb16b74;hpb=aee73991f728cc127d1ed76d5a52571d916235a4;p=o-du%2Fl2.git diff --git a/src/cm/legtp.c b/src/cm/legtp.c index 5e676741a..8407e3812 100644 --- a/src/cm/legtp.c +++ b/src/cm/legtp.c @@ -92,9 +92,9 @@ uint8_t packEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg) { Buffer *mBuf; - if(ODU_GET_MSG(DFLT_REGION, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK) { - printf("\nDU_APP : Failed to allocate memory"); + DU_LOG("\nERROR --> DU_APP : Failed to allocate memory"); return RFAILED; } if(egtpCfg.localIp.ipV4Pres) @@ -141,7 +141,7 @@ uint8_t unpackEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf) { EgtpConfig egtpCfg; - memset((uint8_t *)&egtpCfg, 0, sizeof(EgtpConfig)); + memset(&egtpCfg, 0, sizeof(EgtpConfig)); oduPackUInt32(&(egtpCfg.maxTunnelId), mBuf); oduPackUInt32(&(egtpCfg.minTunnelId), mBuf); @@ -160,7 +160,7 @@ uint8_t unpackEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf) oduPackUInt32(&(egtpCfg.localIp.ipV4Addr), mBuf); } - ODU_PUT_MSG(mBuf); + ODU_PUT_MSG_BUF(mBuf); return ((*func)(pst, egtpCfg)); } @@ -188,9 +188,9 @@ uint8_t packEgtpCfgCfm(Pst *pst, CmStatus cfm) { Buffer *mBuf; - if(ODU_GET_MSG(DFLT_REGION, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK) { - printf("\nEGTP : Failed to allocate memory"); + DU_LOG("\nERROR --> EGTP : Failed to allocate memory"); return RFAILED; } @@ -221,7 +221,7 @@ uint8_t unpackEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf) { CmStatus cfm; - memset((uint8_t *)&cfm, 0, sizeof(CmStatus)); + memset(&cfm, 0, sizeof(CmStatus)); unpackEgtpCfmStatus(&cfm, mBuf); return ((*func)(cfm)); @@ -247,9 +247,9 @@ uint8_t packEgtpSrvOpenReq(Pst *pst) { Buffer *mBuf; - if(ODU_GET_MSG(DFLT_REGION, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK) { - printf("\nDU_APP : Failed to allocate memory"); + DU_LOG("\nERROR --> DU_APP : Failed to allocate memory"); return RFAILED; } @@ -300,9 +300,9 @@ uint8_t packEgtpSrvOpenCfm(Pst *pst, CmStatus cfm) { Buffer *mBuf; - if(ODU_GET_MSG(DFLT_REGION, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK) { - printf("\nEGTP : Failed to allocate memory"); + DU_LOG("\nERROR --> EGTP : Failed to allocate memory"); return RFAILED; } @@ -333,7 +333,7 @@ uint8_t unpackEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf) { CmStatus cfm; - memset((uint8_t *)&cfm, 0, sizeof(CmStatus)); + memset(&cfm, 0, sizeof(CmStatus)); unpackEgtpCfmStatus(&cfm, mBuf); return ((*func)(cfm)); @@ -362,9 +362,9 @@ uint8_t packEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt) { Buffer *mBuf; - if(ODU_GET_MSG(DFLT_REGION, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK) { - printf("\nDU_APP : Failed to allocate memory"); + DU_LOG("\nERROR --> DU_APP : Failed to allocate memory"); return RFAILED; } @@ -399,7 +399,7 @@ uint8_t unpackEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf) { EgtpTnlEvt tnlEvt; - memset((uint8_t *)&tnlEvt, 0, sizeof(EgtpTnlEvt)); + memset(&tnlEvt, 0, sizeof(EgtpTnlEvt)); oduPackUInt32(&(tnlEvt.remTeid), mBuf); oduPackUInt32(&(tnlEvt.lclTeid), mBuf); @@ -432,9 +432,9 @@ uint8_t packEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt) { Buffer *mBuf; - if(ODU_GET_MSG(DFLT_REGION, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK) { - printf("\nEGTP : Failed to allocate memory"); + DU_LOG("\nERROR --> EGTP : Failed to allocate memory"); return RFAILED; } @@ -471,7 +471,7 @@ uint8_t unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf) { EgtpTnlEvt tnlEvt; - memset((uint8_t *)&tnlEvt, 0, sizeof(EgtpTnlEvt)); + memset(&tnlEvt, 0, sizeof(EgtpTnlEvt)); unpackEgtpCfmStatus(&(tnlEvt.cfmStatus), mBuf); oduPackUInt32(&(tnlEvt.remTeid), mBuf); @@ -484,52 +484,34 @@ uint8_t unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf) /******************************************************************* * - * @brief Packs Slot indication and sends to EGTP + * @brief Packs Polling requesting and sends to EGTP * * @details * - * Function : packEgtpSlotInd + * Function : packEgtpStartPollingReq * * Functionality: - * Packs slot indication and sends tp EGTP + * Packs polling request and sends to EGTP * * @params[in] Post structure * @return ROK - success * RFAILED - failure * *******************************************************************/ -uint8_t packEgtpSlotInd(Pst *pst) +uint8_t packEgtpStartPollingReq(Pst *pst) { Buffer *mBuf; - if(ODU_GET_MSG(DFLT_REGION, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK) { - printf("\nDU_APP : Failed to allocate memory"); + DU_LOG("\nERROR --> DU_APP : Failed to allocate memory"); return RFAILED; } ODU_POST_TASK(pst, mBuf); return ROK; - } -/******************************************************************* - * - * @brief Unpacks slot indication - * - * @details - * - * Function : unpackEgtpSlotInd - * - * Functionality: - * Unpacks slot indication - * - * @params[in] - * @return ROK - success - * RFAILED - failure - * -******************************************************************/ -uint8_t unpackEgtpSlotInd(EgtpSlotInd func, Pst *pst, Buffer *mBuf) -{ - return ((*func)()); -} +/********************************************************************** + End of file +**********************************************************************/