X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Flsctp.c;h=95f7bbdfa30619ff1a91bea8c4142b711da2e71a;hb=a5530e70a9d414952dadd1688aa9b4280c0dbb5a;hp=f96c2b26a177ca752c5aab842aa9736633d14713;hpb=3235ecfc7414aa0b72d0ad50db63ae8b5626045b;p=o-du%2Fl2.git diff --git a/src/cm/lsctp.c b/src/cm/lsctp.c index f96c2b26a..95f7bbdfa 100644 --- a/src/cm/lsctp.c +++ b/src/cm/lsctp.c @@ -17,90 +17,8 @@ *******************************************************************************/ /* This file contains DU APP and SCTP interface functions */ - -#include "du_sctp.h" - -/******************************************************************* - * - * @brief Packs SCTP configuration - * - * @details - * - * Function : cmPkSctpAssocReq - * - * Functionality: - * Packs SCTP configuration - * - * @params[in] Notification - * @return ROK - success - * RFAILED - failure - * - ******************************************************************/ -S16 cmPkSctpAssocReq(Pst *pst, F1SctpParams sctpCfgParam) -{ - Buffer *mBuf; - - if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK) - { - printf("\nDU_APP : Failed to allocate memory"); - RETVALUE(RFAILED); - } - - if(sctpCfgParam.duIpAddr.ipV4Pres) - { - SPkU32(sctpCfgParam.duIpAddr.ipV4Addr, mBuf); - } - cmPkBool(sctpCfgParam.duIpAddr.ipV4Pres, mBuf); - SPkU16(sctpCfgParam.duPort, mBuf); - - if(sctpCfgParam.cuIpAddr.ipV4Pres) - { - SPkU32(sctpCfgParam.cuIpAddr.ipV4Addr, mBuf); - } - cmPkBool(sctpCfgParam.cuIpAddr.ipV4Pres, mBuf); - SPkU16(sctpCfgParam.cuPort, mBuf); - - SPstTsk(pst, mBuf); - - RETVALUE(ROK); -} - -/******************************************************************* - * - * @brief Unpacks SCTP configuration - * - * @details - * - * Function : cmUnpkSctpAssocReq - * - * Functionality: - * Unpacks SCTP configuration - * - * @params[in] Notification - * @return ROK - success - * RFAILED - failure - * - ******************************************************************/ -S16 cmUnpkSctpAssocReq(Buffer *mBuf) -{ - cmMemset((U8*)&sctpCfg, 0, sizeof(F1SctpParams)); - - SUnpkU16(&(sctpCfg.cuPort), mBuf); - cmUnpkBool(&(sctpCfg.cuIpAddr.ipV4Pres), mBuf); - if(sctpCfg.cuIpAddr.ipV4Pres) - { - SUnpkU32(&(sctpCfg.cuIpAddr.ipV4Addr), mBuf); - } - - SUnpkU16(&(sctpCfg.duPort), mBuf); - cmUnpkBool(&(sctpCfg.duIpAddr.ipV4Pres), mBuf); - if(sctpCfg.duIpAddr.ipV4Pres) - { - SUnpkU32(&(sctpCfg.duIpAddr.ipV4Addr), mBuf); - } - - RETVALUE(ROK); -} +#include "common_def.h" +#include "lsctp.h" /******************************************************************* * @@ -123,7 +41,7 @@ S16 cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy) { Buffer *mBuf; - if(SGetMsg(DU_APP_MEM_REGION, DU_POOL, &mBuf) != ROK) + if(SGetMsg(pst->region, pst->pool, &mBuf) != ROK) { printf("\nSCTP : Failed to allocate memory"); RETVALUE(RFAILED); @@ -132,6 +50,7 @@ S16 cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy) if(ntfy->header.nType == CM_INET_SCTP_ASSOC_CHANGE) { SPkU16(ntfy->u.assocChange.state, mBuf); + SPkU32(ntfy->u.assocChange.assocId, mBuf); } SPkU16(ntfy->header.nType, mBuf); @@ -169,6 +88,7 @@ S16 cmUnpkSctpNtfy(SctpNtfy func, Pst *pst, Buffer *mBuf) SUnpkU16(&(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); }