Update F1AP new code structure to closer implementing all the procedures
This commit is contained in:
@@ -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];
|
||||
}
|
||||
@@ -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_ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,767 @@
|
||||
/*
|
||||
* 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");
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -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
|
||||
*/
|
||||
@@ -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
|
||||
*/
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* 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");
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -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
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
@@ -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_ */
|
||||
|
||||
@@ -0,0 +1,892 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
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) {
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_UEContextSetupRequest_t *out;
|
||||
F1AP_UEContextSetupRequestIEs_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_UEContextSetup;
|
||||
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_UEContextSetupRequest;
|
||||
out = &pdu.choice.initiatingMessage->value.choice.UEContextSetupRequest;
|
||||
|
||||
/* mandatory */
|
||||
/* c1. GNB_CU_UE_F1AP_ID */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
|
||||
ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional */
|
||||
/* c2. GNB_DU_UE_F1AP_ID */
|
||||
if (0) {
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__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. SpCell_ID */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SpCell_ID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_NRCGI;
|
||||
/* - 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);
|
||||
|
||||
ie->value.choice.NRCGI = nRCGI;
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c4. ServCellIndex */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ServCellndex;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex;
|
||||
ie->value.choice.ServCellIndex = 2;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional */
|
||||
/* c5. CellULConfigured */
|
||||
if (0) {
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SpCellULConfigured;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CellULConfigured;
|
||||
ie->value.choice.CellULConfigured = F1AP_CellULConfigured_ul;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* mandatory */
|
||||
/* c6. CUtoDURRCInformation */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CUtoDURRCInformation;
|
||||
ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo = (F1AP_CG_ConfigInfo_t *)calloc(1, sizeof(F1AP_CG_ConfigInfo_t));
|
||||
/* optional */
|
||||
OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList = (F1AP_UE_CapabilityRAT_ContainerList_t *)calloc(1, sizeof(F1AP_UE_CapabilityRAT_ContainerList_t));
|
||||
/* optional */
|
||||
OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c7. Candidate_SpCell_List */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
|
||||
F1AP_Candidate_SpCell_ItemIEs_t *candidate_spCell_item_ies;
|
||||
candidate_spCell_item_ies = (F1AP_Candidate_SpCell_ItemIEs_t *)calloc(1, sizeof(F1AP_Candidate_SpCell_ItemIEs_t));
|
||||
candidate_spCell_item_ies->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_Item; // 91
|
||||
candidate_spCell_item_ies->criticality = F1AP_Criticality_reject;
|
||||
candidate_spCell_item_ies->value.present = F1AP_Candidate_SpCell_ItemIEs__value_PR_Candidate_SpCell_Item;
|
||||
|
||||
/* 5.1 Candidate_SpCell_Item */
|
||||
F1AP_Candidate_SpCell_Item_t candidate_spCell_item;
|
||||
memset((void *)&candidate_spCell_item, 0, sizeof(F1AP_Candidate_SpCell_Item_t));
|
||||
|
||||
/* - candidate_SpCell_ID */
|
||||
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);
|
||||
|
||||
candidate_spCell_item.candidate_SpCell_ID = nRCGI;
|
||||
|
||||
/* ADD */
|
||||
candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item = candidate_spCell_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Candidate_SpCell_List.list,
|
||||
candidate_spCell_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional */
|
||||
/* c8. DRXCycle */
|
||||
if (0) {
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DRXCycle;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRXCycle;
|
||||
ie->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum
|
||||
if (0) {
|
||||
ie->value.choice.DRXCycle.shortDRXCycleLength = (F1AP_ShortDRXCycleLength_t *)calloc(1, sizeof(F1AP_ShortDRXCycleLength_t));
|
||||
*ie->value.choice.DRXCycle.shortDRXCycleLength = F1AP_ShortDRXCycleLength_ms2; // enum
|
||||
}
|
||||
if (0) {
|
||||
ie->value.choice.DRXCycle.shortDRXCycleTimer = (F1AP_ShortDRXCycleTimer_t *)calloc(1, sizeof(F1AP_ShortDRXCycleTimer_t));
|
||||
*ie->value.choice.DRXCycle.shortDRXCycleTimer = 123L;
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c9. ResourceCoordinationTransferContainer */
|
||||
if (0) {
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ResourceCoordinationTransferContainer;
|
||||
|
||||
ie->value.choice.ResourceCoordinationTransferContainer.buf = malloc(4);
|
||||
ie->value.choice.ResourceCoordinationTransferContainer.size = 4;
|
||||
*ie->value.choice.ResourceCoordinationTransferContainer.buf = "123";
|
||||
|
||||
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* mandatory */
|
||||
/* c10. SCell_ToBeSetup_List */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_SCell_ToBeSetup_ItemIEs_t *scell_toBeSetup_item_ies;
|
||||
scell_toBeSetup_item_ies = (F1AP_SCell_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeSetup_ItemIEs_t));
|
||||
scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; //53
|
||||
scell_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
|
||||
scell_toBeSetup_item_ies->value.present = F1AP_SCell_ToBeSetup_ItemIEs__value_PR_SCell_ToBeSetup_Item;
|
||||
|
||||
/* 8.1 SCell_ToBeSetup_Item */
|
||||
F1AP_SCell_ToBeSetup_Item_t scell_toBeSetup_item;
|
||||
memset((void *)&scell_toBeSetup_item, 0, sizeof(F1AP_SCell_ToBeSetup_Item_t));
|
||||
|
||||
// /* - sCell_ID */
|
||||
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);
|
||||
|
||||
scell_toBeSetup_item.sCell_ID = nRCGI;
|
||||
|
||||
/* sCellIndex */
|
||||
scell_toBeSetup_item.sCellIndex = 3; // issue here
|
||||
// /* ADD */
|
||||
scell_toBeSetup_item_ies->value.choice.SCell_ToBeSetup_Item = scell_toBeSetup_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeSetup_List.list,
|
||||
scell_toBeSetup_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
// /* mandatory */
|
||||
/* c11. SRBs_ToBeSetup_List */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_List;
|
||||
ie->criticality = F1AP_Criticality_reject; // ?
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_SRBs_ToBeSetup_ItemIEs_t *srbs_toBeSetup_item_ies;
|
||||
srbs_toBeSetup_item_ies = (F1AP_SRBs_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeSetup_ItemIEs_t));
|
||||
srbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item; // 73
|
||||
srbs_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
|
||||
srbs_toBeSetup_item_ies->value.present = F1AP_SRBs_ToBeSetup_ItemIEs__value_PR_SRBs_ToBeSetup_Item;
|
||||
|
||||
/* 9.1 SRBs_ToBeSetup_Item */
|
||||
F1AP_SRBs_ToBeSetup_Item_t srbs_toBeSetup_item;
|
||||
memset((void *)&srbs_toBeSetup_item, 0, sizeof(F1AP_SRBs_ToBeSetup_Item_t));
|
||||
|
||||
/* - sRBID */
|
||||
srbs_toBeSetup_item.sRBID = 2L;
|
||||
|
||||
/* ADD */
|
||||
srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item = srbs_toBeSetup_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeSetup_List.list,
|
||||
srbs_toBeSetup_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c12. DRBs_ToBeSetup_List */
|
||||
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_DRBs_ToBeSetup_ItemIEs_t *drbs_toBeSetup_item_ies;
|
||||
drbs_toBeSetup_item_ies = (F1AP_DRBs_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeSetup_ItemIEs_t));
|
||||
drbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_Item;
|
||||
drbs_toBeSetup_item_ies->criticality = F1AP_Criticality_reject;
|
||||
drbs_toBeSetup_item_ies->value.present = F1AP_DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item;
|
||||
|
||||
/* 10.1 DRBs_ToBeSetup_Item */
|
||||
F1AP_DRBs_ToBeSetup_Item_t drbs_toBeSetup_item;
|
||||
memset((void *)&drbs_toBeSetup_item, 0, sizeof(F1AP_DRBs_ToBeSetup_Item_t));
|
||||
|
||||
/* dRBID */
|
||||
drbs_toBeSetup_item.dRBID = 30L;
|
||||
|
||||
/* qoSInformation */
|
||||
drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
|
||||
drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
|
||||
drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->qCI = 254L;
|
||||
|
||||
/* ULTunnels_ToBeSetup_List */
|
||||
int maxnoofULTunnels = 1; // 2;
|
||||
for (i=0;
|
||||
i<maxnoofULTunnels;
|
||||
i++) {
|
||||
/* ULTunnels_ToBeSetup_Item */
|
||||
F1AP_ULUPTNLInformation_ToBeSetup_Item_t *uLUPTNLInformation_ToBeSetup_Item;
|
||||
|
||||
// gTPTunnel
|
||||
uLUPTNLInformation_ToBeSetup_Item = (F1AP_ULUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_ULUPTNLInformation_ToBeSetup_Item_t));
|
||||
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
|
||||
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
|
||||
|
||||
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
|
||||
|
||||
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1234",
|
||||
strlen("1234"));
|
||||
|
||||
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
|
||||
|
||||
ASN_SEQUENCE_ADD(&drbs_toBeSetup_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item);
|
||||
}
|
||||
|
||||
/* rLCMode */
|
||||
drbs_toBeSetup_item.rLCMode = F1AP_RLCMode_rlc_um; // enum
|
||||
|
||||
/* OPTIONAL */
|
||||
/* ULConfiguration */
|
||||
if (0) {
|
||||
drbs_toBeSetup_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
|
||||
}
|
||||
|
||||
/* ADD */
|
||||
drbs_toBeSetup_item_ies->value.choice.DRBs_ToBeSetup_Item = drbs_toBeSetup_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeSetup_List.list,
|
||||
drbs_toBeSetup_item_ies);
|
||||
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* OPTIONAL */
|
||||
if (0) {
|
||||
//F1AP_InactivityMonitoringRequest_t InactivityMonitoringRequest;
|
||||
//F1AP_RAT_FrequencyPriorityInformation_t RAT_FrequencyPriorityInformation;
|
||||
//F1AP_RRCContainer_t RRCContainer;
|
||||
//F1AP_MaskedIMEISV_t MaskedIMEISV;
|
||||
}
|
||||
|
||||
/* 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");
|
||||
}
|
||||
//AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void CU_handle_UE_CONTEXT_SETUP_RESPONSE(F1AP_UEContextSetupResponse_t *UEContextSetupResponse) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void CU_handle_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSetupFailure) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
UE Context Release (gNB-CU initiated)
|
||||
*/
|
||||
|
||||
void CU_handle_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
|
||||
void CU_send_UE_CONTEXT_RELEASE_COMMAND(F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
|
||||
void CU_handle_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UEContextReleaseComplete) {
|
||||
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;
|
||||
F1AP_UEContextModificationRequest_t *out;
|
||||
F1AP_UEContextModificationRequestIEs_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_UEContextModification;
|
||||
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_UEContextModificationRequest;
|
||||
out = &pdu.choice.initiatingMessage->value.choice.UEContextModificationRequest;
|
||||
|
||||
/* mandatory */
|
||||
/* c1. GNB_CU_UE_F1AP_ID */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__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_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__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. NRCGI */
|
||||
if (1) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SpCell_ID;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_NRCGI;
|
||||
/* - 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);
|
||||
ie->value.choice.NRCGI = nRCGI;
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* mandatory */
|
||||
/* c4. ServCellIndex */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ServCellndex;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ServCellIndex;
|
||||
ie->value.choice.ServCellIndex = 5L;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional */
|
||||
/* c5. DRXCycle */
|
||||
if (0) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DRXCycle;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRXCycle;
|
||||
ie->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum
|
||||
if (0) {
|
||||
ie->value.choice.DRXCycle.shortDRXCycleLength = (F1AP_ShortDRXCycleLength_t *)calloc(1, sizeof(F1AP_ShortDRXCycleLength_t));
|
||||
*ie->value.choice.DRXCycle.shortDRXCycleLength = F1AP_ShortDRXCycleLength_ms2; // enum
|
||||
}
|
||||
if (0) {
|
||||
ie->value.choice.DRXCycle.shortDRXCycleTimer = (F1AP_ShortDRXCycleTimer_t *)calloc(1, sizeof(F1AP_ShortDRXCycleTimer_t));
|
||||
*ie->value.choice.DRXCycle.shortDRXCycleTimer = 123L;
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c5. CUtoDURRCInformation */
|
||||
if (1) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_CUtoDURRCInformation;
|
||||
ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo = (F1AP_CG_ConfigInfo_t *)calloc(1, sizeof(F1AP_CG_ConfigInfo_t));
|
||||
/* optional */
|
||||
OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList = (F1AP_UE_CapabilityRAT_ContainerList_t *)calloc(1, sizeof(F1AP_UE_CapabilityRAT_ContainerList_t));
|
||||
/* optional */
|
||||
OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c6. TransmissionStopIndicator */
|
||||
if (1) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransmissionStopIndicator;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_TransmissionStopIndicator;
|
||||
ie->value.choice.TransmissionStopIndicator = F1AP_TransmissionStopIndicator_true;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c7. ResourceCoordinationTransferContainer */
|
||||
if (0) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ResourceCoordinationTransferContainer;
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c7. RRCRconfigurationCompleteIndicator */
|
||||
if (1) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RRCRconfigurationCompleteIndicator;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCRconfigurationCompleteIndicator;
|
||||
ie->value.choice.RRCRconfigurationCompleteIndicator = F1AP_RRCRconfigurationCompleteIndicator_true;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c8. RRCContainer */
|
||||
if (1) {
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCContainer;
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as",
|
||||
strlen("asdsa1d32sa1d31asd31as"));
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* mandatory */
|
||||
/* c9. SCell_ToBeSetupMod_List */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_List;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeSetupMod_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_SCell_ToBeSetupMod_ItemIEs_t *scell_toBeSetupMod_item_ies;
|
||||
scell_toBeSetupMod_item_ies = (F1AP_SCell_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeSetupMod_ItemIEs_t));
|
||||
//memset((void *)&scell_toBeSetupMod_item_ies, 0, sizeof(F1AP_SCell_ToBeSetupMod_ItemIEs_t));
|
||||
scell_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_Item;
|
||||
scell_toBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
|
||||
scell_toBeSetupMod_item_ies->value.present = F1AP_SCell_ToBeSetupMod_ItemIEs__value_PR_SCell_ToBeSetupMod_Item;
|
||||
|
||||
/* 8.1 SCell_ToBeSetup_Item */
|
||||
F1AP_SCell_ToBeSetupMod_Item_t scell_toBeSetupMod_item;
|
||||
memset((void *)&scell_toBeSetupMod_item, 0, sizeof(F1AP_SCell_ToBeSetupMod_Item_t));
|
||||
|
||||
// /* - sCell_ID */
|
||||
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);
|
||||
scell_toBeSetupMod_item.sCell_ID = nRCGI;
|
||||
|
||||
/* sCellIndex */
|
||||
scell_toBeSetupMod_item.sCellIndex = 6; // issue here
|
||||
|
||||
// /* ADD */
|
||||
scell_toBeSetupMod_item_ies->value.choice.SCell_ToBeSetupMod_Item = scell_toBeSetupMod_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeSetupMod_List.list,
|
||||
scell_toBeSetupMod_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c10. SCell_ToBeRemoved_List */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_List;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeRemoved_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_SCell_ToBeRemoved_ItemIEs_t *scell_toBeRemoved_item_ies;
|
||||
scell_toBeRemoved_item_ies = (F1AP_SCell_ToBeRemoved_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t));
|
||||
//memset((void *)&scell_toBeRemoved_item_ies, 0, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t));
|
||||
scell_toBeRemoved_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_Item;
|
||||
scell_toBeRemoved_item_ies->criticality = F1AP_Criticality_ignore;
|
||||
scell_toBeRemoved_item_ies->value.present = F1AP_SCell_ToBeRemoved_ItemIEs__value_PR_SCell_ToBeRemoved_Item;
|
||||
|
||||
/* 10.1 SCell_ToBeRemoved_Item */
|
||||
F1AP_SCell_ToBeRemoved_Item_t scell_toBeRemoved_item;
|
||||
memset((void *)&scell_toBeRemoved_item, 0, sizeof(F1AP_SCell_ToBeRemoved_Item_t));
|
||||
|
||||
/* - sCell_ID */
|
||||
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);
|
||||
scell_toBeRemoved_item.sCell_ID = nRCGI;
|
||||
|
||||
/* ADD */
|
||||
scell_toBeRemoved_item_ies->value.choice.SCell_ToBeRemoved_Item = scell_toBeRemoved_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeRemoved_List.list,
|
||||
scell_toBeRemoved_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c11. SRBs_ToBeSetupMod_List */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeSetupMod_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_SRBs_ToBeSetupMod_ItemIEs_t *srbs_toBeSetupMod_item_ies;
|
||||
srbs_toBeSetupMod_item_ies = (F1AP_SRBs_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeSetupMod_ItemIEs_t));
|
||||
//memset((void *)&srbs_toBeSetupMod_item_ies, 0, sizeof(F1AP_SRBs_ToBeSetupMod_ItemIEs_t));
|
||||
srbs_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_Item;
|
||||
srbs_toBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
|
||||
srbs_toBeSetupMod_item_ies->value.present = F1AP_SRBs_ToBeSetupMod_ItemIEs__value_PR_SRBs_ToBeSetupMod_Item;
|
||||
|
||||
/* 9.1 SRBs_ToBeSetupMod_Item */
|
||||
F1AP_SRBs_ToBeSetupMod_Item_t srbs_toBeSetupMod_item;
|
||||
memset((void *)&srbs_toBeSetupMod_item, 0, sizeof(F1AP_SRBs_ToBeSetupMod_Item_t));
|
||||
|
||||
/* - sRBID */
|
||||
srbs_toBeSetupMod_item.sRBID = 3L;
|
||||
|
||||
/* ADD */
|
||||
srbs_toBeSetupMod_item_ies->value.choice.SRBs_ToBeSetupMod_Item = srbs_toBeSetupMod_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeSetupMod_List.list,
|
||||
srbs_toBeSetupMod_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c12. DRBs_ToBeSetupMod_List */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_DRBs_ToBeSetupMod_ItemIEs_t *drbs_toBeSetupMod_item_ies;
|
||||
drbs_toBeSetupMod_item_ies = (F1AP_DRBs_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeSetupMod_ItemIEs_t));
|
||||
drbs_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item;
|
||||
drbs_toBeSetupMod_item_ies->criticality = F1AP_Criticality_reject;
|
||||
drbs_toBeSetupMod_item_ies->value.present = F1AP_DRBs_ToBeSetupMod_ItemIEs__value_PR_DRBs_ToBeSetupMod_Item;
|
||||
|
||||
/* 12.1 DRBs_ToBeSetupMod_Item */
|
||||
F1AP_DRBs_ToBeSetupMod_Item_t drbs_toBeSetupMod_item;
|
||||
memset((void *)&drbs_toBeSetupMod_item, 0, sizeof(F1AP_DRBs_ToBeSetupMod_Item_t));
|
||||
|
||||
/* dRBID */
|
||||
drbs_toBeSetupMod_item.dRBID = 30L;
|
||||
|
||||
/* qoSInformation */
|
||||
drbs_toBeSetupMod_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
|
||||
drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
|
||||
drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS->qCI = 253L;
|
||||
|
||||
/* ULTunnels_ToBeSetupMod_List */
|
||||
int j = 0;
|
||||
int maxnoofULTunnels = 1; // 2;
|
||||
for (j=0;
|
||||
j<maxnoofULTunnels;
|
||||
j++) {
|
||||
/* ULTunnels_ToBeSetup_Item */
|
||||
|
||||
F1AP_ULUPTNLInformation_ToBeSetup_Item_t *uLUPTNLInformation_ToBeSetup_Item;
|
||||
uLUPTNLInformation_ToBeSetup_Item = (F1AP_ULUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_ULUPTNLInformation_ToBeSetup_Item_t));
|
||||
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
|
||||
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
|
||||
|
||||
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
|
||||
|
||||
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "4567",
|
||||
strlen("4567"));
|
||||
|
||||
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
|
||||
|
||||
ASN_SEQUENCE_ADD(&drbs_toBeSetupMod_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item);
|
||||
}
|
||||
|
||||
/* rLCMode */
|
||||
drbs_toBeSetupMod_item.rLCMode = F1AP_RLCMode_rlc_um; // enum
|
||||
|
||||
/* OPTIONAL */
|
||||
/* ULConfiguration */
|
||||
if (0) {
|
||||
drbs_toBeSetupMod_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
|
||||
}
|
||||
|
||||
/* ADD */
|
||||
drbs_toBeSetupMod_item_ies->value.choice.DRBs_ToBeSetupMod_Item = drbs_toBeSetupMod_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeSetupMod_List.list,
|
||||
drbs_toBeSetupMod_item_ies);
|
||||
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c13. DRBs_ToBeModified_List */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeModified_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_DRBs_ToBeModified_ItemIEs_t *drbs_toBeModified_item_ies;
|
||||
drbs_toBeModified_item_ies = (F1AP_DRBs_ToBeModified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeModified_ItemIEs_t));
|
||||
drbs_toBeModified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeModified_Item;
|
||||
drbs_toBeModified_item_ies->criticality = F1AP_Criticality_reject;
|
||||
drbs_toBeModified_item_ies->value.present = F1AP_DRBs_ToBeModified_ItemIEs__value_PR_DRBs_ToBeModified_Item;
|
||||
|
||||
/* 13.1 SRBs_ToBeModified_Item */
|
||||
F1AP_DRBs_ToBeModified_Item_t drbs_toBeModified_item;
|
||||
memset((void *)&drbs_toBeModified_item, 0, sizeof(F1AP_DRBs_ToBeModified_Item_t));
|
||||
|
||||
/* dRBID */
|
||||
drbs_toBeModified_item.dRBID = 30L;
|
||||
|
||||
/* qoSInformation */
|
||||
drbs_toBeModified_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
|
||||
drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
|
||||
drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS->qCI = 254L;
|
||||
|
||||
/* ULTunnels_ToBeModified_List */
|
||||
int j = 0;
|
||||
int maxnoofULTunnels = 1; // 2;
|
||||
for (j=0;
|
||||
j<maxnoofULTunnels;
|
||||
j++) {
|
||||
/* ULTunnels_ToBeModified_Item */
|
||||
F1AP_ULUPTNLInformation_ToBeSetup_Item_t *uLUPTNLInformation_ToBeSetup_Item;
|
||||
uLUPTNLInformation_ToBeSetup_Item = (F1AP_ULUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_ULUPTNLInformation_ToBeSetup_Item_t));
|
||||
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
|
||||
F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
|
||||
|
||||
TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
|
||||
|
||||
OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
|
||||
strlen("1204"));
|
||||
|
||||
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
|
||||
|
||||
ASN_SEQUENCE_ADD(&drbs_toBeModified_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item);
|
||||
}
|
||||
|
||||
/* OPTIONAL */
|
||||
/* ULConfiguration */
|
||||
if (0) {
|
||||
drbs_toBeModified_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
|
||||
}
|
||||
|
||||
/* ADD */
|
||||
drbs_toBeModified_item_ies->value.choice.DRBs_ToBeModified_Item = drbs_toBeModified_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeModified_List.list,
|
||||
drbs_toBeModified_item_ies);
|
||||
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c14. SRBs_ToBeReleased_List */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeReleased_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeReleased_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_SRBs_ToBeReleased_ItemIEs_t *srbs_toBeReleased_item_ies;
|
||||
srbs_toBeReleased_item_ies = (F1AP_SRBs_ToBeReleased_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeReleased_ItemIEs_t));
|
||||
//memset((void *)&srbs_toBeReleased_item_ies, 0, sizeof(F1AP_SRBs_ToBeReleased_ItemIEs_t));
|
||||
srbs_toBeReleased_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeReleased_Item;
|
||||
srbs_toBeReleased_item_ies->criticality = F1AP_Criticality_ignore;
|
||||
srbs_toBeReleased_item_ies->value.present = F1AP_SRBs_ToBeReleased_ItemIEs__value_PR_SRBs_ToBeReleased_Item;
|
||||
|
||||
/* 9.1 SRBs_ToBeReleased_Item */
|
||||
F1AP_SRBs_ToBeReleased_Item_t srbs_toBeReleased_item;
|
||||
memset((void *)&srbs_toBeReleased_item, 0, sizeof(F1AP_SRBs_ToBeReleased_Item_t));
|
||||
|
||||
/* - sRBID */
|
||||
srbs_toBeReleased_item.sRBID = 2L;
|
||||
|
||||
/* ADD */
|
||||
srbs_toBeReleased_item_ies->value.choice.SRBs_ToBeReleased_Item = srbs_toBeReleased_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeReleased_List.list,
|
||||
srbs_toBeReleased_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* c15. DRBs_ToBeReleased_List */
|
||||
ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_DRBs_ToBeReleased_ItemIEs_t *drbs_toBeReleased_item_ies;
|
||||
drbs_toBeReleased_item_ies = (F1AP_DRBs_ToBeReleased_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeReleased_ItemIEs_t));
|
||||
drbs_toBeReleased_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_Item;
|
||||
drbs_toBeReleased_item_ies->criticality = F1AP_Criticality_reject;
|
||||
drbs_toBeReleased_item_ies->value.present = F1AP_DRBs_ToBeReleased_ItemIEs__value_PR_DRBs_ToBeReleased_Item;
|
||||
|
||||
/* 14.1 SRBs_ToBeReleased_Item */
|
||||
F1AP_DRBs_ToBeReleased_Item_t drbs_toBeReleased_item;
|
||||
memset((void *)&drbs_toBeReleased_item, 0, sizeof(F1AP_DRBs_ToBeReleased_Item_t));
|
||||
|
||||
/* dRBID */
|
||||
drbs_toBeReleased_item.dRBID = 30L;
|
||||
|
||||
/* ADD */
|
||||
drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item = drbs_toBeReleased_item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeReleased_List.list,
|
||||
drbs_toBeReleased_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_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(F1AP_UEContextModificationFailure_t EContextModificationFailure) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequired_t *UEContextModificationRequired) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -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));
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,792 @@
|
||||
/*
|
||||
* 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.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 "f1ap_common.h"
|
||||
#include "f1ap_du_interface_management.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data;
|
||||
|
||||
|
||||
/*
|
||||
Reset
|
||||
*/
|
||||
|
||||
|
||||
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) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Error Indication
|
||||
*/
|
||||
|
||||
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) {
|
||||
module_id_t enb_mod_idP;
|
||||
module_id_t du_mod_idP;
|
||||
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_F1SetupRequest_t *out;
|
||||
F1AP_F1SetupRequestIEs_t *ie;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
/* Create */
|
||||
/* 0. pdu 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_F1Setup;
|
||||
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_F1SetupRequest;
|
||||
out = &pdu.choice.initiatingMessage->value.choice.F1SetupRequest;
|
||||
|
||||
/* mandatory */
|
||||
/* c1. Transaction ID (integer value) */
|
||||
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_F1SetupRequestIEs__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. GNB_DU_ID (integrer value) */
|
||||
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID;
|
||||
asn_int642INTEGER(&ie->value.choice.GNB_DU_ID, f1ap_du_data->gNB_DU_id);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional */
|
||||
/* c3. GNB_DU_Name */
|
||||
if (f1ap_du_data->gNB_DU_name != NULL) {
|
||||
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name;
|
||||
OCTET_STRING_fromBuf(&ie->value.choice.GNB_DU_Name, f1ap_du_data->gNB_DU_name,
|
||||
strlen(f1ap_du_data->gNB_DU_name));
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* mandatory */
|
||||
/* c4. serverd cells list */
|
||||
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
|
||||
|
||||
int num_cells_available = f1ap_du_data->num_cells_available;
|
||||
printf("num_cells_available = %d \n", num_cells_available);
|
||||
for (i=0;
|
||||
i<num_cells_available;
|
||||
i++) {
|
||||
/* mandatory */
|
||||
/* 4.1 serverd cells item */
|
||||
|
||||
F1AP_GNB_DU_Served_Cells_ItemIEs_t *gnb_du_served_cell_list_item_ies;
|
||||
gnb_du_served_cell_list_item_ies = (F1AP_GNB_DU_Served_Cells_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_DU_Served_Cells_ItemIEs_t));
|
||||
gnb_du_served_cell_list_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item;
|
||||
gnb_du_served_cell_list_item_ies->criticality = F1AP_Criticality_reject;
|
||||
gnb_du_served_cell_list_item_ies->value.present = F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
|
||||
|
||||
|
||||
F1AP_GNB_DU_Served_Cells_Item_t gnb_du_served_cells_item;
|
||||
memset((void *)&gnb_du_served_cells_item, 0, sizeof(F1AP_GNB_DU_Served_Cells_Item_t));
|
||||
|
||||
/* 4.1.1 serverd cell Information */
|
||||
F1AP_Served_Cell_Information_t served_cell_information;
|
||||
|
||||
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
|
||||
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity);
|
||||
//MCC_MNC_TO_PLMNID(208, 95, 2, &nRCGI.pLMN_Identity);
|
||||
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity);
|
||||
served_cell_information.nRCGI = nRCGI;
|
||||
|
||||
/* - nRPCI */
|
||||
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
|
||||
|
||||
/* - fiveGS_TAC */
|
||||
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
|
||||
&f1ap_du_data->tac[i],
|
||||
3);
|
||||
|
||||
/* - Configured_EPS_TAC */
|
||||
if(0){
|
||||
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
|
||||
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
|
||||
"2",
|
||||
2);
|
||||
}
|
||||
|
||||
/* - broadcast PLMNs */
|
||||
// RK: add the num_available_broadcast_PLMNs to the message
|
||||
int num_available_broadcast_PLMNs = 1; //f1ap_du_data->num_available_broadcast_PLMNs;
|
||||
printf("num_available_broadcast_PLMNs = %d \n", num_available_broadcast_PLMNs);
|
||||
for (j=0;
|
||||
j<num_available_broadcast_PLMNs; // num_available_broadcast_PLMNs
|
||||
j++) {
|
||||
/* > PLMN BroadcastPLMNs Item */
|
||||
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
//MCC_MNC_TO_PLMNID(208, 95, 2, &broadcastPLMNs_Item->pLMN_Identity);
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
|
||||
}
|
||||
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
//f1ap_du_data->fdd_flag = 1;
|
||||
if (f1ap_du_data->fdd_flag) { // FDD
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
|
||||
/* > FDD >> FDD Info */
|
||||
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
|
||||
/* >>> UL NRFreqInfo */
|
||||
fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_arfcn;
|
||||
|
||||
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
|
||||
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
ul_freqBandNrItem.freqBandIndicatorNr = 777L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
|
||||
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
|
||||
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
|
||||
|
||||
/* >>> DL NRFreqInfo */
|
||||
fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_arfcn;
|
||||
|
||||
F1AP_FreqBandNrItem_t dl_freqBandNrItem;
|
||||
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
dl_freqBandNrItem.freqBandIndicatorNr = 777L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
|
||||
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
|
||||
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
|
||||
|
||||
/* >>> UL Transmission Bandwidth */
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs;
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.ul_nrb;
|
||||
/* >>> DL Transmission Bandwidth */
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs;
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.dl_nrb;
|
||||
|
||||
nR_Mode_Info.choice.fDD = fDD_Info;
|
||||
} else { // TDD
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
|
||||
|
||||
/* > TDD >> TDD Info */
|
||||
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
|
||||
/* >>> ARFCN */
|
||||
tDD_Info->nRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].tdd.nr_arfcn; // Integer
|
||||
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
|
||||
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
// RK: missing params
|
||||
nr_freqBandNrItem.freqBandIndicatorNr = 555L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
|
||||
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
|
||||
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
|
||||
|
||||
tDD_Info->transmission_Bandwidth.nRSCS= f1ap_du_data->nr_mode_info[i].tdd.scs;
|
||||
tDD_Info->transmission_Bandwidth.nRNRB= f1ap_du_data->nr_mode_info[i].tdd.nrb;
|
||||
|
||||
nR_Mode_Info.choice.tDD = tDD_Info;
|
||||
}
|
||||
|
||||
served_cell_information.nR_Mode_Info = nR_Mode_Info;
|
||||
|
||||
/* - measurementTimingConfiguration */
|
||||
char *measurementTimingConfiguration = "0"; //&f1ap_du_data->measurement_timing_information[i]; // sept. 2018
|
||||
|
||||
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
|
||||
measurementTimingConfiguration,
|
||||
strlen(measurementTimingConfiguration));
|
||||
gnb_du_served_cells_item.served_Cell_Information = served_cell_information; //
|
||||
|
||||
/* 4.1.2 gNB-DU System Information */
|
||||
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
|
||||
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
|
||||
f1ap_du_data->mib[i],//f1ap_du_data->mib,
|
||||
f1ap_du_data->mib_length[i]);
|
||||
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
|
||||
f1ap_du_data->sib1[i],
|
||||
f1ap_du_data->sib1_length[i]);
|
||||
|
||||
gnb_du_served_cells_item.gNB_DU_System_Information = gNB_DU_System_Information; //
|
||||
|
||||
/* ADD */
|
||||
gnb_du_served_cell_list_item_ies->value.choice.GNB_DU_Served_Cells_Item = gnb_du_served_cells_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_DU_Served_Cells_List.list,
|
||||
gnb_du_served_cell_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");
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SETUP FAILURE
|
||||
void DU_handle_F1_SETUP_FAILURE(F1AP_F1AP_PDU_t *pdu_p) {
|
||||
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) {
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_GNBDUConfigurationUpdate_t *out;
|
||||
F1AP_GNBDUConfigurationUpdateIEs_t *ie;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
/* Create */
|
||||
/* 0. Message Type */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
|
||||
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBDUConfigurationUpdate;
|
||||
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
|
||||
out = &pdu.choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
|
||||
|
||||
/* mandatory */
|
||||
/* c1. Transaction ID (integer value) */
|
||||
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
|
||||
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c2. Served_Cells_To_Add */
|
||||
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List;
|
||||
|
||||
for (j=0;
|
||||
j<1;
|
||||
j++) {
|
||||
//
|
||||
F1AP_Served_Cells_To_Add_ItemIEs_t *served_cells_to_add_item_ies;
|
||||
served_cells_to_add_item_ies = (F1AP_Served_Cells_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Add_ItemIEs_t));
|
||||
served_cells_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_Item;
|
||||
served_cells_to_add_item_ies->criticality = F1AP_Criticality_reject;
|
||||
served_cells_to_add_item_ies->value.present = F1AP_Served_Cells_To_Add_ItemIEs__value_PR_Served_Cells_To_Add_Item;
|
||||
|
||||
F1AP_Served_Cells_To_Add_Item_t served_cells_to_add_item;
|
||||
memset((void *)&served_cells_to_add_item, 0, sizeof(F1AP_Served_Cells_To_Add_Item_t));
|
||||
|
||||
/* 2.1.1 serverd cell Information */
|
||||
F1AP_Served_Cell_Information_t served_cell_information;
|
||||
|
||||
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
MCC_MNC_TO_PLMNID(f1ap_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);
|
||||
served_cell_information.nRCGI = nRCGI;
|
||||
|
||||
/* - nRPCI */
|
||||
served_cell_information.nRPCI = 321L; // int 0..1007
|
||||
|
||||
/* - fiveGS_TAC */
|
||||
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
|
||||
"10",
|
||||
3);
|
||||
|
||||
/* - Configured_EPS_TAC */
|
||||
if(1){
|
||||
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
|
||||
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
|
||||
"2",
|
||||
2);
|
||||
}
|
||||
|
||||
/* - broadcast PLMNs */
|
||||
int maxnoofBPLMNS = 1;
|
||||
for (i=0;
|
||||
i<maxnoofBPLMNS;
|
||||
i++) {
|
||||
/* > PLMN BroadcastPLMNs Item */
|
||||
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
|
||||
}
|
||||
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
|
||||
if ("FDD") {
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
|
||||
/* > FDD >> FDD Info */
|
||||
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
|
||||
/* >>> UL NRFreqInfo */
|
||||
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
|
||||
|
||||
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
|
||||
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
ul_freqBandNrItem.freqBandIndicatorNr = 888L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
|
||||
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
|
||||
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
|
||||
|
||||
/* >>> DL NRFreqInfo */
|
||||
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
|
||||
|
||||
F1AP_FreqBandNrItem_t dl_freqBandNrItem;
|
||||
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
dl_freqBandNrItem.freqBandIndicatorNr = 555L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
|
||||
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
|
||||
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
|
||||
|
||||
/* >>> UL Transmission Bandwidth */
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
|
||||
/* >>> DL Transmission Bandwidth */
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
|
||||
|
||||
nR_Mode_Info.choice.fDD = fDD_Info;
|
||||
} else { // TDD
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
|
||||
|
||||
/* > TDD >> TDD Info */
|
||||
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
|
||||
/* >>> ARFCN */
|
||||
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
|
||||
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
|
||||
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
nr_freqBandNrItem.freqBandIndicatorNr = 555L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
|
||||
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
|
||||
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
|
||||
|
||||
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
|
||||
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
|
||||
|
||||
nR_Mode_Info.choice.tDD = tDD_Info;
|
||||
}
|
||||
|
||||
served_cell_information.nR_Mode_Info = nR_Mode_Info;
|
||||
|
||||
/* - measurementTimingConfiguration */
|
||||
char *measurementTimingConfiguration = "0"; // sept. 2018
|
||||
|
||||
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
|
||||
measurementTimingConfiguration,
|
||||
strlen(measurementTimingConfiguration));
|
||||
served_cells_to_add_item.served_Cell_Information = served_cell_information; //
|
||||
|
||||
/* 2.1.2 gNB-DU System Information */
|
||||
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
|
||||
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
|
||||
"1",
|
||||
sizeof("1"));
|
||||
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
|
||||
"1",
|
||||
sizeof("1"));
|
||||
served_cells_to_add_item.gNB_DU_System_Information = gNB_DU_System_Information; //
|
||||
|
||||
/* ADD */
|
||||
served_cells_to_add_item_ies->value.choice.Served_Cells_To_Add_Item = served_cells_to_add_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Add_List.list,
|
||||
served_cells_to_add_item_ies);
|
||||
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c3. Served_Cells_To_Modify */
|
||||
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_Served_Cells_To_Modify_ItemIEs_t *served_cells_to_modify_item_ies;
|
||||
served_cells_to_modify_item_ies = (F1AP_Served_Cells_To_Modify_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Modify_ItemIEs_t));
|
||||
served_cells_to_modify_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_Item;
|
||||
served_cells_to_modify_item_ies->criticality = F1AP_Criticality_reject;
|
||||
served_cells_to_modify_item_ies->value.present = F1AP_Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item;
|
||||
|
||||
F1AP_Served_Cells_To_Modify_Item_t served_cells_to_modify_item;
|
||||
memset((void *)&served_cells_to_modify_item, 0, sizeof(F1AP_Served_Cells_To_Modify_Item_t));
|
||||
|
||||
/* 3.1 oldNRCGI */
|
||||
F1AP_NRCGI_t oldNRCGI;
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
|
||||
&oldNRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity);
|
||||
served_cells_to_modify_item.oldNRCGI = oldNRCGI;
|
||||
|
||||
|
||||
/* 3.2.1 serverd cell Information */
|
||||
F1AP_Served_Cell_Information_t served_cell_information;
|
||||
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
|
||||
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
MCC_MNC_TO_PLMNID(f1ap_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);
|
||||
served_cell_information.nRCGI = nRCGI;
|
||||
|
||||
/* - nRPCI */
|
||||
served_cell_information.nRPCI = 321L; // int 0..1007
|
||||
|
||||
/* - fiveGS_TAC */
|
||||
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
|
||||
"10",
|
||||
3);
|
||||
|
||||
/* - Configured_EPS_TAC */
|
||||
if(1){
|
||||
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
|
||||
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
|
||||
"2",
|
||||
2);
|
||||
}
|
||||
|
||||
/* - broadcast PLMNs */
|
||||
int maxnoofBPLMNS = 1;
|
||||
for (i=0;
|
||||
i<maxnoofBPLMNS;
|
||||
i++) {
|
||||
/* > PLMN BroadcastPLMNs Item */
|
||||
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &broadcastPLMNs_Item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
|
||||
}
|
||||
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
|
||||
if ("FDD") {
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
|
||||
/* > FDD >> FDD Info */
|
||||
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
|
||||
/* >>> UL NRFreqInfo */
|
||||
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
|
||||
|
||||
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
|
||||
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
ul_freqBandNrItem.freqBandIndicatorNr = 888L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
|
||||
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
|
||||
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
|
||||
|
||||
/* >>> DL NRFreqInfo */
|
||||
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
|
||||
|
||||
F1AP_FreqBandNrItem_t dl_freqBandNrItem;
|
||||
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
dl_freqBandNrItem.freqBandIndicatorNr = 555L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
|
||||
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
|
||||
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
|
||||
|
||||
/* >>> UL Transmission Bandwidth */
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
|
||||
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
|
||||
/* >>> DL Transmission Bandwidth */
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
|
||||
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
|
||||
|
||||
nR_Mode_Info.choice.fDD = fDD_Info;
|
||||
} else { // TDD
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
|
||||
|
||||
/* > TDD >> TDD Info */
|
||||
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
|
||||
/* >>> ARFCN */
|
||||
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
|
||||
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
|
||||
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
|
||||
nr_freqBandNrItem.freqBandIndicatorNr = 555L;
|
||||
|
||||
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
|
||||
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
|
||||
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
|
||||
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
|
||||
|
||||
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
|
||||
|
||||
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
|
||||
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
|
||||
|
||||
nR_Mode_Info.choice.tDD = tDD_Info;
|
||||
}
|
||||
|
||||
served_cell_information.nR_Mode_Info = nR_Mode_Info;
|
||||
|
||||
/* - measurementTimingConfiguration */
|
||||
char *measurementTimingConfiguration = "0"; // sept. 2018
|
||||
|
||||
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
|
||||
measurementTimingConfiguration,
|
||||
strlen(measurementTimingConfiguration));
|
||||
served_cells_to_modify_item.served_Cell_Information = served_cell_information; //
|
||||
|
||||
/* 3.2.2 gNB-DU System Information */
|
||||
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
|
||||
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
|
||||
"1",
|
||||
sizeof("1"));
|
||||
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
|
||||
"1",
|
||||
sizeof("1"));
|
||||
served_cells_to_modify_item.gNB_DU_System_Information = gNB_DU_System_Information; //
|
||||
|
||||
/* ADD */
|
||||
served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item = served_cells_to_modify_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Modify_List.list,
|
||||
served_cells_to_modify_item_ies);
|
||||
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c4. Served_Cells_To_Delete */
|
||||
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Delete_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_Served_Cells_To_Delete_ItemIEs_t *served_cells_to_delete_item_ies;
|
||||
served_cells_to_delete_item_ies = (F1AP_Served_Cells_To_Delete_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Delete_ItemIEs_t));
|
||||
served_cells_to_delete_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
|
||||
served_cells_to_delete_item_ies->criticality = F1AP_Criticality_reject;
|
||||
served_cells_to_delete_item_ies->value.present = F1AP_Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item;
|
||||
|
||||
F1AP_Served_Cells_To_Delete_Item_t served_cells_to_delete_item;
|
||||
memset((void *)&served_cells_to_delete_item, 0, sizeof(F1AP_Served_Cells_To_Delete_Item_t));
|
||||
|
||||
/* 3.1 oldNRCGI */
|
||||
F1AP_NRCGI_t oldNRCGI;
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
|
||||
&oldNRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity);
|
||||
served_cells_to_delete_item.oldNRCGI = oldNRCGI;
|
||||
|
||||
/* ADD */
|
||||
served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item = served_cells_to_delete_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Delete_List.list,
|
||||
served_cells_to_delete_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
/* mandatory */
|
||||
/* c5. Active_Cells_List */
|
||||
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Active_Cells_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Active_Cells_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
//
|
||||
F1AP_Active_Cells_ItemIEs_t *active_cells_item_ies;
|
||||
active_cells_item_ies = (F1AP_Active_Cells_ItemIEs_t *)calloc(1, sizeof(F1AP_Active_Cells_ItemIEs_t));
|
||||
active_cells_item_ies->id = F1AP_ProtocolIE_ID_id_Active_Cells_Item;
|
||||
active_cells_item_ies->criticality = F1AP_Criticality_reject;
|
||||
active_cells_item_ies->value.present = F1AP_Active_Cells_ItemIEs__value_PR_Active_Cells_Item;
|
||||
|
||||
F1AP_Active_Cells_Item_t active_cells_item;
|
||||
memset((void *)&active_cells_item, 0, sizeof(F1AP_Active_Cells_Item_t));
|
||||
|
||||
/* 3.1 oldNRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
MCC_MNC_TO_PLMNID(f1ap_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);
|
||||
active_cells_item.nRCGI = nRCGI;
|
||||
|
||||
/* ADD */
|
||||
active_cells_item_ies->value.choice.Active_Cells_Item = active_cells_item;
|
||||
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.Active_Cells_List.list,
|
||||
active_cells_item_ies);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
printf("Failed to encode F1 setup request\n");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
//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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DU_handle_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t GNBDUConfigurationUpdateFailure) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpdateAcknowledge_t GNBDUConfigurationUpdateAcknowledge) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
gNB-CU Configuration Update
|
||||
*/
|
||||
|
||||
void DU_handle_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void DU_send_gNB_CU_CONFIGURATION_UPDATE_FALIURE(F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
|
||||
void DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* 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");
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
@@ -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_ */
|
||||
|
||||
@@ -0,0 +1,723 @@
|
||||
/*
|
||||
* 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");
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
@@ -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_ */
|
||||
|
||||
+11
-192
@@ -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 */
|
||||
@@ -141,162 +118,4 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream,
|
||||
(assoc_id, stream, &pdu);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
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;
|
||||
// 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);
|
||||
// message_p = itti_alloc_new_message(TASK_F1AP, SCTP_DATA_REQ);
|
||||
|
||||
sctp_data_req = &message_p->ittiMsg.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;
|
||||
// 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);
|
||||
}
|
||||
// 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_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, F1AP_DOWNLINK_NAS);
|
||||
// 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;
|
||||
|
||||
f1ap_downlink_nas = &message_p->ittiMsg.f1ap_downlink_nas;
|
||||
|
||||
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;
|
||||
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, 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;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user