Commit ced775c1 authored by Masayuki Harada's avatar Masayuki Harada

Merge remote-tracking branch 'remotes/oai/develop-NR_SA_F1AP_5GRECORDS' into...

Merge remote-tracking branch 'remotes/oai/develop-NR_SA_F1AP_5GRECORDS' into develop-NR_SA_F1AP_5GRECORDS
parents 33973121 7bbaffa4
...@@ -3166,15 +3166,12 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) { ...@@ -3166,15 +3166,12 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
if (RC.rrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid && if (RC.rrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid &&
(check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 && (check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
resp->cells_to_activate[j].nrpci == carrier->physCellId)) { resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
LOG_I(ENB_APP, "Copy system information and decode it for %i number of SI\n", resp->cells_to_activate[j].num_SI);
// copy system information and decode it // copy system information and decode it
for (si_ind=2; si_ind<10; si_ind++) { for (si_ind=2; si_ind<resp->cells_to_activate[j].num_SI + 2; si_ind++) {
printf("SI %d size %d: ", si_ind, resp->cells_to_activate[j].SI_container_length[si_ind]); //printf("SI %d size %d: ", si_ind, resp->cells_to_activate[j].SI_container_length[si_ind]);
for (int n=0;n<resp->cells_to_activate[j].SI_container_length[si_ind];n++) //for (int n=0;n<resp->cells_to_activate[j].SI_container_length[si_ind];n++)
printf("%02x ",resp->cells_to_activate[j].SI_container[si_ind][n]); // printf("%02x ",resp->cells_to_activate[j].SI_container[si_ind][n]);
printf("\n"); //printf("\n");
if (si_ind==6) si_ind=9; if (si_ind==6) si_ind=9;
if (resp->cells_to_activate[j].SI_container[si_ind] != NULL) { if (resp->cells_to_activate[j].SI_container[si_ind] != NULL) {
extract_and_decode_SI(i, extract_and_decode_SI(i,
......
...@@ -130,24 +130,27 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -130,24 +130,27 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ccch_sdu_len); ccch_sdu_len);
} }
LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
ie->value.choice.RRCContainer.size);
for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
printf("\n");
/* DUtoCURRCContainer */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, true);
if (ie) {
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(ie->value.choice.DUtoCURRCContainer.size);
memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
ie->value.choice.DUtoCURRCContainer.buf,
ie->value.choice.DUtoCURRCContainer.size);
LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, ie->value.choice.RRCContainer.size);
for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
printf("\n");
/* DUtoCURRCContainer */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, true);
if (ie) {
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(
ie->value.choice.DUtoCURRCContainer.size);
memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
ie->value.choice.DUtoCURRCContainer.buf,
ie->value.choice.DUtoCURRCContainer.size);
}
} }
// Find instance from nr_cellid // Find instance from nr_cellid
int rrc_inst = -1; int rrc_inst = -1;
if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) { if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
...@@ -292,10 +295,12 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -292,10 +295,12 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length); OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length); if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
for (int i = 0; i < ie->value.choice.RRCContainer.size; i++) LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
printf("%02x ", f1ap_dl_rrc->rrc_container[i]); for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
printf("\n"); printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
printf("\n");
}
/* optional */ /* optional */
/* c7. RAT_FrequencyPriorityInformation */ /* c7. RAT_FrequencyPriorityInformation */
......
...@@ -264,7 +264,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -264,7 +264,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->mnc, f1ap_ue_context_setup_req->mnc,
f1ap_ue_context_setup_req->mnc_digit_length, f1ap_ue_context_setup_req->mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
scell_toBeSetup_item.sCell_ID = nRCGI; scell_toBeSetup_item.sCell_ID = nRCGI;
/* 10.1.2 sCellIndex */ /* 10.1.2 sCellIndex */
...@@ -742,13 +742,15 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -742,13 +742,15 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* OPTIONAL */ /* OPTIONAL */
/* RRCContainer */ /* RRCContainer */
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); if(RC.nrrrc) {
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer; ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
ie->criticality = F1AP_Criticality_reject; ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer; ie->criticality = F1AP_Criticality_reject;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_ue_context_setup_req->rrc_container, ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer;
f1ap_ue_context_setup_req->rrc_container_length); OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_ue_context_setup_req->rrc_container,
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); f1ap_ue_context_setup_req->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* OPTIONAL */ /* OPTIONAL */
/* MaskedIMEISV */ /* MaskedIMEISV */
...@@ -781,7 +783,9 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -781,7 +783,9 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
LOG_D(F1AP,"F1AP UEContextSetupRequest Encoded %u bits\n", len); LOG_D(F1AP,"F1AP UEContextSetupRequest Encoded %u bits\n", len);
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/); if(RC.nrrrc) {
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
}
return 0; return 0;
} }
...@@ -1081,8 +1085,8 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { ...@@ -1081,8 +1085,8 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
// for test // for test
int mcc = 208; int mcc = 208;
int mnc = 93; int mnc = 92;
int mnc_digit_length = 8; int mnc_digit_length = 2;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
...@@ -1123,7 +1127,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { ...@@ -1123,7 +1127,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
ie->value.choice.NRCGI = nRCGI; ie->value.choice.NRCGI = nRCGI;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
...@@ -1248,7 +1252,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { ...@@ -1248,7 +1252,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
scell_toBeSetupMod_item.sCell_ID = nRCGI; scell_toBeSetupMod_item.sCell_ID = nRCGI;
/* sCellIndex */ /* sCellIndex */
...@@ -1288,7 +1292,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { ...@@ -1288,7 +1292,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
scell_toBeRemoved_item.sCell_ID = nRCGI; scell_toBeRemoved_item.sCell_ID = nRCGI;
/* ADD */ /* ADD */
......
...@@ -199,14 +199,19 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -199,14 +199,19 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007 served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
uint8_t fiveGS_TAC[3]; if (RC.nrrrc) {
served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC)); uint8_t fiveGS_TAC[3];
fiveGS_TAC[0] = ((uint8_t*)&f1ap_du_data->tac[i])[2]; fiveGS_TAC[0] = ((uint8_t*)&f1ap_du_data->tac[i])[2];
fiveGS_TAC[1] = ((uint8_t*)&f1ap_du_data->tac[i])[1]; fiveGS_TAC[1] = ((uint8_t*)&f1ap_du_data->tac[i])[1];
fiveGS_TAC[2] = ((uint8_t*)&f1ap_du_data->tac[i])[0]; fiveGS_TAC[2] = ((uint8_t*)&f1ap_du_data->tac[i])[0];
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char *)fiveGS_TAC, (const char *)fiveGS_TAC,
3); 3);
} else {
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char*)&f1ap_du_data->tac[i],
3);
}
/* - Configured_EPS_TAC */ /* - Configured_EPS_TAC */
if(0){ if(0){
...@@ -392,6 +397,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -392,6 +397,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
(const char*)f1ap_du_data->mib[i],//f1ap_du_data->mib, (const char*)f1ap_du_data->mib[i],//f1ap_du_data->mib,
f1ap_du_data->mib_length[i]); f1ap_du_data->mib_length[i]);
LOG_I(F1AP,"Filling SIB1_message for cell %d, length %d\n",i,f1ap_du_data->sib1_length[i]);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018 OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
(const char*)f1ap_du_data->sib1[i], (const char*)f1ap_du_data->sib1[i],
f1ap_du_data->sib1_length[i]); f1ap_du_data->sib1_length[i]);
...@@ -409,15 +415,17 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -409,15 +415,17 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* mandatory */ /* mandatory */
/* c5. RRC VERSION */ /* c5. RRC VERSION */
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); if(RC.nrrrc) {
ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version; ie = (F1AP_F1SetupRequestIEs_t *) calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
ie->criticality = F1AP_Criticality_reject; ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version; ie->criticality = F1AP_Criticality_reject;
ie->value.choice.RRC_Version.latest_RRC_Version.buf=calloc(1,sizeof(char)); ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0; ie->value.choice.RRC_Version.latest_RRC_Version.buf = calloc(1, sizeof(char));
ie->value.choice.RRC_Version.latest_RRC_Version.size = 1; ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
ie->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5; ie->value.choice.RRC_Version.latest_RRC_Version.size = 1;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ie->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
...@@ -553,10 +561,10 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -553,10 +561,10 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) { for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si]; F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size; size_t size = sib_item->sIBmessage.size;
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si] = size; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[sib_item->sIBtype] = size;
LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size); LOG_I(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si]); F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype] = malloc(size);
memcpy((void*)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si], memcpy((void*)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype],
(void*)sib_item->sIBmessage.buf, (void*)sib_item->sIBmessage.buf,
size); size);
} }
...@@ -589,7 +597,6 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -589,7 +597,6 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
} // switch ie } // switch ie
} // for IE } // for IE
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n"); AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
AssertFatal(num_cells_to_activate>0,"No cells activated\n");
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = num_cells_to_activate; F1AP_SETUP_RESP (msg_p).num_cells_to_activate = num_cells_to_activate;
for (int i=0;i<num_cells_to_activate;i++) for (int i=0;i<num_cells_to_activate;i++)
...@@ -725,13 +732,19 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -725,13 +732,19 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007 served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
uint8_t fiveGS_TAC[3]; if (RC.nrrrc) {
fiveGS_TAC[0] = ((uint8_t*)&f1ap_setup_req->tac[i])[2]; uint8_t fiveGS_TAC[3];
fiveGS_TAC[1] = ((uint8_t*)&f1ap_setup_req->tac[i])[1]; fiveGS_TAC[0] = ((uint8_t*)&f1ap_setup_req->tac[i])[2];
fiveGS_TAC[2] = ((uint8_t*)&f1ap_setup_req->tac[i])[0]; fiveGS_TAC[1] = ((uint8_t*)&f1ap_setup_req->tac[i])[1];
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, fiveGS_TAC[2] = ((uint8_t*)&f1ap_setup_req->tac[i])[0];
(const char *)fiveGS_TAC, OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
3); (const char *)fiveGS_TAC,
3);
} else {
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char *) &f1ap_setup_req->tac[i],
3);
}
/* - Configured_EPS_TAC */ /* - Configured_EPS_TAC */
if(1){ if(1){
...@@ -890,7 +903,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -890,7 +903,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007 served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char *) &f1ap_setup_req->tac[i], (const char *) &f1ap_setup_req->tac[i],
3); 3);
...@@ -1168,10 +1180,10 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -1168,10 +1180,10 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) { for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si]; F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size; size_t size = sib_item->sIBmessage.size;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si] = size; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[sib_item->sIBtype] = size;
LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size); LOG_I(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si]); F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype] = malloc(size);
memcpy((void*)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si], memcpy((void*)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype],
(void*)sib_item->sIBmessage.buf, (void*)sib_item->sIBmessage.buf,
size); size);
} }
......
...@@ -108,22 +108,52 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -108,22 +108,52 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->cellULConfigured = NULL; f1ap_ue_context_setup_req->cellULConfigured = NULL;
} }
/* CUtoDURRCInformation */ if (RC.nrrrc) {
/* Candidate_SpCell_List */ /* RRCContainer */
/* optional */
/* DRXCycle */
/* optional */
/* ResourceCoordinationTransferContainer */
/* SCell_ToBeSetup_List */
/* SRBs_ToBeSetup_List */
/* DRBs_ToBeSetup_List */
/* Decode DRBs_ToBeSetup_List */
if(0) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List, true); F1AP_ProtocolIE_ID_id_RRCContainer, false);
if (ie) {
/* correct here */
f1ap_ue_context_setup_req->rrc_container = malloc(ie->value.choice.RRCContainer.size);
memcpy(f1ap_ue_context_setup_req->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
} else {
LOG_E(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
}
// AssertFatal(0, "check configuration, send to appropriate handler\n");
protocol_ctxt_t ctxt;
// ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], ie->value.choice.GNB_DU_UE_F1AP_ID);
ctxt.rnti = 0x1234;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(ie->value.choice.RRCContainer.size, __func__);
if (pdcp_pdu_p != NULL) {
memset(pdcp_pdu_p->data, 0, ie->value.choice.RRCContainer.size);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
/* for rfsim */
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ie->value.choice.RRCContainer.size, pdcp_pdu_p);
}
} else {
/* CUtoDURRCInformation */
/* Candidate_SpCell_List */
/* optional */
/* DRXCycle */
/* optional */
/* ResourceCoordinationTransferContainer */
/* SCell_ToBeSetup_List */
/* SRBs_ToBeSetup_List */
/* DRBs_ToBeSetup_List */
/* Decode DRBs_ToBeSetup_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List, true);
f1ap_ue_context_setup_req->drbs_to_be_setup_length = ie->value.choice.DRBs_ToBeSetup_List.list.count; f1ap_ue_context_setup_req->drbs_to_be_setup_length = ie->value.choice.DRBs_ToBeSetup_List.list.count;
f1ap_ue_context_setup_req->drbs_to_be_setup = calloc(f1ap_ue_context_setup_req->drbs_to_be_setup_length, f1ap_ue_context_setup_req->drbs_to_be_setup = calloc(f1ap_ue_context_setup_req->drbs_to_be_setup_length,
sizeof(f1ap_drb_to_be_setup_t)); sizeof(f1ap_drb_to_be_setup_t));
AssertFatal(f1ap_ue_context_setup_req->drbs_to_be_setup, AssertFatal(f1ap_ue_context_setup_req->drbs_to_be_setup,
"could not allocate memory for f1ap_ue_context_setup_req->drbs_to_be_setup\n"); "could not allocate memory for f1ap_ue_context_setup_req->drbs_to_be_setup\n");
...@@ -153,35 +183,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -153,35 +183,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
} }
} }
} }
/* RRCContainer */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, false);
if (ie) {
/* correct here */
f1ap_ue_context_setup_req->rrc_container = malloc(ie->value.choice.RRCContainer.size);
memcpy(f1ap_ue_context_setup_req->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
} else {
LOG_E(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
}
// AssertFatal(0, "check configuration, send to appropriate handler\n");
protocol_ctxt_t ctxt;
// ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], ie->value.choice.GNB_DU_UE_F1AP_ID);
ctxt.rnti = 0x1234;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(ie->value.choice.RRCContainer.size, __func__);
if (pdcp_pdu_p != NULL) {
memset(pdcp_pdu_p->data, 0, ie->value.choice.RRCContainer.size);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
/* for rfsim */
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ie->value.choice.RRCContainer.size, pdcp_pdu_p);
}
return 0; return 0;
} }
......
...@@ -1951,8 +1951,8 @@ int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) { ...@@ -1951,8 +1951,8 @@ int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
du_extract_and_decode_SI(i, du_extract_and_decode_SI(i,
si_ind, si_ind,
resp->cells_to_activate[j].SI_container[si_ind], resp->cells_to_activate[j].SI_container[2+si_ind],
resp->cells_to_activate[j].SI_container_length[si_ind]); resp->cells_to_activate[j].SI_container_length[2+si_ind]);
} }
// perform MAC/L1 common configuration // perform MAC/L1 common configuration
...@@ -1986,8 +1986,8 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up ...@@ -1986,8 +1986,8 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
du_extract_and_decode_SI(i, du_extract_and_decode_SI(i,
si_ind, si_ind,
gnb_cu_cfg_update->cells_to_activate[j].SI_container[si_ind], gnb_cu_cfg_update->cells_to_activate[j].SI_container[2+si_ind],
gnb_cu_cfg_update->cells_to_activate[j].SI_container_length[si_ind]); gnb_cu_cfg_update->cells_to_activate[j].SI_container_length[2+si_ind]);
} }
// perform MAC/L1 common configuration // perform MAC/L1 common configuration
......
...@@ -8845,9 +8845,9 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -8845,9 +8845,9 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
if (rrc->carrier[0].SIB23) { if (rrc->carrier[0].SIB23) {
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container[2+num_SI] = rrc->carrier[0].SIB23; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container[2+num_SI] = rrc->carrier[0].SIB23;
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container_length[2+num_SI] = rrc->carrier[0].sizeof_SIB23; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container_length[2+num_SI] = rrc->carrier[0].sizeof_SIB23;
//printf("SI %d size %d: ", 0, F1AP_SETUP_RESP(msg_p).SI_container_length[j][num_SI]); //printf("SI %d size %d: ", 0, F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container_length[2+num_SI]);
//for (int n = 0; n < F1AP_SETUP_RESP(msg_p).SI_container_length[j][num_SI]; n++) //for (int n = 0; n < F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container_length[2+num_SI]; n++)
// printf("%02x ", F1AP_SETUP_RESP(msg_p).SI_container[0][num_SI][n]); // printf("%02x ", F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container[2+num_SI][n]);
//printf("\n"); //printf("\n");
num_SI++; num_SI++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment