X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_e2ap_msg_hdl.c;h=a179f18e9e7cc9248687deaa186e8c5c4a1f7c64;hb=4d45b914f9e94203603d3b9fdbcb1aad361301dd;hp=efee4d829857c6e7c13540864712458640fb0f2b;hpb=6b44407d464a5a4e060999255233a7cfe78bb0fa;p=o-du%2Fl2.git diff --git a/src/du_app/du_e2ap_msg_hdl.c b/src/du_app/du_e2ap_msg_hdl.c index efee4d829..a179f18e9 100644 --- a/src/du_app/du_e2ap_msg_hdl.c +++ b/src/du_app/du_e2ap_msg_hdl.c @@ -236,7 +236,7 @@ uint8_t BuildAndSendE2SetupReq() /* Prints the Msg formed */ xer_fprint(stdout, &asn_DEF_E2AP_PDU, e2apMsg); - cmMemset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN); + memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN); encBufSize = 0; encRetVal = aper_encode(&asn_DEF_E2AP_PDU, 0, e2apMsg, PrepFinalEncBuf,\ encBuf); @@ -260,7 +260,7 @@ uint8_t BuildAndSendE2SetupReq() } break; - }while(1); + }while(true); deAllocateE2SetupReqMsg(e2apMsg, e2SetupReq, idx); return ret; @@ -644,7 +644,7 @@ uint8_t BuildAndSendRicSubscriptionRsp() uint8_t ret = RFAILED; uint8_t FillRicricSubscriptionRspret; - while(1) + while(true) { DU_LOG("\nE2AP : Building RIC Subscription Response\n"); @@ -678,7 +678,7 @@ uint8_t BuildAndSendRicSubscriptionRsp() /* Prints the Msg formed */ xer_fprint(stdout, &asn_DEF_E2AP_PDU, e2apRicMsg); - cmMemset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN); + memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN); encBufSize = 0; encRetVal = aper_encode(&asn_DEF_E2AP_PDU, 0, e2apRicMsg, PrepFinalEncBuf,\ encBuf); @@ -1080,7 +1080,7 @@ uint8_t BuildAndSendRicIndication() uint8_t ret = RFAILED; uint8_t FillRicIndicationret = ROK; - while(1) + while(true) { DU_LOG("\nE2AP : Building Ric Indication Message\n"); @@ -1111,7 +1111,7 @@ uint8_t BuildAndSendRicIndication() } /* Prints the Msg formed */ xer_fprint(stdout, &asn_DEF_E2AP_PDU, e2apMsg); - cmMemset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN); + memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN); encBufSize = 0; encRetVal = aper_encode(&asn_DEF_E2AP_PDU, 0, e2apMsg, PrepFinalEncBuf,\ encBuf); @@ -1163,26 +1163,26 @@ uint8_t SendE2APMsg(Region region, Pool pool) { Buffer *mBuf=NULLP; - if(SGetMsg(region, pool, &mBuf) == ROK) + if(ODU_GET_MSG(region, pool, &mBuf) == ROK) { - if(SAddPstMsgMult((Data *)encBuf, encBufSize, mBuf) == ROK) + if(ODU_ADD_POST_MSG_MULT((Data *)encBuf, encBufSize, mBuf) == ROK) { - SPrntMsg(mBuf, 0,0); + ODU_PRINT_MSG(mBuf, 0,0); if(sctpSend(mBuf, E2_INTERFACE) != ROK) { DU_LOG("\nE2AP : SCTP Send for E2 failed"); - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); return RFAILED; } } else { - DU_LOG("\nE2AP : SAddPstMsgMult failed"); - SPutMsg(mBuf); + DU_LOG("\nE2AP : ODU_ADD_POST_MSG_MULT failed"); + ODU_PUT_MSG(mBuf); return RFAILED; } - SPutMsg(mBuf); + ODU_PUT_MSG(mBuf); } else { @@ -1221,16 +1221,18 @@ void E2APMsgHdlr(Buffer *mBuf) E2AP_PDU_t e2apasnmsg ; DU_LOG("\nE2AP : Received E2AP message buffer"); - SPrntMsg(mBuf, 0,0); + ODU_PRINT_MSG(mBuf, 0,0); /* Copy mBuf into char array to decode it */ - SFndLenMsg(mBuf, &recvBufLen); - if(SGetSBuf(DFLT_REGION, DFLT_POOL, (Data **)&recvBuf, (Size)recvBufLen) != ROK) + ODU_FIND_MSG_LEN(mBuf, &recvBufLen); + DU_ALLOC(recvBuf, (Size)recvBufLen); + + if(recvBuf == NULLP) { DU_LOG("\nE2AP : Memory allocation failed"); return; } - if(SCpyMsgFix(mBuf, 0, recvBufLen, (Data *)recvBuf, ©Cnt) != ROK) + if(ODU_COPY_MSG_TO_FIX_BUF(mBuf, 0, recvBufLen, (Data *)recvBuf, ©Cnt) != ROK) { DU_LOG("\nE2AP : Failed while copying %d", copyCnt); return; @@ -1247,7 +1249,8 @@ void E2APMsgHdlr(Buffer *mBuf) memset(e2apMsg, 0, sizeof(E2AP_PDU_t)); rval = aper_decode(0, &asn_DEF_E2AP_PDU, (void **)&e2apMsg, recvBuf, recvBufLen, 0, 0); - SPutSBuf(DFLT_REGION, DFLT_POOL, (Data *)recvBuf, (Size)recvBufLen); + DU_FREE(recvBuf, (Size)recvBufLen); + if(rval.code == RC_FAIL || rval.code == RC_WMORE) { DU_LOG("\nE2AP : ASN decode failed");