#include "lkw.x"
#include "lrg.x"
#include "legtp.h"
+#include "du_app_mac_inf.h"
+#include "du_app_rlc_inf.h"
#include "du_cfg.h"
+#include "du_mgr.h"
#include "du_mgr_main.h"
+#include "du_utils.h"
#include "GlobalE2node-gNB-ID.h"
-#include "odu_common_codec.h"
#include<ProtocolIE-FieldE2.h>
#include "E2AP-PDU.h"
#include "du_e2ap_msg_hdl.h"
+#include "odu_common_codec.h"
/* Global variable */
DuCfgParams duCfgParam;
else
{
buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn, \
- &gNbId->global_gNB_ID.plmn_id);
+ gNbId->global_gNB_ID.plmn_id.buf);
/* fill gND Id */
gNbId->global_gNB_ID.gnb_id.present = GNB_ID_Choice_PR_gnb_ID;
/* Allocate Buffer size */
/* 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);
}
break;
- }while(1);
+ }while(true);
deAllocateE2SetupReqMsg(e2apMsg, e2SetupReq, idx);
return ret;
uint8_t ret = RFAILED;
uint8_t FillRicricSubscriptionRspret;
- while(1)
+ while(true)
{
DU_LOG("\nE2AP : Building RIC Subscription Response\n");
/* 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);
else
{
buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn, \
- &ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationHeader);
+ ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationHeader.buf);
idx++;
/* TO BE CHANGED: RIC INDICATION DATA */
/* For now filling a dummy octect data, need to tested with PRBs*/
else
{
buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn, \
- &ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationMessage);
+ ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationMessage.buf);
}
}
}
{
E2AP_PDU_t *e2apMsg = NULLP;
RICindication_t *ricIndicationMsg=NULLP;
- uint8_t elementCnt=0;
asn_enc_rval_t encRetVal; /* Encoder return value */
uint8_t ret = RFAILED;
uint8_t FillRicIndicationret = ROK;
- while(1)
+ while(true)
{
DU_LOG("\nE2AP : Building Ric Indication Message\n");
}
/* 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);
{
Buffer *mBuf=NULLP;
- if(SGetMsg(region, pool, &mBuf) == ROK)
+ if(ODU_GET_MSG_BUF(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_BUF(mBuf);
return RFAILED;
}
}
else
{
- DU_LOG("\nE2AP : SAddPstMsgMult failed");
- SPutMsg(mBuf);
+ DU_LOG("\nE2AP : ODU_ADD_POST_MSG_MULT failed");
+ ODU_PUT_MSG_BUF(mBuf);
return RFAILED;
}
- SPutMsg(mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
}
else
{
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_GET_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;
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");