*******************************************************************************/
/* This file contains DU APP and EGTP interface functions */
-
-#include "du_egtp.h"
+#include "common_def.h"
#include "legtp.h"
/*******************************************************************
* RFAILED - failure
*
******************************************************************/
-S16 packEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
+uint8_t packEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
{
- SPkU16(cfm.status, mBuf);
- SPkU16(cfm.reason, mBuf);
+ oduUnpackUInt16(cfm.status, mBuf);
+ oduUnpackUInt16(cfm.reason, mBuf);
- RETVALUE(ROK);
+ return ROK;
}
/*******************************************************************
*
******************************************************************/
-S16 unpackEgtpCfmStatus(CmStatus *cfm, Buffer *mBuf)
+uint8_t unpackEgtpCfmStatus(CmStatus *cfm, Buffer *mBuf)
{
- SUnpkU16(&(cfm->reason), mBuf);
- SUnpkU16(&(cfm->status), mBuf);
+ oduPackUInt16(&(cfm->reason), mBuf);
+ oduPackUInt16(&(cfm->status), mBuf);
- RETVALUE(ROK);
+ return ROK;
}
/*******************************************************************
* RFAILED - failure
*
******************************************************************/
-S16 packEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
+uint8_t packEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
- RETVALUE(RFAILED);
+ return RFAILED;
}
if(egtpCfg.localIp.ipV4Pres)
{
- SPkU32(egtpCfg.localIp.ipV4Addr, mBuf);
+ oduUnpackUInt32(egtpCfg.localIp.ipV4Addr, mBuf);
}
- cmPkBool(egtpCfg.localIp.ipV4Pres, mBuf);
- SPkU16(egtpCfg.localPort, mBuf);
+ oduPackBool(egtpCfg.localIp.ipV4Pres, mBuf);
+ oduUnpackUInt16(egtpCfg.localPort, mBuf);
if(egtpCfg.destIp.ipV4Pres)
{
- SPkU32(egtpCfg.destIp.ipV4Addr, mBuf);
+ oduUnpackUInt32(egtpCfg.destIp.ipV4Addr, mBuf);
}
- cmPkBool(egtpCfg.destIp.ipV4Pres, mBuf);
- SPkU16(egtpCfg.destPort, mBuf);
+ oduPackBool(egtpCfg.destIp.ipV4Pres, mBuf);
+ oduUnpackUInt16(egtpCfg.destPort, mBuf);
- SPkU32(egtpCfg.minTunnelId, mBuf);
- SPkU32(egtpCfg.maxTunnelId, mBuf);
+ oduUnpackUInt32(egtpCfg.minTunnelId, mBuf);
+ oduUnpackUInt32(egtpCfg.maxTunnelId, mBuf);
- SPstTsk(pst, mBuf);
+ ODU_POST_TASK(pst, mBuf);
- RETVALUE(ROK);
+ return ROK;
}
/*******************************************************************
* RFAILED - failure
*
* ****************************************************************/
-S16 unpackEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf)
+uint8_t unpackEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf)
{
EgtpConfig egtpCfg;
- cmMemset((U8 *)&egtpCfg, 0, sizeof(EgtpConfig));
+ memset(&egtpCfg, 0, sizeof(EgtpConfig));
- SUnpkU32(&(egtpCfg.maxTunnelId), mBuf);
- SUnpkU32(&(egtpCfg.minTunnelId), mBuf);
+ oduPackUInt32(&(egtpCfg.maxTunnelId), mBuf);
+ oduPackUInt32(&(egtpCfg.minTunnelId), mBuf);
- SUnpkU16(&(egtpCfg.destPort), mBuf);
- cmUnpkBool(&(egtpCfg.destIp.ipV4Pres), mBuf);
+ oduPackUInt16(&(egtpCfg.destPort), mBuf);
+ oduUnpackBool(&(egtpCfg.destIp.ipV4Pres), mBuf);
if(egtpCfg.destIp.ipV4Pres)
{
- SUnpkU32(&(egtpCfg.destIp.ipV4Addr), mBuf);
+ oduPackUInt32(&(egtpCfg.destIp.ipV4Addr), mBuf);
}
- SUnpkU16(&(egtpCfg.localPort), mBuf);
- cmUnpkBool(&(egtpCfg.localIp.ipV4Pres), mBuf);
+ oduPackUInt16(&(egtpCfg.localPort), mBuf);
+ oduUnpackBool(&(egtpCfg.localIp.ipV4Pres), mBuf);
if(egtpCfg.localIp.ipV4Pres)
{
- SUnpkU32(&(egtpCfg.localIp.ipV4Addr), mBuf);
+ oduPackUInt32(&(egtpCfg.localIp.ipV4Addr), mBuf);
}
- SPutMsg(mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
- RETVALUE((*func)(pst, egtpCfg));
+ return ((*func)(pst, egtpCfg));
}
*
******************************************************************/
-S16 packEgtpCfgCfm(Pst *pst, CmStatus cfm)
+uint8_t packEgtpCfgCfm(Pst *pst, CmStatus cfm)
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nEGTP : Failed to allocate memory");
- RETVALUE(RFAILED);
+ return RFAILED;
}
packEgtpCfmStatus(cfm, mBuf);
- SPstTsk(pst, mBuf);
- RETVALUE(ROK);
+ ODU_POST_TASK(pst, mBuf);
+ return ROK;
}
/*******************************************************************
*
******************************************************************/
-S16 unpackEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf)
+uint8_t unpackEgtpCfgCfm(EgtpCfgCfm func, Buffer *mBuf)
{
CmStatus cfm;
- cmMemset((U8 *)&cfm, 0, sizeof(CmStatus));
+ memset(&cfm, 0, sizeof(CmStatus));
unpackEgtpCfmStatus(&cfm, mBuf);
- RETVALUE((*func)(cfm));
+ return ((*func)(cfm));
}
/*******************************************************************
* RFAILED - failure
*
*******************************************************************/
-S16 packEgtpSrvOpenReq(Pst *pst)
+uint8_t packEgtpSrvOpenReq(Pst *pst)
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
- RETVALUE(RFAILED);
+ return RFAILED;
}
- SPstTsk(pst, mBuf);
- RETVALUE(ROK);
+ ODU_POST_TASK(pst, mBuf);
+ return ROK;
}
/*******************************************************************
* RFAILED - failure
*
******************************************************************/
-S16 unpackEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf)
+uint8_t unpackEgtpSrvOpenReq(EgtpSrvOpenReq func, Pst *pst, Buffer *mBuf)
{
- RETVALUE((*func)(pst));
+ return ((*func)(pst));
}
* RFAILED - failure
*
*******************************************************************/
-S16 packEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
+uint8_t packEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nEGTP : Failed to allocate memory");
- RETVALUE(RFAILED);
+ return RFAILED;
}
packEgtpCfmStatus(cfm, mBuf);
- SPstTsk(pst, mBuf);
- RETVALUE(ROK);
+ ODU_POST_TASK(pst, mBuf);
+ return ROK;
}
* RFAILED - failure
*
*******************************************************************/
-S16 unpackEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf)
+uint8_t unpackEgtpSrvOpenCfm(EgtpSrvOpenCfm func, Buffer *mBuf)
{
CmStatus cfm;
- cmMemset((U8 *)&cfm, 0, sizeof(CmStatus));
+ memset(&cfm, 0, sizeof(CmStatus));
unpackEgtpCfmStatus(&cfm, mBuf);
- RETVALUE((*func)(cfm));
+ return ((*func)(cfm));
}
/*******************************************************************
* RFAILED - failure
*
*******************************************************************/
-S16 packEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
+uint8_t packEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
- RETVALUE(RFAILED);
+ return RFAILED;
}
- SPkU8(tnlEvt.action, mBuf);
- SPkU32(tnlEvt.lclTeid, mBuf);
- SPkU32(tnlEvt.remTeid, mBuf);
+ oduUnpackUInt8(tnlEvt.action, mBuf);
+ oduUnpackUInt32(tnlEvt.lclTeid, mBuf);
+ oduUnpackUInt32(tnlEvt.remTeid, mBuf);
- SPstTsk(pst, mBuf);
- RETVALUE(ROK);
+ ODU_POST_TASK(pst, mBuf);
+ return ROK;
}
* RFAILED - failure
*
* *******************************************************************/
-S16 unpackEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf)
+uint8_t unpackEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf)
{
EgtpTnlEvt tnlEvt;
- cmMemset((U8 *)&tnlEvt, 0, sizeof(EgtpTnlEvt));
+ memset(&tnlEvt, 0, sizeof(EgtpTnlEvt));
- SUnpkU32(&(tnlEvt.remTeid), mBuf);
- SUnpkU32(&(tnlEvt.lclTeid), mBuf);
- SUnpkU8(&(tnlEvt.action), mBuf);
+ oduPackUInt32(&(tnlEvt.remTeid), mBuf);
+ oduPackUInt32(&(tnlEvt.lclTeid), mBuf);
+ oduPackUInt8(&(tnlEvt.action), mBuf);
- RETVALUE((* func)(pst, tnlEvt));
+ return ((* func)(pst, tnlEvt));
}
*
********************************************************************/
-S16 packEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
+uint8_t packEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nEGTP : Failed to allocate memory");
- RETVALUE(RFAILED);
+ return RFAILED;
}
- SPkU8(tnlEvt.action, mBuf);
- SPkU32(tnlEvt.lclTeid, mBuf);
- SPkU32(tnlEvt.remTeid, mBuf);
+ oduUnpackUInt8(tnlEvt.action, mBuf);
+ oduUnpackUInt32(tnlEvt.lclTeid, mBuf);
+ oduUnpackUInt32(tnlEvt.remTeid, mBuf);
packEgtpCfmStatus(tnlEvt.cfmStatus, mBuf);
- SPstTsk(pst, mBuf);
- RETVALUE(ROK);
+ ODU_POST_TASK(pst, mBuf);
+ return ROK;
}
* RFAILED - failure
*
* *******************************************************************/
-S16 unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf)
+uint8_t unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf)
{
EgtpTnlEvt tnlEvt;
- cmMemset((U8 *)&tnlEvt, 0, sizeof(EgtpTnlEvt));
+ memset(&tnlEvt, 0, sizeof(EgtpTnlEvt));
unpackEgtpCfmStatus(&(tnlEvt.cfmStatus), mBuf);
- SUnpkU32(&(tnlEvt.remTeid), mBuf);
- SUnpkU32(&(tnlEvt.lclTeid), mBuf);
- SUnpkU8(&(tnlEvt.action), mBuf);
+ oduPackUInt32(&(tnlEvt.remTeid), mBuf);
+ oduPackUInt32(&(tnlEvt.lclTeid), mBuf);
+ oduPackUInt8(&(tnlEvt.action), mBuf);
- RETVALUE((* func)(tnlEvt));
+ return ((* func)(tnlEvt));
}
/*******************************************************************
*
- * @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
*
*******************************************************************/
-S16 packEgtpSlotInd(Pst *pst)
+uint8_t packEgtpStartPollingReq(Pst *pst)
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(ODU_GET_MSG_BUF(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
- RETVALUE(RFAILED);
+ return RFAILED;
}
- SPstTsk(pst, mBuf);
- RETVALUE(ROK);
-
+ 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
- *
-******************************************************************/
-S16 unpackEgtpSlotInd(EgtpSlotInd func, Pst *pst, Buffer *mBuf)
-{
- RETVALUE((*func)());
-}
+/**********************************************************************
+ End of file
+**********************************************************************/