[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[o-du/l2.git] / src / cm / legtp.c
index 5eb17e6..1c07916 100644 (file)
@@ -39,8 +39,8 @@
  ******************************************************************/
 uint8_t packEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
 {
-   oduUnpackUInt16(cfm.status, mBuf);
-   oduUnpackUInt16(cfm.reason, mBuf);
+   oduPackUInt16(cfm.status, mBuf);
+   oduPackUInt16(cfm.reason, mBuf);
    
    return ROK;
 }
@@ -65,8 +65,8 @@ uint8_t packEgtpCfmStatus(CmStatus cfm, Buffer *mBuf)
 
 uint8_t unpackEgtpCfmStatus(CmStatus *cfm, Buffer *mBuf)
 {
-   oduPackUInt16(&(cfm->reason), mBuf);
-   oduPackUInt16(&(cfm->status), mBuf);
+   oduUnpackUInt16(&(cfm->reason), mBuf);
+   oduUnpackUInt16(&(cfm->status), mBuf);
 
    return ROK;
 }
@@ -94,25 +94,25 @@ uint8_t packEgtpCfgReq(Pst *pst, EgtpConfig egtpCfg)
 
    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)
    {
-      oduUnpackUInt32(egtpCfg.localIp.ipV4Addr, mBuf);
+      oduPackUInt32(egtpCfg.localIp.ipV4Addr, mBuf);
    }
    oduPackBool(egtpCfg.localIp.ipV4Pres, mBuf);
-   oduUnpackUInt16(egtpCfg.localPort, mBuf);
+   oduPackUInt16(egtpCfg.localPort, mBuf);
 
    if(egtpCfg.destIp.ipV4Pres)
    {
-      oduUnpackUInt32(egtpCfg.destIp.ipV4Addr, mBuf);
+      oduPackUInt32(egtpCfg.destIp.ipV4Addr, mBuf);
    }
    oduPackBool(egtpCfg.destIp.ipV4Pres, mBuf);
-   oduUnpackUInt16(egtpCfg.destPort, mBuf);
+   oduPackUInt16(egtpCfg.destPort, mBuf);
 
-   oduUnpackUInt32(egtpCfg.minTunnelId, mBuf);
-   oduUnpackUInt32(egtpCfg.maxTunnelId, mBuf);
+   oduPackUInt32(egtpCfg.minTunnelId, mBuf);
+   oduPackUInt32(egtpCfg.maxTunnelId, mBuf);
 
    ODU_POST_TASK(pst, mBuf);
 
@@ -143,21 +143,21 @@ uint8_t unpackEgtpCfgReq(EgtpCfgReq func, Pst *pst, Buffer *mBuf)
 
    memset(&egtpCfg, 0, sizeof(EgtpConfig));
 
-   oduPackUInt32(&(egtpCfg.maxTunnelId), mBuf);
-   oduPackUInt32(&(egtpCfg.minTunnelId), mBuf);
+   oduUnpackUInt32(&(egtpCfg.maxTunnelId), mBuf);
+   oduUnpackUInt32(&(egtpCfg.minTunnelId), mBuf);
   
-   oduPackUInt16(&(egtpCfg.destPort), mBuf);
+   oduUnpackUInt16(&(egtpCfg.destPort), mBuf);
    oduUnpackBool(&(egtpCfg.destIp.ipV4Pres), mBuf);
    if(egtpCfg.destIp.ipV4Pres)
    {  
-      oduPackUInt32(&(egtpCfg.destIp.ipV4Addr), mBuf);
+      oduUnpackUInt32(&(egtpCfg.destIp.ipV4Addr), mBuf);
    }
 
-   oduPackUInt16(&(egtpCfg.localPort), mBuf);
+   oduUnpackUInt16(&(egtpCfg.localPort), mBuf);
    oduUnpackBool(&(egtpCfg.localIp.ipV4Pres), mBuf);
    if(egtpCfg.localIp.ipV4Pres)
    {
-      oduPackUInt32(&(egtpCfg.localIp.ipV4Addr), mBuf);
+      oduUnpackUInt32(&(egtpCfg.localIp.ipV4Addr), mBuf);
    }
    
    ODU_PUT_MSG_BUF(mBuf);
@@ -190,7 +190,7 @@ uint8_t packEgtpCfgCfm(Pst *pst, CmStatus cfm)
   
    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;
    }
  
@@ -249,7 +249,7 @@ uint8_t packEgtpSrvOpenReq(Pst *pst)
  
    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;
    }
   
@@ -302,7 +302,7 @@ uint8_t packEgtpSrvOpenCfm(Pst *pst, CmStatus cfm)
  
    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;
    }
  
@@ -364,13 +364,13 @@ uint8_t packEgtpTnlMgmtReq(Pst *pst, EgtpTnlEvt tnlEvt)
 
    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;
    }
 
-   oduUnpackUInt8(tnlEvt.action, mBuf);
-   oduUnpackUInt32(tnlEvt.lclTeid, mBuf);
-   oduUnpackUInt32(tnlEvt.remTeid, mBuf);
+   oduPackUInt8(tnlEvt.action, mBuf);
+   oduPackUInt32(tnlEvt.lclTeid, mBuf);
+   oduPackUInt32(tnlEvt.remTeid, mBuf);
 
    ODU_POST_TASK(pst, mBuf);
    return ROK;
@@ -401,9 +401,9 @@ uint8_t unpackEgtpTnlMgmtReq(EgtpTnlMgmtReq func, Pst *pst, Buffer *mBuf)
 
    memset(&tnlEvt, 0, sizeof(EgtpTnlEvt));
 
-   oduPackUInt32(&(tnlEvt.remTeid), mBuf);
-   oduPackUInt32(&(tnlEvt.lclTeid), mBuf);
-   oduPackUInt8(&(tnlEvt.action), mBuf);
+   oduUnpackUInt32(&(tnlEvt.remTeid), mBuf);
+   oduUnpackUInt32(&(tnlEvt.lclTeid), mBuf);
+   oduUnpackUInt8(&(tnlEvt.action), mBuf);
 
    return ((* func)(pst, tnlEvt));
 
@@ -434,13 +434,13 @@ uint8_t packEgtpTnlMgmtCfm(Pst *pst, EgtpTnlEvt tnlEvt)
 
    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;
    }
     
-   oduUnpackUInt8(tnlEvt.action, mBuf);
-   oduUnpackUInt32(tnlEvt.lclTeid, mBuf);
-   oduUnpackUInt32(tnlEvt.remTeid, mBuf);
+   oduPackUInt8(tnlEvt.action, mBuf);
+   oduPackUInt32(tnlEvt.lclTeid, mBuf);
+   oduPackUInt32(tnlEvt.remTeid, mBuf);
    
    packEgtpCfmStatus(tnlEvt.cfmStatus, mBuf);
     
@@ -474,9 +474,9 @@ uint8_t unpackEgtpTnlMgmtCfm(EgtpTnlMgmtCfm func, Buffer *mBuf)
    memset(&tnlEvt, 0, sizeof(EgtpTnlEvt));
 
    unpackEgtpCfmStatus(&(tnlEvt.cfmStatus), mBuf); 
-   oduPackUInt32(&(tnlEvt.remTeid), mBuf);
-   oduPackUInt32(&(tnlEvt.lclTeid), mBuf);
-   oduPackUInt8(&(tnlEvt.action), mBuf);
+   oduUnpackUInt32(&(tnlEvt.remTeid), mBuf);
+   oduUnpackUInt32(&(tnlEvt.lclTeid), mBuf);
+   oduUnpackUInt8(&(tnlEvt.action), mBuf);
  
    return ((* func)(tnlEvt));
  
@@ -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_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
+**********************************************************************/