[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[o-du/l2.git] / src / cm / lsctp.c
index c28cc1d..3d7895e 100644 (file)
@@ -41,22 +41,22 @@ uint8_t cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy)
 {
    Buffer *mBuf;
 
-   if(ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK)
+   if(ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
    {
-      printf("\nSCTP : Failed to allocate memory");
+      DU_LOG("\nERROR  -->  SCTP : Failed to allocate memory");
       return RFAILED;
    }
 
    if(ntfy->header.nType == CM_INET_SCTP_ASSOC_CHANGE)
    {
-      oduUnpackUInt16(ntfy->u.assocChange.state, mBuf);
-      oduUnpackUInt32(ntfy->u.assocChange.assocId, mBuf);
+      oduPackUInt16(ntfy->u.assocChange.state, mBuf);
+      oduPackUInt32(ntfy->u.assocChange.assocId, mBuf);
    }
-   oduUnpackUInt16(ntfy->header.nType, mBuf);
+   oduPackUInt16(ntfy->header.nType, mBuf);
 
    if (ODU_POST_TASK(pst, mBuf) != ROK)
    {
-      printf("\nSCTP : ODU_POST_TASK failed while sending SCTP notification");
+      DU_LOG("\nERROR  -->  SCTP : ODU_POST_TASK failed while sending SCTP notification");
       return RFAILED;
    }
 
@@ -83,13 +83,13 @@ uint8_t cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy)
 uint8_t cmUnpkSctpNtfy(SctpNtfy func, Pst *pst, Buffer *mBuf)
 {
    CmInetSctpNotification ntfy;
-   memset((uint8_t*)&ntfy, 0, sizeof(CmInetSctpNotification));
+   memset(&ntfy, 0, sizeof(CmInetSctpNotification));
 
-   oduPackUInt16(&(ntfy.header.nType), mBuf);
+   oduUnpackUInt16(&(ntfy.header.nType), mBuf);
    if(ntfy.header.nType == CM_INET_SCTP_ASSOC_CHANGE)
    {
-      oduPackUInt32(&(ntfy.u.assocChange.assocId), mBuf);
-      oduPackUInt16(&(ntfy.u.assocChange.state), mBuf);
+      oduUnpackUInt32(&(ntfy.u.assocChange.assocId), mBuf);
+      oduUnpackUInt16(&(ntfy.u.assocChange.state), mBuf);
    }
 
    return ((*func)(mBuf, &ntfy));