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

Remove the dummy value in DU, and store the payload data in DU

parent 7732b49a
...@@ -66,6 +66,12 @@ typedef struct f1ap_setup_req_s { ...@@ -66,6 +66,12 @@ typedef struct f1ap_setup_req_s {
// Midhaul networking parameters // Midhaul networking parameters
/* Connexion id used between SCTP/F1AP */
uint16_t cnx_id;
/* SCTP association id */
int32_t assoc_id;
/* The eNB IP address to bind */ /* The eNB IP address to bind */
f1ap_net_ip_address_t CU_f1_ip_address; f1ap_net_ip_address_t CU_f1_ip_address;
f1ap_net_ip_address_t DU_f1_ip_address; f1ap_net_ip_address_t DU_f1_ip_address;
...@@ -91,20 +97,20 @@ typedef struct f1ap_setup_req_s { ...@@ -91,20 +97,20 @@ typedef struct f1ap_setup_req_s {
/* Mobile Country Codes /* Mobile Country Codes
* Mobile Network Codes * Mobile Network Codes
*/ */
uint16_t mcc[F1AP_MAX_NB_CELLS]; uint16_t mcc[F1AP_MAX_NB_CELLS];//[6];
uint16_t mnc[F1AP_MAX_NB_CELLS]; uint16_t mnc[F1AP_MAX_NB_CELLS];//[6];
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS]; uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];//[6];
// NR Physical Cell Ids // NR Physical Cell Ids
uint16_t nr_pci[F1AP_MAX_NB_CELLS]; uint16_t nr_pci[F1AP_MAX_NB_CELLS];
// NR Cell Ids // NR Cell Ids
uint8_t nr_cellid[F1AP_MAX_NB_CELLS]; uint8_t nr_cellid[F1AP_MAX_NB_CELLS];
// Number of slide support items (max 16, could be increased to as much as 1024) // Number of slide support items (max 16, could be increased to as much as 1024)
uint16_t num_ssi[F1AP_MAX_NB_CELLS]; uint16_t num_ssi[F1AP_MAX_NB_CELLS];//[6];
uint8_t sst[F1AP_MAX_NB_CELLS][16]; uint8_t sst[F1AP_MAX_NB_CELLS];//[16][6];
uint8_t sd[F1AP_MAX_NB_CELLS][16]; uint8_t sd[F1AP_MAX_NB_CELLS];//[16][6];
// tdd_flag = 0 means FDD, 1 means TDD // fdd_flag = 1 means FDD, 0 means TDD
int tdd_flag; int fdd_flag;
union { union {
struct { struct {
......
...@@ -2432,10 +2432,12 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) { ...@@ -2432,10 +2432,12 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
F1AP_SETUP_REQ (msg_p).nr_pci[k] = rrc->carrier[0].physCellId; F1AP_SETUP_REQ (msg_p).nr_pci[k] = rrc->carrier[0].physCellId;
F1AP_SETUP_REQ (msg_p).nr_cellid[k] = 0; F1AP_SETUP_REQ (msg_p).nr_cellid[k] = 0;
F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0; F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0;
if (rrc->carrier[0].sib1->tdd_Config) { if (rrc->carrier[0].sib1->tdd_Config) {
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k); LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
F1AP_SETUP_REQ (msg_p).tdd_flag = 1; F1AP_SETUP_REQ (msg_p).fdd_flag = 0;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_arfcn = freq_to_arfcn10(rrc->carrier[0].sib1->freqBandIndicator, F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_arfcn = freq_to_arfcn10(rrc->carrier[0].sib1->freqBandIndicator,
rrc->carrier[0].dl_CarrierFreq); rrc->carrier[0].dl_CarrierFreq);
// For LTE use scs field to carry prefix type and number of antennas // For LTE use scs field to carry prefix type and number of antennas
...@@ -2449,8 +2451,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) { ...@@ -2449,8 +2451,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
} }
else { else {
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k); LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k);
F1AP_SETUP_REQ (msg_p).tdd_flag = 0; F1AP_SETUP_REQ (msg_p).fdd_flag = 1;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_arfcn = freq_to_arfcn10(rrc->carrier[0].sib1->freqBandIndicator, F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_arfcn = freq_to_arfcn10(rrc->carrier[0].sib1->freqBandIndicator,
rrc->carrier[0].dl_CarrierFreq); rrc->carrier[0].dl_CarrierFreq);
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nr_arfcn = F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_arfcn; F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nr_arfcn = F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_arfcn;
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include "common/ran_context.h" #include "common/ran_context.h"
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
static f1ap_setup_resp_t *f1ap_cu_data;
/* This structure describes association of a DU to a CU */ /* This structure describes association of a DU to a CU */
typedef struct f1ap_info { typedef struct f1ap_info {
...@@ -166,6 +168,14 @@ void *F1AP_CU_task(void *arg) { ...@@ -166,6 +168,14 @@ void *F1AP_CU_task(void *arg) {
CU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind); CU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
break; 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: case TERMINATE_MESSAGE:
LOG_W(CU_F1AP, " *** Exiting CU_F1AP thread\n"); LOG_W(CU_F1AP, " *** Exiting CU_F1AP thread\n");
itti_exit_task(); itti_exit_task();
...@@ -211,6 +221,11 @@ void CU_handle_F1_SETUP_REQUEST(F1AP_F1SetupRequest_t *message_p) { ...@@ -211,6 +221,11 @@ void CU_handle_F1_SETUP_REQUEST(F1AP_F1SetupRequest_t *message_p) {
/* handle */ /* handle */
// fill f1ap_setup_req_t
// send ITTI F1AP_SETUP_REQ to RRC
// return
// send successful callback // send successful callback
//CU_send_F1_SETUP_RESPONSE(); //CU_send_F1_SETUP_RESPONSE();
// or failure callback // or failure callback
...@@ -218,7 +233,7 @@ void CU_handle_F1_SETUP_REQUEST(F1AP_F1SetupRequest_t *message_p) { ...@@ -218,7 +233,7 @@ void CU_handle_F1_SETUP_REQUEST(F1AP_F1SetupRequest_t *message_p) {
} }
void CU_send_F1_SETUP_RESPONSE(instance_t instance, sctp_new_association_ind_t *f1ap_setup_ind) { void CU_send_F1_SETUP_RESPONSE(instance_t instance, sctp_new_association_ind_t *f1ap_setup_ind, f1ap_setup_resp_t *f1ap_setup_resp) {
//void CU_send_F1_SETUP_RESPONSE(F1AP_F1SetupResponse_t *F1SetupResponse) { //void CU_send_F1_SETUP_RESPONSE(F1AP_F1SetupResponse_t *F1SetupResponse) {
//AssertFatal(1==0,"Not implemented yet\n"); //AssertFatal(1==0,"Not implemented yet\n");
......
...@@ -19,45 +19,9 @@ ...@@ -19,45 +19,9 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include <stdint.h>
#include "queue.h"
#include "tree.h"
#include "sctp_eNB_defs.h"
#ifndef CU_F1AP_DEFS_H_ #ifndef CU_F1AP_DEFS_H_
#define CU_F1AP_DEFS_H_ #define CU_F1AP_DEFS_H_
struct cu_f1ap_instance_s;
typedef struct du_f1ap_instance_s {
/* Next f1ap du association.
* Only used for virtual mode.
*/
/* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
instance_t instance;
// F1_Setup_Req payload
uint32_t gNB_CU_id;
char *gNB_CU_name;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t eNB_id;
/* Tracking area code */
uint16_t tac;
/* Mobile Country Code
* Mobile Network Code
*/
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
} cu_f1ap_instance_t;
#endif /* CU_F1AP_DEFS_H_ */ #endif /* CU_F1AP_DEFS_H_ */
...@@ -43,40 +43,9 @@ ...@@ -43,40 +43,9 @@
#include "T.h" #include "T.h"
/* This structure describes association of a DU to a CU */ static f1ap_setup_req_t *f1ap_du_data;
typedef struct f1ap_info {
module_id_t enb_mod_idP; void DU_handle_sctp_association_resp(instance_t instance,sctp_new_association_resp_t *sctp_new_association_resp);
module_id_t cu_mod_idP;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t GNB_DU_ID;
/* This is the optional name provided by the MME */
char *GNB_DU_Name;
f1ap_net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets
/* Number of input/ouput streams */
uint16_t in_streams;
uint16_t out_streams;
/* Connexion id used between SCTP/S1AP */
uint16_t cnx_id;
/* SCTP association id */
int32_t assoc_id;
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
} f1ap_info_t;
void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
uint8_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id) { uint8_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id) {
...@@ -104,7 +73,6 @@ void DU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) ...@@ -104,7 +73,6 @@ void DU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
void *F1AP_DU_task(void *arg) { void *F1AP_DU_task(void *arg) {
//sctp_cu_init(); //sctp_cu_init();
MessageDef *received_msg = NULL; MessageDef *received_msg = NULL;
int result; int result;
...@@ -172,12 +140,9 @@ void *F1AP_DU_task(void *arg) { ...@@ -172,12 +140,9 @@ void *F1AP_DU_task(void *arg) {
// ============================================================================== // ==============================================================================
static void du_f1ap_register(du_f1ap_instance_t *instance_p, void DU_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
f1ap_net_ip_address_t *remote_address, // CU
f1ap_net_ip_address_t *local_address, // DU DevAssert(f1ap_setup_req != NULL);
uint16_t in_streams,
uint16_t out_streams)
{
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL; sctp_new_association_req_t *sctp_new_association_req_p = NULL;
...@@ -185,68 +150,52 @@ static void du_f1ap_register(du_f1ap_instance_t *instance_p, ...@@ -185,68 +150,52 @@ static void du_f1ap_register(du_f1ap_instance_t *instance_p,
message_p = itti_alloc_new_message(TASK_DU_F1, SCTP_NEW_ASSOCIATION_REQ); 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 = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->ulp_cnx_id = instance_p->instance; sctp_new_association_req_p->ulp_cnx_id = instance;
sctp_new_association_req_p->port = F1AP_PORT_NUMBER; sctp_new_association_req_p->port = F1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = F1AP_SCTP_PPID; sctp_new_association_req_p->ppid = F1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = in_streams; sctp_new_association_req_p->in_streams = f1ap_setup_req->sctp_in_streams;
sctp_new_association_req_p->out_streams = out_streams; sctp_new_association_req_p->out_streams = f1ap_setup_req->sctp_out_streams;
// remote
memcpy(&sctp_new_association_req_p->remote_address, memcpy(&sctp_new_association_req_p->remote_address,
remote_address, &f1ap_setup_req->CU_f1_ip_address,
sizeof(*remote_address)); sizeof(f1ap_setup_req->CU_f1_ip_address));
// local
memcpy(&sctp_new_association_req_p->local_address, memcpy(&sctp_new_association_req_p->local_address,
local_address, &f1ap_setup_req->DU_f1_ip_address,
sizeof(*local_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;
itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p); //du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
} }
void DU_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) { void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
du_f1ap_instance_t *new_instance;
//uint8_t index;
DevAssert(f1ap_setup_req != NULL); DevAssert(sctp_new_association_resp != NULL);
/* Look if the provided instance already exists */ if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
//new_instance = s1ap_eNB_get_instance(instance); LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
// @Todo instance,
// if (new_instance != NULL) { sctp_new_association_resp->ulp_cnx_id);
// /* Checks if it is a retry on the same eNB */
// DevCheck(new_instance->gNB_DU_id == f1ap_setup_req->gNB_DU_id, new_instance->gNB_DU_id, f1ap_setup_req->gNB_DU_id, 0);
// DevCheck(new_instance->cell_type == f1ap_setup_req->cell_type, new_instance->cell_type, f1ap_setup_req->cell_type, 0);
// DevCheck(new_instance->tac == f1ap_setup_req->tac, new_instance->tac, f1ap_setup_req->tac, 0);
// DevCheck(new_instance->mcc == f1ap_setup_req->mcc, new_instance->mcc, f1ap_setup_req->mcc, 0);
// DevCheck(new_instance->mnc == f1ap_setup_req->mnc, new_instance->mnc, f1ap_setup_req->mnc, 0);
// DevCheck(new_instance->mnc_digit_length == f1ap_setup_req->mnc_digit_length, new_instance->mnc_digit_length, f1ap_setup_req->mnc_digit_length, 0);
// DevCheck(new_instance->default_drx == f1ap_setup_req->default_drx, new_instance->default_drx, f1ap_setup_req->default_drx, 0);
// } else {
new_instance = calloc(1, sizeof(du_f1ap_instance_t));
DevAssert(new_instance != NULL);
/* Copy usefull parameters */
new_instance->instance = instance;
new_instance->gNB_DU_id = f1ap_setup_req->gNB_DU_id;
new_instance->gNB_DU_name = f1ap_setup_req->gNB_DU_name;
new_instance->tac = f1ap_setup_req->tac[0];
new_instance->mcc = f1ap_setup_req->mcc[0];
new_instance->mnc = f1ap_setup_req->mnc[0];
new_instance->mnc_digit_length = f1ap_setup_req->mnc_digit_length;
//}
du_f1ap_register(new_instance,
&f1ap_setup_req->CU_f1_ip_address, // remote
&f1ap_setup_req->DU_f1_ip_address, // local
f1ap_setup_req->sctp_in_streams,
f1ap_setup_req->sctp_out_streams);
} //f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
}
void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) { // save the assoc id
DU_send_F1_SETUP_REQUEST(instance, sctp_new_association_resp); 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);
} }
...@@ -254,8 +203,7 @@ void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_r ...@@ -254,8 +203,7 @@ void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_r
// SETUP REQUEST // SETUP REQUEST
//void DU_send_F1_SETUP_REQUEST(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) { void DU_send_F1_SETUP_REQUEST(instance_t instance) {
void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *f1ap_setup_req) {
module_id_t enb_mod_idP; module_id_t enb_mod_idP;
module_id_t du_mod_idP; module_id_t du_mod_idP;
...@@ -266,14 +214,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -266,14 +214,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int i = 0; int i = 0;
int j = 0;
// for test
f1ap_info_t f1ap_info;
f1ap_info.GNB_DU_ID = 789;
f1ap_info.GNB_DU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 3;
/* Create */ /* Create */
/* 0. pdu Type */ /* 0. pdu Type */
...@@ -300,18 +241,18 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -300,18 +241,18 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID; ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID; ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID;
asn_int642INTEGER(&ie->value.choice.GNB_DU_ID, f1ap_info.GNB_DU_ID); asn_int642INTEGER(&ie->value.choice.GNB_DU_ID, f1ap_du_data->gNB_DU_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */ /* optional */
/* c3. GNB_DU_Name */ /* c3. GNB_DU_Name */
if (f1ap_info.GNB_DU_Name != NULL) { if (f1ap_du_data->gNB_DU_name != NULL) {
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name; ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name;
ie->criticality = F1AP_Criticality_ignore; ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name; ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name;
OCTET_STRING_fromBuf(&ie->value.choice.GNB_DU_Name, f1ap_info.GNB_DU_Name, OCTET_STRING_fromBuf(&ie->value.choice.GNB_DU_Name, f1ap_du_data->gNB_DU_name,
strlen(f1ap_info.GNB_DU_Name)); strlen(f1ap_du_data->gNB_DU_name));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
} }
...@@ -322,8 +263,10 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -322,8 +263,10 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List; 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; for (i=0;
i<1; i<num_cells_available;
i++) { i++) {
/* mandatory */ /* mandatory */
/* 4.1 serverd cells item */ /* 4.1 serverd cells item */
...@@ -344,30 +287,25 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -344,30 +287,25 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &nRCGI.pLMN_Identity); 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);
//INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
nRCGI.nRCellIdentity.buf = malloc((36+7)/8);
nRCGI.nRCellIdentity.size = (36+7)/8;
nRCGI.nRCellIdentity.bits_unused = 4;
nRCGI.nRCellIdentity.buf[0] = 123;
//nRCGI.nRCellIdentity = 15;
served_cell_information.nRCGI = nRCGI; served_cell_information.nRCGI = nRCGI;
/* - nRPCI */ /* - nRPCI */
served_cell_information.nRPCI = 321; // int 0..1007 served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
"10", f1ap_du_data->tac[i],
3); sizeof(f1ap_du_data->tac[i]));
// OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
// "10",
// 3);
/* - Configured_EPS_TAC */ /* - Configured_EPS_TAC */
if(1){ if(0){
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t)); 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, OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
"2", "2",
...@@ -375,30 +313,33 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -375,30 +313,33 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
} }
/* - broadcast PLMNs */ /* - broadcast PLMNs */
int maxnoofBPLMNS = 1; // RK: add the num_available_broadcast_PLMNs to the message
for (i=0; int num_available_broadcast_PLMNs = 1; //f1ap_du_data->num_available_broadcast_PLMNs;
i<maxnoofBPLMNS; printf("num_available_broadcast_PLMNs = %d \n", num_available_broadcast_PLMNs);
i++) { for (j=0;
j<num_available_broadcast_PLMNs; // num_available_broadcast_PLMNs
j++) {
/* > PLMN BroadcastPLMNs Item */ /* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t)); 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)); //memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &broadcastPLMNs_Item->pLMN_Identity); //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); ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
} }
// // /* - CHOICE NR-MODE-Info */ // // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info; F1AP_NR_Mode_Info_t nR_Mode_Info;
//f1ap_du_data->fdd_flag = 1;
if ("FDD") { if (f1ap_du_data->fdd_flag) { // FDD
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD; nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */ /* > FDD >> FDD Info */
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t)); F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
/* >>> UL NRFreqInfo */ /* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L; fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_arfcn;
F1AP_FreqBandNrItem_t ul_freqBandNrItem; F1AP_FreqBandNrItem_t ul_freqBandNrItem;
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
ul_freqBandNrItem.freqBandIndicatorNr = 888L; ul_freqBandNrItem.freqBandIndicatorNr = 777L;
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem; F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
...@@ -408,25 +349,25 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -408,25 +349,25 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem); ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
/* >>> DL NRFreqInfo */ /* >>> DL NRFreqInfo */
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L; fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_arfcn;
F1AP_FreqBandNrItem_t dl_freqBandNrItem; F1AP_FreqBandNrItem_t dl_freqBandNrItem;
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
dl_freqBandNrItem.freqBandIndicatorNr = 555L; dl_freqBandNrItem.freqBandIndicatorNr = 777L;
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem; F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L; dl_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem); ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem); ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
/* >>> UL Transmission Bandwidth */ /* >>> UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; fDD_Info->uL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.ul_nrb;
/* >>> DL Transmission Bandwidth */ /* >>> DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; fDD_Info->dL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.dl_nrb;
nR_Mode_Info.choice.fDD = fDD_Info; nR_Mode_Info.choice.fDD = fDD_Info;
} else { // TDD } else { // TDD
...@@ -435,9 +376,10 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -435,9 +376,10 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
/* > TDD >> TDD Info */ /* > TDD >> TDD Info */
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t)); F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
/* >>> ARFCN */ /* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer tDD_Info->nRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].tdd.nr_arfcn; // Integer
F1AP_FreqBandNrItem_t nr_freqBandNrItem; F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
// RK: missing params
nr_freqBandNrItem.freqBandIndicatorNr = 555L; nr_freqBandNrItem.freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem; F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
...@@ -447,8 +389,8 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -447,8 +389,8 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem); ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15; tDD_Info->transmission_Bandwidth.nRSCS= f1ap_du_data->nr_mode_info[i].tdd.scs;
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11; tDD_Info->transmission_Bandwidth.nRNRB= f1ap_du_data->nr_mode_info[i].tdd.nrb;
nR_Mode_Info.choice.tDD = tDD_Info; nR_Mode_Info.choice.tDD = tDD_Info;
} }
...@@ -467,12 +409,20 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -467,12 +409,20 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
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)); 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 OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",//f1ap_setup_req->mib, f1ap_du_data->mib[i],//f1ap_du_data->mib,
sizeof("1")); f1ap_du_data->mib_length[i]);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018 OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
"1", f1ap_du_data->sib1[i],
sizeof("1")); f1ap_du_data->sib1_length[i]);
// OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
// "1",//f1ap_setup_req->mib,
// sizeof("1"));
// OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
// "1",
// sizeof("1"));
gnb_du_served_cells_item.gNB_DU_System_Information = gNB_DU_System_Information; // gnb_du_served_cells_item.gNB_DU_System_Information = gNB_DU_System_Information; //
/* ADD */ /* ADD */
...@@ -489,7 +439,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t * ...@@ -489,7 +439,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
} }
du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0); du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
} }
...@@ -510,27 +460,16 @@ void DU_handle_F1_SETUP_RESPONSE() { ...@@ -510,27 +460,16 @@ void DU_handle_F1_SETUP_RESPONSE() {
// SETUP FAILURE // SETUP FAILURE
void DU_handle_F1_SETUP_FAILURE(struct F1AP_F1AP_PDU_t *pdu_p) { void DU_handle_F1_SETUP_FAILURE(struct F1AP_F1AP_PDU_t *pdu_p) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
//F1AP_F1SetupFailureIEs_t *f1_setup_failure_p;
//f1_setup_failure_p = &pdu_p.choice.unsuccessfulOutcome.value.choice.F1SetupFailureIEs.protocolIEs;
} }
void DU_send_ERROR_INDICATION(struct F1AP_F1AP_PDU_t *pdu_p) { void DU_send_ERROR_INDICATION(struct F1AP_F1AP_PDU_t *pdu_p) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
//F1AP_F1ErrorIndicationIEs_t *f1_error_indication_p;
//f1_error_indication_p = &pdu_p.choice.successfulOutcome.value.choice.F1ErrorIndicationIEs.protocolIEs;
} }
void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_handle_RESET(F1AP_Reset_t *Reset) { void DU_handle_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -547,8 +486,6 @@ void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { ...@@ -547,8 +486,6 @@ void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
//void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
//void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER() {
void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER( void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_id_t module_idP, module_id_t module_idP,
int CC_idP, int CC_idP,
...@@ -565,14 +502,6 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER( ...@@ -565,14 +502,6 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
// for test
f1ap_info_t f1ap_info;
f1ap_info.GNB_DU_ID = 789;
f1ap_info.GNB_DU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 3;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -601,7 +530,7 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER( ...@@ -601,7 +530,7 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI; ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI;
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
ie->value.choice.NRCGI = nRCGI; ie->value.choice.NRCGI = nRCGI;
...@@ -732,7 +661,7 @@ void DU_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessage ...@@ -732,7 +661,7 @@ void DU_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessage
//void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { //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) { 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_F1AP_PDU_t pdu;
F1AP_GNBDUConfigurationUpdate_t *out; F1AP_GNBDUConfigurationUpdate_t *out;
F1AP_GNBDUConfigurationUpdateIEs_t *ie; F1AP_GNBDUConfigurationUpdateIEs_t *ie;
...@@ -740,14 +669,8 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -740,14 +669,8 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int i = 0; int i = 0;
int j = 0;
// for test
f1ap_info_t f1ap_info;
f1ap_info.GNB_DU_ID = 789;
f1ap_info.GNB_DU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 3;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -775,9 +698,9 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -775,9 +698,9 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List; ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List;
for (i=0; for (j=0;
i<1; j<1;
i++) { j++) {
// //
F1AP_Served_Cells_To_Add_ItemIEs_t *served_cells_to_add_item_ies; 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 = (F1AP_Served_Cells_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Add_ItemIEs_t));
...@@ -794,22 +717,12 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -794,22 +717,12 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &nRCGI.pLMN_Identity); 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);
//INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
nRCGI.nRCellIdentity.buf = malloc((36+7)/8);
nRCGI.nRCellIdentity.size = (36+7)/8;
nRCGI.nRCellIdentity.bits_unused = 4;
nRCGI.nRCellIdentity.buf[0] = 123;
//nRCGI.nRCellIdentity = 15;
served_cell_information.nRCGI = nRCGI; served_cell_information.nRCGI = nRCGI;
/* - nRPCI */ /* - nRPCI */
served_cell_information.nRPCI = 321; // int 0..1007 served_cell_information.nRPCI = 321L; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
...@@ -832,7 +745,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -832,7 +745,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* > PLMN BroadcastPLMNs Item */ /* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t)); 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)); //memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &broadcastPLMNs_Item->pLMN_Identity); 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); ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
} }
...@@ -957,7 +870,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -957,7 +870,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI; F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity);
served_cells_to_modify_item.oldNRCGI = oldNRCGI; served_cells_to_modify_item.oldNRCGI = oldNRCGI;
...@@ -969,14 +882,13 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -969,14 +882,13 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
served_cell_information.nRCGI = nRCGI; served_cell_information.nRCGI = nRCGI;
/* - nRPCI */ /* - nRPCI */
served_cell_information.nRPCI = 321; // int 0..1007 served_cell_information.nRPCI = 321L; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
...@@ -999,7 +911,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -999,7 +911,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* > PLMN BroadcastPLMNs Item */ /* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t)); 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)); //memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &broadcastPLMNs_Item->pLMN_Identity); 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); ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item);
} }
...@@ -1124,7 +1036,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -1124,7 +1036,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI; F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity);
served_cells_to_delete_item.oldNRCGI = oldNRCGI; served_cells_to_delete_item.oldNRCGI = oldNRCGI;
...@@ -1160,7 +1072,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -1160,7 +1072,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
active_cells_item.nRCGI = nRCGI; active_cells_item.nRCGI = nRCGI;
...@@ -1224,12 +1136,6 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) { ...@@ -1224,12 +1136,6 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
uint32_t len; uint32_t len;
int i = 0; int i = 0;
f1ap_info_t f1ap_info;
f1ap_info.GNB_DU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 8;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -1435,7 +1341,7 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) { ...@@ -1435,7 +1341,7 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; // issue here F1AP_NRCGI_t nRCGI; // issue here
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &nRCGI.pLMN_Identity); 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); // INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
// nRCGI.nRCellIdentity.buf = malloc((36+7)/8); // nRCGI.nRCellIdentity.buf = malloc((36+7)/8);
...@@ -1529,12 +1435,6 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) { ...@@ -1529,12 +1435,6 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
uint32_t len; uint32_t len;
int i = 0; int i = 0;
f1ap_info_t f1ap_info;
f1ap_info.GNB_DU_Name = "ABC";
f1ap_info.mcc = 208;
f1ap_info.mnc = 93;
f1ap_info.mnc_digit_length = 8;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -1797,7 +1697,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) { ...@@ -1797,7 +1697,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
/* - sCell_ID */ /* - sCell_ID */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
......
...@@ -19,45 +19,8 @@ ...@@ -19,45 +19,8 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include <stdint.h>
#include "queue.h"
#include "tree.h"
#include "sctp_eNB_defs.h"
#ifndef DU_F1AP_DEFS_H_ #ifndef DU_F1AP_DEFS_H_
#define DU_F1AP_DEFS_H_ #define DU_F1AP_DEFS_H_
struct du_f1ap_instance_s;
typedef struct du_f1ap_instance_s {
/* Next f1ap du association.
* Only used for virtual mode.
*/
/* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
instance_t instance;
// F1_Setup_Req payload
uint32_t gNB_DU_id;
char *gNB_DU_name;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t eNB_id;
/* Tracking area code */
uint16_t tac;
/* Mobile Country Code
* Mobile Network Code
*/
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
} du_f1ap_instance_t;
#endif /* DU_F1AP_DEFS_H_ */ #endif /* DU_F1AP_DEFS_H_ */
...@@ -19,45 +19,9 @@ ...@@ -19,45 +19,9 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include <stdint.h>
#include "queue.h"
#include "tree.h"
#include "sctp_eNB_defs.h"
#ifndef DU_F1AP_DEFS_H_ #ifndef DU_F1AP_DEFS_H_
#define DU_F1AP_DEFS_H_ #define DU_F1AP_DEFS_H_
struct du_f1ap_instance_s;
typedef struct du_f1ap_instance_s {
/* Next f1ap du association.
* Only used for virtual mode.
*/
/* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
instance_t instance;
// F1_Setup_Req payload
uint32_t gNB_DU_id;
char *gNB_DU_name;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t eNB_id;
/* Tracking area code */
uint16_t tac;
/* Mobile Country Code
* Mobile Network Code
*/
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
} du_f1ap_instance_t;
#endif /* DU_F1AP_DEFS_H_ */ #endif /* DU_F1AP_DEFS_H_ */
...@@ -86,7 +86,7 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) ...@@ -86,7 +86,7 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
DevAssert(buffer != NULL); DevAssert(buffer != NULL);
DevAssert(length != NULL); DevAssert(length != NULL);
//xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu); xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer); encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) { if (encoded < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment