X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcu_stub%2Fcu_f1ap_msg_hdl.c;h=0cfc141f4bed1e1e691019702550cdeb7af4e9c0;hb=ba78fa13b01e0729fe0a6a7a18cbf1d52cdcda1c;hp=5b617b18d626807b44bc5598191c2796917cbf53;hpb=7c6820e987fadb1102e5891408ad33a8ce36ba95;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 5b617b18d..0cfc141f4 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -224,11 +224,7 @@ S16 SendF1APMsg(Region region, Pool pool) S16 BuildNrCellId(BIT_STRING_t *nrcell) { - U8 tmp; - for (tmp = 0 ; tmp < nrcell->size-1; tmp++) - { - nrcell->buf[tmp] = 0; - } + memset(nrcell->buf, 0, nrcell->size); nrcell->buf[4] = 16; nrcell->bits_unused = 4; nrcell->size = 5 * sizeof(uint8_t); @@ -255,8 +251,8 @@ S16 BuildNrCellId(BIT_STRING_t *nrcell) * ****************************************************************/ S16 BuildAndSendF1SetupRsp() { - U8 idx,ieIdx; - U8 elementCnt,cellCnt; + uint8_t idx,ieIdx; + uint8_t elementCnt,cellCnt; F1AP_PDU_t *f1apMsg = NULL; F1SetupResponse_t *f1SetupRsp; GNB_CU_Name_t *cuName; @@ -482,7 +478,7 @@ S16 BuildAndSendF1SetupRsp() rrcVer = &f1SetupRsp->protocolIEs.list.array[idx]->value.choice.RRC_Version; rrcVer->latest_RRC_Version.size = RRC_SIZE; - CU_ALLOC(rrcVer->latest_RRC_Version.buf, sizeof(U8)); + CU_ALLOC(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t)); if(rrcVer->latest_RRC_Version.buf == NULLP) { CU_FREE(cuName->buf, sizeof(cuName->size)); @@ -504,7 +500,7 @@ S16 BuildAndSendF1SetupRsp() CU_ALLOC(rrcVer->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P81_t)); if(rrcVer->iE_Extensions == NULLP) { - CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(U8)); + CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t)); CU_FREE(cuName->buf, sizeof(cuName->size)); for(ieIdx=0; ieIdxiE_Extensions,\ sizeof(ProtocolExtensionContainer_4624P81_t)); - CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(U8)); + CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t)); CU_FREE(cuName->buf, sizeof(cuName->size)); for(ieIdx=0; ieIdxiE_Extensions,\ sizeof(ProtocolExtensionContainer_4624P81_t)); - CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(U8)); + CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t)); CU_FREE(cuName->buf, sizeof(cuName->size)); for(ieIdx=0; ieIdxiE_Extensions->list.array[0]->extensionValue.present = \ RRC_Version_ExtIEs__extensionValue_PR_Latest_RRC_Version_Enhanced; rrcVer->iE_Extensions->list.array[0]->extensionValue.choice.\ - Latest_RRC_Version_Enhanced.size = 3*sizeof(U8); + Latest_RRC_Version_Enhanced.size = 3*sizeof(uint8_t); CU_ALLOC(rrcVer->iE_Extensions->list.\ array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf,\ - 3*sizeof(U8)); + 3*sizeof(uint8_t)); if(rrcVer->iE_Extensions->list.\ array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf == NULLP) { @@ -578,7 +574,7 @@ S16 BuildAndSendF1SetupRsp() sizeof(struct RRC_Version_ExtIEs *)); CU_FREE(rrcVer->iE_Extensions,\ sizeof(ProtocolExtensionContainer_4624P81_t)); - CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(U8)); + CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t)); CU_FREE(cuName->buf, sizeof(cuName->size)); for(ieIdx=0; ieIdxlatest_RRC_Version.buf, sizeof(U8)); + CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t)); CU_FREE(cuName->buf, sizeof(cuName->size)); for(idx=0; idxprotocolIEs.list.array[idx]->criticality = Criticality_reject; dlRRCMsg->protocolIEs.list.array[idx]->value.present = \ DLRRCMessageTransferIEs__value_PR_SRBID; - dlRRCMsg->protocolIEs.list.array[idx]->value.choice.SRBID = SRB1; + dlRRCMsg->protocolIEs.list.array[idx]->value.choice.SRBID = SRB0; /* RRCContainer */ idx++; @@ -1815,9 +1811,9 @@ uint8_t procInitULRRCMsg(F1AP_PDU_t *f1apMsg) uint8_t BuildNrcgi(NRCGI_t *nrcgi) { uint8_t ret; - uint8_t unused = 4; + uint8_t unused_bits = 4; uint8_t byteSize = 5; - uint8_t val = 16; + uint8_t val = 1; /* Allocate Buffer Memory */ nrcgi->pLMN_Identity.size = 3 * sizeof(uint8_t); CU_ALLOC(nrcgi->pLMN_Identity.buf, nrcgi->pLMN_Identity.size); @@ -1837,11 +1833,17 @@ uint8_t BuildNrcgi(NRCGI_t *nrcgi) { return RFAILED; } +#if 0 ret = fillBitString(&nrcgi->nRCellIdentity, unused, byteSize, val); if(ret != ROK) { return RFAILED; } +#endif + memset(nrcgi->nRCellIdentity.buf, 0, nrcgi->nRCellIdentity.size); + nrcgi->nRCellIdentity.buf[0] |= val; + nrcgi->nRCellIdentity.bits_unused = unused_bits; + return ROK; } /*******************************************************************