X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Flsctp.c;h=3d7895e49fc3ab86069f808e4acdef3f0f9e2f4a;hb=49856df248fd976b4a9882ca4e650fc0bc3e4ee3;hp=95f7bbdfa30619ff1a91bea8c4142b711da2e71a;hpb=45d134510deb6902b870b4a0fb574b6075fba601;p=o-du%2Fl2.git diff --git a/src/cm/lsctp.c b/src/cm/lsctp.c index 95f7bbdfa..3d7895e49 100644 --- a/src/cm/lsctp.c +++ b/src/cm/lsctp.c @@ -37,30 +37,30 @@ * * ****************************************************************/ -S16 cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy) +uint8_t cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy) { Buffer *mBuf; - if(SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + if(ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - printf("\nSCTP : Failed to allocate memory"); - RETVALUE(RFAILED); + DU_LOG("\nERROR --> SCTP : Failed to allocate memory"); + return RFAILED; } if(ntfy->header.nType == CM_INET_SCTP_ASSOC_CHANGE) { - SPkU16(ntfy->u.assocChange.state, mBuf); - SPkU32(ntfy->u.assocChange.assocId, mBuf); + oduPackUInt16(ntfy->u.assocChange.state, mBuf); + oduPackUInt32(ntfy->u.assocChange.assocId, mBuf); } - SPkU16(ntfy->header.nType, mBuf); + oduPackUInt16(ntfy->header.nType, mBuf); - if (SPstTsk(pst, mBuf) != ROK) + if (ODU_POST_TASK(pst, mBuf) != ROK) { - printf("\nSCTP : SPstTsk failed while sending SCTP notification"); - RETVALUE(RFAILED); + DU_LOG("\nERROR --> SCTP : ODU_POST_TASK failed while sending SCTP notification"); + return RFAILED; } - RETVALUE(ROK); + return ROK; } /******************************************************************* @@ -80,19 +80,19 @@ S16 cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy) * * ****************************************************************/ -S16 cmUnpkSctpNtfy(SctpNtfy func, Pst *pst, Buffer *mBuf) +uint8_t cmUnpkSctpNtfy(SctpNtfy func, Pst *pst, Buffer *mBuf) { CmInetSctpNotification ntfy; - cmMemset((U8*)&ntfy, 0, sizeof(CmInetSctpNotification)); + memset(&ntfy, 0, sizeof(CmInetSctpNotification)); - SUnpkU16(&(ntfy.header.nType), mBuf); + oduUnpackUInt16(&(ntfy.header.nType), mBuf); if(ntfy.header.nType == CM_INET_SCTP_ASSOC_CHANGE) { - SUnpkU32(&(ntfy.u.assocChange.assocId), mBuf); - SUnpkU16(&(ntfy.u.assocChange.state), mBuf); + oduUnpackUInt32(&(ntfy.u.assocChange.assocId), mBuf); + oduUnpackUInt16(&(ntfy.u.assocChange.state), mBuf); } - RETVALUE((*func)(mBuf, &ntfy)); + return ((*func)(mBuf, &ntfy)); } /**********************************************************************