Commit 666aee7f authored by Raymond Knopp's avatar Raymond Knopp

addition of GNB-CU-Configuration-Update/Update-Acknowledge/Update-Failure

parent 1e8a23f5
...@@ -24,10 +24,13 @@ MESSAGE_DEF(F1AP_CU_SCTP_REQ , MESSAGE_PRIORITY_MED, f1ap_cu_setup_req_t ...@@ -24,10 +24,13 @@ MESSAGE_DEF(F1AP_CU_SCTP_REQ , MESSAGE_PRIORITY_MED, f1ap_cu_setup_req_t
/* eNB_DU application layer -> F1AP messages or CU F1AP -> RRC*/ /* eNB_DU application layer -> F1AP messages or CU F1AP -> RRC*/
MESSAGE_DEF(F1AP_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_setup_req_t , f1ap_setup_req) MESSAGE_DEF(F1AP_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_setup_req_t , f1ap_setup_req)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_acknowledge_t , f1ap_gnb_cu_configuration_update_acknowledge)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_failure_t , f1ap_gnb_cu_configuration_update_failure)
/* F1AP -> eNB_DU or eNB_CU_RRC -> F1AP application layer messages */ /* F1AP -> eNB_DU or eNB_CU_RRC -> F1AP application layer messages */
MESSAGE_DEF(F1AP_SETUP_RESP , MESSAGE_PRIORITY_MED, f1ap_setup_resp_t , f1ap_setup_resp) MESSAGE_DEF(F1AP_SETUP_RESP , MESSAGE_PRIORITY_MED, f1ap_setup_resp_t , f1ap_setup_resp)
MESSAGE_DEF(F1AP_SETUP_FAILURE , MESSAGE_PRIORITY_MED, f1ap_setup_failure_t , f1ap_setup_failure) MESSAGE_DEF(F1AP_SETUP_FAILURE , MESSAGE_PRIORITY_MED, f1ap_setup_failure_t , f1ap_setup_failure)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_t , f1ap_gnb_cu_configuration_update)
/* MAC -> F1AP messages */ /* MAC -> F1AP messages */
MESSAGE_DEF(F1AP_INITIAL_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_initial_ul_rrc_message_t , f1ap_initial_ul_rrc_message) MESSAGE_DEF(F1AP_INITIAL_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_initial_ul_rrc_message_t , f1ap_initial_ul_rrc_message)
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#define F1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_req #define F1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_req
#define F1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_resp #define F1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_resp
#define F1AP_GNB_CU_CONFIGURATION_UPDATE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_acknowledge
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_failure
#define F1AP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_failure #define F1AP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_failure
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message #define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
...@@ -55,6 +58,8 @@ ...@@ -55,6 +58,8 @@
// Note this should be 512 from maxval in 38.473 // Note this should be 512 from maxval in 38.473
#define F1AP_MAX_NB_CELLS 2 #define F1AP_MAX_NB_CELLS 2
#define F1AP_MAX_NO_OF_TNL_ASSOCIATIONS 32
#define F1AP_MAX_NO_UE_ID 1024
typedef struct f1ap_net_ip_address_s { typedef struct f1ap_net_ip_address_s {
unsigned ipv4:1; unsigned ipv4:1;
unsigned ipv6:1; unsigned ipv6:1;
...@@ -174,6 +179,24 @@ typedef struct f1ap_setup_req_s { ...@@ -174,6 +179,24 @@ typedef struct f1ap_setup_req_s {
} f1ap_setup_req_t; } f1ap_setup_req_t;
typedef struct served_cells_to_activate_s {
/// mcc of DU cells
uint16_t mcc;
/// mnc of DU cells
uint16_t mnc;
/// mnc digit length of DU cells
uint8_t mnc_digit_length;
// NR Global Cell Id
uint64_t nr_cellid;
/// NRPCI
uint16_t nrpci;
/// num SI messages per DU cell
uint8_t num_SI;
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[21];
int SI_container_length[21];
} served_cells_to_activate_t;
typedef struct f1ap_setup_resp_s { typedef struct f1ap_setup_resp_s {
/* Connexion id used between SCTP/F1AP */ /* Connexion id used between SCTP/F1AP */
uint16_t cnx_id; uint16_t cnx_id;
...@@ -189,29 +212,62 @@ typedef struct f1ap_setup_resp_s { ...@@ -189,29 +212,62 @@ typedef struct f1ap_setup_resp_s {
char *gNB_CU_name; char *gNB_CU_name;
/// number of DU cells to activate /// number of DU cells to activate
uint16_t num_cells_to_activate; //0< num_cells_to_activate <= 512; uint16_t num_cells_to_activate; //0< num_cells_to_activate <= 512;
/// mcc of DU cells served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
uint16_t mcc[F1AP_MAX_NB_CELLS];
/// mnc of DU cells
uint16_t mnc[F1AP_MAX_NB_CELLS];
/// mnc digit length of DU cells
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];
// NR Global Cell Id
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
/// NRPCI
uint16_t nrpci[F1AP_MAX_NB_CELLS];
/// num SI messages per DU cell
uint8_t num_SI[F1AP_MAX_NB_CELLS];
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[F1AP_MAX_NB_CELLS][21];
int SI_container_length[F1AP_MAX_NB_CELLS][21];
} f1ap_setup_resp_t; } f1ap_setup_resp_t;
typedef struct f1ap_gnb_cu_configuration_update_s {
/* Connexion id used between SCTP/F1AP */
uint16_t cnx_id;
/* SCTP association id */
int32_t assoc_id;
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
/// string holding gNB_CU_name
char *gNB_CU_name;
/// number of DU cells to activate
uint16_t num_cells_to_activate; //0< num_cells_to_activate/mod <= 512;
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
} f1ap_gnb_cu_configuration_update_t;
typedef struct f1ap_setup_failure_s { typedef struct f1ap_setup_failure_s {
uint16_t cause; uint16_t cause;
uint16_t time_to_wait; uint16_t time_to_wait;
uint16_t criticality_diagnostics; uint16_t criticality_diagnostics;
} f1ap_setup_failure_t; } f1ap_setup_failure_t;
typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
uint16_t num_cells_failed_to_be_activated;
uint16_t mcc[F1AP_MAX_NB_CELLS];
uint16_t mnc[F1AP_MAX_NB_CELLS];
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
uint16_t cause[F1AP_MAX_NB_CELLS];
int have_criticality;
uint16_t criticality_diagnostics;
uint16_t noofTNLAssociations_to_setup;
uint16_t have_port[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
in_addr_t tl_address[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
uint16_t noofTNLAssociations_failed;
in_addr_t tl_address_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
uint16_t cause_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
uint16_t noofDedicatedSIDeliveryNeededUEs;
uint32_t gNB_CU_ue_id[F1AP_MAX_NO_UE_ID];
uint16_t ue_mcc[F1AP_MAX_NO_UE_ID];
uint16_t ue_mnc[F1AP_MAX_NO_UE_ID];
uint8_t ue_mnc_digit_length[F1AP_MAX_NO_UE_ID];
uint64_t ue_nr_cellid[F1AP_MAX_NO_UE_ID];
} f1ap_gnb_cu_configuration_update_acknowledge_t;
typedef struct f1ap_gnb_cu_configuration_update_failure_s {
uint16_t cause;
uint16_t time_to_wait;
uint16_t criticality_diagnostics;
} f1ap_gnb_cu_configuration_update_failure_t;
typedef struct f1ap_dl_rrc_message_s { typedef struct f1ap_dl_rrc_message_s {
uint32_t gNB_CU_ue_id; uint32_t gNB_CU_ue_id;
......
...@@ -3083,21 +3083,21 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) { ...@@ -3083,21 +3083,21 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
rrc_eNB_carrier_data_t *carrier = &RC.rrc[i]->carrier[0]; rrc_eNB_carrier_data_t *carrier = &RC.rrc[i]->carrier[0];
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID // identify local index of cell j by nr_cellid, plmn identity and physical cell ID
LOG_I(ENB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n", LOG_I(ENB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n",
j,i,RC.rrc[i]->nr_cellid,resp->nr_cellid[j]); j,i,RC.rrc[i]->nr_cellid,resp->cells_to_activate[j].nr_cellid);
if (RC.rrc[i]->nr_cellid == resp->nr_cellid[j] && if (RC.rrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid &&
(check_plmn_identity(carrier, resp->mcc[j], resp->mnc[j], resp->mnc_digit_length[j])>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->nrpci[j] == carrier->physCellId)) { resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it // copy system information and decode it
for (si_ind=0; si_ind<resp->num_SI[j]; si_ind++) { for (si_ind=0; si_ind<resp->cells_to_activate[j].num_SI; si_ind++) {
//printf("SI %d size %d: ", si_ind, resp->SI_container_length[j][si_ind]); //printf("SI %d size %d: ", si_ind, resp->SI_container_length[j][si_ind]);
//for (int n=0;n<resp->SI_container_length[j][si_ind];n++) //for (int n=0;n<resp->SI_container_length[j][si_ind];n++)
// printf("%02x ",resp->SI_container[j][si_ind][n]); // printf("%02x ",resp->SI_container[j][si_ind][n]);
//printf("\n"); //printf("\n");
extract_and_decode_SI(i, extract_and_decode_SI(i,
si_ind, si_ind,
resp->SI_container[j][si_ind], resp->cells_to_activate[j].SI_container[si_ind],
resp->SI_container_length[j][si_ind]); resp->cells_to_activate[j].SI_container_length[si_ind]);
} }
// perform MAC/L1 common configuration // perform MAC/L1 common configuration
......
...@@ -315,92 +315,95 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -315,92 +315,95 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
/* mandatory */ /* mandatory */
/* c3. cells to be Activated list */ /* c3. cells to be Activated list */
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate; int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate;
LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate); LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
for (i=0; if (num_cells_to_activate >0) {
i<num_cells_to_activate; ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
i++) { ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject;
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies; ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject; for (i=0;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item; i<num_cells_to_activate;
i++) {
/* 3.1 cells to be Activated list item */
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item; F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t)); cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
/* - nRCGI */ cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
F1AP_NRCGI_t nRCGI; cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i], /* 3.1 cells to be Activated list item */
&nRCGI.pLMN_Identity); F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity); memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
cells_to_be_activated_list_item.nRCGI = nRCGI;
/* - nRCGI */
/* optional */ F1AP_NRCGI_t nRCGI;
/* - nRPCI */ memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
if (1) { MCC_MNC_TO_PLMNID(f1ap_setup_resp->cells_to_activate[i].mcc, f1ap_setup_resp->cells_to_activate[i].mnc, f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t)); &nRCGI.pLMN_Identity);
*cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->nrpci[i]; // int 0..1007 NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
} cells_to_be_activated_list_item.nRCGI = nRCGI;
/* optional */ /* optional */
/* - gNB-CU System Information */ /* - nRPCI */
if (1) { if (1) {
/* 3.1.2 gNB-CUSystem Information */ cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs; *cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t)); }
cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject; /* optional */
cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation; /* - gNB-CU System Information */
if (1) {
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t)); /* 3.1.2 gNB-CUSystem Information */
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]); F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++) cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]); cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
//printf("\n"); //printf("\n");
// for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ? // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
for (int sIBtype=2;sIBtype<21;sIBtype++) { for (int sIBtype=2;sIBtype<21;sIBtype++) {
if (f1ap_setup_resp->SI_container[i][sIBtype]!=NULL) { if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype); AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item)); F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
memset((void*)sib_item,0,sizeof(*sib_item)); memset((void*)sib_item,0,sizeof(*sib_item));
sib_item->sIBtype = sIBtype; sib_item->sIBtype = sIBtype;
OCTET_STRING_fromBuf(&sib_item->sIBmessage, OCTET_STRING_fromBuf(&sib_item->sIBmessage,
(const char*)f1ap_setup_resp->SI_container[i][sIBtype], (const char*)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
f1ap_setup_resp->SI_container_length[i][sIBtype]); f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->SI_container_length[i][sIBtype]); LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item); ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
} }
}
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
ASN_SEQUENCE_ADD(&p_154P112_t.list,
cells_to_be_activated_list_itemExtIEs);
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
free(gNB_CUSystemInformation);
gNB_CUSystemInformation = NULL;
} }
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation; /* ADD */
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
ASN_SEQUENCE_ADD(&p_154P112_t.list,
cells_to_be_activated_list_itemExtIEs);
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
free(gNB_CUSystemInformation);
gNB_CUSystemInformation = NULL;
}
/* ADD */
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
cells_to_be_activated_list_item_ies); cells_to_be_activated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
} }
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) {
...@@ -529,7 +532,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -529,7 +532,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
*/ */
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) { //void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP) { int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update) {
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_GNBCUConfigurationUpdate_t *out; F1AP_GNBCUConfigurationUpdate_t *out;
F1AP_GNBCUConfigurationUpdateIEs_t *ie; F1AP_GNBCUConfigurationUpdateIEs_t *ie;
...@@ -538,10 +541,6 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -538,10 +541,6 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
uint32_t len; uint32_t len;
int i = 0; int i = 0;
// for test
int mcc = 208;
int mnc = 93;
int mnc_digit_length = 8;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
...@@ -549,7 +548,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -549,7 +548,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate; pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore; pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate; pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
out = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate; out = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
...@@ -559,63 +558,106 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -559,63 +558,106 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
ie->id = F1AP_ProtocolIE_ID_id_TransactionID; ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID; ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP); ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, 0);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// mandatory
// c2. Cells_to_be_Activated_List
if (f1ap_gnb_cu_configuration_update->num_cells_to_activate > 0) {
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
for (i=0;
i<f1ap_gnb_cu_configuration_update->num_cells_to_activate;
i++) {
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
// 2.1 cells to be Activated list item
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
// - nRCGI
F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
&nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
// optional
// -nRPCI
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
*cells_to_be_activated_list_item.nRPCI = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
// optional
// 3.1.2 gNB-CUSystem Information
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
/* mandatory */ if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
/* c2. Cells_to_be_Activated_List */ F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List; //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
ie->criticality = F1AP_Criticality_reject; // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List; //printf("\n");
for (i=0; // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
i<1; for (int sIBtype=2;sIBtype<21;sIBtype++) {
i++) { if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies; F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t)); memset((void*)sib_item,0,sizeof(*sib_item));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item; sib_item->sIBtype = sIBtype;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject; OCTET_STRING_fromBuf(&sib_item->sIBmessage,
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item; (const char*)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype],
f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
/* 2.1 cells to be Activated list item */
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item; LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t)); ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
}
/* - nRCGI */ }
F1AP_NRCGI_t nRCGI; cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
cells_to_be_activated_list_item.nRCGI = nRCGI;
ASN_SEQUENCE_ADD(&p_154P112_t.list,
/* optional */ cells_to_be_activated_list_itemExtIEs);
/* - nRPCI */ cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
if (0) {
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t)); free(gNB_CUSystemInformation);
*cells_to_be_activated_list_item.nRPCI = 321L; // int 0..1007 gNB_CUSystemInformation = NULL;
} }
/* optional */ // ADD
/* - gNB-CU System Information */ cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
//if (1) { ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
cells_to_be_activated_list_item_ies);
//} }
/* ADD */ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list, }
cells_to_be_activated_list_item_ies);
} /*
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ // c3. Cells_to_be_Deactivated_List
/* c3. Cells_to_be_Deactivated_List */ //
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List; ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
...@@ -631,11 +673,11 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -631,11 +673,11 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject; cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item; cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
/* 3.1 cells to be Deactivated list item */ // 3.1 cells to be Deactivated list item
F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item; F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t)); memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
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,
...@@ -643,17 +685,17 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -643,17 +685,17 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_deactivated_list_item.nRCGI = nRCGI; cells_to_be_deactivated_list_item.nRCGI = nRCGI;
//}
/* ADD */
cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item; cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
cells_to_be_deactivated_list_item_ies); cells_to_be_deactivated_list_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/
/* mandatory */ /*
/* c4. GNB_CU_TNL_Association_To_Add_List */ // c4. GNB_CU_TNL_Association_To_Add_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List; ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
...@@ -669,12 +711,12 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -669,12 +711,12 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item; gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
/* 4.1 GNB_CU_TNL_Association_To_Add_Item */ // 4.1 GNB_CU_TNL_Association_To_Add_Item
F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item; F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item;
memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t)); memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */ // 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t transportLayerAddress; F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address; transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
...@@ -687,21 +729,22 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -687,21 +729,22 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress; gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* 4.1.2 tNLAssociationUsage */ // 4.1.2 tNLAssociationUsage
gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue; gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
/* ADD */
gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item; gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
gnb_cu_tnl_association_to_add_item_ies); gnb_cu_tnl_association_to_add_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/
/*
/* mandatory */
/* c5. GNB_CU_TNL_Association_To_Remove_List */ // c5. GNB_CU_TNL_Association_To_Remove_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List; ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
...@@ -716,12 +759,12 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -716,12 +759,12 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item; gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
/* 4.1 GNB_CU_TNL_Association_To_Remove_Item */ // 4.1 GNB_CU_TNL_Association_To_Remove_Item
F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item; F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item;
memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t)); memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */ // 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t transportLayerAddress; F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address; transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
...@@ -735,15 +778,16 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -735,15 +778,16 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress; gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* ADD */
gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item; gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
gnb_cu_tnl_association_to_remove_item_ies); gnb_cu_tnl_association_to_remove_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/
/* mandatory */ /*
/* c6. GNB_CU_TNL_Association_To_Update_List */ //c6. GNB_CU_TNL_Association_To_Update_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List; ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
...@@ -758,12 +802,12 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -758,12 +802,12 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item; gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
/* 4.1 GNB_CU_TNL_Association_To_Update_Item */ // 4.1 GNB_CU_TNL_Association_To_Update_Item
F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item; F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t)); memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */ // 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t transportLayerAddress; F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address; transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
...@@ -777,13 +821,13 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -777,13 +821,13 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress; gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* 4.1.2 tNLAssociationUsage */ // 4.1.2 tNLAssociationUsage
if (1) { if (1) {
gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t)); gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
*gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue; *gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
} }
/* ADD */
gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item; gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
gnb_cu_tnl_association_to_update_item_ies); gnb_cu_tnl_association_to_update_item_ies);
...@@ -791,9 +835,10 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -791,9 +835,10 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/
/* mandatory */ /*
/* c7. Cells_to_be_Barred_List */ // c7. Cells_to_be_Barred_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List; ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
...@@ -808,11 +853,11 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -808,11 +853,11 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject; cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item; cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
/* 7.1 cells to be Deactivated list item */ // 7.1 cells to be Deactivated list item
F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item; F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t)); memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
/* - nRCGI */ // - nRCGI
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
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,
...@@ -820,20 +865,19 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -820,20 +865,19 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_barred_item.nRCGI = nRCGI; cells_to_be_barred_item.nRCGI = nRCGI;
/* 7.2 cellBarred*/ // 7.2 cellBarred
cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred; cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
/* ADD */
cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item; cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
cells_to_be_barred_item_ies); cells_to_be_barred_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/
/*
/* mandatory */ // c8. Protected_EUTRA_Resources_List
/* c8. Protected_EUTRA_Resources_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List; ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
...@@ -846,7 +890,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -846,7 +890,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies; F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
/* 8.1 SpectrumSharingGroupID */ // 8.1 SpectrumSharingGroupID
protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t)); protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List; protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject; protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
...@@ -856,7 +900,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -856,7 +900,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
sizeof(F1AP_Protected_EUTRA_Resources_Item_t)); sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies); ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
/*
F1AP_Served_EUTRA_Cells_Information_t served_eutra_cells_information; F1AP_Served_EUTRA_Cells_Information_t served_eutra_cells_information;
memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t)); memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
...@@ -887,9 +931,10 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -887,9 +931,10 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
ASN_SEQUENCE_ADD(&protected_eutra_resources_item_ies->value.choice.ListofEUTRACellsinGNBDUCoordination.list, &served_eutra_cells_information); ASN_SEQUENCE_ADD(&protected_eutra_resources_item_ies->value.choice.ListofEUTRACellsinGNBDUCoordination.list, &served_eutra_cells_information);
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies); ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
*/
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/
/* encode */ /* encode */
...@@ -897,7 +942,10 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -897,7 +942,10 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
LOG_E(F1AP, "Failed to encode F1 gNB-CU CONFIGURATION UPDATE\n"); LOG_E(F1AP, "Failed to encode F1 gNB-CU CONFIGURATION UPDATE\n");
return -1; return -1;
} }
printf("F1AP gNB-CU CONFIGURATION UPDATE : ");
for (int i=0;i<len;i++) printf("%02x ",buffer[i]);
printf("\n");
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0); cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0; return 0;
} }
......
...@@ -85,8 +85,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -85,8 +85,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
/* /*
* gNB-CU Configuration Update * gNB-CU Configuration Update
*/ */
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP); int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
......
...@@ -172,6 +172,14 @@ void *F1AP_CU_task(void *arg) { ...@@ -172,6 +172,14 @@ void *F1AP_CU_task(void *arg) {
&F1AP_SETUP_RESP(received_msg)); &F1AP_SETUP_RESP(received_msg));
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_GNB_CU_CONFIGURAITON_UPDATE\n");
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg));
CU_send_gNB_CU_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
break;
case F1AP_DL_RRC_MESSAGE: // from rrc case F1AP_DL_RRC_MESSAGE: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n"); LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
......
...@@ -49,6 +49,11 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) ...@@ -49,6 +49,11 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__); LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
break; break;
case F1AP_ProcedureCode_id_gNBCUConfigurationUpdate:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n", __func__);
break;
case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer: case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); //res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_InitialULRRCMessageTransfer\n", __func__); LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_InitialULRRCMessageTransfer\n", __func__);
...@@ -152,7 +157,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t ...@@ -152,7 +157,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
0, 0,
0); 0);
if (asn1_decoder_xer_print) { if (1 /*asn1_decoder_xer_print*/) {
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT START----------------- \n"); LOG_E(F1AP, "----------------- ASN1 DECODER PRINT START----------------- \n");
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu); xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n"); LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
...@@ -160,7 +165,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t ...@@ -160,7 +165,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code); //LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
if (dec_ret.code != RC_OK) { if (dec_ret.code != RC_OK) {
LOG_E(F1AP, "Failed to decode pdu\n"); AssertFatal(1==0,"Failed to decode pdu\n");
return -1; return -1;
} }
......
...@@ -43,10 +43,8 @@ extern RAN_CONTEXT_t RC; ...@@ -43,10 +43,8 @@ extern RAN_CONTEXT_t RC;
int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273}; int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273};
int to_NRNRB(int nrb) { int to_NRNRB(int nrb) {
for (int i=0;i<29;i++) if (nrb_lut[i] == nrb) return i; for (int i=0;i<29;i++) if (nrb_lut[i] == nrb) return i;
AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n"); AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n",nrb);
} }
int DU_handle_RESET(instance_t instance, int DU_handle_RESET(instance_t instance,
...@@ -495,7 +493,7 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -495,7 +493,7 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item; cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).mcc[i], F1AP_SETUP_RESP (msg_p).mnc[i], F1AP_SETUP_RESP (msg_p).mnc_digit_length[i]); TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc_digit_length);
AssertFatal(cell->nRPCI != NULL, "nRPCI is null\n"); AssertFatal(cell->nRPCI != NULL, "nRPCI is null\n");
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n", LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
cell->nRCGI.nRCellIdentity.buf[0], cell->nRCGI.nRCellIdentity.buf[0],
...@@ -504,7 +502,7 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -504,7 +502,7 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
cell->nRCGI.nRCellIdentity.buf[3], cell->nRCGI.nRCellIdentity.buf[3],
cell->nRCGI.nRCellIdentity.buf[4]); cell->nRCGI.nRCellIdentity.buf[4]);
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity, BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
F1AP_SETUP_RESP (msg_p).nr_cellid[i]); F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid);
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions; F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
AssertFatal(ext!=NULL,"Extension is null\n"); AssertFatal(ext!=NULL,"Extension is null\n");
...@@ -521,20 +519,20 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -521,20 +519,20 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
*/ */
case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation: case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation:
{ {
F1AP_SETUP_RESP (msg_p).nrpci[i] = *cell->nRPCI; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nrpci = *cell->nRPCI;
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t*)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation; F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t*)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
F1AP_SETUP_RESP (msg_p).num_SI[i] = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;
AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n"); AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n");
LOG_D(F1AP, "F1AP: F1Setup-Resp Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n", LOG_D(F1AP, "F1AP: F1Setup-Resp Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n",
i, F1AP_SETUP_RESP (msg_p).mcc[i], F1AP_SETUP_RESP (msg_p).mnc[i], i, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc,
F1AP_SETUP_RESP (msg_p).nr_cellid[i], F1AP_SETUP_RESP (msg_p).num_SI[i]); F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI);
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).SI_container_length[i][si] = size; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si] = size;
LOG_D(F1AP, "F1AP: F1Setup-Resp SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size); LOG_D(F1AP, "F1AP: F1Setup-Resp SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
F1AP_SETUP_RESP (msg_p).SI_container[i][si] = malloc(F1AP_SETUP_RESP (msg_p).SI_container_length[i][si]); 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]);
memcpy((void*)F1AP_SETUP_RESP (msg_p).SI_container[i][si], memcpy((void*)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si],
(void*)sib_item->sIBmessage.buf, (void*)sib_item->sIBmessage.buf,
size); size);
} }
...@@ -567,12 +565,12 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -567,12 +565,12 @@ 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"); LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
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;
// tmp // tmp
// F1AP_SETUP_RESP (msg_p).num_SI[0] = 1; // F1AP_SETUP_RESP (msg_p).num_SI[0] = 1;
for (int i=0;i<num_cells_to_activate;i++) for (int i=0;i<num_cells_to_activate;i++)
AssertFatal(F1AP_SETUP_RESP (msg_p).num_SI[i] > 0, "System Information %d is missing",i); AssertFatal(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI > 0, "System Information %d is missing",i);
MSC_LOG_RX_MESSAGE( MSC_LOG_RX_MESSAGE(
MSC_F1AP_DU, MSC_F1AP_DU,
...@@ -1051,17 +1049,191 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -1051,17 +1049,191 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
LOG_D(F1AP, "DU_handle_gNB_CU_CONFIGURATION_UPDATE\n");
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_initiatingMessage,
"pdu->present != F1AP_F1AP_PDU_PR_initiatingMessage\n");
AssertFatal(pdu->choice.initiatingMessage->procedureCode == F1AP_ProcedureCode_id_gNBCUConfigurationUpdate,
"pdu->choice.initiatingMessage->procedureCode != F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n");
AssertFatal(pdu->choice.initiatingMessage->criticality == F1AP_Criticality_reject,
"pdu->choice.initiatingMessage->criticality != F1AP_Criticality_reject\n");
AssertFatal(pdu->choice.initiatingMessage->value.present == F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate,
"pdu->choice.initiatingMessage->value.present != F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate\n");
F1AP_GNBCUConfigurationUpdate_t *in = &pdu->choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
F1AP_GNBCUConfigurationUpdateIEs_t *ie;
int TransactionId = -1;
int num_cells_to_activate = 0;
F1AP_Cells_to_be_Activated_List_Item_t *cell;
MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE);
LOG_D(F1AP, "F1AP: gNB_CU_Configuration_Update: protocolIEs.list.count %d\n",
in->protocolIEs.list.count);
for (int i=0;i < in->protocolIEs.list.count; i++) {
ie = in->protocolIEs.list.array[i];
switch (ie->id) {
case F1AP_ProtocolIE_ID_id_TransactionID:
AssertFatal(ie->criticality == F1AP_Criticality_reject,
"ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID,
"ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID\n");
TransactionId=ie->value.choice.TransactionID;
LOG_D(F1AP, "F1AP: GNB-CU-ConfigurationUpdate: TransactionId %d\n",
TransactionId);
break;
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List:
{
AssertFatal(ie->criticality == F1AP_Criticality_reject,
"ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List,
"ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List\n");
num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count;
LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate);
for (int i=0;i<num_cells_to_activate;i++) {
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i];
AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item,
"cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject,
"cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item,
"cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc_digit_length);
AssertFatal(cell->nRPCI != NULL, "nRPCI is null\n");
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
cell->nRCGI.nRCellIdentity.buf[0],
cell->nRCGI.nRCellIdentity.buf[1],
cell->nRCGI.nRCellIdentity.buf[2],
cell->nRCGI.nRCellIdentity.buf[3],
cell->nRCGI.nRCellIdentity.buf[4]);
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid);
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
AssertFatal(ext!=NULL,"Extension is null\n");
for (int cnt=0;cnt<ext->list.count;cnt++) {
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt];
switch (cells_to_be_activated_list_itemExtIEs->id) {
/*
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_NOTHING:
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailablePLMNList,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_ExtendedAvailablePLMN_List,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_IAB_Info_IAB_donor_CU,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailableSNPN_ID_List
*/
case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation:
{
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nrpci = *cell->nRPCI;
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t*)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;
AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n");
LOG_D(F1AP, "F1AP: F1Setup-Resp Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n",
i, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc,
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI);
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si] = size;
LOG_D(F1AP, "F1AP: F1Setup-Resp 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]);
memcpy((void*)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si],
(void*)sib_item->sIBmessage.buf,
size);
}
break;
}
case F1AP_ProtocolIE_ID_id_AvailablePLMNList:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break;
case F1AP_ProtocolIE_ID_id_ExtendedAvailablePLMN_List:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break;
case F1AP_ProtocolIE_ID_id_IAB_Info_IAB_donor_CU:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break;
case F1AP_ProtocolIE_ID_id_AvailableSNPN_ID_List:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break;
default:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n",(int)cells_to_be_activated_list_itemExtIEs->id);
break;
}
} // for (cnt=...
} // for (cells_to_activate...
break;
} // case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List
default:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n", (int)ie->id);
break;
} // switch ie
} // for IE
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate;
// tmp
// F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_SI[0] = 1;
for (int i=0;i<num_cells_to_activate;i++)
AssertFatal(F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI > 0, "System Information %d is missing",i);
MSC_LOG_RX_MESSAGE(
MSC_F1AP_DU,
MSC_F1AP_CU,
0,
0,
MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
assoc_id);
if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to GNB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
} else {
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to ENB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
}
return 0;
} }
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) { f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n",
GNBCUConfigurationUpdateFailure->cause);
} }
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) { f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0,
"%d cells failed to activate\n",
GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated);
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup == 0,
"%d TNLAssociations to setup, handle this ...\n",
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup);
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed == 0,
"%d TNLAssociations failed\n",
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed);
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs == 0,
"%d DedicatedSIDeliveryNeededUEs\n",
GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs);
return 0;
} }
......
...@@ -98,10 +98,10 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -98,10 +98,10 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure); f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge); f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
/* /*
......
...@@ -159,6 +159,14 @@ void *F1AP_DU_task(void *arg) { ...@@ -159,6 +159,14 @@ void *F1AP_DU_task(void *arg) {
du_task_send_sctp_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg), du_task_send_sctp_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_SETUP_REQ(received_msg)); &F1AP_SETUP_REQ(received_msg));
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg));
break;
case SCTP_NEW_ASSOCIATION_RESP: case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon // 1. store the respon
......
...@@ -50,7 +50,7 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = { ...@@ -50,7 +50,7 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */ { CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */
{ 0, 0, 0 }, /* ErrorIndication */ { 0, 0, 0 }, /* ErrorIndication */
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */ { 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ 0, 0, 0 }, /* gNBCUConfigurationUpdate */ { DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE }, /* gNBCUConfigurationUpdate */
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */ { DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
{ DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */ { DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */
{ 0, 0, 0 }, /* UEContextModification */ { 0, 0, 0 }, /* UEContextModification */
......
...@@ -146,9 +146,10 @@ void *gNB_app_task(void *args_p) ...@@ -146,9 +146,10 @@ void *gNB_app_task(void *args_p)
uint32_t registered_gnb = 0; uint32_t registered_gnb = 0;
uint32_t register_gnb_pending; uint32_t register_gnb_pending;
long gnb_register_retry_timer_id; long gnb_register_retry_timer_id;
int ret=0;
uint32_t gnb_id; uint32_t gnb_id;
MessageDef *msg_p = NULL; MessageDef *msg_p = NULL;
MessageDef *msg_ack_p = NULL;
const char *msg_name = NULL; const char *msg_name = NULL;
instance_t instance; instance_t instance;
int result; int result;
...@@ -254,7 +255,8 @@ void *gNB_app_task(void *args_p) ...@@ -254,7 +255,8 @@ void *gNB_app_task(void *args_p)
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p), LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate); F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
gNB_app_handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p)); if (F1AP_SETUP_RESP(msg_p).num_cells_to_activate > 0)
ret=gNB_app_handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
DevAssert(register_gnb_pending > 0); DevAssert(register_gnb_pending > 0);
register_gnb_pending--; register_gnb_pending--;
...@@ -291,7 +293,53 @@ void *gNB_app_task(void *args_p) ...@@ -291,7 +293,53 @@ void *gNB_app_task(void *args_p)
} }
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE:
AssertFatal(NODE_IS_DU(RC.nrrrc[0]->node_type), "Should not have received F1AP_GNB_CU_CONFIGURATION_UPDATE in CU/gNB\n");
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).gNB_CU_name,F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate);
gNB_app_handle_f1ap_gnb_cu_configuration_update(&F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p));
DevAssert(register_gnb_pending > 0);
/* Check if at least gNB is registered with one AMF */
if (registered_gnb == 0 && F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate > 0) {
register_gnb_pending--;
registered_gnb++;
}
else {
AssertFatal(1==0,"Received F1AP_GNB_CU_CONFIGURATION_UPDATE with at least one cell already configured, help !\n");
}
/* Check if all register gNB requests have been processed */
if (register_gnb_pending == 0) {
if (registered_gnb == gnb_nb) {
/* If all gNB cells are registered, start L2L1 task */
MessageDef *msg_init_p;
msg_init_p = itti_alloc_new_message (TASK_GNB_APP, 0, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
} else {
LOG_W(GNB_APP, " %d gNB not associated with a AMF, retrying registration in %d seconds ...\n",
gnb_nb - registered_gnb, GNB_REGISTER_RETRY_DELAY);
/* Restart the gNB registration process in GNB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (GNB_REGISTER_RETRY_DELAY, 0, TASK_GNB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &gnb_register_retry_timer_id) < 0) {
LOG_E(GNB_APP, " Can not start gNB register retry timer, use \"sleep\" instead!\n");
sleep(GNB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
registered_gnb = 0;
register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
}
}
}
break;
case NGAP_DEREGISTERED_GNB_IND: case NGAP_DEREGISTERED_GNB_IND:
LOG_W(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name, LOG_W(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf); NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf);
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "ngap_gNB.h" #include "ngap_gNB.h"
#include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
#include "sctp_default_values.h" #include "sctp_default_values.h"
#include "F1AP_CauseRadioNetwork.h"
// #include "SystemInformationBlockType2.h" // #include "SystemInformationBlockType2.h"
// #include "LAYER2/MAC/extern.h" // #include "LAYER2/MAC/extern.h"
// #include "LAYER2/MAC/proto.h" // #include "LAYER2/MAC/proto.h"
...@@ -1698,9 +1699,11 @@ void configure_gnb_du_mac(int inst) { ...@@ -1698,9 +1699,11 @@ void configure_gnb_du_mac(int inst) {
); );
} }
void gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
int i, j, si_ind; int i, j, si_ind;
LOG_I(GNB_APP, "cells_to_activated %d, RRC instances %d\n", int ret=0;
LOG_I(GNB_APP, "cells_to_activate %d, RRC instances %d\n",
resp->num_cells_to_activate, RC.nb_nr_inst); resp->num_cells_to_activate, RC.nb_nr_inst);
for (j = 0; j < resp->num_cells_to_activate; j++) { for (j = 0; j < resp->num_cells_to_activate; j++) {
...@@ -1708,27 +1711,85 @@ void gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) { ...@@ -1708,27 +1711,85 @@ void gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[i]->carrier; rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[i]->carrier;
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID // identify local index of cell j by nr_cellid, plmn identity and physical cell ID
LOG_I(GNB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n", LOG_I(GNB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n",
j, i, RC.nrrrc[i]->nr_cellid, resp->nr_cellid[j]); j, i, RC.nrrrc[i]->nr_cellid, resp->cells_to_activate[j].nr_cellid);
if (RC.nrrrc[i]->nr_cellid == resp->nr_cellid[j] && if (RC.nrrrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid &&
(du_check_plmn_identity(carrier, resp->mcc[j], resp->mnc[j], resp->mnc_digit_length[j])>0 && (du_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->nrpci[j] == carrier->physCellId)) { resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it // copy system information and decode it
for (si_ind=0; si_ind<resp->num_SI[j]; si_ind++) { for (si_ind=0; si_ind<resp->cells_to_activate[j].num_SI; si_ind++) {
du_extract_and_decode_SI(i, du_extract_and_decode_SI(i,
si_ind, si_ind,
resp->SI_container[j][si_ind], resp->cells_to_activate[j].SI_container[si_ind],
resp->SI_container_length[j][si_ind]); resp->cells_to_activate[j].SI_container_length[si_ind]);
} }
// perform MAC/L1 common configuration // perform MAC/L1 common configuration
configure_gnb_du_mac(i); configure_gnb_du_mac(i);
ret++;
} else { } else {
LOG_E(GNB_APP, "F1 Setup Response not matching\n"); LOG_E(GNB_APP, "F1 Setup Response not matching\n");
} }
} }
} }
return(ret);
}
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update) {
int i, j, si_ind, ret=0;
LOG_I(GNB_APP, "cells_to_activate %d, RRC instances %d\n",
gnb_cu_cfg_update->num_cells_to_activate, RC.nb_nr_inst);
for (j = 0; j < gnb_cu_cfg_update->num_cells_to_activate; j++) {
for (i = 0; i < RC.nb_nr_inst; i++) {
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[i]->carrier;
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID
LOG_I(GNB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, gnb_cu_cfg_updatenr_cellid %lx\n",
j, i, RC.nrrrc[i]->nr_cellid, gnb_cu_cfg_update->cells_to_activate[j].nr_cellid);
if (RC.nrrrc[i]->nr_cellid == gnb_cu_cfg_update->cells_to_activate[j].nr_cellid &&
(du_check_plmn_identity(carrier, gnb_cu_cfg_update->cells_to_activate[j].mcc, gnb_cu_cfg_update->cells_to_activate[j].mnc, gnb_cu_cfg_update->cells_to_activate[j].mnc_digit_length)>0 &&
gnb_cu_cfg_update->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it
for (si_ind=0; si_ind<gnb_cu_cfg_update->cells_to_activate[j].num_SI; si_ind++) {
du_extract_and_decode_SI(i,
si_ind,
gnb_cu_cfg_update->cells_to_activate[j].SI_container[si_ind],
gnb_cu_cfg_update->cells_to_activate[j].SI_container_length[si_ind]);
}
// perform MAC/L1 common configuration
configure_gnb_du_mac(i);
ret++;
} else {
LOG_E(GNB_APP, "GNB_CU_CONFIGURATION_UPDATE not matching\n");
}
}
}
MessageDef *msg_ack_p = NULL;
if (ret > 0) {
// generate gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE);
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).num_cells_failed_to_be_activated = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0;
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
}
else {
// generate gNB_CU_CONFIGURATION_UPDATE_FAILURE
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE);
F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(msg_ack_p).cause = F1AP_CauseRadioNetwork_cell_not_available;
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
}
return(ret);
} }
void set_node_type(void) { void set_node_type(void) {
......
...@@ -107,7 +107,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc); ...@@ -107,7 +107,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i); int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i); int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i); int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i);
void gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp); int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update);
void nr_read_config_and_init(void); void nr_read_config_and_init(void);
#endif /* GNB_CONFIG_H_ */ #endif /* GNB_CONFIG_H_ */
......
...@@ -8563,16 +8563,16 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -8563,16 +8563,16 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
} }
F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name; F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name;
F1AP_SETUP_RESP (msg_p).mcc[cu_cell_ind] = rrc->configuration.mcc[0]; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mcc = rrc->configuration.mcc[0];
F1AP_SETUP_RESP (msg_p).mnc[cu_cell_ind] = rrc->configuration.mnc[0]; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mnc = rrc->configuration.mnc[0];
F1AP_SETUP_RESP (msg_p).mnc_digit_length[cu_cell_ind] = rrc->configuration.mnc_digit_length[0]; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mnc_digit_length = rrc->configuration.mnc_digit_length[0];
F1AP_SETUP_RESP (msg_p).nr_cellid[cu_cell_ind] = rrc->nr_cellid; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].nr_cellid = rrc->nr_cellid;
F1AP_SETUP_RESP (msg_p).nrpci[cu_cell_ind] = f1_setup_req->nr_pci[i]; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->nr_pci[i];
int num_SI= 0; int num_SI= 0;
if (rrc->carrier[0].SIB23) { if (rrc->carrier[0].SIB23) {
F1AP_SETUP_RESP (msg_p).SI_container[cu_cell_ind][num_SI] = rrc->carrier[0].SIB23; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container[num_SI] = rrc->carrier[0].SIB23;
F1AP_SETUP_RESP (msg_p).SI_container_length[cu_cell_ind][num_SI] = rrc->carrier[0].sizeof_SIB23; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container_length[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).SI_container_length[j][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).SI_container_length[j][num_SI]; n++)
// printf("%02x ", F1AP_SETUP_RESP(msg_p).SI_container[0][num_SI][n]); // printf("%02x ", F1AP_SETUP_RESP(msg_p).SI_container[0][num_SI][n]);
...@@ -8580,7 +8580,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -8580,7 +8580,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
num_SI++; num_SI++;
} }
F1AP_SETUP_RESP (msg_p).num_SI[cu_cell_ind] = num_SI; F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].num_SI = num_SI;
cu_cell_ind++; cu_cell_ind++;
found_cell=1; found_cell=1;
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = cu_cell_ind; F1AP_SETUP_RESP (msg_p).num_cells_to_activate = cu_cell_ind;
......
...@@ -2353,7 +2353,7 @@ rrc_gNB_decode_dcch( ...@@ -2353,7 +2353,7 @@ rrc_gNB_decode_dcch(
void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
LOG_I(NR_RRC,"Received F1 Setup Request from gNB_DU %llu (%s)\n",(unsigned long long int)f1_setup_req->gNB_DU_id,f1_setup_req->gNB_DU_name); LOG_I(NR_RRC,"Received F1 Setup Request from gNB_DU %llu (%s)\n",(unsigned long long int)f1_setup_req->gNB_DU_id,f1_setup_req->gNB_DU_name);
int cu_cell_ind = 0; int cu_cell_ind = 0;
MessageDef *msg_p = NULL; MessageDef *msg_p = NULL,*msg_p2=NULL;
for (int i = 0; i < f1_setup_req->num_cells_available; i++) { for (int i = 0; i < f1_setup_req->num_cells_available; i++) {
int found_cell=0; int found_cell=0;
...@@ -2406,32 +2406,39 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -2406,32 +2406,39 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
"bcch_message->message.choice.c1->present != NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1\n"); "bcch_message->message.choice.c1->present != NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1\n");
rrc->carrier.sib1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1; rrc->carrier.sib1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
rrc->carrier.physCellId = f1_setup_req->nr_pci[i]; rrc->carrier.physCellId = f1_setup_req->nr_pci[i];
if (cu_cell_ind == 0) {
// prepare F1_SETUP_RESPONSE // prepare F1_SETUP_RESPONSE + GNB_CU_CONFIGURATION_UPDATE
if (msg_p == NULL) { if (msg_p == NULL) {
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_SETUP_RESP); msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_SETUP_RESP);
} }
if (msg_p2 == NULL) {
F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name; msg_p2 = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE);
F1AP_SETUP_RESP (msg_p).mcc[cu_cell_ind] = rrc->configuration.mcc[0]; }
F1AP_SETUP_RESP (msg_p).mnc[cu_cell_ind] = rrc->configuration.mnc[0];
F1AP_SETUP_RESP (msg_p).mnc_digit_length[cu_cell_ind] = rrc->configuration.mnc_digit_length[0]; F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name;
F1AP_SETUP_RESP (msg_p).nr_cellid[cu_cell_ind] = rrc->nr_cellid; F1AP_SETUP_RESP (msg_p).num_cells_to_activate = 0;
F1AP_SETUP_RESP (msg_p).nrpci[cu_cell_ind] = f1_setup_req->nr_pci[i];
}
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).gNB_CU_name = rrc->node_name;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mcc = rrc->configuration.mcc[0];
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mnc = rrc->configuration.mnc[0];
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mnc_digit_length = rrc->configuration.mnc_digit_length[0];
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].nr_cellid = rrc->nr_cellid;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->nr_pci[i];
int num_SI= 0; int num_SI= 0;
if (rrc->carrier.SIB23) { if (rrc->carrier.SIB23) {
F1AP_SETUP_RESP (msg_p).SI_container[cu_cell_ind][2] = rrc->carrier.SIB23; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].SI_container[2] = rrc->carrier.SIB23;
F1AP_SETUP_RESP (msg_p).SI_container_length[cu_cell_ind][2] = rrc->carrier.sizeof_SIB23; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].SI_container_length[2] = rrc->carrier.sizeof_SIB23;
num_SI++; num_SI++;
} }
F1AP_SETUP_RESP (msg_p).num_SI[cu_cell_ind] = num_SI; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].num_SI = num_SI;
cu_cell_ind++; cu_cell_ind++;
found_cell=1; found_cell=1;
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = cu_cell_ind; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).num_cells_to_activate = cu_cell_ind;
// send ITTI message to F1AP-CU task // send
itti_send_msg_to_task (TASK_CU_F1, GNB_MODULE_ID_TO_INSTANCE(j), msg_p);
break; break;
} else {// setup_req mcc/mnc match rrc internal list element } else {// setup_req mcc/mnc match rrc internal list element
LOG_W(NR_RRC,"[Inst %d] No matching MCC/MNC: rrc->mcc/f1_setup_req->mcc %d/%d rrc->mnc/f1_setup_req->mnc %d/%d rrc->nr_cellid/f1_setup_req->nr_cellid %ld/%ld \n", LOG_W(NR_RRC,"[Inst %d] No matching MCC/MNC: rrc->mcc/f1_setup_req->mcc %d/%d rrc->mnc/f1_setup_req->mnc %d/%d rrc->nr_cellid/f1_setup_req->nr_cellid %ld/%ld \n",
...@@ -2444,6 +2451,13 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -2444,6 +2451,13 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
if (found_cell == 0) { if (found_cell == 0) {
AssertFatal(1 == 0, "No cell found\n"); AssertFatal(1 == 0, "No cell found\n");
} }
else {
// send ITTI message to F1AP-CU task
itti_send_msg_to_task (TASK_CU_F1, 0, msg_p);
itti_send_msg_to_task (TASK_CU_F1, 0, msg_p2);
}
// handle other failure cases // handle other failure cases
}//for (int i=0;i<f1_setup_req->num_cells_available;i++) }//for (int i=0;i<f1_setup_req->num_cells_available;i++)
......
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