Commit 3021cf11 authored by Bing-Kai Hong's avatar Bing-Kai Hong

F1 & MAC:

1. Fix UE_CONTEXT_SETUP_REQUEST and CONTEXT_MODIFICATION_REQUEST encode/decode
2. Add gNB_DU_CONFIGURATION_UPDATE and gNB_CU_CONFIGURATION_UPDATE procedure
3. Add C_RNTI_TO_BIT_STRING function
4. Add INITIAL_UL_RRC_MESSAGE_TRANSFER procedure and with mac_du_data_ind (MSG3)
5. Add GNB-CUSystemInformation extension part for the F1SetupResponse procedure
parent a817b54c
......@@ -525,12 +525,16 @@ add_library(F1AP_LIB
include_directories ("${F1AP_C_DIR}")
include_directories ("${F1AP_DIR}")
message(${F1AP_C_DIR})
message(${F1AP_DIR})
add_library(F1AP
#${F1AP_DIR}/test.c
${F1AP_DIR}/DU_F1AP.c
${F1AP_DIR}/CU_F1AP.c
${F1AP_DIR}/sctp_du.c
${F1AP_DIR}/sctp_cu.c
)
add_executable(test_f1ap_du
......
......@@ -87,17 +87,20 @@ uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_
void F1AP_CU_task() {
printf("Start F1AP CU task!\n");
sctp_cu_init();
//sctp_cu_init();
// while (1) {
// switch () {
// case F1AP_ProcedureCode_id_F1Setup:
//CU_send_F1_SETUP_RESPONSE();
//CU_send_DL_RRC_MESSAGE_TRANSFER(); // L436
//CU_send_UE_CONTEXT_SETUP_REQUEST(); // god
//CU_send_UE_CONTEXT_MODIFICATION_REQUEST(); // oh my
//case F1AP_ProcedureCode_id_F1Setup:
CU_send_F1_SETUP_RESPONSE();
//case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer:
// CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER ();
//CU_send_DL_RRC_MESSAGE_TRANSFER(); // SRBID and RRCContainer get issue when decode.
//CU_send_UE_CONTEXT_SETUP_REQUEST();
//CU_send_UE_CONTEXT_MODIFICATION_REQUEST();
//CU_send_gNB_CU_CONFIGURATION_UPDATE((module_id_t)1, (module_id_t)2); // some problem found
// break;
// default:
......@@ -171,11 +174,6 @@ void CU_send_F1_SETUP_RESPONSE() {
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse;
/* response_present_val */
//F1AP_F1SetupResponseIEs__value_PR_TransactionID
//F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name
//F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List
/* mandatory */
/* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
......@@ -228,16 +226,39 @@ void CU_send_F1_SETUP_RESPONSE() {
/* optional */
/* - nRPCI */
if (0) {
if (1) {
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
*cells_to_be_activated_list_item.nRPCI = 321L; // int 0..1007
}
/* optional */
/* - gNB-CU System Information */
//if (1) {
if (1) {
/* 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;
//}
F1AP_GNB_CUSystemInformation_t gNB_CUSystemInformation;
memset((void *)&gNB_CUSystemInformation, 0, sizeof(F1AP_GNB_CUSystemInformation_t));
OCTET_STRING_fromBuf(&gNB_CUSystemInformation.sImessage,
"123456", strlen("123456"));
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = gNB_CUSystemInformation;
F1AP_ProtocolExtensionContainer_160P9_t p_160P9_t;
memset((void *)&p_160P9_t, 0, sizeof(F1AP_ProtocolExtensionContainer_160P9_t));
ASN_SEQUENCE_ADD(&p_160P9_t.list,
cells_to_be_activated_list_itemExtIEs);
cells_to_be_activated_list_item.iE_Extensions = &p_160P9_t;
}
/* 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,
......@@ -386,6 +407,16 @@ void CU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER(){
printf("CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER\n");
// decode the F1 message
// get the rrc message from the contauiner
// call func rrc_eNB_decode_ccch: <-- needs some update here
// if size > 0
// CU_send_DL_RRC_MESSAGE_TRANSFER(C.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.Payload, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.payload_size)
}
void CU_handle_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
AssertFatal(1==0,"Not implemented yet\n");
......@@ -447,7 +478,7 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER() {
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = 1L;
ie->value.choice.SRBID = 2L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
......@@ -468,7 +499,7 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER() {
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1", strlen("asdsa1"));
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "A", strlen("A"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
......@@ -516,8 +547,384 @@ void CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpda
}
void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
AssertFatal(1==0,"Not implemented yet\n");
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
void CU_send_gNB_CU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du_mod_idP) {
F1AP_F1AP_PDU_t pdu;
F1AP_GNBCUConfigurationUpdate_t *out;
F1AP_GNBCUConfigurationUpdateIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int ret = 0;
int i = 0;
f1ap_info_t f1ap_info;
f1ap_info.GNB_CU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 8;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
out = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
/* mandatory */
/* c1. Transaction ID (integer value) */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. Cells_to_be_Activated_List */
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<1;
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;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
/* optional */
/* - nRPCI */
if (0) {
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
*cells_to_be_activated_list_item.nRPCI = 321L; // int 0..1007
}
/* optional */
/* - gNB-CU System Information */
//if (1) {
//}
/* 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,
cells_to_be_activated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. Cells_to_be_Deactivated_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
for (i=0;
i<1;
i++) {
F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *cells_to_be_deactivated_list_item_ies;
cells_to_be_deactivated_list_item_ies = (F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Deactivated_List_ItemIEs_t));
cells_to_be_deactivated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
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;
/* 3.1 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));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
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;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
cells_to_be_deactivated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c4. GNB_CU_TNL_Association_To_Add_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
for (i=0;
i<1;
i++) {
F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *gnb_cu_tnl_association_to_add_item_ies;
gnb_cu_tnl_association_to_add_item_ies = (F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t));
gnb_cu_tnl_association_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
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;
/* 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;
memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* 4.1.2 tNLAssociationUsage */
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;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
gnb_cu_tnl_association_to_add_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c5. GNB_CU_TNL_Association_To_Remove_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
for (i=0;
i<1;
i++) {
F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *gnb_cu_tnl_association_to_remove_item_ies;
gnb_cu_tnl_association_to_remove_item_ies = (F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t));
gnb_cu_tnl_association_to_remove_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
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;
/* 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;
memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
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;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
gnb_cu_tnl_association_to_remove_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c6. GNB_CU_TNL_Association_To_Update_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
for (i=0;
i<1;
i++) {
F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *gnb_cu_tnl_association_to_update_item_ies;
gnb_cu_tnl_association_to_update_item_ies = (F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t));
gnb_cu_tnl_association_to_update_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
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;
/* 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;
memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* 4.1.2 tNLAssociationUsage */
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_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;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
gnb_cu_tnl_association_to_update_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c7. Cells_to_be_Barred_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
for (i=0;
i<1;
i++) {
F1AP_Cells_to_be_Barred_ItemIEs_t *cells_to_be_barred_item_ies;
cells_to_be_barred_item_ies = (F1AP_Cells_to_be_Barred_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Barred_ItemIEs_t));
cells_to_be_barred_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
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;
/* 7.1 cells to be Deactivated list 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));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_barred_item.nRCGI = nRCGI;
/* 7.2 cellBarred*/
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;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
cells_to_be_barred_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c8. Protected_EUTRA_Resources_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
for (i=0;
i<1;
i++) {
F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
/* 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->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_SpectrumSharingGroupID;
protected_eutra_resources_item_ies->value.choice.SpectrumSharingGroupID = 1L;
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
/* 8.2 ListofEUTRACellsinGNBDUCoordination */
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->criticality = F1AP_Criticality_reject;
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_ListofEUTRACellsinGNBDUCoordination;
F1AP_Served_EUTRA_Cells_Information_t served_eutra_cells_information;
memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
F1AP_EUTRA_Mode_Info_t eUTRA_Mode_Info;
memset((void *)&eUTRA_Mode_Info, 0, sizeof(F1AP_EUTRA_Mode_Info_t));
// eUTRAFDD
eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRAFDD;
F1AP_EUTRA_FDD_Info_t *eutra_fdd_info;
eutra_fdd_info = (F1AP_EUTRA_FDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_FDD_Info_t));
eutra_fdd_info->uL_offsetToPointA = 123L;
eutra_fdd_info->dL_offsetToPointA = 456L;
eUTRA_Mode_Info.choice.eUTRAFDD = eutra_fdd_info;
// eUTRATDD
// eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRATDD;
// F1AP_EUTRA_TDD_Info_t *eutra_tdd_info;
// eutra_tdd_info = (F1AP_EUTRA_TDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_TDD_Info_t));
// eutra_tdd_info->uL_offsetToPointA = 123L;
// eutra_tdd_info->dL_offsetToPointA = 456L;
// eUTRA_Mode_Info.choice.eUTRATDD = eutra_tdd_info;
served_eutra_cells_information.eUTRA_Mode_Info = eUTRA_Mode_Info;
OCTET_STRING_fromBuf(&served_eutra_cells_information.protectedEUTRAResourceIndication, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
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(&out->protocolIEs.list, ie);
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return -1;
}
printf("\n");
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
}
}
void CU_handle_gNB_CU_CONFIGURATION_UPDATE_FALIURE(F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) {
......@@ -596,7 +1003,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST() {
/* c4. ServCellIndex */
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ServCellndex;
ie->criticality = F1AP_Criticality_ignore;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex;
ie->value.choice.ServCellIndex = 2;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......@@ -763,7 +1170,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST() {
memset((void *)&srbs_toBeSetup_item, 0, sizeof(F1AP_SRBs_ToBeSetup_Item_t));
/* - sRBID */
srbs_toBeSetup_item.sRBID = 50L;
srbs_toBeSetup_item.sRBID = 2L;
/* ADD */
srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item = srbs_toBeSetup_item;
......@@ -789,7 +1196,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST() {
drbs_toBeSetup_item_ies->criticality = F1AP_Criticality_reject;
drbs_toBeSetup_item_ies->value.present = F1AP_DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item;
/* 10.1 SRBs_ToBeSetup_Item */
/* 10.1 DRBs_ToBeSetup_Item */
F1AP_DRBs_ToBeSetup_Item_t drbs_toBeSetup_item;
memset((void *)&drbs_toBeSetup_item, 0, sizeof(F1AP_DRBs_ToBeSetup_Item_t));
......@@ -799,7 +1206,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST() {
/* qoSInformation */
drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->qCI = 789L;
drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->qCI = 254L;
/* ULTunnels_ToBeSetup_List */
int maxnoofULTunnels = 1; // 2;
......@@ -808,6 +1215,8 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST() {
i++) {
/* ULTunnels_ToBeSetup_Item */
F1AP_ULUPTNLInformation_ToBeSetup_Item_t *uLUPTNLInformation_ToBeSetup_Item;
// gTPTunnel
uLUPTNLInformation_ToBeSetup_Item = (F1AP_ULUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_ULUPTNLInformation_ToBeSetup_Item_t));
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
......@@ -819,7 +1228,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST() {
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
ASN_SEQUENCE_ADD(&drbs_toBeSetup_item.uLUPTNLInformation_ToBeSetup_List.list, &uLUPTNLInformation_ToBeSetup_Item);
ASN_SEQUENCE_ADD(&drbs_toBeSetup_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item);
}
/* rLCMode */
......@@ -1137,7 +1546,7 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST() {
memset((void *)&srbs_toBeSetupMod_item, 0, sizeof(F1AP_SRBs_ToBeSetupMod_Item_t));
/* - sRBID */
srbs_toBeSetupMod_item.sRBID = 50L;
srbs_toBeSetupMod_item.sRBID = 3L;
/* ADD */
srbs_toBeSetupMod_item_ies->value.choice.SRBs_ToBeSetupMod_Item = srbs_toBeSetupMod_item;
......@@ -1175,7 +1584,7 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST() {
/* qoSInformation */
drbs_toBeSetupMod_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS->qCI = 789L;
drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS->qCI = 253L;
/* ULTunnels_ToBeSetupMod_List */
int j = 0;
......@@ -1244,7 +1653,7 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST() {
/* qoSInformation */
drbs_toBeModified_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS->qCI = 789L;
drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS->qCI = 254L;
/* ULTunnels_ToBeModified_List */
int j = 0;
......@@ -1305,7 +1714,7 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST() {
memset((void *)&srbs_toBeReleased_item, 0, sizeof(F1AP_SRBs_ToBeReleased_Item_t));
/* - sRBID */
srbs_toBeReleased_item.sRBID = 50L;
srbs_toBeReleased_item.sRBID = 2L;
/* ADD */
srbs_toBeReleased_item_ies->value.choice.SRBs_ToBeReleased_Item = srbs_toBeReleased_item;
......
......@@ -34,7 +34,7 @@
#include "f1ap_common.h"
#include "f1ap_messages_types.h"
#include "platform_types.h"
#include "log.h"
#include "common/utils/LOG/log.h"
/* This structure describes association of a DU to a CU */
typedef struct f1ap_info {
......@@ -71,6 +71,7 @@ typedef struct f1ap_info {
// helper functions
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
#define F1AP_UE_IDENTIFIER_NUMBER 3
#define NUMBER_OF_eNB_MAX 3
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t du_mod_idP) {
......@@ -80,6 +81,13 @@ uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_
return transaction_identifier[enb_mod_idP+du_mod_idP];
}
uint8_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id) {
static uint8_t UE_identifier[NUMBER_OF_eNB_MAX];
UE_identifier[enb_mod_idP+CC_idP+UE_id] = (UE_identifier[enb_mod_idP+CC_idP+UE_id] + 1) % F1AP_UE_IDENTIFIER_NUMBER;
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+du_mod_idP]);
return UE_identifier[enb_mod_idP+CC_idP+UE_id];
}
// ==============================================================================
void F1AP_DU_task() {
......@@ -94,9 +102,11 @@ void F1AP_DU_task() {
// case F1AP_ProcedureCode_id_F1Setup:
//DU_send_F1_SETUP_REQUEST((module_id_t)1, (module_id_t)2);
// break;
//DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER();
//DU_send_UL_RRC_MESSAGE_TRANSFER(); // OK
//DU_send_UE_CONTEXT_SETUP_RESPONSE(); // OK
DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(); // OK
//DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(); // OK
//DU_send_gNB_DU_CONFIGURATION_UPDATE((module_id_t)1, (module_id_t)2);
// default:
// } // switch
......@@ -106,6 +116,10 @@ void F1AP_DU_task() {
return NULL;
}
// ==============================================================================
// ==============================================================================
......@@ -573,6 +587,114 @@ void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
//void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER() {
void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP,
uint8_t *sduP,
sdu_size_t sdu_lenP
)
{
F1AP_F1AP_PDU_t pdu;
F1AP_InitialULRRCMessageTransfer_t *out;
F1AP_InitialULRRCMessageTransferIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int ret = 0;
int i = 0;
// for test
f1ap_info_t f1ap_info;
f1ap_info.GNB_DU_ID = 789;
f1ap_info.GNB_DU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 3;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_InitialULRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_InitialULRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.InitialULRRCMessageTransfer;
/* mandatory */
/* c1. GNB_DU_UE_F1AP_ID */
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = F1AP_get_UE_identifier(module_idP, CC_idP, UE_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. NRCGI */
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_NRCGI;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI;
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
ie->value.choice.NRCGI = nRCGI;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. C_RNTI */ // 16
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_C_RNTI;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_C_RNTI;
C_RNTI_TO_BIT_STRING(rntiP, &ie->value.choice.C_RNTI);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c4. RRCContainer */
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, sduP, sdu_lenP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c5. DUtoCURRCContainer */
if (0) {
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_DUtoCURRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCContainer, "dummy_val",
strlen("dummy_val"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
}
printf("\n");
f1ap_du_send_message(buffer, len);
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
void DU_send_UL_RRC_MESSAGE_TRANSFER() {
......@@ -653,8 +775,462 @@ void DU_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessage
}
void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
AssertFatal(1==0,"Not implemented yet\n");
//void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du_mod_idP) {
F1AP_F1AP_PDU_t pdu;
F1AP_GNBDUConfigurationUpdate_t *out;
F1AP_GNBDUConfigurationUpdateIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int ret = 0;
int i = 0;
// for test
f1ap_info_t f1ap_info;
f1ap_info.GNB_DU_ID = 789;
f1ap_info.GNB_DU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 3;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBDUConfigurationUpdate;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
out = &pdu.choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
/* mandatory */
/* c1. Transaction ID (integer value) */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. Served_Cells_To_Add */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List;
for (i=0;
i<1;
i++) {
//
F1AP_Served_Cells_To_Add_ItemIEs_t *served_cells_to_add_item_ies;
served_cells_to_add_item_ies = (F1AP_Served_Cells_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Add_ItemIEs_t));
served_cells_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_Item;
served_cells_to_add_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_add_item_ies->value.present = F1AP_Served_Cells_To_Add_ItemIEs__value_PR_Served_Cells_To_Add_Item;
F1AP_Served_Cells_To_Add_Item_t served_cells_to_add_item;
memset((void *)&served_cells_to_add_item, 0, sizeof(F1AP_Served_Cells_To_Add_Item_t));
/* 2.1.1 serverd cell Information */
F1AP_Served_Cell_Information_t served_cell_information;
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &nRCGI.pLMN_Identity);
//INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
nRCGI.nRCellIdentity.buf = malloc((36+7)/8);
nRCGI.nRCellIdentity.size = (36+7)/8;
nRCGI.nRCellIdentity.bits_unused = 4;
nRCGI.nRCellIdentity.buf[0] = 123;
//nRCGI.nRCellIdentity = 15;
served_cell_information.nRCGI = nRCGI;
/* - nRPCI */
served_cell_information.nRPCI = 321; // int 0..1007
/* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
"10",
3);
/* - Configured_EPS_TAC */
if(1){
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
"2",
2);
}
/* - broadcast PLMNs */
int maxnoofBPLMNS = 1;
for (i=0;
i<maxnoofBPLMNS;
i++) {
/* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &broadcastPLMNs_Item->pLMN_Identity);
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
}
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info;
if ("FDD") {
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
ul_freqBandNrItem.freqBandIndicatorNr = 888L;
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
/* >>> DL NRFreqInfo */
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
F1AP_FreqBandNrItem_t dl_freqBandNrItem;
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
dl_freqBandNrItem.freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
/* >>> UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
/* >>> DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
nR_Mode_Info.choice.fDD = fDD_Info;
} else { // TDD
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
/* > TDD >> TDD Info */
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
/* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
nr_freqBandNrItem.freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
nR_Mode_Info.choice.tDD = tDD_Info;
}
served_cell_information.nR_Mode_Info = nR_Mode_Info;
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
served_cells_to_add_item.served_Cell_Information = served_cell_information; //
/* 2.1.2 gNB-DU System Information */
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
"1",
sizeof("1"));
served_cells_to_add_item.gNB_DU_System_Information = gNB_DU_System_Information; //
/* ADD */
served_cells_to_add_item_ies->value.choice.Served_Cells_To_Add_Item = served_cells_to_add_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Add_List.list,
served_cells_to_add_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. Served_Cells_To_Modify */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
for (i=0;
i<1;
i++) {
//
F1AP_Served_Cells_To_Modify_ItemIEs_t *served_cells_to_modify_item_ies;
served_cells_to_modify_item_ies = (F1AP_Served_Cells_To_Modify_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Modify_ItemIEs_t));
served_cells_to_modify_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_Item;
served_cells_to_modify_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_modify_item_ies->value.present = F1AP_Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item;
F1AP_Served_Cells_To_Modify_Item_t served_cells_to_modify_item;
memset((void *)&served_cells_to_modify_item, 0, sizeof(F1AP_Served_Cells_To_Modify_Item_t));
/* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity);
served_cells_to_modify_item.oldNRCGI = oldNRCGI;
/* 3.2.1 serverd cell Information */
F1AP_Served_Cell_Information_t served_cell_information;
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
served_cell_information.nRCGI = nRCGI;
/* - nRPCI */
served_cell_information.nRPCI = 321; // int 0..1007
/* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
"10",
3);
/* - Configured_EPS_TAC */
if(1){
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
"2",
2);
}
/* - broadcast PLMNs */
int maxnoofBPLMNS = 1;
for (i=0;
i<maxnoofBPLMNS;
i++) {
/* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &broadcastPLMNs_Item->pLMN_Identity);
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
}
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info;
if ("FDD") {
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
ul_freqBandNrItem.freqBandIndicatorNr = 888L;
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
/* >>> DL NRFreqInfo */
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
F1AP_FreqBandNrItem_t dl_freqBandNrItem;
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
dl_freqBandNrItem.freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
/* >>> UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
/* >>> DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
nR_Mode_Info.choice.fDD = fDD_Info;
} else { // TDD
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
/* > TDD >> TDD Info */
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
/* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
nr_freqBandNrItem.freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
nR_Mode_Info.choice.tDD = tDD_Info;
}
served_cell_information.nR_Mode_Info = nR_Mode_Info;
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
served_cells_to_modify_item.served_Cell_Information = served_cell_information; //
/* 3.2.2 gNB-DU System Information */
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
"1",
sizeof("1"));
served_cells_to_modify_item.gNB_DU_System_Information = gNB_DU_System_Information; //
/* ADD */
served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item = served_cells_to_modify_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Modify_List.list,
served_cells_to_modify_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c4. Served_Cells_To_Delete */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Delete_List;
for (i=0;
i<1;
i++) {
//
F1AP_Served_Cells_To_Delete_ItemIEs_t *served_cells_to_delete_item_ies;
served_cells_to_delete_item_ies = (F1AP_Served_Cells_To_Delete_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Delete_ItemIEs_t));
served_cells_to_delete_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
served_cells_to_delete_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_delete_item_ies->value.present = F1AP_Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item;
F1AP_Served_Cells_To_Delete_Item_t served_cells_to_delete_item;
memset((void *)&served_cells_to_delete_item, 0, sizeof(F1AP_Served_Cells_To_Delete_Item_t));
/* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity);
served_cells_to_delete_item.oldNRCGI = oldNRCGI;
/* ADD */
served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item = served_cells_to_delete_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Delete_List.list,
served_cells_to_delete_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c5. Active_Cells_List */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Active_Cells_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Active_Cells_List;
for (i=0;
i<1;
i++) {
//
F1AP_Active_Cells_ItemIEs_t *active_cells_item_ies;
active_cells_item_ies = (F1AP_Active_Cells_ItemIEs_t *)calloc(1, sizeof(F1AP_Active_Cells_ItemIEs_t));
active_cells_item_ies->id = F1AP_ProtocolIE_ID_id_Active_Cells_Item;
active_cells_item_ies->criticality = F1AP_Criticality_reject;
active_cells_item_ies->value.present = F1AP_Active_Cells_ItemIEs__value_PR_Active_Cells_Item;
F1AP_Active_Cells_Item_t active_cells_item;
memset((void *)&active_cells_item, 0, sizeof(F1AP_Active_Cells_Item_t));
/* 3.1 oldNRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
active_cells_item.nRCGI = nRCGI;
/* ADD */
active_cells_item_ies->value.choice.Active_Cells_Item = active_cells_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Active_Cells_List.list,
active_cells_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
}
printf("\n");
//f1ap_du_send_message(buffer, len);
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
}
}
void DU_handle_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t GNBDUConfigurationUpdateFailure) {
......
......@@ -366,14 +366,19 @@ rx_sdu(const module_id_t enb_mod_idP,
for (ii = 0; ii < NB_RA_PROC_MAX; ii++) {
ra = &mac->common_channels[CC_idP].ra[ii];
if ((ra->rnti == current_rnti) && (ra->state != IDLE)) {
mac_rrc_data_ind(enb_mod_idP,
//int RC.cudu.du_flag = 1;
int du_flag = 1;
mac_rrc_data_ind(
enb_mod_idP,
CC_idP,
frameP, subframeP,
frameP, subframeP, old_UE_id,
old_rnti,
DCCH,
(uint8_t *) payload_ptr,
rx_lengths[i],
0);
0,
du_flag
);
// prepare transmission of Msg4(RRCConnectionReconfiguration)
ra->state = MSGCRNTI;
LOG_I(MAC,
......@@ -613,14 +618,19 @@ rx_sdu(const module_id_t enb_mod_idP,
// kill RA procedure
}
mac_rrc_data_ind(enb_mod_idP,
//int RC.cudu.du_flag = 1;
int du_flag = 1;
mac_rrc_data_ind(
enb_mod_idP,
CC_idP,
frameP, subframeP,
frameP, subframeP, UE_id,
current_rnti,
CCCH,
(uint8_t *) payload_ptr,
rx_lengths[i],
0);
0,
du_flag
);
if (num_ce > 0) { // handle msg3 which is not RRCConnectionRequest
......
......@@ -47,14 +47,16 @@ mac_rrc_data_req(
int8_t
mac_rrc_data_ind(
const module_id_t module_idP,
const int CC_idP,
const int CC_id,
const frame_t frameP,
const sub_frame_t sub_frameP,
const int UE_id,
const rnti_t rntiP,
const rb_id_t srb_idP,
const uint8_t *sduP,
const uint8_t* sduP,
const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_area
const uint8_t mbsfn_sync_areaP,
const int du_flag
);
int8_t
......
......@@ -232,6 +232,33 @@ mac_rrc_data_req(
return(0);
}
//--------------------------------------------------------------------------
int8_t
mac_du_data_ind(
const module_id_t module_idP,
const int CC_idP,
const int UE_id,
const rnti_t rntiP,
const uint8_t *sduP,
const sdu_size_t sdu_lenP
)
//--------------------------------------------------------------------------
{
printf(
"[F1 %d][RAPROC] CC_id %d current_rnti %x Received Msg3 from already registered UE %d: length %d, offset %ld\n",
module_idP, CC_idP, rntiP,
UE_id, sdu_lenP, sduP);
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_idP,
CC_idP,
UE_id,
rntiP,
sduP,
sdu_lenP
);
}
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_ind(
......@@ -239,14 +266,28 @@ mac_rrc_data_ind(
const int CC_id,
const frame_t frameP,
const sub_frame_t sub_frameP,
const int UE_id,
const rnti_t rntiP,
const rb_id_t srb_idP,
const uint8_t* sduP,
const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP
const uint8_t mbsfn_sync_areaP,
const int du_flag
)
//--------------------------------------------------------------------------
{
// navid update / Bing-Kai modify
if (du_flag) {
mac_du_data_ind(
module_idP,
CC_id,
UE_id,
rntiP,
sduP,
sdu_lenP);
}
SRB_INFO *Srb_info;
protocol_ctxt_t ctxt;
sdu_size_t sdu_size = 0;
......
......@@ -6446,6 +6446,7 @@ rrc_eNB_decode_ccch(
rrc_eNB_generate_RRCConnectionReject(ctxt_pP,
rrc_eNB_get_ue_context(RC.rrc[ctxt_pP->module_id], ctxt_pP->rnti),
CC_id);
// navid:
break;
}
......
......@@ -423,11 +423,13 @@ mac_rrc_data_ind(
const int CC_id,
const frame_t frameP,
const sub_frame_t sub_frameP,
const int UE_id,
const rnti_t rntiP,
const rb_id_t srb_idP,
const uint8_t* sduP,
const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP
const uint8_t mbsfn_sync_areaP,
const int du_flag
);
int8_t
......
......@@ -252,8 +252,21 @@ do { \
} while(0)
/* TS 38.473 v15.2.1 section 9.3.1.32:
* C RNTI
*/
#define C_RNTI_TO_BIT_STRING(mACRO, bITsTRING) \
do { \
(bITsTRING)->buf = calloc(2, sizeof(uint8_t)); \
(bITsTRING)->buf[0] = (mACRO) >> 4; \
(bITsTRING)->buf[1] = ((mACRO) & 0x0f) << 4; \
(bITsTRING)->size = 2; \
(bITsTRING)->bits_unused = 0; \
} while(0)
/* TS 38.473 v15.1.1 section 9.3.2.1:
* NR CELL ID
* TRANSPORT LAYER ADDRESS
*/
#define TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(mACRO, bITsTRING) \
do { \
......
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