Commit f736213d authored by Bing-Kai Hong's avatar Bing-Kai Hong

Update F1AP new code structure to closer implementing all the procedures

parent e54f6305
......@@ -281,7 +281,7 @@ endif (${ENABLE_ITTI})
# (so creating new asn.1 objects instead of modifying the object attributes)
# New C code source file, cmake must be re-run (instead of re-running make only)
#############
set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1")
# set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1")
# set(fix_asn1c_call "${OPENAIR_CMAKE}/tools/fix_asn1")
set(asn1_generated_dir ${OPENAIR_BIN_DIR})
......@@ -504,40 +504,30 @@ set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-Containers.asn
)
set(F1AP_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_C_DIR} ${F1AP_ASN_FILES}")
execute_process(COMMAND mkdir -p ${F1AP_C_DIR}
COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_C_DIR} ${F1AP_ASN_FILES}
set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR}
COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
RESULT_VARIABLE ret
OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${asn1c_call}: error")
message(FATAL_ERROR "asn1c: error")
endif (NOT ${ret} STREQUAL 0)
file(GLOB F1AP_source ${F1AP_C_DIR}/*.c)
file(GLOB f1ap_h ${F1AP_C_DIR}/*.h)
set(f1ap_h ${f1ap_h} )
file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c)
add_library(F1AP_LIB
${F1AP_source}
)
${F1AP_ASN_GENERATED_C_FILES}
)
include_directories ("${F1AP_C_DIR}")
include_directories ("${F1AP_ASN_GENERATED_C_DIR}")
include_directories ("${F1AP_DIR}")
message(${F1AP_C_DIR})
message(${F1AP_DIR})
file(GLOB F1AP_C_FILES ${F1AP_DIR}/*.c)
add_library(F1AP
${F1AP_DIR}/f1ap_du.c
${F1AP_DIR}/f1ap_cu.c
${F1AP_DIR}/f1ap_itti_messaging.c
${F1AP_DIR}/f1ap_encoder.c
${F1AP_DIR}/f1ap_decoder.c
${F1AP_DIR}/f1ap_handlers.c
${F1AP_DIR}/f1ap_common.c
)
${F1AP_C_FILES}
)
# Hardware dependant options
......
......@@ -30,10 +30,7 @@
* \warning
*/
#include <stdint.h>
#include "f1ap_common.h"
//#include "S1AP-PDU.h"
#if defined(EMIT_ASN_DEBUG_EXTERN)
int asn_debug = 0;
......@@ -211,3 +208,10 @@ uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+cu_mod_idP]);
return transaction_identifier[enb_mod_idP+cu_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];
}
\ No newline at end of file
......@@ -356,6 +356,17 @@ inline void ASN_DEBUG(const char *fmt, ...);
#include "F1AP_Cells-To-Be-Broadcast-Item.h"
#include "F1AP_QCI.h"
#include "conversions.h"
#include "platform_types.h"
#include "common/utils/LOG/log.h"
#include "intertask_interface.h"
#include "sctp_messages_types.h"
#include "f1ap_messages_types.h"
#include <arpa/inet.h>
#include "T.h"
#include "common/ran_context.h"
#include "msc.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
# error "You are compiling f1ap with the wrong version of ASN1C"
......@@ -415,5 +426,6 @@ typedef int (*f1ap_message_decoded_callback)(
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP);
uint8_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id);
#endif /* F1AP_COMMON_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_interface_management.c
* \brief f1ap interface management for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_du_interface_management.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du;
/*
Reset
*/
void CU_send_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
Error Indication
*/
void CU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
F1 Setup
*/
int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{
printf("CU_handle_F1_SETUP_REQUEST\n");
MessageDef *message_p;
F1AP_F1SetupRequest_t *container;
F1AP_F1SetupRequestIEs_t *ie;
int i = 0;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage->value.choice.F1SetupRequest;
/* F1 Setup Request == Non UE-related procedure -> stream 0 */
if (stream != 0) {
LOG_W(F1AP, "[SCTP %d] Received f1 setup request on stream != 0 (%d)\n",
assoc_id, stream);
}
message_p = itti_alloc_new_message(TASK_RRC_ENB, F1AP_SETUP_REQ);
/* assoc_id */
F1AP_SETUP_REQ(message_p).assoc_id = assoc_id;
/* gNB_DU_id */
// this function exits if the ie is mandatory
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_ID, true);
asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &F1AP_SETUP_REQ(message_p).gNB_DU_id);
printf("F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id);
/* gNB_DU_name */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Name, true);
F1AP_SETUP_REQ(message_p).gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).gNB_DU_name, ie->value.choice.GNB_DU_Name.buf,
ie->value.choice.GNB_DU_Name.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).gNB_DU_name[ie->value.choice.GNB_DU_Name.size] = '\0';
printf ("F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name);
/* GNB_DU_Served_Cells_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List, true);
F1AP_SETUP_REQ(message_p).num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
printf ("F1AP_SETUP_REQ(message_p).num_cells_available %d \n", F1AP_SETUP_REQ(message_p).num_cells_available);
int num_cells_available = F1AP_SETUP_REQ(message_p).num_cells_available;
for (i=0; i<num_cells_available; i++) {
F1AP_GNB_DU_Served_Cells_Item_t *served_celles_item_p;
served_celles_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item);
/* tac */
// @issue in here
OCTET_STRING_TO_INT16(&(served_celles_item_p->served_Cell_Information.fiveGS_TAC), F1AP_SETUP_REQ(message_p).tac[i]);
printf ("F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]);
/* - nRCGI */
TBCD_TO_MCC_MNC(&(served_celles_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i],
F1AP_SETUP_REQ(message_p).mnc_digit_length[i]);
// @issue in here cellID
F1AP_SETUP_REQ(message_p).nr_cellid[i] = 1;
printf("[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %d\n", assoc_id,
F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i],
F1AP_SETUP_REQ(message_p).nr_cellid[i]);
/* - nRPCI */
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_celles_item_p->served_Cell_Information.nRPCI;
printf ("F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n", i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
// System Information
/* mib */
F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_celles_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_celles_item_p->gNB_DU_System_Information->mIB_message.buf,
served_celles_item_p->gNB_DU_System_Information->mIB_message.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).mib[i][served_celles_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
F1AP_SETUP_REQ(message_p).mib_length[i] = served_celles_item_p->gNB_DU_System_Information->mIB_message.size;
printf ("F1AP_SETUP_REQ(message_p).mib[%d] %s , len = %d \n", i, F1AP_SETUP_REQ(message_p).mib[i], F1AP_SETUP_REQ(message_p).mib_length[i]);
/* sib1 */
F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_celles_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_celles_item_p->gNB_DU_System_Information->sIB1_message.buf,
served_celles_item_p->gNB_DU_System_Information->sIB1_message.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).sib1[i][served_celles_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
F1AP_SETUP_REQ(message_p).sib1_length[i] = served_celles_item_p->gNB_DU_System_Information->sIB1_message.size;
printf ("F1AP_SETUP_REQ(message_p).sib1[%d] %s , len = %d \n", i, F1AP_SETUP_REQ(message_p).sib1[i], F1AP_SETUP_REQ(message_p).sib1_length[i]);
}
*f1ap_du_data_from_du = F1AP_SETUP_REQ(message_p);
// char *measurement_timing_information[F1AP_MAX_NB_CELLS];
// uint8_t ranac[F1AP_MAX_NB_CELLS];
// int fdd_flag = f1ap_setup_req->fdd_flag;
// union {
// struct {
// uint32_t ul_nr_arfcn;
// uint8_t ul_scs;
// uint8_t ul_nrb;
// uint32_t dl_nr_arfcn;
// uint8_t dl_scs;
// uint8_t dl_nrb;
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
// } fdd;
// struct {
// uint32_t nr_arfcn;
// uint8_t scs;
// uint8_t nrb;
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
// } tdd;
// } nr_mode_info[F1AP_MAX_NB_CELLS];
return itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(assoc_id), message_p);
}
void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp) {
module_id_t enb_mod_idP;
module_id_t cu_mod_idP;
enb_mod_idP = (module_id_t)12;
cu_mod_idP = (module_id_t)34;
F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupResponse_t *out;
F1AP_F1SetupResponseIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse;
/* mandatory */
/* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c2. GNB_CU_Name */
if (f1ap_setup_resp->gNB_CU_name != NULL) {
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_Name;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name;
OCTET_STRING_fromBuf(&ie->value.choice.GNB_CU_Name, f1ap_setup_resp->gNB_CU_name,
strlen(f1ap_setup_resp->gNB_CU_name));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* 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;
printf("num_cells_to_activate = %d \n", num_cells_to_activate);
for (i=0;
i<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;
/* 3.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_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
/* optional */
/* - nRPCI */
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) {
/* 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 = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
OCTET_STRING_fromBuf(&gNB_CUSystemInformation->sImessage,
f1ap_setup_resp->SI_container[i][0], f1ap_setup_resp->SI_container_length[i][0]);
printf("f1ap_setup_resp->SI_container_length = %d \n" , f1ap_setup_resp->SI_container_length[0][0]);
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,
cells_to_be_activated_list_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");
}
// printf("\n");
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//printf("F1 setup response present = %d\n", out->value.present);
//f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0);
}
void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) {
AssertFatal(1==0,"Not implemented yet\n");
//AssertFatal(1==0,"Not implemented yet\n");
//f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0);
}
/*
gNB-DU Configuration Update
*/
void CU_handle_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
gNB-CU Configuration Update
*/
//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 i = 0;
// for test
int mcc = 208;
int mnc = 93;
int 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(mcc, mnc, 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(mcc, mnc, 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(mcc, mnc, 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;
}
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) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_interface_management.h
* \brief f1ap interface management for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_CU_INTERFACE_MANAGEMENT_H_
#define F1AP_CU_INTERFACE_MANAGEMENT_H_
int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp);
void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure);
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
\ No newline at end of file
......@@ -19,9 +19,13 @@
* contact@openairinterface.org
*/
#ifndef DU_F1AP_DEFS_H_
#define DU_F1AP_DEFS_H_
#endif /* DU_F1AP_DEFS_H_ */
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
......@@ -19,9 +19,13 @@
* contact@openairinterface.org
*/
#ifndef CU_F1AP_DEFS_H_
#define CU_F1AP_DEFS_H_
#endif /* CU_F1AP_DEFS_H_ */
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_rrc_message_transfer.c
* \brief f1ap rrc message transfer for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_cu_rrc_message_transfer.h"
/*
Initial UL RRC Message Transfer
*/
void CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER(void) {
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)
}
/*
DL RRC Message Transfer.
*/
//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
void CU_send_DL_RRC_MESSAGE_TRANSFER(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_DLRRCMessageTransfer_t *out;
F1AP_DLRRCMessageTransferIEs_t *ie;
uint8_t *buffer;
uint32_t len;
/* 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_DLRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c3. oldgNB_DU_UE_F1AP_ID */
if (0) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
//ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_NOTHING;
//ie->value.choice. = 1;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* c4. SRBID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = 2L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c5. ExecuteDuplication */
if (0) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ExecuteDuplication;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_ExecuteDuplication;
ie->value.choice.ExecuteDuplication = F1AP_ExecuteDuplication_true;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
// issue in here
/* mandatory */
/* c6. RRCContainer */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
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, "A", strlen("A"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c7. RAT_FrequencyPriorityInformation */
if (0) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP;
ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP = 123L;
//ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
//ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
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");
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
}
//AssertFatal(1==0,"Not implemented yet\n");
}
/*
UL RRC Message Transfer
*/
void CU_handle_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_rrc_message_transfer.h
* \brief f1ap rrc message transfer for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_CU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
#endif /* F1AP_CU_RRC_MESSAGE_TRANSFER_H_ */
\ No newline at end of file
......@@ -19,8 +19,13 @@
* contact@openairinterface.org
*/
#ifndef DU_F1AP_DEFS_H_
#define DU_F1AP_DEFS_H_
#endif /* DU_F1AP_DEFS_H_ */
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/F1AP/CU_F1AP.c
* \brief data structures for F1 interface modules
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_handlers.h"
#include "f1ap_cu_interface_management.h"
#include "f1ap_cu_task.h"
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data_from_du;
void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind) {
// Nothing
}
void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
instance,
sctp_new_association_resp->ulp_cnx_id);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
}
// go to an init func
f1ap_du_data_from_du = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
// save the assoc id
f1ap_du_data_from_du->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data_from_du->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
}
void cu_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) {
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void cu_task_send_sctp_init_req(instance_t enb_id) {
// 1. get the itti msg, and retrive the enb_id from the message
// 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port
// 3. creat an itti message to init
LOG_I(CU_F1AP, "F1AP_CU_SCTP_REQ(create socket)\n");
MessageDef *message_p = NULL;
message_p = itti_alloc_new_message (TASK_CU_F1, SCTP_INIT_MSG);
message_p->ittiMsg.sctp_init.port = F1AP_PORT_NUMBER;
message_p->ittiMsg.sctp_init.ppid = F1AP_SCTP_PPID;
message_p->ittiMsg.sctp_init.ipv4 = 1;
message_p->ittiMsg.sctp_init.ipv6 = 0;
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.rrc[enb_id]->eth_params_s.my_addr);
/*
* SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* * * * Disable it for now.
*/
message_p->ittiMsg.sctp_init.nb_ipv6_addr = 0;
message_p->ittiMsg.sctp_init.ipv6_address[0] = "0:0:0:0:0:0:0:1";
itti_send_msg_to_task(TASK_SCTP, enb_id, message_p);
}
void *F1AP_CU_task(void *arg) {
MessageDef *received_msg = NULL;
int result;
LOG_I(CU_F1AP,"Starting F1AP at CU\n");
itti_mark_task_ready(TASK_CU_F1);
cu_task_send_sctp_init_req(0);
while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg);
switch (ITTI_MSG_ID(received_msg)) {
case SCTP_NEW_ASSOCIATION_IND:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_IND\n");
cu_task_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_ind);
break;
case SCTP_NEW_ASSOCIATION_RESP:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n");
cu_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp);
break;
case SCTP_DATA_IND:
LOG_I(CU_F1AP, "SCTP_DATA_IND\n");
cu_task_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_SETUP_RESP: // from rrc
LOG_W(CU_F1AP, "F1AP_SETUP_RESP\n");
// CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg));
CU_send_F1_SETUP_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_RESP(received_msg));
break;
// case F1AP_SETUP_RESPONSE: // This is from RRC
// CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
// break;
// case F1AP_SETUP_FAILURE: // This is from RRC
// CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure)
// break;
case TERMINATE_MESSAGE:
LOG_W(CU_F1AP, " *** Exiting CU_F1AP thread\n");
itti_exit_task();
break;
default:
LOG_E(CU_F1AP, "CU Received unhandled message: %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL;
} // while
return NULL;
}
\ No newline at end of file
......@@ -22,6 +22,11 @@
#ifndef CU_F1AP_TASK_H_
#define CU_F1AP_TASK_H_
void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind);
void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
void cu_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind);
void cu_task_send_sctp_init_req(instance_t enb_id);
void *F1AP_CU_task(void *arg);
#endif /* CU_F1AP_TASK_H_ */
......@@ -19,904 +19,22 @@
* contact@openairinterface.org
*/
/*! \file openair2/F1AP/CU_F1AP.c
* \brief data structures for F1 interface modules
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "conversions.h"
#include "f1ap_common.h"
#include "f1ap_cu_defs.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_cu_task.h"
#include "platform_types.h"
#include "common/utils/LOG/log.h"
#include "intertask_interface.h"
#include "f1ap_itti_messaging.h"
#include <arpa/inet.h>
#include "T.h"
#define MAX_F1AP_BUFFER_SIZE 4096
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data_from_du;
// ==============================================================================
static
void CU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) {
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void CU_send_sctp_init_req(instance_t enb_id) {
// 1. get the itti msg, and retrive the enb_id from the message
// 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port
// 3. creat an itti message to init
LOG_I(CU_F1AP, "F1AP_CU_SCTP_REQ(create socket)\n");
MessageDef *message_p = NULL;
message_p = itti_alloc_new_message (TASK_CU_F1, SCTP_INIT_MSG);
message_p->ittiMsg.sctp_init.port = F1AP_PORT_NUMBER;
message_p->ittiMsg.sctp_init.ppid = F1AP_SCTP_PPID;
message_p->ittiMsg.sctp_init.ipv4 = 1;
message_p->ittiMsg.sctp_init.ipv6 = 0;
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.rrc[enb_id]->eth_params_s.my_addr);
/*
* SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* * * * Disable it for now.
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
message_p->ittiMsg.sctp_init.nb_ipv6_addr = 0;
message_p->ittiMsg.sctp_init.ipv6_address[0] = "0:0:0:0:0:0:0:1";
itti_send_msg_to_task(TASK_SCTP, enb_id, message_p);
}
void *F1AP_CU_task(void *arg) {
//sctp_cu_init();
MessageDef *received_msg = NULL;
int result;
LOG_I(CU_F1AP,"Starting F1AP at CU\n");
//f1ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_CU_F1);
CU_send_sctp_init_req(0);
while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg);
switch (ITTI_MSG_ID(received_msg)) {
// case F1AP_CU_SCTP_REQ:
// LOG_I(CU_F1AP, "F1AP_CU_SCTP_REQ\n");
// break;
case SCTP_NEW_ASSOCIATION_IND:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_IND\n");
CU_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_ind);
break;
case SCTP_NEW_ASSOCIATION_RESP:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n");
CU_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp);
break;
case SCTP_DATA_IND:
LOG_I(CU_F1AP, "SCTP_DATA_IND\n");
CU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_SETUP_RESP: // from rrc
LOG_W(CU_F1AP, "F1AP_SETUP_RESP\n");
// CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg));
CU_send_F1_SETUP_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_RESP(received_msg));
break;
// case F1AP_SETUP_RESPONSE: // This is from RRC
// CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
// break;
// case F1AP_SETUP_FAILURE: // This is from RRC
// CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure)
// break;
case TERMINATE_MESSAGE:
LOG_W(CU_F1AP, " *** Exiting CU_F1AP thread\n");
itti_exit_task();
break;
default:
LOG_E(CU_F1AP, "CU Received unhandled message: %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL;
} // while
return NULL;
}
void CU_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind) {
//CU_send_F1_SETUP_RESPONSE(instance, sctp_new_association_ind);
}
void CU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
//CU_send_F1_SETUP_RESPONSE(instance, sctp_new_association_resp);
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
instance,
sctp_new_association_resp->ulp_cnx_id);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
}
// go to an init func
f1ap_du_data_from_du = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
// save the assoc id
f1ap_du_data_from_du->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data_from_du->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
}
// ==============================================================================
void CU_handle_F1_SETUP_REQUEST(F1AP_F1SetupRequest_t *message_p) {
F1AP_F1AP_PDU_t pdu;
uint8_t *buffer;
uint32_t len;
/* Receiver */
//f1ap_receiver(&buffer);
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
}
/* decode */
//CU_F1AP_decode(args_p);
// fill in f1ap_setup_req message for RRC task
/* handle */
// fill f1ap_setup_req_t
// send ITTI F1AP_SETUP_REQ to RRC
// return
// send successful callback
//CU_send_F1_SETUP_RESPONSE();
// or failure callback
//CU_send_F1_SETUP_FAILURE();
}
void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp) {
//void CU_send_F1_SETUP_RESPONSE(F1AP_F1SetupResponse_t *F1SetupResponse) {
//AssertFatal(1==0,"Not implemented yet\n");
module_id_t enb_mod_idP;
module_id_t cu_mod_idP;
enb_mod_idP = (module_id_t)12;
cu_mod_idP = (module_id_t)34;
F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupResponse_t *out;
F1AP_F1SetupResponseIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse;
/* mandatory */
/* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c2. GNB_CU_Name */
if (f1ap_setup_resp->gNB_CU_name != NULL) {
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_Name;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name;
OCTET_STRING_fromBuf(&ie->value.choice.GNB_CU_Name, f1ap_setup_resp->gNB_CU_name,
strlen(f1ap_setup_resp->gNB_CU_name));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* 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;
printf("num_cells_to_activate = %d \n", num_cells_to_activate);
for (i=0;
i<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;
/* 3.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_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
/* optional */
/* - nRPCI */
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) {
/* 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 = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
OCTET_STRING_fromBuf(&gNB_CUSystemInformation->sImessage,
f1ap_setup_resp->SI_container[i][0], f1ap_setup_resp->SI_container_length[i][0]);
printf("f1ap_setup_resp->SI_container_length = %d \n" , f1ap_setup_resp->SI_container_length[0][0]);
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,
cells_to_be_activated_list_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");
}
// printf("\n");
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//printf("F1 setup response present = %d\n", out->value.present);
//f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0);
}
void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) {
AssertFatal(1==0,"Not implemented yet\n");
//AssertFatal(1==0,"Not implemented yet\n");
//f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0);
}
void CU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER(void) {
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");
}
//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
void CU_send_DL_RRC_MESSAGE_TRANSFER(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_DLRRCMessageTransfer_t *out;
F1AP_DLRRCMessageTransferIEs_t *ie;
uint8_t *buffer;
uint32_t len;
/* 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_DLRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c3. oldgNB_DU_UE_F1AP_ID */
if (0) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
//ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_NOTHING;
//ie->value.choice. = 1;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* c4. SRBID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = 2L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c5. ExecuteDuplication */
if (0) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ExecuteDuplication;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_ExecuteDuplication;
ie->value.choice.ExecuteDuplication = F1AP_ExecuteDuplication_true;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
// issue in here
/* mandatory */
/* c6. RRCContainer */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
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, "A", strlen("A"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c7. RAT_FrequencyPriorityInformation */
if (0) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP;
ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP = 123L;
//ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
//ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
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");
/* 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 CU_handle_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
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 i = 0;
// for test
int mcc = 208;
int mnc = 93;
int 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(mcc, mnc, 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(mcc, mnc, 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(mcc, mnc, 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;
}
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) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Setup
*/
#include "f1ap_common.h"
//void CU_send_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) {
void CU_send_UE_CONTEXT_SETUP_REQUEST(void) {
......@@ -1260,6 +378,10 @@ void CU_handle_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSe
}
/*
UE Context Release (gNB-CU initiated)
*/
void CU_handle_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) {
AssertFatal(1==0,"Not implemented yet\n");
}
......@@ -1274,6 +396,11 @@ void CU_handle_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UECo
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Modification Required (gNB-DU initiated)
*/
//void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) {
F1AP_F1AP_PDU_t pdu;
......@@ -1763,119 +890,3 @@ void CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequir
void CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
static int F1AP_CU_decode_initiating_message(F1AP_InitiatingMessage_t *initiating_p) {
switch (initiating_p->value.present) {
case F1AP_InitiatingMessage__value_PR_NOTHING: /* No components present */
AssertFatal(1==0,"Should not receive NOTHING on CU\n");
break;
case F1AP_InitiatingMessage__value_PR_Reset:
CU_send_RESET(&initiating_p->value.choice.Reset);
break;
case F1AP_InitiatingMessage__value_PR_F1SetupRequest:
CU_handle_F1_SETUP_REQUEST(&initiating_p->value.choice.F1SetupRequest);
break;
case F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate:
AssertFatal(1==0,"Should not receive GNBDUConfigurationUpdate on CU\n");
break;
case F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate:
CU_handle_gNB_CU_CONFIGURATION_UPDATE(&initiating_p->value.choice.GNBCUConfigurationUpdate);
break;
case F1AP_InitiatingMessage__value_PR_UEContextSetupRequest:
CU_handle_UE_CONTEXT_SETUP_REQUEST(&initiating_p->value.choice.UEContextSetupRequest);
break;
case F1AP_InitiatingMessage__value_PR_UEContextReleaseCommand:
CU_handle_UE_CONTEXT_SETUP_RELEASE_COMMAND(&initiating_p->value.choice.UEContextReleaseCommand);
break;
case F1AP_InitiatingMessage__value_PR_UEContextModificationRequest:
CU_handle_UE_CONTEXT_MODIFICATION_REQUEST(&initiating_p->value.choice.UEContextModificationRequest);
break;
case F1AP_InitiatingMessage__value_PR_UEContextModificationRequired:
AssertFatal(1==0,"Should not receive UECONTEXTMODIFICATIONREQUIRED on CU\n");
break;
case F1AP_InitiatingMessage__value_PR_ErrorIndication:
AssertFatal(1==0,"Should not receive ErrorIndication on CU\n");
break;
case F1AP_InitiatingMessage__value_PR_UEContextReleaseRequest:
AssertFatal(1==0,"Should not receive UECONTEXTRELEASEREQUEST on CU\n");
break;
case F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer:
CU_handle_DL_RRC_MESSAGE_TRANSFER(&initiating_p->value.choice.DLRRCMessageTransfer);
break;
case F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer:
AssertFatal(1==0,"Should not receive ULRRCMESSAGETRANSFER on CU\n");
break;
case F1AP_InitiatingMessage__value_PR_PrivateMessage:
AssertFatal(1==0,"Should not receive PRIVATEMESSAGE on CU\n");
break;
default:
AssertFatal(1==0,"Shouldn't get here\n");
}
}
static int F1AP_CU_decode_successful_outcome(F1AP_SuccessfulOutcome_t *successfulOutcome_p)
{
switch (successfulOutcome_p->value.present) {
case F1AP_SuccessfulOutcome__value_PR_NOTHING: /* No components present */
AssertFatal(1==0,"Should not received NOTHING!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge:
AssertFatal(1==0,"CU Should not receive ResetAcknowled!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_F1SetupResponse:
AssertFatal(1==0,"CU Should not receive F1SetupResponse!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge:
CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(successfulOutcome_p->value.choice.GNBDUConfigurationUpdateAcknowledge);
break;
case F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge:
AssertFatal(1==0,"CU Should not receive GNBCUConfigurationUpdateAcknowledge!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse:
AssertFatal(1==0,"CU Should not receive UEContextSetupResponse!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextReleaseComplete:
AssertFatal(1==0,"CU Should not receive UEContextReleaseComplete!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse:
AssertFatal(1==0,"CU Should not receive UEContextModificationResponse!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextModificationConfirm:
CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(successfulOutcome_p->value.choice.UEContextModificationConfirm);
break;
}
}
static int F1AP_CU_decode_unsuccessful_outcome(F1AP_UnsuccessfulOutcome_t *unSuccessfulOutcome_p)
{
switch (unSuccessfulOutcome_p->value.present) {
case F1AP_UnsuccessfulOutcome__value_PR_NOTHING:
AssertFatal(1==0,"Should not receive NOTHING!\n");
break; /* No components present */
case F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure:
AssertFatal(1==0,"Should not receive F1SetupFailure\n");
break;
case F1AP_UnsuccessfulOutcome__value_PR_GNBDUConfigurationUpdateFailure:
CU_handle_gNB_CU_CONFIGURATION_FAILURE(unSuccessfulOutcome_p->value.choice.GNBDUConfigurationUpdateFailure);
break;
case F1AP_UnsuccessfulOutcome__value_PR_GNBCUConfigurationUpdateFailure:
AssertFatal(1==0,"Should not receive GNBCUConfigurationUpdateFailure\n");
break;
case F1AP_UnsuccessfulOutcome__value_PR_UEContextSetupFailure:
CU_handle_UE_CONTEXT_SETUP_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextSetupFailure);
break;
case F1AP_UnsuccessfulOutcome__value_PR_UEContextModificationFailure:
CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextModificationFailure);
break;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
......@@ -30,12 +30,6 @@
* \warning
*/
#include <stdio.h>
#include "assertions.h"
#include "intertask_interface.h"
#include "f1ap_common.h"
#include "f1ap_decoder.h"
......
......@@ -33,8 +33,6 @@
#ifndef F1AP_ENB_ENCODER_H_
#define F1AP_ENB_ENCODER_H_
#include "f1ap_common.h"
int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
__attribute__ ((warn_unused_result));
......
......@@ -19,184 +19,61 @@
* contact@openairinterface.org
*/
/*! \file openair2/F1AP/DU_F1AP.c
* \brief data structures for F1 interface modules
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
/*! \file f1ap_du_interface_management.c
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "conversions.h"
#include "f1ap_common.h"
#include "f1ap_du_defs.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_du_task.h"
#include "platform_types.h"
#include "common/utils/LOG/log.h"
#include "intertask_interface.h"
#include "f1ap_itti_messaging.h"
#include "T.h"
static f1ap_setup_req_t *f1ap_du_data;
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];
}
#include "f1ap_du_interface_management.h"
// ==============================================================================
static
void DU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
{
int result;
extern f1ap_setup_req_t *f1ap_du_data;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
/*
Reset
*/
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void *F1AP_DU_task(void *arg) {
//sctp_cu_init();
MessageDef *received_msg = NULL;
int result;
LOG_I(DU_F1AP, "Starting F1AP at DU\n");
//f1ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_DU_F1);
// SCTP
while (1) {
itti_receive_msg(TASK_DU_F1, &received_msg);
switch (ITTI_MSG_ID(received_msg)) {
// case TERMINATE_MESSAGE:
// //F1AP_WARN(" *** Exiting F1AP DU thread\n");
// itti_exit_task();
// break;
case F1AP_SETUP_REQ: // this is not a true F1 message, but rather an ITTI message sent by enb_app
// 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message,
// 2. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req
LOG_I(DU_F1AP, "F1AP_SETUP_REQ\n");
DU_send_sctp_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_REQ(received_msg));
break;
case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon
// 2. send the f1setup_req
LOG_I(DU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n");
DU_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp);
break;
case SCTP_DATA_IND:
// ex: any F1 incoming message for DU ends here
LOG_I(DU_F1AP, "SCTP_DATA_IND\n");
DU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
break;
case TERMINATE_MESSAGE:
LOG_W(DU_F1AP, " *** Exiting DU_F1AP thread\n");
itti_exit_task();
break;
default:
LOG_E(DU_F1AP, "DU Received unhandled message: %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL;
} // while
return NULL;
void DU_handle_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
// ==============================================================================
void DU_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
DevAssert(f1ap_setup_req != NULL);
MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
message_p = itti_alloc_new_message(TASK_DU_F1, SCTP_NEW_ASSOCIATION_REQ);
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->ulp_cnx_id = instance;
sctp_new_association_req_p->port = F1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = F1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = f1ap_setup_req->sctp_in_streams;
sctp_new_association_req_p->out_streams = f1ap_setup_req->sctp_out_streams;
// remote
memcpy(&sctp_new_association_req_p->remote_address,
&f1ap_setup_req->CU_f1_ip_address,
sizeof(f1ap_setup_req->CU_f1_ip_address));
// local
memcpy(&sctp_new_association_req_p->local_address,
&f1ap_setup_req->DU_f1_ip_address,
sizeof(f1ap_setup_req->DU_f1_ip_address));
// store data
f1ap_du_data = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
*f1ap_du_data = *f1ap_setup_req;
//printf("sib itti message %s\n", f1ap_setup_req_t->sib1[0]);
printf("sib f1ap context %s\n", f1ap_du_data->sib1[0]);
//du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
void DU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
instance,
sctp_new_association_resp->ulp_cnx_id);
void DU_send_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
}
void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
// save the assoc id
f1ap_du_data->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
/*
Error Indication
*/
DU_send_F1_SETUP_REQUEST(instance);
void DU_send_ERROR_INDICATION(struct F1AP_F1AP_PDU_t *pdu_p) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n");
}
// ==============================================================================
/*
F1 Setup
*/
// SETUP REQUEST
void DU_send_F1_SETUP_REQUEST(instance_t instance) {
......@@ -428,223 +305,24 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance) {
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
}
int DU_handle_F1_SETUP_RESPONSE(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{
printf("DU_handle_F1_SETUP_RESPONSE\n");
// SETUP SUCCESSFUL
void DU_handle_F1_SETUP_RESPONSE() {
AssertFatal(0,"Not implemented yet\n");
/* decode */
//DU_F1AP_decode(args_p);
/* handle */
/* save state */
return 0;
}
// ==============================================================================
// SETUP FAILURE
void DU_handle_F1_SETUP_FAILURE(struct F1AP_F1AP_PDU_t *pdu_p) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_ERROR_INDICATION(struct F1AP_F1AP_PDU_t *pdu_p) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
void DU_handle_F1_SETUP_FAILURE(F1AP_F1AP_PDU_t *pdu_p) {
AssertFatal(1==0,"Not implemented yet\n");
}
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;
/* 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_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0],
&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");
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
/* 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(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_ULRRCMessageTransfer_t *out;
F1AP_ULRRCMessageTransferIEs_t *ie;
uint8_t *buffer;
uint32_t len;
/* 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_ULRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. SRBID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = 1;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// issue in here
/* mandatory */
/* c4. RRCContainer */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
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");
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
/* 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_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
gNB-DU Configuration Update
*/
//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_setup_req_t *f1ap_du_data) {
......@@ -1086,6 +764,8 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
}
}
void DU_handle_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
......@@ -1095,6 +775,10 @@ void DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUp
}
/*
gNB-CU Configuration Update
*/
void DU_handle_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
AssertFatal(1==0,"Not implemented yet\n");
}
......@@ -1106,816 +790,3 @@ void DU_send_gNB_CU_CONFIGURATION_UPDATE_FALIURE(F1AP_GNBCUConfigurationUpdateFa
void DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
void DU_handle_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UE_CONTEXT_SETUP_RESPONSE(F1AP_UEContextSetupResponse_t *UEContextSetupResponse) {
void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextSetupResponse_t *out;
F1AP_UEContextSetupResponseIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.UEContextSetupResponse;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. DUtoCURRCInformation */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCInformation;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation;
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCInformation.cellGroupConfig, "asdsa",
strlen("asdsa"));
/* OPTIONAL */
if (0) {
ie->value.choice.DUtoCURRCInformation.measGapConfig = (F1AP_MeasGapConfig_t *)calloc(1, sizeof(F1AP_MeasGapConfig_t));
OCTET_STRING_fromBuf( ie->value.choice.DUtoCURRCInformation.measGapConfig, "asdsa",
strlen("asdsa"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c4. ResourceCoordinationTransferContainer */
if (0) {
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_ResourceCoordinationTransferContainer;
OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa",
strlen("asdsa"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
// /* */
/* c5. DRBs_Setup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_Setup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DRBs_Setup_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_Setup_ItemIEs_t *drbs_setup_item_ies;
drbs_setup_item_ies = (F1AP_DRBs_Setup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_Setup_ItemIEs_t));
drbs_setup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_Setup_Item;
drbs_setup_item_ies->criticality = F1AP_Criticality_ignore;
drbs_setup_item_ies->value.present = F1AP_SRBs_FailedToBeSetup_ItemIEs__value_PR_SRBs_FailedToBeSetup_Item;
/* 5.1 DRBs_Setup_Item */
F1AP_DRBs_Setup_Item_t drbs_setup_item;
memset((void *)&drbs_setup_item, 0, sizeof(F1AP_DRBs_Setup_Item_t));
drbs_setup_item.dRBID = 12;
int j;
for (j=0;
j<1;
j++) {
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dLUPTNLInformation_ToBeSetup_Item;
dLUPTNLInformation_ToBeSetup_Item = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_DLUPTNLInformation_ToBeSetup_Item_t));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
// F1AP_TransportLayerAddress_t transportLayerAddress;
// transportLayerAddress.buf = malloc((36+7)/8);
// transportLayerAddress.size = (36+7)/8;
// transportLayerAddress.bits_unused = 4;
// *transportLayerAddress.buf = 123;
// dLUPTNLInformation_ToBeSetup_Item.dL_GTP_Tunnel_EndPoint.transportLayerAddress = transportLayerAddress;
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
strlen("1204"));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
ASN_SEQUENCE_ADD(&drbs_setup_item.dLUPTNLInformation_ToBeSetup_List.list,
dLUPTNLInformation_ToBeSetup_Item);
}
// /* ADD */
drbs_setup_item_ies->value.choice.DRBs_Setup_Item = drbs_setup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_Setup_List.list,
drbs_setup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c6. SRBs_FailedToBeSetup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_SRBs_FailedToBeSetup_List;
for (i=0;
i<1;
i++) {
//
F1AP_SRBs_FailedToBeSetup_ItemIEs_t *srbs_failedToBeSetup_item_ies;
srbs_failedToBeSetup_item_ies = (F1AP_SRBs_FailedToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_FailedToBeSetup_ItemIEs_t));
srbs_failedToBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_Item;
srbs_failedToBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
srbs_failedToBeSetup_item_ies->value.present = F1AP_SRBs_FailedToBeSetup_ItemIEs__value_PR_SRBs_FailedToBeSetup_Item;
/* 6.1 SRBs_Setup_Item */
F1AP_SRBs_FailedToBeSetup_Item_t srbs_failedToBeSetup_item;
memset((void *)&srbs_failedToBeSetup_item, 0, sizeof(F1AP_SRBs_FailedToBeSetup_Item_t));
srbs_failedToBeSetup_item.sRBID = 13;
srbs_failedToBeSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
srbs_failedToBeSetup_item.cause->present = F1AP_Cause_PR_radioNetwork;
srbs_failedToBeSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id;
// /* ADD */
srbs_failedToBeSetup_item_ies->value.choice.SRBs_FailedToBeSetup_Item = srbs_failedToBeSetup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_FailedToBeSetup_List.list,
srbs_failedToBeSetup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c7. DRBs_FailedToBeSetup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DRBs_FailedToBeSetup_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_FailedToBeSetup_ItemIEs_t *drbs_failedToBeSetup_item_ies;
drbs_failedToBeSetup_item_ies = (F1AP_DRBs_FailedToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeSetup_ItemIEs_t));
drbs_failedToBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_Item;
drbs_failedToBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
drbs_failedToBeSetup_item_ies->value.present = F1AP_DRBs_FailedToBeSetup_ItemIEs__value_PR_DRBs_FailedToBeSetup_Item;
/* 7.1 DRBs_Setup_Item */
F1AP_DRBs_FailedToBeSetup_Item_t drbs_failedToBeSetup_item;
memset((void *)&drbs_failedToBeSetup_item, 0, sizeof(F1AP_DRBs_FailedToBeSetup_Item_t));
drbs_failedToBeSetup_item.dRBID = 14;
drbs_failedToBeSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
drbs_failedToBeSetup_item.cause->present = F1AP_Cause_PR_radioNetwork;
drbs_failedToBeSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id;
// /* ADD */
drbs_failedToBeSetup_item_ies->value.choice.DRBs_FailedToBeSetup_Item = drbs_failedToBeSetup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeSetup_List.list,
drbs_failedToBeSetup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c8. SCell_FailedtoSetup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_SCell_FailedtoSetup_List;
for (i=0;
i<1;
i++) {
//
F1AP_SCell_FailedtoSetup_ItemIEs_t *sCell_FailedtoSetup_item_ies;
sCell_FailedtoSetup_item_ies = (F1AP_SCell_FailedtoSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_FailedtoSetup_ItemIEs_t));
sCell_FailedtoSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_Item;
sCell_FailedtoSetup_item_ies->criticality = F1AP_Criticality_ignore;
sCell_FailedtoSetup_item_ies->value.present = F1AP_SCell_FailedtoSetup_ItemIEs__value_PR_SCell_FailedtoSetup_Item;
/* 8.1 DRBs_Setup_Item */
F1AP_SCell_FailedtoSetup_Item_t sCell_FailedtoSetup_item;
memset((void *)&sCell_FailedtoSetup_item, 0, sizeof(F1AP_SCell_FailedtoSetup_Item_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI; // issue here
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &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;
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
sCell_FailedtoSetup_item.sCell_ID = nRCGI;
sCell_FailedtoSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
sCell_FailedtoSetup_item.cause->present = F1AP_Cause_PR_radioNetwork;
sCell_FailedtoSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id;
// /* ADD */
sCell_FailedtoSetup_item_ies->value.choice.SCell_FailedtoSetup_Item = sCell_FailedtoSetup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_FailedtoSetup_List.list,
sCell_FailedtoSetup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c9. CriticalityDiagnostics */
if (0) {
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_CriticalityDiagnostics;
ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t));
*ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t));
*ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message;
ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t));
*ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject;
ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t));
*ie->value.choice.CriticalityDiagnostics.transactionID = 0;
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;
}
printf("\n");
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
}
void DU_send_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSetupFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_UE_CONTEXT_RELEASE_COMMAND(F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UEContextReleaseComplete) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) {
void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextModificationResponse_t *out;
F1AP_UEContextModificationResponseIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_UEContextModification;
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse;
out = &pdu.choice.successfulOutcome->value.choice.UEContextModificationResponse;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c3. ResourceCoordinationTransferContainer */
if (0) {
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_ResourceCoordinationTransferContainer;
OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c4. DUtoCURRCInformation */
if (0) {
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCInformation;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DUtoCURRCInformation;
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCInformation.cellGroupConfig, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
/* OPTIONAL */
if (1) {
ie->value.choice.DUtoCURRCInformation.measGapConfig = (F1AP_MeasGapConfig_t *)calloc(1, sizeof(F1AP_MeasGapConfig_t));
OCTET_STRING_fromBuf( ie->value.choice.DUtoCURRCInformation.measGapConfig, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
}
/* mandatory */
/* c5. DRBs_SetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_SetupMod_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_SetupMod_ItemIEs_t *drbs_setupMod_item_ies;
drbs_setupMod_item_ies = (F1AP_DRBs_SetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_SetupMod_ItemIEs_t));
drbs_setupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_SetupMod_Item;
drbs_setupMod_item_ies->criticality = F1AP_Criticality_reject;
drbs_setupMod_item_ies->value.present = F1AP_DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item;
/* 10.1 DRBs_SetupMod_Item */
F1AP_DRBs_SetupMod_Item_t drbs_setupMod_item;
memset((void *)&drbs_setupMod_item, 0, sizeof(F1AP_DRBs_SetupMod_Item_t));
/* dRBID */
drbs_setupMod_item.dRBID = 30L;
/* DLTunnels_SetupMod_List */
int j = 0;
int maxnoofDLUPTNLInformation = 1; // 2;
for (j=0;
j<maxnoofDLUPTNLInformation;
j++) {
/* DLTunnels_ToBeSetup_Item */
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dLUPTNLInformation_ToBeSetup_Item;
dLUPTNLInformation_ToBeSetup_Item = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_DLUPTNLInformation_ToBeSetup_Item_t));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
strlen("1204"));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
ASN_SEQUENCE_ADD(&drbs_setupMod_item.dLUPTNLInformation_ToBeSetup_List.list, dLUPTNLInformation_ToBeSetup_Item);
}
/* ADD */
drbs_setupMod_item_ies->value.choice.DRBs_SetupMod_Item = drbs_setupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_SetupMod_List.list,
drbs_setupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c6. DRBs_Modified_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_Modified_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_Modified_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_Modified_ItemIEs_t *drbs_modified_item_ies;
drbs_modified_item_ies = (F1AP_DRBs_Modified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_Modified_ItemIEs_t));
drbs_modified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_Modified_Item;
drbs_modified_item_ies->criticality = F1AP_Criticality_reject;
drbs_modified_item_ies->value.present = F1AP_DRBs_Modified_ItemIEs__value_PR_DRBs_Modified_Item;
/* 13.1 SRBs_modified_Item */
F1AP_DRBs_Modified_Item_t drbs_modified_item;
memset((void *)&drbs_modified_item, 0, sizeof(F1AP_DRBs_Modified_Item_t));
/* dRBID */
drbs_modified_item.dRBID = 25L;
/* ULTunnels_Modified_List */
int maxnoofULTunnels = 1; // 2;
int j = 0;
for (j=0;
j<maxnoofULTunnels;
j++) {
/* DLTunnels_Modified_Item */
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dLUPTNLInformation_ToBeSetup_Item;
dLUPTNLInformation_ToBeSetup_Item = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_DLUPTNLInformation_ToBeSetup_Item_t));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
strlen("1204"));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
ASN_SEQUENCE_ADD(&drbs_modified_item.dLUPTNLInformation_ToBeSetup_List.list, dLUPTNLInformation_ToBeSetup_Item);
}
/* ADD */
drbs_modified_item_ies->value.choice.DRBs_Modified_Item = drbs_modified_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_Modified_List.list,
drbs_modified_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c7. SRBs_FailedToBeSetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetupMod_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_SRBs_FailedToBeSetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t *srbs_failedToBeSetupMod_item_ies;
srbs_failedToBeSetupMod_item_ies = (F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t));
srbs_failedToBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetupMod_Item;
srbs_failedToBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
srbs_failedToBeSetupMod_item_ies->value.present = F1AP_SRBs_FailedToBeSetupMod_ItemIEs__value_PR_SRBs_FailedToBeSetupMod_Item;
/* 9.1 SRBs_FailedToBeSetupMod_Item */
F1AP_SRBs_FailedToBeSetupMod_Item_t srbs_failedToBeSetupMod_item;
memset((void *)&srbs_failedToBeSetupMod_item, 0, sizeof(F1AP_SRBs_FailedToBeSetupMod_Item_t));
/* - sRBID */
srbs_failedToBeSetupMod_item.sRBID = 50L;
srbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
srbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
srbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
srbs_failedToBeSetupMod_item_ies->value.choice.SRBs_FailedToBeSetupMod_Item = srbs_failedToBeSetupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_FailedToBeSetupMod_List.list,
srbs_failedToBeSetupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c8. DRBs_FailedToBeSetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetupMod_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_FailedToBeSetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t *drbs_failedToBeSetupMod_item_ies;
drbs_failedToBeSetupMod_item_ies = (F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t));
drbs_failedToBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetupMod_Item;
drbs_failedToBeSetupMod_item_ies->criticality = F1AP_Criticality_reject;
drbs_failedToBeSetupMod_item_ies->value.present = F1AP_DRBs_FailedToBeSetupMod_ItemIEs__value_PR_DRBs_FailedToBeSetupMod_Item;
/* 10.1 DRBs_ToBeSetupMod_Item */
F1AP_DRBs_FailedToBeSetupMod_Item_t drbs_failedToBeSetupMod_item;
memset((void *)&drbs_failedToBeSetupMod_item, 0, sizeof(F1AP_DRBs_FailedToBeSetupMod_Item_t));
/* dRBID */
drbs_failedToBeSetupMod_item.dRBID = 30L;
drbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
drbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
drbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
drbs_failedToBeSetupMod_item_ies->value.choice.DRBs_FailedToBeSetupMod_Item = drbs_failedToBeSetupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeSetupMod_List.list,
drbs_failedToBeSetupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c9. SCell_FailedtoSetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetupMod_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_SCell_FailedtoSetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_SCell_FailedtoSetupMod_ItemIEs_t *scell_failedtoSetupMod_item_ies;
scell_failedtoSetupMod_item_ies = (F1AP_SCell_FailedtoSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_FailedtoSetupMod_ItemIEs_t));
scell_failedtoSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetupMod_Item;
scell_failedtoSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
scell_failedtoSetupMod_item_ies->value.present = F1AP_SCell_FailedtoSetupMod_ItemIEs__value_PR_SCell_FailedtoSetupMod_Item;
/* 8.1 SCell_ToBeSetup_Item */
F1AP_SCell_FailedtoSetupMod_Item_t scell_failedtoSetupMod_item;
memset((void *)&scell_failedtoSetupMod_item, 0, sizeof(F1AP_SCell_FailedtoSetupMod_Item_t));
/* - sCell_ID */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
scell_failedtoSetupMod_item.sCell_ID = nRCGI;
scell_failedtoSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
scell_failedtoSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
scell_failedtoSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
scell_failedtoSetupMod_item_ies->value.choice.SCell_FailedtoSetupMod_Item = scell_failedtoSetupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_FailedtoSetupMod_List.list,
scell_failedtoSetupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c10. DRBs_FailedToBeModified_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeModified_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_FailedToBeModified_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_FailedToBeModified_ItemIEs_t *drbs_failedToBeModified_item_ies;
drbs_failedToBeModified_item_ies = (F1AP_DRBs_FailedToBeModified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeModified_ItemIEs_t));
drbs_failedToBeModified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeModified_Item;
drbs_failedToBeModified_item_ies->criticality = F1AP_Criticality_reject;
drbs_failedToBeModified_item_ies->value.present = F1AP_DRBs_FailedToBeModified_ItemIEs__value_PR_DRBs_FailedToBeModified_Item;
/* 13.1 DRBs_FailedToBeModified_Item */
F1AP_DRBs_FailedToBeModified_Item_t drbs_failedToBeModified_item;
memset((void *)&drbs_failedToBeModified_item, 0, sizeof(F1AP_DRBs_FailedToBeModified_Item_t));
/* dRBID */
drbs_failedToBeModified_item.dRBID = 30L;
drbs_failedToBeModified_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
drbs_failedToBeModified_item.cause->present = F1AP_Cause_PR_radioNetwork;
drbs_failedToBeModified_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
drbs_failedToBeModified_item_ies->value.choice.DRBs_FailedToBeModified_Item = drbs_failedToBeModified_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeModified_List.list,
drbs_failedToBeModified_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c11. CriticalityDiagnostics */
if (0) {
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_CriticalityDiagnostics;
ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t));
*ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextModification;
ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t));
*ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message;
ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t));
*ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject;
ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t));
*ie->value.choice.CriticalityDiagnostics.transactionID = 0;
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;
}
printf("\n");
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
}
void DU_send_UE_CONTEXT_MODIFICATION_FAILURE(F1AP_UEContextModificationFailure_t UEContextModificationFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequired_t *UEContextModificationRequired) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
AssertFatal(1==0,"Not implemented yet\n");
}
static int F1AP_DU_decode_initiating_message(F1AP_InitiatingMessage_t *initiating_p) {
switch (initiating_p->value.present) {
case F1AP_InitiatingMessage__value_PR_NOTHING: /* No components present */
AssertFatal(1==0,"Should not receive NOTHING on DU\n");
break;
case F1AP_InitiatingMessage__value_PR_Reset:
DU_handle_RESET(&initiating_p->value.choice.Reset);
break;
/*case F1AP_Initiatingpdu__value_PR_F1SetupRequest:
DU_send_F1_SETUP_REQUEST(&initiating_p->value.choice.F1SetupRequest);
break;*/
case F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate:
AssertFatal(1==0,"Should not receive GNBDUConfigurationUpdate on DU\n");
break;
case F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate:
DU_handle_gNB_CU_CONFIGURATION_UPDATE(&initiating_p->value.choice.GNBCUConfigurationUpdate);
break;
case F1AP_InitiatingMessage__value_PR_UEContextSetupRequest:
DU_handle_UE_CONTEXT_SETUP_REQUEST(&initiating_p->value.choice.UEContextSetupRequest);
break;
case F1AP_InitiatingMessage__value_PR_UEContextReleaseCommand:
DU_handle_UE_CONTEXT_RELEASE_COMMAND(&initiating_p->value.choice.UEContextReleaseCommand);
break;
case F1AP_InitiatingMessage__value_PR_UEContextModificationRequest:
DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(&initiating_p->value.choice.UEContextModificationRequest);
break;
case F1AP_InitiatingMessage__value_PR_UEContextModificationRequired:
AssertFatal(1==0,"Should not receive UECONTEXTMODIFICATIONREQUIRED on DU\n");
break;
case F1AP_InitiatingMessage__value_PR_ErrorIndication:
AssertFatal(1==0,"Should not receive ErrorIndication on DU\n");
break;
case F1AP_InitiatingMessage__value_PR_UEContextReleaseRequest:
AssertFatal(1==0,"Should not receive UECONTEXTRELEASEREQUEST on DU\n");
break;
case F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer:
DU_handle_DL_RRC_Message_TRANSFER(&initiating_p->value.choice.DLRRCMessageTransfer);
break;
case F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer:
AssertFatal(1==0,"Should not receive ULRRCmessageTRANSFER on DU\n");
break;
case F1AP_InitiatingMessage__value_PR_PrivateMessage:
AssertFatal(1==0,"Should not receive PRIVATEmessage on DU\n");
break;
default:
AssertFatal(1==0,"Shouldn't get here\n");
}
}
static int F1AP_DU_decode_successful_outcome(F1AP_SuccessfulOutcome_t *successfulOutcome_p) {
switch (successfulOutcome_p->value.present) {
case F1AP_SuccessfulOutcome__value_PR_NOTHING: /* No components present */
AssertFatal(1==0,"Should not received NOTHING!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge:
AssertFatal(1==0,"DU Should not receive ResetAcknowled!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_F1SetupResponse:
AssertFatal(1==0,"DU Should not receive F1SetupResponse!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge:
DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(successfulOutcome_p->value.choice.GNBDUConfigurationUpdateAcknowledge);
break;
case F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge:
AssertFatal(1==0,"DU Should not receive GNBCUConfigurationUpdateAcknowledge!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse:
AssertFatal(1==0,"DU Should not receive UEContextSetupResponse!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextReleaseComplete:
AssertFatal(1==0,"DU Should not receive UEContextReleaseComplete!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse:
AssertFatal(1==0,"DU Should not receive UEContextModificationResponse!\n");
break;
case F1AP_SuccessfulOutcome__value_PR_UEContextModificationConfirm:
DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(successfulOutcome_p->value.choice.UEContextModificationConfirm);
break;
}
}
static int F1AP_DU_decode_unsuccessful_outcome(F1AP_UnsuccessfulOutcome_t *unSuccessfulOutcome_p) {
switch (unSuccessfulOutcome_p->value.present) {
case F1AP_UnsuccessfulOutcome__value_PR_NOTHING:
AssertFatal(1==0,"Should not receive NOTHING!\n");
break; /* No components present */
case F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure:
AssertFatal(1==0,"Should not receive F1SetupFailure\n");
break;
case F1AP_UnsuccessfulOutcome__value_PR_GNBDUConfigurationUpdateFailure:
DU_handle_gNB_DU_CONFIGURATION_FAILURE(unSuccessfulOutcome_p->value.choice.GNBDUConfigurationUpdateFailure);
break;
case F1AP_UnsuccessfulOutcome__value_PR_GNBCUConfigurationUpdateFailure:
AssertFatal(1==0,"Should not receive GNBCUConfigurationUpdateFailure\n");
break;
case F1AP_UnsuccessfulOutcome__value_PR_UEContextSetupFailure:
DU_send_UE_CONTEXT_SETUP_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextSetupFailure);
break;
case F1AP_UnsuccessfulOutcome__value_PR_UEContextModificationFailure:
DU_send_UE_CONTEXT_MODIFICATION_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextModificationFailure);
break;
}
}
static int F1AP_DU_encode_initiating_message(F1AP_InitiatingMessage_t *initiating_p) {
return -1;
}
static int F1AP_DU_encode_successful_outcome(F1AP_SuccessfulOutcome_t *successfulOutcome_p)
{
return -1;
}
static int F1AP_DU_encode_unsuccessful_outcome(F1AP_UnsuccessfulOutcome_t *unSuccessfulOutcome_p)
{
return -1;
}
#define MAX_F1AP_BUFFER_SIZE 4096
// or init function
void DU_F1AP_init(void* args_p ) {
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_DU_INTERFACE_MANAGEMENT_H_
#define F1AP_DU_INTERFACE_MANAGEMENT_H_
void DU_send_F1_SETUP_REQUEST(instance_t instance);
int DU_handle_F1_SETUP_RESPONSE(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
void DU_handle_F1_SETUP_FAILURE(F1AP_F1AP_PDU_t *pdu_p);
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_rrc_message_transfer.c
* \brief f1ap rrc message transfer for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_du_rrc_message_transfer.h"
// undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
// replaces in ie->value.choice.C_RNTI, causing
// a compile error
#undef C_RNTI
extern f1ap_setup_req_t *f1ap_du_data;
/* DL RRC Message Transfer */
void DU_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
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(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_ULRRCMessageTransfer_t *out;
F1AP_ULRRCMessageTransferIEs_t *ie;
uint8_t *buffer;
uint32_t len;
/* 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_ULRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. SRBID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = 1;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// issue in here
/* mandatory */
/* c4. RRCContainer */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
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");
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//AssertFatal(1==0,"Not implemented yet\n");
}
/* 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;
/* 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_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0],
&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");
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_rrc_message_transfer.h
* \brief f1ap rrc message transfer for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/F1AP/DU_F1AP.c
* \brief data structures for F1 interface modules
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_handlers.h"
#include "f1ap_du_interface_management.h"
#include "f1ap_du_task.h"
f1ap_setup_req_t *f1ap_du_data;
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
DevAssert(f1ap_setup_req != NULL);
MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
message_p = itti_alloc_new_message(TASK_DU_F1, SCTP_NEW_ASSOCIATION_REQ);
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->ulp_cnx_id = instance;
sctp_new_association_req_p->port = F1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = F1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = f1ap_setup_req->sctp_in_streams;
sctp_new_association_req_p->out_streams = f1ap_setup_req->sctp_out_streams;
// remote
memcpy(&sctp_new_association_req_p->remote_address,
&f1ap_setup_req->CU_f1_ip_address,
sizeof(f1ap_setup_req->CU_f1_ip_address));
// local
memcpy(&sctp_new_association_req_p->local_address,
&f1ap_setup_req->DU_f1_ip_address,
sizeof(f1ap_setup_req->DU_f1_ip_address));
// store data
f1ap_du_data = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
*f1ap_du_data = *f1ap_setup_req;
//printf("sib itti message %s\n", f1ap_setup_req_t->sib1[0]);
printf("sib f1ap context %s\n", f1ap_du_data->sib1[0]);
//du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
instance,
sctp_new_association_resp->ulp_cnx_id);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
}
// save the assoc id
f1ap_du_data->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
DU_send_F1_SETUP_REQUEST(instance);
}
void du_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
{
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void *F1AP_DU_task(void *arg) {
//sctp_cu_init();
MessageDef *received_msg = NULL;
int result;
LOG_I(DU_F1AP, "Starting F1AP at DU\n");
//f1ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_DU_F1);
// SCTP
while (1) {
itti_receive_msg(TASK_DU_F1, &received_msg);
switch (ITTI_MSG_ID(received_msg)) {
// case TERMINATE_MESSAGE:
// //F1AP_WARN(" *** Exiting F1AP DU thread\n");
// itti_exit_task();
// break;
case F1AP_SETUP_REQ: // this is not a true F1 message, but rather an ITTI message sent by enb_app
// 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message,
// 2. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req
LOG_I(DU_F1AP, "F1AP_SETUP_REQ\n");
du_task_send_sctp_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_REQ(received_msg));
break;
case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon
// 2. send the f1setup_req
LOG_I(DU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n");
du_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp);
break;
case SCTP_DATA_IND:
// ex: any F1 incoming message for DU ends here
LOG_I(DU_F1AP, "SCTP_DATA_IND\n");
du_task_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
break;
case TERMINATE_MESSAGE:
LOG_W(DU_F1AP, " *** Exiting DU_F1AP thread\n");
itti_exit_task();
break;
default:
LOG_E(DU_F1AP, "DU Received unhandled message: %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL;
} // while
return NULL;
}
\ No newline at end of file
......@@ -22,6 +22,9 @@
#ifndef DU_F1AP_TASK_H_
#define DU_F1AP_TASK_H_
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req);
void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
void du_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind);
void *F1AP_DU_task(void *arg);
#endif /* DU_F1AP_TASK_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_du_ue_context_management.h"
extern f1ap_setup_req_t *f1ap_du_data;
/*
UE Context Setup
*/
void DU_handle_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UE_CONTEXT_SETUP_RESPONSE(F1AP_UEContextSetupResponse_t *UEContextSetupResponse) {
void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextSetupResponse_t *out;
F1AP_UEContextSetupResponseIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.UEContextSetupResponse;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. DUtoCURRCInformation */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCInformation;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation;
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCInformation.cellGroupConfig, "asdsa",
strlen("asdsa"));
/* OPTIONAL */
if (0) {
ie->value.choice.DUtoCURRCInformation.measGapConfig = (F1AP_MeasGapConfig_t *)calloc(1, sizeof(F1AP_MeasGapConfig_t));
OCTET_STRING_fromBuf( ie->value.choice.DUtoCURRCInformation.measGapConfig, "asdsa",
strlen("asdsa"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c4. ResourceCoordinationTransferContainer */
if (0) {
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_ResourceCoordinationTransferContainer;
OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa",
strlen("asdsa"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
// /* */
/* c5. DRBs_Setup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_Setup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DRBs_Setup_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_Setup_ItemIEs_t *drbs_setup_item_ies;
drbs_setup_item_ies = (F1AP_DRBs_Setup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_Setup_ItemIEs_t));
drbs_setup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_Setup_Item;
drbs_setup_item_ies->criticality = F1AP_Criticality_ignore;
drbs_setup_item_ies->value.present = F1AP_SRBs_FailedToBeSetup_ItemIEs__value_PR_SRBs_FailedToBeSetup_Item;
/* 5.1 DRBs_Setup_Item */
F1AP_DRBs_Setup_Item_t drbs_setup_item;
memset((void *)&drbs_setup_item, 0, sizeof(F1AP_DRBs_Setup_Item_t));
drbs_setup_item.dRBID = 12;
int j;
for (j=0;
j<1;
j++) {
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dLUPTNLInformation_ToBeSetup_Item;
dLUPTNLInformation_ToBeSetup_Item = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_DLUPTNLInformation_ToBeSetup_Item_t));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
// F1AP_TransportLayerAddress_t transportLayerAddress;
// transportLayerAddress.buf = malloc((36+7)/8);
// transportLayerAddress.size = (36+7)/8;
// transportLayerAddress.bits_unused = 4;
// *transportLayerAddress.buf = 123;
// dLUPTNLInformation_ToBeSetup_Item.dL_GTP_Tunnel_EndPoint.transportLayerAddress = transportLayerAddress;
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
strlen("1204"));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
ASN_SEQUENCE_ADD(&drbs_setup_item.dLUPTNLInformation_ToBeSetup_List.list,
dLUPTNLInformation_ToBeSetup_Item);
}
// /* ADD */
drbs_setup_item_ies->value.choice.DRBs_Setup_Item = drbs_setup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_Setup_List.list,
drbs_setup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c6. SRBs_FailedToBeSetup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_SRBs_FailedToBeSetup_List;
for (i=0;
i<1;
i++) {
//
F1AP_SRBs_FailedToBeSetup_ItemIEs_t *srbs_failedToBeSetup_item_ies;
srbs_failedToBeSetup_item_ies = (F1AP_SRBs_FailedToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_FailedToBeSetup_ItemIEs_t));
srbs_failedToBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_Item;
srbs_failedToBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
srbs_failedToBeSetup_item_ies->value.present = F1AP_SRBs_FailedToBeSetup_ItemIEs__value_PR_SRBs_FailedToBeSetup_Item;
/* 6.1 SRBs_Setup_Item */
F1AP_SRBs_FailedToBeSetup_Item_t srbs_failedToBeSetup_item;
memset((void *)&srbs_failedToBeSetup_item, 0, sizeof(F1AP_SRBs_FailedToBeSetup_Item_t));
srbs_failedToBeSetup_item.sRBID = 13;
srbs_failedToBeSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
srbs_failedToBeSetup_item.cause->present = F1AP_Cause_PR_radioNetwork;
srbs_failedToBeSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id;
// /* ADD */
srbs_failedToBeSetup_item_ies->value.choice.SRBs_FailedToBeSetup_Item = srbs_failedToBeSetup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_FailedToBeSetup_List.list,
srbs_failedToBeSetup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c7. DRBs_FailedToBeSetup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DRBs_FailedToBeSetup_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_FailedToBeSetup_ItemIEs_t *drbs_failedToBeSetup_item_ies;
drbs_failedToBeSetup_item_ies = (F1AP_DRBs_FailedToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeSetup_ItemIEs_t));
drbs_failedToBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_Item;
drbs_failedToBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
drbs_failedToBeSetup_item_ies->value.present = F1AP_DRBs_FailedToBeSetup_ItemIEs__value_PR_DRBs_FailedToBeSetup_Item;
/* 7.1 DRBs_Setup_Item */
F1AP_DRBs_FailedToBeSetup_Item_t drbs_failedToBeSetup_item;
memset((void *)&drbs_failedToBeSetup_item, 0, sizeof(F1AP_DRBs_FailedToBeSetup_Item_t));
drbs_failedToBeSetup_item.dRBID = 14;
drbs_failedToBeSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
drbs_failedToBeSetup_item.cause->present = F1AP_Cause_PR_radioNetwork;
drbs_failedToBeSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id;
// /* ADD */
drbs_failedToBeSetup_item_ies->value.choice.DRBs_FailedToBeSetup_Item = drbs_failedToBeSetup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeSetup_List.list,
drbs_failedToBeSetup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c8. SCell_FailedtoSetup_List */
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_SCell_FailedtoSetup_List;
for (i=0;
i<1;
i++) {
//
F1AP_SCell_FailedtoSetup_ItemIEs_t *sCell_FailedtoSetup_item_ies;
sCell_FailedtoSetup_item_ies = (F1AP_SCell_FailedtoSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_FailedtoSetup_ItemIEs_t));
sCell_FailedtoSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_Item;
sCell_FailedtoSetup_item_ies->criticality = F1AP_Criticality_ignore;
sCell_FailedtoSetup_item_ies->value.present = F1AP_SCell_FailedtoSetup_ItemIEs__value_PR_SCell_FailedtoSetup_Item;
/* 8.1 DRBs_Setup_Item */
F1AP_SCell_FailedtoSetup_Item_t sCell_FailedtoSetup_item;
memset((void *)&sCell_FailedtoSetup_item, 0, sizeof(F1AP_SCell_FailedtoSetup_Item_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI; // issue here
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &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;
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
sCell_FailedtoSetup_item.sCell_ID = nRCGI;
sCell_FailedtoSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
sCell_FailedtoSetup_item.cause->present = F1AP_Cause_PR_radioNetwork;
sCell_FailedtoSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id;
// /* ADD */
sCell_FailedtoSetup_item_ies->value.choice.SCell_FailedtoSetup_Item = sCell_FailedtoSetup_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_FailedtoSetup_List.list,
sCell_FailedtoSetup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c9. CriticalityDiagnostics */
if (0) {
ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_CriticalityDiagnostics;
ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t));
*ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t));
*ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message;
ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t));
*ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject;
ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t));
*ie->value.choice.CriticalityDiagnostics.transactionID = 0;
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;
}
printf("\n");
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
}
void DU_send_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSetupFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Release Request (gNB-DU initiated).
*/
void DU_send_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_UE_CONTEXT_RELEASE_COMMAND(F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UEContextReleaseComplete) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Modification (gNB-CU initiated)
*/
void DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) {
void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextModificationResponse_t *out;
F1AP_UEContextModificationResponseIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_UEContextModification;
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse;
out = &pdu.choice.successfulOutcome->value.choice.UEContextModificationResponse;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c3. ResourceCoordinationTransferContainer */
if (0) {
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_ResourceCoordinationTransferContainer;
OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c4. DUtoCURRCInformation */
if (0) {
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCInformation;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DUtoCURRCInformation;
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCInformation.cellGroupConfig, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
/* OPTIONAL */
if (1) {
ie->value.choice.DUtoCURRCInformation.measGapConfig = (F1AP_MeasGapConfig_t *)calloc(1, sizeof(F1AP_MeasGapConfig_t));
OCTET_STRING_fromBuf( ie->value.choice.DUtoCURRCInformation.measGapConfig, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
}
/* mandatory */
/* c5. DRBs_SetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_SetupMod_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_SetupMod_ItemIEs_t *drbs_setupMod_item_ies;
drbs_setupMod_item_ies = (F1AP_DRBs_SetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_SetupMod_ItemIEs_t));
drbs_setupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_SetupMod_Item;
drbs_setupMod_item_ies->criticality = F1AP_Criticality_reject;
drbs_setupMod_item_ies->value.present = F1AP_DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item;
/* 10.1 DRBs_SetupMod_Item */
F1AP_DRBs_SetupMod_Item_t drbs_setupMod_item;
memset((void *)&drbs_setupMod_item, 0, sizeof(F1AP_DRBs_SetupMod_Item_t));
/* dRBID */
drbs_setupMod_item.dRBID = 30L;
/* DLTunnels_SetupMod_List */
int j = 0;
int maxnoofDLUPTNLInformation = 1; // 2;
for (j=0;
j<maxnoofDLUPTNLInformation;
j++) {
/* DLTunnels_ToBeSetup_Item */
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dLUPTNLInformation_ToBeSetup_Item;
dLUPTNLInformation_ToBeSetup_Item = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_DLUPTNLInformation_ToBeSetup_Item_t));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
strlen("1204"));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
ASN_SEQUENCE_ADD(&drbs_setupMod_item.dLUPTNLInformation_ToBeSetup_List.list, dLUPTNLInformation_ToBeSetup_Item);
}
/* ADD */
drbs_setupMod_item_ies->value.choice.DRBs_SetupMod_Item = drbs_setupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_SetupMod_List.list,
drbs_setupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c6. DRBs_Modified_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_Modified_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_Modified_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_Modified_ItemIEs_t *drbs_modified_item_ies;
drbs_modified_item_ies = (F1AP_DRBs_Modified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_Modified_ItemIEs_t));
drbs_modified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_Modified_Item;
drbs_modified_item_ies->criticality = F1AP_Criticality_reject;
drbs_modified_item_ies->value.present = F1AP_DRBs_Modified_ItemIEs__value_PR_DRBs_Modified_Item;
/* 13.1 SRBs_modified_Item */
F1AP_DRBs_Modified_Item_t drbs_modified_item;
memset((void *)&drbs_modified_item, 0, sizeof(F1AP_DRBs_Modified_Item_t));
/* dRBID */
drbs_modified_item.dRBID = 25L;
/* ULTunnels_Modified_List */
int maxnoofULTunnels = 1; // 2;
int j = 0;
for (j=0;
j<maxnoofULTunnels;
j++) {
/* DLTunnels_Modified_Item */
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dLUPTNLInformation_ToBeSetup_Item;
dLUPTNLInformation_ToBeSetup_Item = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_DLUPTNLInformation_ToBeSetup_Item_t));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
strlen("1204"));
dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
ASN_SEQUENCE_ADD(&drbs_modified_item.dLUPTNLInformation_ToBeSetup_List.list, dLUPTNLInformation_ToBeSetup_Item);
}
/* ADD */
drbs_modified_item_ies->value.choice.DRBs_Modified_Item = drbs_modified_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_Modified_List.list,
drbs_modified_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c7. SRBs_FailedToBeSetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetupMod_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_SRBs_FailedToBeSetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t *srbs_failedToBeSetupMod_item_ies;
srbs_failedToBeSetupMod_item_ies = (F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t));
srbs_failedToBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetupMod_Item;
srbs_failedToBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
srbs_failedToBeSetupMod_item_ies->value.present = F1AP_SRBs_FailedToBeSetupMod_ItemIEs__value_PR_SRBs_FailedToBeSetupMod_Item;
/* 9.1 SRBs_FailedToBeSetupMod_Item */
F1AP_SRBs_FailedToBeSetupMod_Item_t srbs_failedToBeSetupMod_item;
memset((void *)&srbs_failedToBeSetupMod_item, 0, sizeof(F1AP_SRBs_FailedToBeSetupMod_Item_t));
/* - sRBID */
srbs_failedToBeSetupMod_item.sRBID = 50L;
srbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
srbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
srbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
srbs_failedToBeSetupMod_item_ies->value.choice.SRBs_FailedToBeSetupMod_Item = srbs_failedToBeSetupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_FailedToBeSetupMod_List.list,
srbs_failedToBeSetupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c8. DRBs_FailedToBeSetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetupMod_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_FailedToBeSetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t *drbs_failedToBeSetupMod_item_ies;
drbs_failedToBeSetupMod_item_ies = (F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t));
drbs_failedToBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetupMod_Item;
drbs_failedToBeSetupMod_item_ies->criticality = F1AP_Criticality_reject;
drbs_failedToBeSetupMod_item_ies->value.present = F1AP_DRBs_FailedToBeSetupMod_ItemIEs__value_PR_DRBs_FailedToBeSetupMod_Item;
/* 10.1 DRBs_ToBeSetupMod_Item */
F1AP_DRBs_FailedToBeSetupMod_Item_t drbs_failedToBeSetupMod_item;
memset((void *)&drbs_failedToBeSetupMod_item, 0, sizeof(F1AP_DRBs_FailedToBeSetupMod_Item_t));
/* dRBID */
drbs_failedToBeSetupMod_item.dRBID = 30L;
drbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
drbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
drbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
drbs_failedToBeSetupMod_item_ies->value.choice.DRBs_FailedToBeSetupMod_Item = drbs_failedToBeSetupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeSetupMod_List.list,
drbs_failedToBeSetupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c9. SCell_FailedtoSetupMod_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetupMod_List;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_SCell_FailedtoSetupMod_List;
for (i=0;
i<1;
i++) {
//
F1AP_SCell_FailedtoSetupMod_ItemIEs_t *scell_failedtoSetupMod_item_ies;
scell_failedtoSetupMod_item_ies = (F1AP_SCell_FailedtoSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_FailedtoSetupMod_ItemIEs_t));
scell_failedtoSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetupMod_Item;
scell_failedtoSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
scell_failedtoSetupMod_item_ies->value.present = F1AP_SCell_FailedtoSetupMod_ItemIEs__value_PR_SCell_FailedtoSetupMod_Item;
/* 8.1 SCell_ToBeSetup_Item */
F1AP_SCell_FailedtoSetupMod_Item_t scell_failedtoSetupMod_item;
memset((void *)&scell_failedtoSetupMod_item, 0, sizeof(F1AP_SCell_FailedtoSetupMod_Item_t));
/* - sCell_ID */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
scell_failedtoSetupMod_item.sCell_ID = nRCGI;
scell_failedtoSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
scell_failedtoSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork;
scell_failedtoSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
scell_failedtoSetupMod_item_ies->value.choice.SCell_FailedtoSetupMod_Item = scell_failedtoSetupMod_item;
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_FailedtoSetupMod_List.list,
scell_failedtoSetupMod_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c10. DRBs_FailedToBeModified_List */
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeModified_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_FailedToBeModified_List;
for (i=0;
i<1;
i++) {
//
F1AP_DRBs_FailedToBeModified_ItemIEs_t *drbs_failedToBeModified_item_ies;
drbs_failedToBeModified_item_ies = (F1AP_DRBs_FailedToBeModified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeModified_ItemIEs_t));
drbs_failedToBeModified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeModified_Item;
drbs_failedToBeModified_item_ies->criticality = F1AP_Criticality_reject;
drbs_failedToBeModified_item_ies->value.present = F1AP_DRBs_FailedToBeModified_ItemIEs__value_PR_DRBs_FailedToBeModified_Item;
/* 13.1 DRBs_FailedToBeModified_Item */
F1AP_DRBs_FailedToBeModified_Item_t drbs_failedToBeModified_item;
memset((void *)&drbs_failedToBeModified_item, 0, sizeof(F1AP_DRBs_FailedToBeModified_Item_t));
/* dRBID */
drbs_failedToBeModified_item.dRBID = 30L;
drbs_failedToBeModified_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t));
drbs_failedToBeModified_item.cause->present = F1AP_Cause_PR_radioNetwork;
drbs_failedToBeModified_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id;
/* ADD */
drbs_failedToBeModified_item_ies->value.choice.DRBs_FailedToBeModified_Item = drbs_failedToBeModified_item;
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeModified_List.list,
drbs_failedToBeModified_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// /* */
/* c11. CriticalityDiagnostics */
if (0) {
ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_CriticalityDiagnostics;
ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t));
*ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextModification;
ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t));
*ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message;
ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t));
*ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject;
ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t));
*ie->value.choice.CriticalityDiagnostics.transactionID = 0;
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;
}
printf("\n");
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
}
void DU_send_UE_CONTEXT_MODIFICATION_FAILURE(F1AP_UEContextModificationFailure_t UEContextModificationFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequired_t *UEContextModificationRequired) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_ue_context_management.h
* \brief f1ap ue context management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_DU_UE_CONTEXT_MANAGEMENT_H_
#define F1AP_DU_UE_CONTEXT_MANAGEMENT_H_
#endif /* F1AP_DU_UE_CONTEXT_MANAGEMENT_H_ */
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
......@@ -30,16 +30,6 @@
* \warning
*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
#include "f1ap_common.h"
#include "f1ap_encoder.h"
......
......@@ -33,9 +33,7 @@
#ifndef F1AP_ENCODER_H_
#define F1AP_ENCODER_H_
#include "f1ap_common.h"
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *message, uint8_t **buffer, uint32_t *len)
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
__attribute__ ((warn_unused_result));
#endif /* F1AP_ENCODER_H_ */
......@@ -30,54 +30,31 @@
* \warning
*/
#include <stdint.h>
#include "intertask_interface.h"
#include "asn1_conversions.h"
#include "f1ap_common.h"
// #include "f1ap_eNB.h"
#include "f1ap_handlers.h"
#include "f1ap_decoder.h"
#include "f1ap_default_values.h"
#include "assertions.h"
#include "conversions.h"
#include "msc.h"
#include "f1ap_cu_interface_management.h"
#include "f1ap_du_interface_management.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du;
static
int f1ap_handle_f1_setup_request(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
static
int f1ap_handle_f1_setup_response(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/* Handlers matrix. Only f1 related procedure present here */
f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* Reset */
{ f1ap_handle_f1_setup_request, f1ap_handle_f1_setup_response, 0 }, /* F1Setup */
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, 0 }, /* F1Setup */
{ 0, 0, 0 }, /* ErrorIndication */
{ f1ap_handle_f1_setup_request, 0, 0 }, /* gNBDUConfigurationUpdate */
{ f1ap_handle_f1_setup_request, 0, 0 }, /* gNBCUConfigurationUpdate */
{ f1ap_handle_f1_setup_request, 0, 0 }, /* UEContextSetup */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* gNBDUConfigurationUpdate */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* gNBCUConfigurationUpdate */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* UEContextSetup */
{ 0, 0, 0 }, /* UEContextRelease */
{ f1ap_handle_f1_setup_request, 0, 0 }, /* UEContextModification */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */
{ 0, 0, 0 }, /* UEMobilityCommand */
{ 0, 0, 0 }, /* UEContextReleaseRequest */
{ f1ap_handle_f1_setup_request, 0, 0 }, /* InitialULRRCMessageTransfer */
{ f1ap_handle_f1_setup_request, 0, 0 }, /* DLRRCMessageTransfer */
{ f1ap_handle_f1_setup_request, 0, 0 }, /* ULRRCMessageTransfer */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* InitialULRRCMessageTransfer */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* DLRRCMessageTransfer */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* ULRRCMessageTransfer */
{ 0, 0, 0 }, /* privateMessage */
{ 0, 0, 0 }, /* UEInactivityNotification */
{ 0, 0, 0 }, /* GNBDUResourceCoordination */
......@@ -142,161 +119,3 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream,
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return ret;
}
\ No newline at end of file
static
int f1ap_handle_f1_setup_request(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{
printf("f1ap_handle_f1_setup_request\n");
MessageDef *message_p;
F1AP_F1SetupRequest_t *container;
F1AP_F1SetupRequestIEs_t *ie;
int i = 0;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage->value.choice.F1SetupRequest;
/* F1 Setup Request == Non UE-related procedure -> stream 0 */
if (stream != 0) {
LOG_W(F1AP, "[SCTP %d] Received f1 setup request on stream != 0 (%d)\n",
assoc_id, stream);
}
message_p = itti_alloc_new_message(TASK_RRC_ENB, F1AP_SETUP_REQ);
/* assoc_id */
F1AP_SETUP_REQ(message_p).assoc_id = assoc_id;
/* gNB_DU_id */
// this function exits if the ie is mandatory
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_ID, true);
asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &F1AP_SETUP_REQ(message_p).gNB_DU_id);
printf("F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id);
/* gNB_DU_name */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Name, true);
F1AP_SETUP_REQ(message_p).gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).gNB_DU_name, ie->value.choice.GNB_DU_Name.buf,
ie->value.choice.GNB_DU_Name.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).gNB_DU_name[ie->value.choice.GNB_DU_Name.size] = '\0';
printf ("F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name);
/* GNB_DU_Served_Cells_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List, true);
F1AP_SETUP_REQ(message_p).num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
printf ("F1AP_SETUP_REQ(message_p).num_cells_available %d \n", F1AP_SETUP_REQ(message_p).num_cells_available);
int num_cells_available = F1AP_SETUP_REQ(message_p).num_cells_available;
for (i=0; i<num_cells_available; i++) {
F1AP_GNB_DU_Served_Cells_Item_t *served_celles_item_p;
served_celles_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item);
/* tac */
// @issue in here
OCTET_STRING_TO_INT16(&(served_celles_item_p->served_Cell_Information.fiveGS_TAC), F1AP_SETUP_REQ(message_p).tac[i]);
printf ("F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]);
/* - nRCGI */
TBCD_TO_MCC_MNC(&(served_celles_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i],
F1AP_SETUP_REQ(message_p).mnc_digit_length[i]);
// @issue in here cellID
F1AP_SETUP_REQ(message_p).nr_cellid[i] = 1;
printf("[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %d\n", assoc_id,
F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i],
F1AP_SETUP_REQ(message_p).nr_cellid[i]);
/* - nRPCI */
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_celles_item_p->served_Cell_Information.nRPCI;
printf ("F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n", i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
// System Information
/* mib */
F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_celles_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_celles_item_p->gNB_DU_System_Information->mIB_message.buf,
served_celles_item_p->gNB_DU_System_Information->mIB_message.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).mib[i][served_celles_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
F1AP_SETUP_REQ(message_p).mib_length[i] = served_celles_item_p->gNB_DU_System_Information->mIB_message.size;
printf ("F1AP_SETUP_REQ(message_p).mib[%d] %s , len = %d \n", i, F1AP_SETUP_REQ(message_p).mib[i], F1AP_SETUP_REQ(message_p).mib_length[i]);
/* sib1 */
F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_celles_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_celles_item_p->gNB_DU_System_Information->sIB1_message.buf,
served_celles_item_p->gNB_DU_System_Information->sIB1_message.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).sib1[i][served_celles_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
F1AP_SETUP_REQ(message_p).sib1_length[i] = served_celles_item_p->gNB_DU_System_Information->sIB1_message.size;
printf ("F1AP_SETUP_REQ(message_p).sib1[%d] %s , len = %d \n", i, F1AP_SETUP_REQ(message_p).sib1[i], F1AP_SETUP_REQ(message_p).sib1_length[i]);
}
*f1ap_du_data_from_du = F1AP_SETUP_REQ(message_p);
// char *measurement_timing_information[F1AP_MAX_NB_CELLS];
// uint8_t ranac[F1AP_MAX_NB_CELLS];
// int fdd_flag = f1ap_setup_req->fdd_flag;
// union {
// struct {
// uint32_t ul_nr_arfcn;
// uint8_t ul_scs;
// uint8_t ul_nrb;
// uint32_t dl_nr_arfcn;
// uint8_t dl_scs;
// uint8_t dl_nrb;
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
// } fdd;
// struct {
// uint32_t nr_arfcn;
// uint8_t scs;
// uint8_t nrb;
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
// } tdd;
// } nr_mode_info[F1AP_MAX_NB_CELLS];
return itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(assoc_id), message_p);
}
static
int f1ap_handle_f1_setup_response(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{
printf("f1ap_handle_f1_setup_response\n");
return 0;
}
......@@ -19,8 +19,7 @@
* contact@openairinterface.org
*/
#include "intertask_interface.h"
#include "f1ap_common.h"
#include "f1ap_itti_messaging.h"
void cu_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
......
......@@ -31,58 +31,36 @@
*/
#include "intertask_interface.h"
#include "f1ap_common.h"
#include "f1ap_messaging.h"
void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream)
{
MessageDef *message_p;
sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_F1AP, SCTP_DATA_REQ);
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void f1ap_send_nas_downlink_ind(instance_t instance,
uint16_t ue_initial_id,
uint32_t eNB_ue_s1ap_id,
uint8_t *nas_pdu,
uint32_t nas_pdu_length)
{
MessageDef *message_p;
f1ap_downlink_nas_t *f1ap_downlink_nas;
// void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
// uint32_t buffer_length, uint16_t stream)
// {
// MessageDef *message_p;
// sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_F1AP, F1AP_DOWNLINK_NAS);
// message_p = itti_alloc_new_message(TASK_F1AP, SCTP_DATA_REQ);
f1ap_downlink_nas = &message_p->ittiMsg.f1ap_downlink_nas;
// sctp_data_req = &message_p->ittiMsg.sctp_data_req;
f1ap_downlink_nas->ue_initial_id = ue_initial_id;
f1ap_downlink_nas->eNB_ue_s1ap_id = eNB_ue_f1ap_id;
f1ap_downlink_nas->nas_pdu.buffer = nas_pdu;
f1ap_downlink_nas->nas_pdu.length = nas_pdu_length;
// sctp_data_req->assoc_id = assoc_id;
// sctp_data_req->buffer = buffer;
// sctp_data_req->buffer_length = buffer_length;
// sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_RRC_ENB, instance, message_p);
}
// itti_send_msg_to_task(TASK_SCTP, instance, message_p);
// }
void f1ap_send_sctp_close_association(instance_t instance, int32_t assoc_id)
{
MessageDef *message_p = NULL;
sctp_close_association_t *sctp_close_association_p = NULL;
// void f1ap_send_sctp_close_association(instance_t instance, int32_t assoc_id)
// {
// MessageDef *message_p = NULL;
// sctp_close_association_t *sctp_close_association_p = NULL;
message_p = itti_alloc_new_message(TASK_F1AP, SCTP_CLOSE_ASSOCIATION);
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
sctp_close_association_p->assoc_id = assoc_id;
// message_p = itti_alloc_new_message(TASK_F1AP, SCTP_CLOSE_ASSOCIATION);
// sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
// sctp_close_association_p->assoc_id = assoc_id;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
// itti_send_msg_to_task(TASK_SCTP, instance, message_p);
// }
......@@ -37,12 +37,6 @@
void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream);
void f1ap_send_nas_downlink_ind(instance_t instance,
uint16_t ue_initial_id,
uint32_t eNB_ue_f1ap_id,
uint8_t *nas_pdu,
uint32_t nas_pdu_length);
void f1ap_send_sctp_close_association(instance_t instance,
int32_t assoc_id);
......
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