#include "du_utils.h"
#include "GlobalE2node-gNB-ID.h"
#include<ProtocolIE-FieldE2.h>
+#include "E2setupRequest.h"
+#include "InitiatingMessageE2.h"
+#include "SuccessfulOutcomeE2.h"
#include "E2AP-PDU.h"
#include "du_e2ap_msg_hdl.h"
#include "odu_common_codec.h"
DU_ALLOC(gNbId->global_gNB_ID.plmn_id.buf , gNbId->global_gNB_ID.plmn_id.size);
if(gNbId->global_gNB_ID.plmn_id.buf == NULLP)
{
- DU_LOG("\nE2AP: Memory allocation failed for Plmn buffer");
+ DU_LOG("\nERROR --> E2AP: Memory allocation failed for Plmn buffer");
ret = RFAILED;
}
else
gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.size);
if(gNbId->global_gNB_ID.gnb_id.choice.gnb_ID.buf == NULLP)
{
- DU_LOG("\nE2AP: Memory allocation failed for gnb buffer");
+ DU_LOG("\nERROR --> E2AP: Memory allocation failed for gnb buffer");
ret = RFAILED;
}
else
(*e2SetupReq)->protocolIEs.list.size);
if((*e2SetupReq)->protocolIEs.list.array == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation failed for array elements");
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed for array elements");
ret = RFAILED;
}
else
sizeof(E2setupRequestIEs_t));
if((*e2SetupReq)->protocolIEs.list.array[*idx] == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation failed for arrayidx [%d]", *idx);
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed for arrayidx [%d]", *idx);
ret = RFAILED;
}
else
if((*e2SetupReq)->protocolIEs.list.array[idx2]->value.choice.\
GlobalE2node_ID.choice.gNB == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation failed for gNbId");
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed for gNbId");
ret = RFAILED;
}
else
else
{
ret = RFAILED;
- DU_LOG("\nE2AP : Passed e2SetupReq is NULL");
+ DU_LOG("\nERROR --> E2AP : received e2SetupReq is NULL");
}
return ret;
}
E2setupRequest_t *e2SetupReq = NULLP;
asn_enc_rval_t encRetVal; /* Encoder return value */
- DU_LOG("\nE2AP : Building E2 Setup Request\n");
+ DU_LOG("\nINFO --> E2AP : Building E2 Setup Request\n");
do
{
DU_ALLOC(e2apMsg, sizeof(E2AP_PDU_t));
if(e2apMsg == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for E2AP-PDU failed");
break;
}
e2apMsg->present = E2AP_PDU_PR_initiatingMessage;
DU_ALLOC(e2apMsg->choice.initiatingMessage, sizeof(InitiatingMessageE2_t));
if(e2apMsg->choice.initiatingMessage == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for E2AP-PDU failed");
DU_FREE(e2apMsg, sizeof(E2AP_PDU_t));
return RFAILED;
}
ret = fillE2SetupReq(&e2SetupReq, &idx);
if(ret != ROK)
{
- DU_LOG("\nE2AP : fillE2SetupReq() failed");
+ DU_LOG("\nERROR --> E2AP : fillE2SetupReq() failed");
break;
}
/* Prints the Msg formed */
encBuf);
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG("\nE2AP : Could not encode E2SetupRequest structure (at %s)\n",\
+ DU_LOG("\nERROR --> E2AP : Could not encode E2SetupRequest structure (at %s)\n",\
encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
break;
}
else
{
- DU_LOG("\nE2AP : Created APER encoded buffer for E2SetupRequest\n");
+ DU_LOG("\nDEBUG --> E2AP : Created APER encoded buffer for E2SetupRequest\n");
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
}
if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
{
- DU_LOG("\nE2AP : Sending E2 Setup request failed");
+ DU_LOG("\nERROR --> E2AP : Sending E2 Setup request failed");
}
break;
break;
}
default:
- DU_LOG("\n E2AP: Invalid event at e2SetupRequet %ld ",\
+ DU_LOG("\nERROR --> E2AP: Invalid event at e2SetupRequet %ld ",\
(e2SetupReq->protocolIEs.list.array[idx2]->id));
break;
}
if(admitListPtr == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for RIC Admit List failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RIC Admit List failed");
ret = RFAILED;
}
else
DU_ALLOC(admitListPtr->list.array, admitListPtr->list.size);
if(admitListPtr->list.array == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for RIC Admit List failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RIC Admit List failed");
ret = RFAILED;
}
else
ricSubscriptionRsp->protocolIEs.list.size);
if(ricSubscriptionRsp->protocolIEs.list.array == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for FillRicSubscriptionRsp failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for FillRicSubscriptionRsp failed");
ret = RFAILED;
}
else
while(true)
{
- DU_LOG("\nE2AP : Building RIC Subscription Response\n");
+ DU_LOG("\nINFO --> E2AP : Building RIC Subscription Response\n");
DU_ALLOC(e2apRicMsg, sizeof(E2AP_PDU_t));
if(e2apRicMsg == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for E2AP-PDU failed");
break;
}
e2apRicMsg->present = E2AP_PDU_PR_successfulOutcome;
DU_ALLOC(e2apRicMsg->choice.successfulOutcome, sizeof(SuccessfulOutcomeE2_t));
if(e2apRicMsg->choice.successfulOutcome == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for Ric subscription Response failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RIC subscription Response failed");
break;
}
FillRicricSubscriptionRspret = FillRicSubscriptionRsp(ricSubscriptionRsp);
if(FillRicricSubscriptionRspret != ROK)
{
- DU_LOG("\nE2AP : Memory allocation for RICsubscriptionResponseIE failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RICsubscriptionResponseIE failed");
break;
}
encBuf);
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG("\nE2AP : Could not encode RIC Subscription Response structure (at %s)\n",\
+ DU_LOG("\nERROR --> E2AP : Could not encode RIC Subscription Response structure (at %s)\n",\
encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
break;
}
else
{
- DU_LOG("\nE2AP : Created APER encoded buffer for RIC subscription response \n");
+ DU_LOG("\nDEBUG --> E2AP : Created APER encoded buffer for RIC subscription response \n");
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
{
- DU_LOG("\nE2AP : Sending RIC Subscription Response failed");
+ DU_LOG("\nERROR --> E2AP : Sending RIC Subscription Response failed");
break;
}
uint32_t recvBufLen;
E2setupResponse_t *e2SetRspMsg;
- DU_LOG("\nE2AP : E2 Setup Response received");
+ DU_LOG("\nINFO --> E2AP : E2 Setup Response received");
duCb.e2Status = TRUE; //Set E2 status as true
e2SetRspMsg = &e2apMsg->choice.successfulOutcome->value.choice.E2setupResponse;
break;
}
default:
- DU_LOG("\nE2AP : Invalid IE received in E2SetupRsp:%ld",
+ DU_LOG("\nERROR --> E2AP : Invalid IE received in E2SetupRsp:%ld",
e2SetRspMsg->protocolIEs.list.array[idx]->id);
break;
}
RICsubscriptionRequest_t *ricSubsReq;
RICaction_ToBeSetup_ItemIEs_t *actionItem;
- DU_LOG("\nE2AP : Ric Subscription request received");
+ DU_LOG("\nINFO --> E2AP : RIC Subscription request received");
ricSubsReq = &e2apMsg->choice.initiatingMessage->value.choice.RICsubscriptionRequest;
for(idx=0; idx<ricSubsReq->protocolIEs.list.count; idx++)
break;
}
default:
- DU_LOG("\nE2AP : Invalid IE received in RicSetupLst:%ld",actionItem->id);
+ DU_LOG("\nERROR --> E2AP : Invalid IE received in RicSetupLst:%ld",actionItem->id);
break;
}
free(actionItem);
}
default:
- DU_LOG("\nE2AP : Invalid IE received in Ric SubsReq:%ld",
+ DU_LOG("\nERROR --> E2AP : Invalid IE received in RIC SubsReq:%ld",
ricSubsReq->protocolIEs.list.array[idx]->id);
break;
}
ricIndicationMsg->protocolIEs.list.size);
if(ricIndicationMsg->protocolIEs.list.array == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for RICindicationIEs failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RICindicationIEs failed");
ret = RFAILED;
}
else
sizeof(RICindication_IEs_t));
if(ricIndicationMsg->protocolIEs.list.array[idx] == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for RICindicationIEs failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RICindicationIEs failed");
ret = RFAILED;
}
}
ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationHeader.size);
if(ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationHeader.buf == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for RICindicationIEs failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RICindicationIEs failed");
ret = RFAILED;
}
else
ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationMessage.size);
if(ricIndicationMsg->protocolIEs.list.array[idx]->value.choice.RICindicationMessage.buf == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for RICindicationIEs failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for RICindicationIEs failed");
ret = RFAILED;
}
else
while(true)
{
- DU_LOG("\nE2AP : Building Ric Indication Message\n");
+ DU_LOG("\nINFO --> E2AP : Building RIC Indication Message\n");
DU_ALLOC(e2apMsg, sizeof(E2AP_PDU_t));
if(e2apMsg == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for E2AP-PDU failed");
break;
}
DU_ALLOC(e2apMsg->choice.initiatingMessage, sizeof(InitiatingMessageE2_t));
if(e2apMsg->choice.initiatingMessage == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation for E2AP-PDU failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation for E2AP-PDU failed");
break;
}
e2apMsg->choice.initiatingMessage->procedureCode = ProcedureCodeE2_id_RICindication;
encBuf);
if(encRetVal.encoded == ENCODE_FAIL)
{
- DU_LOG("\nE2AP : Could not encode RIC Indication Message (at %s)\n",\
+ DU_LOG("\nERROR --> E2AP : Could not encode RIC Indication Message (at %s)\n",\
encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
break;
}
else
{
- DU_LOG("\nE2AP : Created APER encoded buffer for RIC Indication Message \n");
+ DU_LOG("\nDEBUG --> E2AP : Created APER encoded buffer for RIC Indication Message \n");
for(int i=0; i< encBufSize; i++)
{
printf("%x",encBuf[i]);
if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
{
- DU_LOG("\nE2AP : Sending RIC Indication Message");
+ DU_LOG("\nINFO --> E2AP : Sending RIC Indication Message");
}
ret = ROK;
if(sctpSend(mBuf, E2_INTERFACE) != ROK)
{
- DU_LOG("\nE2AP : SCTP Send for E2 failed");
+ DU_LOG("\nERROR --> E2AP : SCTP Send for E2 failed");
ODU_PUT_MSG_BUF(mBuf);
return RFAILED;
}
}
else
{
- DU_LOG("\nE2AP : ODU_ADD_POST_MSG_MULT failed");
+ DU_LOG("\nERROR --> E2AP : ODU_ADD_POST_MSG_MULT failed");
ODU_PUT_MSG_BUF(mBuf);
return RFAILED;
}
}
else
{
- DU_LOG("\nE2AP : Failed to allocate memory");
+ DU_LOG("\nERROR --> E2AP : Failed to allocate memory");
return RFAILED;
}
asn_dec_rval_t rval ={0}; /* Decoder return value */
E2AP_PDU_t e2apasnmsg={0} ;
- DU_LOG("\nE2AP : Received E2AP message buffer");
+ DU_LOG("\nDEBUG --> E2AP : Received E2AP message buffer");
ODU_PRINT_MSG(mBuf, 0,0);
/* Copy mBuf into char array to decode it */
if(recvBuf == NULLP)
{
- DU_LOG("\nE2AP : Memory allocation failed");
+ DU_LOG("\nERROR --> E2AP : Memory allocation failed");
return;
}
if(ODU_COPY_MSG_TO_FIX_BUF(mBuf, 0, recvBufLen, (Data *)recvBuf, ©Cnt) != ROK)
{
- DU_LOG("\nE2AP : Failed while copying %d", copyCnt);
+ DU_LOG("\nERROR --> E2AP : Failed while copying %d", copyCnt);
return;
}
- printf("\nE2AP : Received flat buffer to be decoded : ");
+ printf("\nDEBUG --> E2AP : Received flat buffer to be decoded : ");
for(i=0; i< recvBufLen; i++)
{
printf("%x",recvBuf[i]);
if(rval.code == RC_FAIL || rval.code == RC_WMORE)
{
- DU_LOG("\nE2AP : ASN decode failed");
+ DU_LOG("\nERROR --> E2AP : ASN decode failed");
return;
}
printf("\n");
{
if(!duCb.e2Status)
{
- DU_LOG("\nE2AP : Store E2 setup response Params");
+ DU_LOG("\nDEBUG --> E2AP : Store E2 setup response Params");
procE2SetupRsp(e2apMsg);
}
break;
}
default:
{
- DU_LOG("\nE2AP : Invalid type of sucessful message [%d]", e2apMsg->choice.successfulOutcome->value.present);
+ DU_LOG("\nERROR --> E2AP : Invalid type of E2AP_PDU_PR_successfulOutcome [%d]",\
+ e2apMsg->choice.successfulOutcome->value.present);
return;
}
}/* End of switch(successfulOutcome) */
{
case InitiatingMessageE2__value_PR_RICsubscriptionRequest:
{
- DU_LOG("\nE2AP : Calling RIC Subscription Response");
if(procRicSubsReq(e2apMsg) == ROK)
{
BuildAndSendRicIndication();
}
default:
{
- DU_LOG("\nE2AP : Invalid type of intiating message [%d]", e2apMsg->choice.initiatingMessage->value.present);
+ DU_LOG("\nERROR --> E2AP : Invalid type of E2AP_PDU_PR_initiatingMessage [%d]",\
+ e2apMsg->choice.initiatingMessage->value.present);
return;
}
}/* End of switch(initiatingMessage) */
}
default:
{
- DU_LOG("\nE2AP : Invalid type of e2apMsg->present [%d]",e2apMsg->present);
+ DU_LOG("\nERROR --> E2AP : Invalid type of e2apMsg->present [%d]",e2apMsg->present);
return;
}
free(e2apMsg);