Coarse grain cleanup: a lot of errors fixed
This commit is contained in:
@@ -102,12 +102,8 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb) {
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
NR_gNB_COMMON *common_vars = &gNB->common_vars;
|
||||
PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
double rx_gain = openair0_cfg[0].rx_gain[0];
|
||||
double rx_gain_offset = openair0_cfg[0].rx_gain_offset[0];
|
||||
uint32_t *rb_mask = gNB->rb_mask_ul;
|
||||
int rb, offset, offset0, nb_rb, len;
|
||||
uint32_t n0_subband_power_temp = 0;
|
||||
int32_t *ul_ch;
|
||||
int32_t n0_power_tot;
|
||||
int64_t n0_power_tot2;
|
||||
|
||||
@@ -71,6 +71,29 @@ typedef struct f1ap_cu_setup_req_s {
|
||||
//
|
||||
} f1ap_cu_setup_req_t;
|
||||
|
||||
typedef struct cellIDs_s {
|
||||
|
||||
// Served Cell Information
|
||||
/* Tracking area code */
|
||||
uint32_t tac;
|
||||
|
||||
/* Mobile Country Codes
|
||||
* Mobile Network Codes
|
||||
*/
|
||||
uint16_t mcc;
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
|
||||
// NR Global Cell Id
|
||||
uint64_t nr_cellid;
|
||||
// NR Physical Cell Ids
|
||||
uint16_t nr_pci;
|
||||
// Number of slide support items (max 16, could be increased to as much as 1024)
|
||||
uint16_t num_ssi;
|
||||
uint8_t sst;
|
||||
uint8_t sd;
|
||||
} cellIDs_t;
|
||||
|
||||
typedef struct f1ap_setup_req_s {
|
||||
|
||||
// Midhaul networking parameters
|
||||
@@ -100,26 +123,7 @@ typedef struct f1ap_setup_req_s {
|
||||
|
||||
/// number of DU cells available
|
||||
uint16_t num_cells_available; //0< num_cells_available <= 512;
|
||||
|
||||
// Served Cell Information
|
||||
/* Tracking area code */
|
||||
uint32_t tac[F1AP_MAX_NB_CELLS];
|
||||
|
||||
/* Mobile Country Codes
|
||||
* Mobile Network Codes
|
||||
*/
|
||||
uint16_t mcc[F1AP_MAX_NB_CELLS];//[6];
|
||||
uint16_t mnc[F1AP_MAX_NB_CELLS];//[6];
|
||||
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];//[6];
|
||||
|
||||
// NR Global Cell Id
|
||||
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
|
||||
// NR Physical Cell Ids
|
||||
uint16_t nr_pci[F1AP_MAX_NB_CELLS];
|
||||
// Number of slide support items (max 16, could be increased to as much as 1024)
|
||||
uint16_t num_ssi[F1AP_MAX_NB_CELLS];//[6];
|
||||
uint8_t sst[F1AP_MAX_NB_CELLS];//[16][6];
|
||||
uint8_t sd[F1AP_MAX_NB_CELLS];//[16][6];
|
||||
cellIDs_t cell[F1AP_MAX_NB_CELLS];
|
||||
// fdd_flag = 1 means FDD, 0 means TDD
|
||||
int fdd_flag;
|
||||
|
||||
|
||||
@@ -1930,20 +1930,20 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
LOG_I(ENB_APP,"F1AP: gNB_DU_id[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_id);
|
||||
F1AP_SETUP_REQ (msg_p).gNB_DU_name = strdup(*(ENBParamList.paramarray[0][ENB_ENB_NAME_IDX].strptr));
|
||||
LOG_I(ENB_APP,"F1AP: gNB_DU_name[%d] %s\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_name);
|
||||
F1AP_SETUP_REQ (msg_p).tac[k] = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
LOG_I(ENB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).tac[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mcc[k] = *PLMNParamList.paramarray[0][ENB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
LOG_I(ENB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mcc[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mnc[k] = *PLMNParamList.paramarray[0][ENB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
LOG_I(ENB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] = *PLMNParamList.paramarray[0][ENB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
LOG_I(ENB_APP,"F1AP: mnc_digit_length[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
|
||||
AssertFatal((F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 2) ||
|
||||
(F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 3),
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
LOG_I(ENB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].tac);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mcc = *PLMNParamList.paramarray[0][ENB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
LOG_I(ENB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mcc);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mnc = *PLMNParamList.paramarray[0][ENB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
LOG_I(ENB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length = *PLMNParamList.paramarray[0][ENB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
LOG_I(ENB_APP,"F1AP: mnc_digit_length[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
|
||||
AssertFatal((F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 2) ||
|
||||
(F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 3),
|
||||
"BAD MNC DIGIT LENGTH %d",
|
||||
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
|
||||
F1AP_SETUP_REQ (msg_p).nr_cellid[k] = (uint64_t)*(ENBParamList.paramarray[i][ENB_NRCELLID_IDX].u64ptr);
|
||||
LOG_I(ENB_APP,"F1AP: nr_cellid[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).nr_cellid[k]);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid = (uint64_t)*(ENBParamList.paramarray[i][ENB_NRCELLID_IDX].u64ptr);
|
||||
LOG_I(ENB_APP,"F1AP: nr_cellid[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid);
|
||||
LOG_I(ENB_APP,"F1AP: CU_ip4_address in DU %s\n",RC.mac[k]->eth_params_n.remote_addr);
|
||||
LOG_I(ENB_APP,"FIAP: CU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv4_address,(int)strlen(RC.mac[k]->eth_params_n.remote_addr));
|
||||
F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv6 = 0;
|
||||
@@ -1974,12 +1974,12 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
pthread_mutex_unlock(&rrc->cell_info_mutex);
|
||||
} while (cell_info_configured ==0);
|
||||
|
||||
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).mcc[k];
|
||||
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).mnc[k];
|
||||
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).tac[k];
|
||||
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).nr_cellid[k];
|
||||
F1AP_SETUP_REQ (msg_p).nr_pci[k] = rrc->carrier[0].physCellId;
|
||||
F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0;
|
||||
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mcc;
|
||||
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mnc;
|
||||
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).cell[k].tac;
|
||||
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid;
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].nr_pci = rrc->carrier[0].physCellId;
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].num_ssi = 0;
|
||||
|
||||
if (rrc->carrier[0].sib1->tdd_Config) {
|
||||
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
|
||||
|
||||
+25
-10
@@ -36,15 +36,15 @@
|
||||
int asn_debug = 0;
|
||||
int asn1_xer_print = 0;
|
||||
|
||||
inline void ASN_DEBUG(const char *fmt, ...)
|
||||
{
|
||||
inline void ASN_DEBUG(const char *fmt, ...) {
|
||||
if (asn_debug) {
|
||||
int adi = asn_debug_indent;
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
fprintf(stderr, "[ASN1]");
|
||||
|
||||
while(adi--) fprintf(stderr, " ");
|
||||
while(adi--)
|
||||
fprintf(stderr, " ");
|
||||
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\n");
|
||||
@@ -53,11 +53,10 @@ inline void ASN_DEBUG(const char *fmt, ...)
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP)
|
||||
{
|
||||
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP) {
|
||||
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
|
||||
transaction_identifier[enb_mod_idP+cu_mod_idP] =
|
||||
(transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
|
||||
(transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
|
||||
//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];
|
||||
}
|
||||
@@ -75,6 +74,7 @@ int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
|
||||
if (f1_inst->f1ap_ue[i].rnti == 0 ) {
|
||||
f1_inst->f1ap_ue[i].rnti = rntiP;
|
||||
@@ -87,6 +87,7 @@ int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -99,27 +100,30 @@ int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
f1_inst->num_ues--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int f1ap_get_du_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
|
||||
rnti_t rntiP) {
|
||||
rnti_t rntiP) {
|
||||
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
|
||||
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
|
||||
return f1_inst->f1ap_ue[i].du_ue_f1ap_id;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int f1ap_get_cu_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
|
||||
rnti_t rntiP) {
|
||||
rnti_t rntiP) {
|
||||
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
|
||||
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
|
||||
return f1_inst->f1ap_ue[i].cu_ue_f1ap_id;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -130,6 +134,7 @@ int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
|
||||
return f1_inst->f1ap_ue[i].rnti;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -140,6 +145,7 @@ int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
|
||||
return f1_inst->f1ap_ue[i].rnti;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -150,6 +156,7 @@ int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -160,6 +167,7 @@ int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -170,6 +178,7 @@ int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -177,7 +186,10 @@ int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
|
||||
module_id_t du_ue_f1ap_id,
|
||||
module_id_t cu_ue_f1ap_id) {
|
||||
module_id_t f1ap_uid = f1ap_get_du_uid(f1_inst,du_ue_f1ap_id);
|
||||
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1;
|
||||
|
||||
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB)
|
||||
return -1;
|
||||
|
||||
f1_inst->f1ap_ue[f1ap_uid].cu_ue_f1ap_id = cu_ue_f1ap_id;
|
||||
LOG_I(F1AP, "Adding cu_ue_f1ap_id %d for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
|
||||
return 0;
|
||||
@@ -187,7 +199,10 @@ int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
|
||||
module_id_t cu_ue_f1ap_id,
|
||||
module_id_t du_ue_f1ap_id) {
|
||||
module_id_t f1ap_uid = f1ap_get_cu_uid(f1_inst,cu_ue_f1ap_id);
|
||||
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1;
|
||||
|
||||
if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB)
|
||||
return -1;
|
||||
|
||||
f1_inst->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
|
||||
LOG_I(F1AP, "Adding du_ue_f1ap_id %d for UE with RNTI %x\n", du_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
|
||||
return 0;
|
||||
|
||||
+31
-18
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H_
|
||||
# include "config.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef F1AP_COMMON_H_
|
||||
@@ -43,7 +43,7 @@
|
||||
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
|
||||
|
||||
#if defined(EMIT_ASN_DEBUG_EXTERN)
|
||||
inline void ASN_DEBUG(const char *fmt, ...);
|
||||
inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#include "F1AP_RAT-FrequencyPriorityInformation.h"
|
||||
@@ -360,14 +360,14 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
|
||||
/* Checking version of ASN1C compiler */
|
||||
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
|
||||
# error "You are compiling f1ap with the wrong version of ASN1C"
|
||||
# error "You are compiling f1ap with the wrong version of ASN1C"
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE (0)
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
# define TRUE (!FALSE)
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
|
||||
#define F1AP_UE_ID_FMT "0x%06"PRIX32
|
||||
@@ -375,20 +375,20 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
#include "assertions.h"
|
||||
|
||||
#if defined(ENB_MODE)
|
||||
# include "common/utils/LOG/log.h"
|
||||
# include "f1ap_default_values.h"
|
||||
# define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
|
||||
# define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
|
||||
# define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args)
|
||||
# define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args)
|
||||
# define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "f1ap_default_values.h"
|
||||
#define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
|
||||
#define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
|
||||
#define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args)
|
||||
#define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args)
|
||||
#define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
|
||||
#else
|
||||
//# include "mme_default_values.h"
|
||||
# define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0)
|
||||
# define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0)
|
||||
# define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0)
|
||||
# define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0)
|
||||
# define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
|
||||
//# include "mme_default_values.h"
|
||||
#define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0)
|
||||
#define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0)
|
||||
#define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0)
|
||||
#define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0)
|
||||
#define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
|
||||
#endif
|
||||
|
||||
//Forward declaration
|
||||
@@ -476,4 +476,17 @@ int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
|
||||
module_id_t cu_ue_f1ap_id,
|
||||
module_id_t du_ue_f1ap_id);
|
||||
|
||||
#define asn1cCalloc(VaR, TyPe, lOcPtr) TyPe *lOcPtr=VaR=(TyPe*) calloc(1,sizeof(TyPe));
|
||||
#define asn1cCallocOne(VaR, TyPe, VaLue) VaR=(TyPe*) calloc(1,sizeof(TyPe)); *VaR=VaLue;
|
||||
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) TyPe *lOcPtr=(TyPe*) calloc(1,sizeof(TyPe)); ASN_SEQUENCE_ADD(&VaR,lOcPtr);
|
||||
|
||||
//lts: C struct type is not homogeneous, so we need macros instead of functions
|
||||
#define addnRCGI(nRCGi, servedCelL) \
|
||||
MCC_MNC_TO_PLMNID((servedCelL)->mcc,(servedCelL)-> mnc,(servedCelL)->mnc_digit_length, \
|
||||
&((nRCGi).pLMN_Identity)); \
|
||||
NR_CELL_ID_TO_BIT_STRING((servedCelL)->nr_cellid, &((nRCGi).nRCellIdentity));
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data_from_du;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#endif /* F1AP_COMMON_H_ */
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
#include "f1ap_itti_messaging.h"
|
||||
#include "f1ap_cu_interface_management.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data_from_du;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#define asn1cCalloc(VaR, TyPe, lOcPtr) TyPe *lOcPtr=VaR=(TyPe*) calloc(1,sizeof(TyPe));
|
||||
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) TyPe *lOcPtr=(TyPe*) calloc(1,sizeof(TyPe)); ASN_SEQUENCE_ADD(&VaR,lOcPtr);
|
||||
|
||||
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) {
|
||||
AssertFatal(1==0,"Not implemented yet\n");
|
||||
}
|
||||
@@ -103,29 +97,30 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
|
||||
/* assoc_id */
|
||||
F1AP_SETUP_REQ(message_p).assoc_id = assoc_id;
|
||||
f1ap_setup_req_t *req=&F1AP_SETUP_REQ(message_p);
|
||||
req->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);
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id);
|
||||
asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &req->gNB_DU_id);
|
||||
LOG_D(F1AP, "req->gNB_DU_id %lu \n", req->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,
|
||||
req->gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char));
|
||||
memcpy(req->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';
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name);
|
||||
req->gNB_DU_name[ie->value.choice.GNB_DU_Name.size] = '\0';
|
||||
LOG_D(F1AP, "req->gNB_DU_name %s \n", req->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;
|
||||
LOG_D(F1AP, "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;
|
||||
req->num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
|
||||
LOG_D(F1AP, "req->num_cells_available %d \n",
|
||||
req->num_cells_available);
|
||||
int num_cells_available = req->num_cells_available;
|
||||
|
||||
for (i=0; i<num_cells_available; i++) {
|
||||
F1AP_GNB_DU_Served_Cells_Item_t *served_cells_item_p;
|
||||
@@ -133,22 +128,17 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
|
||||
|
||||
/* tac */
|
||||
if (served_cells_item_p->served_Cell_Information.fiveGS_TAC) {
|
||||
OCTET_STRING_TO_INT16(served_cells_item_p->served_Cell_Information.fiveGS_TAC, F1AP_SETUP_REQ(message_p).tac[i]);
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n",
|
||||
i, F1AP_SETUP_REQ(message_p).tac[i]);
|
||||
OCTET_STRING_TO_INT16(served_cells_item_p->served_Cell_Information.fiveGS_TAC, req->cell[i].tac);
|
||||
LOG_D(F1AP, "req->tac[%d] %d \n", i, req->cell[i].tac);
|
||||
}
|
||||
|
||||
/* - nRCGI */
|
||||
TBCD_TO_MCC_MNC(&(served_cells_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]);
|
||||
// NR cellID
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity,
|
||||
F1AP_SETUP_REQ(message_p).nr_cellid[i]);
|
||||
addnRCGI(served_cells_item_p->served_Cell_Information.nRCGI, req->cell+i);
|
||||
|
||||
LOG_D(F1AP, "[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n", assoc_id,
|
||||
F1AP_SETUP_REQ(message_p).mcc[i],
|
||||
F1AP_SETUP_REQ(message_p).mnc[i],
|
||||
(long long unsigned int)F1AP_SETUP_REQ(message_p).nr_cellid[i]);
|
||||
req->cell[i].mcc,
|
||||
req->cell[i].mnc,
|
||||
(long long unsigned int)req->cell[i].nr_cellid);
|
||||
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0],
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1],
|
||||
@@ -156,28 +146,28 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[3],
|
||||
served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]);
|
||||
/* - nRPCI */
|
||||
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_cells_item_p->served_Cell_Information.nRPCI;
|
||||
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n",
|
||||
i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
|
||||
req->cell[i].nr_pci = served_cells_item_p->served_Cell_Information.nRPCI;
|
||||
LOG_D(F1AP, "req->nr_pci[%d] %d \n",
|
||||
i, req->cell[i].nr_pci);
|
||||
// System Information
|
||||
/* mib */
|
||||
F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_cells_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
|
||||
memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_cells_item_p->gNB_DU_System_Information->mIB_message.buf,
|
||||
req->mib[i] = calloc(served_cells_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
|
||||
memcpy(req->mib[i], served_cells_item_p->gNB_DU_System_Information->mIB_message.buf,
|
||||
served_cells_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_cells_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
|
||||
F1AP_SETUP_REQ(message_p).mib_length[i] = served_cells_item_p->gNB_DU_System_Information->mIB_message.size;
|
||||
LOG_D(F1AP, "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]);
|
||||
req->mib[i][served_cells_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
|
||||
req->mib_length[i] = served_cells_item_p->gNB_DU_System_Information->mIB_message.size;
|
||||
LOG_D(F1AP, "req->mib[%d] %s , len = %d \n",
|
||||
i, req->mib[i], req->mib_length[i]);
|
||||
/* sib1 */
|
||||
F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_cells_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
|
||||
memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_cells_item_p->gNB_DU_System_Information->sIB1_message.buf,
|
||||
req->sib1[i] = calloc(served_cells_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
|
||||
memcpy(req->sib1[i], served_cells_item_p->gNB_DU_System_Information->sIB1_message.buf,
|
||||
served_cells_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_cells_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
|
||||
F1AP_SETUP_REQ(message_p).sib1_length[i] = served_cells_item_p->gNB_DU_System_Information->sIB1_message.size;
|
||||
LOG_D(F1AP, "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]);
|
||||
req->sib1[i][served_cells_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
|
||||
req->sib1_length[i] = served_cells_item_p->gNB_DU_System_Information->sIB1_message.size;
|
||||
LOG_D(F1AP, "req->sib1[%d] %s , len = %d \n",
|
||||
i, req->sib1[i], req->sib1_length[i]);
|
||||
}
|
||||
|
||||
*f1ap_du_data_from_du = F1AP_SETUP_REQ(message_p);
|
||||
@@ -252,40 +242,34 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
|
||||
// This should be fixed
|
||||
enb_mod_idP = (module_id_t)0;
|
||||
cu_mod_idP = (module_id_t)0;
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_F1SetupResponse_t *out;
|
||||
F1AP_F1SetupResponseIEs_t *ie;
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int i = 0;
|
||||
F1AP_F1AP_PDU_t pdu= {0};
|
||||
uint8_t *buffer=NULL;
|
||||
uint32_t len=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;
|
||||
asn1cCalloc(pdu.choice.successfulOutcome, F1AP_SuccessfulOutcome_t, tmp);
|
||||
tmp->procedureCode = F1AP_ProcedureCode_id_F1Setup;
|
||||
tmp->criticality = F1AP_Criticality_reject;
|
||||
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
|
||||
F1AP_F1SetupResponse_t *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);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie1);
|
||||
ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie1->criticality = F1AP_Criticality_reject;
|
||||
ie1->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID;
|
||||
ie1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
|
||||
|
||||
/* 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,
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie2);
|
||||
ie2->id = F1AP_ProtocolIE_ID_id_gNB_CU_Name;
|
||||
ie2->criticality = F1AP_Criticality_ignore;
|
||||
ie2->value.present = F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name;
|
||||
OCTET_STRING_fromBuf(&ie2->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 */
|
||||
@@ -294,84 +278,59 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
|
||||
LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
|
||||
|
||||
if (num_cells_to_activate >0) {
|
||||
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;
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie3);
|
||||
ie3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
|
||||
ie3->criticality = F1AP_Criticality_reject;
|
||||
ie3->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
|
||||
|
||||
for (i=0;
|
||||
for (int i=0;
|
||||
i<num_cells_to_activate;
|
||||
i++) {
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
|
||||
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;
|
||||
asn1cSequenceAdd(ie3->value.choice.Cells_to_be_Activated_List.list,
|
||||
F1AP_Cells_to_be_Activated_List_ItemIEs_t, cells_to_be_activated_ies);
|
||||
cells_to_be_activated_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_activated_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_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));
|
||||
F1AP_Cells_to_be_Activated_List_Item_t *cells_to_be_activated_item=
|
||||
&cells_to_be_activated_ies->value.choice.Cells_to_be_Activated_List_Item;
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_resp->cells_to_activate[i].mcc, f1ap_setup_resp->cells_to_activate[i].mnc, f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
|
||||
cells_to_be_activated_list_item.nRCGI = nRCGI;
|
||||
addnRCGI(cells_to_be_activated_item->nRCGI, f1ap_setup_resp->cells_to_activate+i);
|
||||
|
||||
/* 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 = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
|
||||
cells_to_be_activated_item->nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
|
||||
*cells_to_be_activated_item->nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // 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));
|
||||
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
|
||||
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
|
||||
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
|
||||
//printf("\n");
|
||||
F1AP_ProtocolExtensionContainer_154P112_t *p_154P112=calloc(1, sizeof(* p_154P112));
|
||||
cells_to_be_activated_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p_154P112;
|
||||
asn1cSequenceAdd(p_154P112->list, F1AP_Cells_to_be_Activated_List_ItemExtIEs_t, cells_to_be_activated_itemExtIEs);
|
||||
cells_to_be_activated_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
|
||||
cells_to_be_activated_itemExtIEs->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
|
||||
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation =
|
||||
&cells_to_be_activated_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
|
||||
|
||||
// for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
|
||||
for (int sIBtype=2; sIBtype<21; sIBtype++) {
|
||||
if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
|
||||
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
|
||||
F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
|
||||
memset((void *)sib_item,0,sizeof(*sib_item));
|
||||
asn1cSequenceAdd(gNB_CUSystemInformation->sibtypetobeupdatedlist.list, F1AP_SibtypetobeupdatedListItem_t, sib_item);
|
||||
sib_item->sIBtype = sIBtype;
|
||||
OCTET_STRING_fromBuf(&sib_item->sIBmessage,
|
||||
(const char *)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
|
||||
f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
|
||||
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
|
||||
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
|
||||
}
|
||||
}
|
||||
|
||||
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
|
||||
F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
|
||||
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
|
||||
ASN_SEQUENCE_ADD(&p_154P112_t.list,
|
||||
cells_to_be_activated_list_itemExtIEs);
|
||||
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)&p_154P112_t;
|
||||
free(gNB_CUSystemInformation);
|
||||
gNB_CUSystemInformation = NULL;
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
@@ -380,76 +339,68 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
|
||||
return -1;
|
||||
}
|
||||
|
||||
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CU_send_F1_SETUP_FAILURE(instance_t instance) {
|
||||
LOG_D(F1AP, "CU_send_F1_SETUP_FAILURE\n");
|
||||
module_id_t enb_mod_idP;
|
||||
module_id_t cu_mod_idP;
|
||||
module_id_t enb_mod_idP=0;
|
||||
module_id_t cu_mod_idP=0;
|
||||
// This should be fixed
|
||||
enb_mod_idP = (module_id_t)0;
|
||||
cu_mod_idP = (module_id_t)0;
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_F1SetupFailure_t *out;
|
||||
F1AP_F1SetupFailureIEs_t *ie;
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
F1AP_F1AP_PDU_t pdu= {0};
|
||||
uint8_t *buffer=NULL;
|
||||
uint32_t len=0;
|
||||
/* Create */
|
||||
/* 0. Message Type */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
asn1cCalloc(pdu.choice.unsuccessfulOutcome, F1AP_UnsuccessfulOutcome_t, UnsuccessfulOutcome);
|
||||
pdu.present = F1AP_F1AP_PDU_PR_unsuccessfulOutcome;
|
||||
pdu.choice.unsuccessfulOutcome = (F1AP_UnsuccessfulOutcome_t *)calloc(1, sizeof(F1AP_UnsuccessfulOutcome_t));
|
||||
pdu.choice.unsuccessfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
|
||||
pdu.choice.unsuccessfulOutcome->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.unsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure;
|
||||
out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
|
||||
UnsuccessfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
|
||||
UnsuccessfulOutcome->criticality = F1AP_Criticality_reject;
|
||||
UnsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure;
|
||||
F1AP_F1SetupFailure_t *out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
|
||||
/* mandatory */
|
||||
/* c1. Transaction ID (integer value)*/
|
||||
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_F1SetupFailureIEs__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);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie1);
|
||||
ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie1->criticality = F1AP_Criticality_reject;
|
||||
ie1->value.present = F1AP_F1SetupFailureIEs__value_PR_TransactionID;
|
||||
ie1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
|
||||
/* mandatory */
|
||||
/* c2. Cause */
|
||||
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_Cause;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_Cause;
|
||||
ie->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
|
||||
ie->value.choice.Cause.choice.radioNetwork = F1AP_CauseRadioNetwork_unspecified;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie2);
|
||||
ie2->id = F1AP_ProtocolIE_ID_id_Cause;
|
||||
ie2->criticality = F1AP_Criticality_ignore;
|
||||
ie2->value.present = F1AP_F1SetupFailureIEs__value_PR_Cause;
|
||||
ie2->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
|
||||
ie2->value.choice.Cause.choice.radioNetwork = F1AP_CauseRadioNetwork_unspecified;
|
||||
|
||||
/* optional */
|
||||
/* c3. TimeToWait */
|
||||
if (0) {
|
||||
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TimeToWait;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TimeToWait;
|
||||
ie->value.choice.TimeToWait = F1AP_TimeToWait_v10s;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie3);
|
||||
ie3->id = F1AP_ProtocolIE_ID_id_TimeToWait;
|
||||
ie3->criticality = F1AP_Criticality_ignore;
|
||||
ie3->value.present = F1AP_F1SetupFailureIEs__value_PR_TimeToWait;
|
||||
ie3->value.choice.TimeToWait = F1AP_TimeToWait_v10s;
|
||||
}
|
||||
|
||||
/* optional */
|
||||
/* c4. CriticalityDiagnostics*/
|
||||
if (0) {
|
||||
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_F1SetupFailureIEs__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);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie4);
|
||||
ie4->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
|
||||
ie4->criticality = F1AP_Criticality_ignore;
|
||||
ie4->value.present = F1AP_F1SetupFailureIEs__value_PR_CriticalityDiagnostics;
|
||||
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.procedureCode,
|
||||
F1AP_ProcedureCode_t, F1AP_ProcedureCode_id_UEContextSetup);
|
||||
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.triggeringMessage,
|
||||
F1AP_TriggeringMessage_t, F1AP_TriggeringMessage_initiating_message);
|
||||
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.procedureCriticality,
|
||||
F1AP_Criticality_t, F1AP_Criticality_reject);
|
||||
asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.transactionID,
|
||||
F1AP_TransactionID_t, 0);
|
||||
}
|
||||
|
||||
/* encode */
|
||||
@@ -458,6 +409,7 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -522,20 +474,15 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
|
||||
|
||||
for (int i=0; i<f1ap_gnb_cu_configuration_update->num_cells_to_activate; i++) {
|
||||
asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Activated_List.list,F1AP_Cells_to_be_Activated_List_ItemIEs_t,
|
||||
cells_to_be_activated_list_item_ies);
|
||||
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;
|
||||
cells_to_be_activated_ies);
|
||||
cells_to_be_activated_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
|
||||
cells_to_be_activated_ies->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_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=&cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
|
||||
F1AP_Cells_to_be_Activated_List_Item_t *cells_to_be_activated_list_item=
|
||||
&cells_to_be_activated_ies->value.choice.Cells_to_be_Activated_List_Item;
|
||||
// - nRCGI
|
||||
F1AP_NRCGI_t *nRCGI=&cells_to_be_activated_list_item->nRCGI;
|
||||
MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
|
||||
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
|
||||
&nRCGI->pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
|
||||
&nRCGI->nRCellIdentity);
|
||||
addnRCGI(cells_to_be_activated_list_item->nRCGI, f1ap_gnb_cu_configuration_update->cells_to_activate+i);
|
||||
// optional
|
||||
// -nRPCI
|
||||
asn1cCalloc(cells_to_be_activated_list_item->nRPCI, F1AP_NRPCI_t, tmp);
|
||||
@@ -545,13 +492,14 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
|
||||
F1AP_ProtocolExtensionContainer_154P112_t *p_154P112=(F1AP_ProtocolExtensionContainer_154P112_t *) calloc(1,sizeof(*p_154P112));
|
||||
cells_to_be_activated_list_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p_154P112;
|
||||
//F1AP_ProtocolExtensionContainer_154P112_t
|
||||
asn1cSequenceAdd(p_154P112->list,F1AP_Cells_to_be_Activated_List_ItemExtIEs_t, cells_to_be_activated_list_itemExtIEs);
|
||||
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;
|
||||
asn1cSequenceAdd(p_154P112->list,F1AP_Cells_to_be_Activated_List_ItemExtIEs_t, cells_to_be_activated_itemExtIEs);
|
||||
cells_to_be_activated_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
|
||||
cells_to_be_activated_itemExtIEs->criticality = F1AP_Criticality_reject;
|
||||
cells_to_be_activated_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
|
||||
|
||||
if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
|
||||
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = &cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
|
||||
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation =
|
||||
&cells_to_be_activated_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
|
||||
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
|
||||
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
|
||||
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
|
||||
@@ -861,14 +809,8 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
printf("F1AP gNB-CU CONFIGURATION UPDATE : ");
|
||||
|
||||
for (int i=0; i<len; i++)
|
||||
printf("%02x ",buffer[i]);
|
||||
|
||||
LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-CU CONFIGURATION UPDATE : ");
|
||||
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
printf("\n");
|
||||
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -72,39 +72,39 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance);
|
||||
* gNB-DU Configuration Update
|
||||
*/
|
||||
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
|
||||
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
|
||||
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
|
||||
|
||||
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
|
||||
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
|
||||
|
||||
/*
|
||||
* gNB-CU Configuration Update
|
||||
*/
|
||||
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update);
|
||||
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/*
|
||||
* gNB-DU Resource Coordination
|
||||
*/
|
||||
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
|
||||
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
|
||||
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
|
||||
|
||||
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
|
||||
|
||||
@@ -53,61 +53,52 @@ extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
LOG_D(F1AP, "CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER\n");
|
||||
// decode the F1 message
|
||||
// get the rrc message from the contauiner
|
||||
// get the rrc message from the contauiner
|
||||
// call func rrc_eNB_decode_ccch: <-- needs some update here
|
||||
MessageDef *message_p;
|
||||
F1AP_InitialULRRCMessageTransfer_t *container;
|
||||
F1AP_InitialULRRCMessageTransferIEs_t *ie;
|
||||
|
||||
rnti_t rnti;
|
||||
sdu_size_t ccch_sdu_len;
|
||||
int CC_id =0;
|
||||
|
||||
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
|
||||
if (stream != 0) {
|
||||
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
|
||||
assoc_id, stream);
|
||||
return -1;
|
||||
}
|
||||
// TODO: use context
|
||||
|
||||
// TODO: use context
|
||||
f1ap_stream = stream;
|
||||
f1ap_assoc_id = assoc_id;
|
||||
|
||||
container = &pdu->choice.initiatingMessage->value.choice.InitialULRRCMessageTransfer;
|
||||
|
||||
/* GNB_DU_UE_F1AP_ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
|
||||
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
LOG_D(F1AP, "du_ue_f1ap_id %lu \n", du_ue_f1ap_id);
|
||||
|
||||
/* NRCGI
|
||||
/* NRCGI
|
||||
* TODO: process NRCGI
|
||||
*/
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_NRCGI, true);
|
||||
|
||||
|
||||
uint64_t nr_cellid;
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&ie->value.choice.NRCGI.nRCellIdentity,nr_cellid);
|
||||
|
||||
/* RNTI */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_C_RNTI, true);
|
||||
rnti = ie->value.choice.C_RNTI;
|
||||
|
||||
/* RRC Container */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_RRCContainer, true);
|
||||
AssertFatal(ie!=NULL,"RRCContainer is missing\n");
|
||||
|
||||
// create an ITTI message and copy SDU
|
||||
if (RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
message_p = itti_alloc_new_message (TASK_CU_F1, 0, NR_RRC_MAC_CCCH_DATA_IND);
|
||||
@@ -125,69 +116,75 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
|
||||
LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__,
|
||||
ie->value.choice.RRCContainer.size);
|
||||
|
||||
for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
|
||||
printf("\n");
|
||||
|
||||
printf("\n");
|
||||
/* DUtoCURRCContainer */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, true);
|
||||
|
||||
if (ie) {
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(ie->value.choice.DUtoCURRCContainer.size);
|
||||
memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
|
||||
ie->value.choice.DUtoCURRCContainer.buf,
|
||||
ie->value.choice.DUtoCURRCContainer.size);
|
||||
|
||||
ie->value.choice.DUtoCURRCContainer.buf,
|
||||
ie->value.choice.DUtoCURRCContainer.size);
|
||||
}
|
||||
|
||||
// Find instance from nr_cellid
|
||||
int rrc_inst = -1;
|
||||
|
||||
if (RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
for (int i=0;i<RC.nb_nr_inst;i++) {
|
||||
for (int i=0; i<RC.nb_nr_inst; i++) {
|
||||
// first get RRC instance (note, no the ITTI instance)
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[i];
|
||||
|
||||
if (rrc->nr_cellid == nr_cellid) {
|
||||
rrc_inst = i;
|
||||
rrc_inst = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i=0;i<RC.nb_inst;i++) {
|
||||
// first get RRC instance (note, no the ITTI instance)
|
||||
for (int i=0; i<RC.nb_inst; i++) {
|
||||
// first get RRC instance (note, no the ITTI instance)
|
||||
eNB_RRC_INST *rrc = RC.rrc[i];
|
||||
|
||||
if (rrc->nr_cellid == nr_cellid) {
|
||||
rrc_inst = i;
|
||||
rrc_inst = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AssertFatal(rrc_inst>=0,"couldn't find an RRC instance for nr_cell %llu\n",(unsigned long long int)nr_cellid);
|
||||
|
||||
int f1ap_uid = f1ap_add_ue(&f1ap_cu_inst[rrc_inst], rrc_inst, CC_id, 0, rnti);
|
||||
|
||||
if (f1ap_uid < 0 ) {
|
||||
LOG_E(F1AP, "Failed to add UE \n");
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
|
||||
return -1;
|
||||
}
|
||||
|
||||
f1ap_cu_inst[rrc_inst].f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
|
||||
|
||||
if (RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).gnb_index = rrc_inst; // CU instance
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).gnb_index = rrc_inst; // CU instance
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
|
||||
NR_RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
|
||||
itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p);
|
||||
} else {
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
|
||||
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
|
||||
}
|
||||
|
||||
@@ -201,116 +198,94 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
|
||||
//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
|
||||
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
f1ap_dl_rrc_message_t *f1ap_dl_rrc)
|
||||
{
|
||||
|
||||
f1ap_dl_rrc_message_t *f1ap_dl_rrc) {
|
||||
LOG_D(F1AP, "CU send DL_RRC_MESSAGE_TRANSFER \n");
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_F1AP_PDU_t pdu= {0};
|
||||
F1AP_DLRRCMessageTransfer_t *out;
|
||||
F1AP_DLRRCMessageTransferIEs_t *ie;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
|
||||
uint8_t *buffer=NULL;
|
||||
uint32_t len=0;
|
||||
/* Create */
|
||||
/* 0. Message Type */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
/* 0. Message Type */
|
||||
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;
|
||||
|
||||
asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, tmp);
|
||||
tmp->procedureCode = F1AP_ProcedureCode_id_DLRRCMessageTransfer;
|
||||
tmp->criticality = F1AP_Criticality_ignore;
|
||||
tmp->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer;
|
||||
out = &tmp->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 = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie1);
|
||||
ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
|
||||
ie1->criticality = F1AP_Criticality_reject;
|
||||
ie1->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
|
||||
ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
|
||||
LOG_I(F1AP, "Setting GNB_CU_UE_F1AP_ID %llu associated with UE RNTI %x (instance %ld)\n",
|
||||
(unsigned long long int)ie->value.choice.GNB_CU_UE_F1AP_ID, f1ap_dl_rrc->rnti, instance);
|
||||
|
||||
|
||||
(unsigned long long int)ie1->value.choice.GNB_CU_UE_F1AP_ID, f1ap_dl_rrc->rnti, instance);
|
||||
/* 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 = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
LOG_I(F1AP, "GNB_DU_UE_F1AP_ID %llu associated with UE RNTI %x \n", (unsigned long long int)ie->value.choice.GNB_DU_UE_F1AP_ID, f1ap_dl_rrc->rnti);
|
||||
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie2);
|
||||
ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
|
||||
ie2->criticality = F1AP_Criticality_reject;
|
||||
ie2->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
|
||||
ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
|
||||
LOG_I(F1AP, "GNB_DU_UE_F1AP_ID %llu associated with UE RNTI %x \n", (unsigned long long int)ie2->value.choice.GNB_DU_UE_F1AP_ID, f1ap_dl_rrc->rnti);
|
||||
/* optional */
|
||||
/* c3. oldgNB_DU_UE_F1AP_ID */
|
||||
/* if (f1ap_dl_rrc->old_gNB_DU_ue_id != 0xFFFFFFFF) {
|
||||
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.oldgNB_DU_UE_F1AP_ID = f1ap_dl_rrc->old_gNB_DU_ue_id;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}*/
|
||||
|
||||
/* if (f1ap_dl_rrc->old_gNB_DU_ue_id != 0xFFFFFFFF) {
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie3);
|
||||
ie3->id = F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID;
|
||||
ie3->criticality = F1AP_Criticality_reject;
|
||||
ie3->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_NOTHING;
|
||||
ie3->value.choice.oldgNB_DU_UE_F1AP_ID = f1ap_dl_rrc->old_gNB_DU_ue_id;
|
||||
}*/
|
||||
/* 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 = f1ap_dl_rrc->srb_id;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie4);
|
||||
ie4->id = F1AP_ProtocolIE_ID_id_SRBID;
|
||||
ie4->criticality = F1AP_Criticality_reject;
|
||||
ie4->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID;
|
||||
ie4->value.choice.SRBID = f1ap_dl_rrc->srb_id;
|
||||
|
||||
/* optional */
|
||||
/* c5. ExecuteDuplication */
|
||||
if (f1ap_dl_rrc->execute_duplication) {
|
||||
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);
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie5);
|
||||
ie5->id = F1AP_ProtocolIE_ID_id_ExecuteDuplication;
|
||||
ie5->criticality = F1AP_Criticality_ignore;
|
||||
ie5->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_ExecuteDuplication;
|
||||
ie5->value.choice.ExecuteDuplication = F1AP_ExecuteDuplication_true;
|
||||
}
|
||||
|
||||
// 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, (const char*)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
|
||||
for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
|
||||
printf("\n");
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie6);
|
||||
ie6->id = F1AP_ProtocolIE_ID_id_RRCContainer;
|
||||
ie6->criticality = F1AP_Criticality_reject;
|
||||
ie6->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RRCContainer;
|
||||
OCTET_STRING_fromBuf(&ie6->value.choice.RRCContainer,
|
||||
(const char *)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
|
||||
|
||||
/* optional */
|
||||
/* c7. RAT_FrequencyPriorityInformation */
|
||||
/* TODO */
|
||||
/* TODO */
|
||||
if (0) {
|
||||
int endc=1;
|
||||
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;
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie7);
|
||||
ie7->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
|
||||
ie7->criticality = F1AP_Criticality_reject;
|
||||
ie7->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
|
||||
|
||||
if (endc==1) {
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 123L;
|
||||
ie7->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
|
||||
ie7->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 123L;
|
||||
} else {
|
||||
ie7->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
|
||||
ie7->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
|
||||
}
|
||||
else {
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
|
||||
ie->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
|
||||
}
|
||||
//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);
|
||||
|
||||
//ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
|
||||
//ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
|
||||
}
|
||||
|
||||
/* encode */
|
||||
@@ -319,8 +294,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
return -1;
|
||||
}
|
||||
|
||||
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
|
||||
|
||||
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/, buffer, len, 0 /* BK: fix me*/);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -332,63 +306,53 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
|
||||
LOG_D(F1AP, "CU_handle_UL_RRC_MESSAGE_TRANSFER \n");
|
||||
|
||||
F1AP_ULRRCMessageTransfer_t *container;
|
||||
F1AP_ULRRCMessageTransferIEs_t *ie;
|
||||
|
||||
uint64_t cu_ue_f1ap_id;
|
||||
uint64_t du_ue_f1ap_id;
|
||||
uint64_t srb_id;
|
||||
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
|
||||
if (stream != 0) {
|
||||
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
|
||||
assoc_id, stream);
|
||||
assoc_id, stream);
|
||||
return -1;
|
||||
}
|
||||
|
||||
container = &pdu->choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
|
||||
|
||||
|
||||
/* GNB_CU_UE_F1AP_ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
|
||||
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
LOG_D(F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x\n", cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id));
|
||||
|
||||
|
||||
LOG_D(F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x\n",
|
||||
cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id));
|
||||
/* GNB_DU_UE_F1AP_ID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
|
||||
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with RNTI %x\n", du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], du_ue_f1ap_id));
|
||||
|
||||
|
||||
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with RNTI %x\n",
|
||||
du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], du_ue_f1ap_id));
|
||||
/* mandatory */
|
||||
/* SRBID */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_SRBID, true);
|
||||
srb_id = ie->value.choice.SRBID;
|
||||
if (srb_id < 1 )
|
||||
LOG_E(F1AP, "Unexpected UL RRC MESSAGE for srb_id %lu \n", srb_id);
|
||||
else
|
||||
LOG_D(F1AP, "UL RRC MESSAGE for srb_id %lu in DCCH \n", srb_id);
|
||||
|
||||
if (srb_id < 1 )
|
||||
LOG_E(F1AP, "Unexpected UL RRC MESSAGE for srb_id %lu \n", srb_id);
|
||||
else
|
||||
LOG_D(F1AP, "UL RRC MESSAGE for srb_id %lu in DCCH \n", srb_id);
|
||||
|
||||
// issue in here
|
||||
/* mandatory */
|
||||
/* RRC Container */
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
|
||||
F1AP_ProtocolIE_ID_id_RRCContainer, true);
|
||||
// print message in debug mode
|
||||
|
||||
// print message in debug mode
|
||||
// create an ITTI message and copy SDU
|
||||
|
||||
/*
|
||||
|
||||
|
||||
message_p = itti_alloc_new_message (TASK_CU_F1, 0, RRC_DCCH_DATA_IND);
|
||||
|
||||
RRC_DCCH_DATA_IND (message_p).sdu_p = malloc(ie->value.choice.RRCContainer.size);
|
||||
@@ -412,19 +376,17 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
ctxt.eNB_index = 0;
|
||||
ctxt.configured = 1;
|
||||
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
|
||||
memcpy((void*)mb->data,(void*)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
|
||||
memcpy((void *)mb->data,(void *)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
|
||||
LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %x srb_id %lu with size %ld (DCCH) \n", ctxt.rnti, srb_id, ie->value.choice.RRCContainer.size);
|
||||
|
||||
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
|
||||
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
|
||||
// printf("%02x ", mb->data[i]);
|
||||
//printf("\n");
|
||||
|
||||
pdcp_data_ind (&ctxt,
|
||||
1, // srb_flag
|
||||
0, // embms_flag
|
||||
srb_id,
|
||||
ie->value.choice.RRCContainer.size,
|
||||
mb);
|
||||
1, // srb_flag
|
||||
0, // embms_flag
|
||||
srb_id,
|
||||
ie->value.choice.RRCContainer.size,
|
||||
mb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
|
||||
|
||||
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
f1ap_dl_rrc_message_t *f1ap_dl_rrc);
|
||||
|
||||
@@ -49,28 +49,27 @@ void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_associati
|
||||
}
|
||||
|
||||
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 %ld, cnx_id %u\n",
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
|
||||
if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN)
|
||||
proto_agent_stop(instance);
|
||||
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
|
||||
return; // exit -1 for debugging
|
||||
|
||||
//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
|
||||
// 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;
|
||||
|
||||
/* setup parameters for F1U and start the server */
|
||||
const cudu_params_t params = {
|
||||
.local_ipv4_address = RC.nrrrc[instance]->eth_params_s.my_addr,
|
||||
@@ -85,12 +84,9 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
|
||||
|
||||
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
|
||||
int result;
|
||||
|
||||
DevAssert(sctp_data_ind != NULL);
|
||||
|
||||
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
||||
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -99,69 +95,63 @@ 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(F1AP, "F1AP_CU_SCTP_REQ(create socket)\n");
|
||||
MessageDef *message_p = NULL;
|
||||
|
||||
message_p = itti_alloc_new_message (TASK_CU_F1, 0, 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;
|
||||
|
||||
if (RC.nrrrc[0]->node_type == ngran_gNB_CU) {
|
||||
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.nrrrc[enb_id]->eth_params_s.my_addr);
|
||||
} else{
|
||||
} else {
|
||||
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(F1AP, "Starting F1AP at CU\n");
|
||||
|
||||
// no RLC in CU, initialize mem pool for PDCP
|
||||
pool_buffer_init();
|
||||
|
||||
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)) {
|
||||
|
||||
switch (ITTI_MSG_ID(received_msg)) {
|
||||
case SCTP_NEW_ASSOCIATION_IND:
|
||||
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_IND for instance %ld\n",
|
||||
ITTI_MSG_DESTINATION_INSTANCE(received_msg));
|
||||
cu_task_handle_sctp_association_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_ind);
|
||||
&received_msg->ittiMsg.sctp_new_association_ind);
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP:
|
||||
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_RESP for instance %ld\n",
|
||||
ITTI_MSG_DESTINATION_INSTANCE(received_msg));
|
||||
cu_task_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
break;
|
||||
|
||||
case SCTP_DATA_IND:
|
||||
LOG_I(F1AP, "CU Task Received SCTP_DATA_IND for Instance %ld\n",
|
||||
ITTI_MSG_DESTINATION_INSTANCE(received_msg));
|
||||
cu_task_handle_sctp_data_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
break;
|
||||
|
||||
case F1AP_SETUP_RESP: // from rrc
|
||||
@@ -169,7 +159,7 @@ void *F1AP_CU_task(void *arg) {
|
||||
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &F1AP_SETUP_RESP(received_msg));
|
||||
CU_send_F1_SETUP_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_SETUP_RESP(received_msg));
|
||||
&F1AP_SETUP_RESP(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc
|
||||
@@ -177,19 +167,19 @@ void *F1AP_CU_task(void *arg) {
|
||||
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &F1AP_SETUP_RESP(received_msg));
|
||||
CU_send_gNB_CU_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_DL_RRC_MESSAGE: // from rrc
|
||||
LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
|
||||
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_DL_RRC_MESSAGE(received_msg));
|
||||
&F1AP_DL_RRC_MESSAGE(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_SETUP_REQ: // from rrc
|
||||
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_SETUP_REQ\n");
|
||||
CU_send_UE_CONTEXT_SETUP_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
|
||||
&F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
|
||||
@@ -198,13 +188,13 @@ void *F1AP_CU_task(void *arg) {
|
||||
&F1AP_UE_CONTEXT_RELEASE_CMD(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 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(F1AP, " *** Exiting F1AP thread\n");
|
||||
@@ -216,9 +206,9 @@ void *F1AP_CU_task(void *arg) {
|
||||
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
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -54,9 +54,9 @@ int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
|
||||
* UE Context Release Request (gNB-DU initiated)
|
||||
*/
|
||||
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/*
|
||||
* UE Context Release (gNB-CU initiated)
|
||||
@@ -65,32 +65,32 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
|
||||
f1ap_ue_context_release_cmd_t *cmd);
|
||||
|
||||
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/*
|
||||
* UE Context Modification (gNB-CU initiated)
|
||||
*/
|
||||
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
|
||||
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/*
|
||||
* UE Context Modification Required (gNB-DU initiated)
|
||||
*/
|
||||
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
|
||||
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
|
||||
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
|
||||
|
||||
/*
|
||||
* UE Inactivity Notification
|
||||
|
||||
@@ -35,15 +35,13 @@
|
||||
|
||||
int asn1_decoder_xer_print = 0;
|
||||
|
||||
static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
|
||||
{
|
||||
static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) {
|
||||
//MessageDef *message_p;
|
||||
//MessagesIds message_id;
|
||||
//asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
switch(pdu->choice.initiatingMessage->procedureCode) {
|
||||
|
||||
case F1AP_ProcedureCode_id_F1Setup:
|
||||
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
|
||||
@@ -68,15 +66,19 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
|
||||
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_ULRRCMessageTransfer\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_UEContextRelease:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_UEContextReleaseRequest:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextReleaseRequest\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_UEContextSetup:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
|
||||
break;
|
||||
|
||||
// case F1AP_ProcedureCode_id_InitialContextSetup:
|
||||
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
// message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
|
||||
@@ -92,7 +94,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
|
||||
// F1AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
|
||||
// (int)pdu->choice.initiatingMessage->procedureCode);
|
||||
LOG_E(F1AP, "Unknown procedure ID (%d) for initiating message\n",
|
||||
(int)pdu->choice.initiatingMessage->procedureCode);
|
||||
(int)pdu->choice.initiatingMessage->procedureCode);
|
||||
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
|
||||
(int)pdu->choice.initiatingMessage->procedureCode);
|
||||
return -1;
|
||||
@@ -101,8 +103,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu)
|
||||
{
|
||||
static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) {
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
switch(pdu->choice.successfulOutcome->procedureCode) {
|
||||
@@ -120,39 +121,35 @@ static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu)
|
||||
|
||||
default:
|
||||
LOG_E(F1AP,"Unknown procedure ID (%d) for successfull outcome message\n",
|
||||
(int)pdu->choice.successfulOutcome->procedureCode);
|
||||
(int)pdu->choice.successfulOutcome->procedureCode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int f1ap_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu)
|
||||
{
|
||||
static int f1ap_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu) {
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
switch(pdu->choice.unsuccessfulOutcome->procedureCode) {
|
||||
case F1AP_ProcedureCode_id_F1Setup:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
|
||||
break;
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
|
||||
break;
|
||||
|
||||
default:
|
||||
// F1AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
|
||||
// (int)pdu->choice.unsuccessfulOutcome->procedureCode);
|
||||
LOG_E(F1AP, "Unknown procedure ID (%d) for unsuccessfull outcome message\n",
|
||||
(int)pdu->choice.unsuccessfulOutcome->procedureCode);
|
||||
(int)pdu->choice.unsuccessfulOutcome->procedureCode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
|
||||
{
|
||||
int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length) {
|
||||
asn_dec_rval_t dec_ret;
|
||||
|
||||
DevAssert(buffer != NULL);
|
||||
|
||||
dec_ret = aper_decode(NULL,
|
||||
&asn_DEF_F1AP_F1AP_PDU,
|
||||
(void **)&pdu,
|
||||
@@ -166,6 +163,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
|
||||
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
|
||||
}
|
||||
|
||||
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
|
||||
|
||||
if (dec_ret.code != RC_OK) {
|
||||
@@ -188,6 +186,5 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ extern RAN_CONTEXT_t RC;
|
||||
int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273};
|
||||
|
||||
int to_NRNRB(int nrb) {
|
||||
for (int i=0; i<29; i++)
|
||||
for (int i=0; i<sizeofArray(nrb_lut); i++)
|
||||
if (nrb_lut[i] == nrb)
|
||||
return i;
|
||||
|
||||
@@ -93,9 +93,6 @@ int DU_handle_ERROR_INDICATION(instance_t instance,
|
||||
F1 Setup
|
||||
*/
|
||||
|
||||
#define asn1cCalloc(VaR, TyPe, lOcPtr) TyPe *lOcPtr=VaR=(TyPe*) calloc(1,sizeof(TyPe));
|
||||
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) TyPe *lOcPtr=(TyPe*) calloc(1,sizeof(TyPe)); ASN_SEQUENCE_ADD(&VaR,lOcPtr);
|
||||
|
||||
// SETUP REQUEST
|
||||
int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
module_id_t enb_mod_idP=0;
|
||||
@@ -155,25 +152,13 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
duServedCell->criticality = F1AP_Criticality_reject;
|
||||
duServedCell->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=&duServedCell->value.choice.GNB_DU_Served_Cells_Item;
|
||||
|
||||
/* 4.1.1 served cell Information */
|
||||
F1AP_Served_Cell_Information_t *served_cell_information= &gnb_du_served_cells_item->served_Cell_Information;
|
||||
F1AP_NRCGI_t *nRCGI= &served_cell_information->nRCGI;
|
||||
/* - 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);
|
||||
LOG_D(F1AP, "plmn: (%d,%d)\n",f1ap_du_data->mcc[i],f1ap_du_data->mnc[i]);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI->nRCellIdentity);
|
||||
LOG_D(F1AP, "nRCellIdentity (%llx): %x.%x.%x.%x.%x\n",
|
||||
(long long unsigned int)f1ap_du_data->nr_cellid[i],
|
||||
nRCGI->nRCellIdentity.buf[0],
|
||||
nRCGI->nRCellIdentity.buf[1],
|
||||
nRCGI->nRCellIdentity.buf[2],
|
||||
nRCGI->nRCellIdentity.buf[3],
|
||||
nRCGI->nRCellIdentity.buf[4]);
|
||||
//addnRCGI(served_cell_information->nRCGI,f1ap_du_data->cell+i);
|
||||
/* - nRPCI */
|
||||
served_cell_information->nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
|
||||
served_cell_information->nRPCI = f1ap_du_data->cell[i].nr_pci; // int 0..1007
|
||||
/* - fiveGS_TAC */
|
||||
uint32_t tac=htonl(f1ap_du_data->tac[i]);
|
||||
uint32_t tac=htonl(f1ap_du_data->cell[i].tac);
|
||||
asn1cCalloc(served_cell_information->fiveGS_TAC, F1AP_FiveGS_TAC_t, netOrder);
|
||||
OCTET_STRING_fromBuf(netOrder, ((char *)&tac)+1, 3);
|
||||
|
||||
@@ -185,8 +170,8 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
|
||||
/* servedPLMN information */
|
||||
asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t,servedPLMN_item);
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i],
|
||||
f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->cell[i].mcc, f1ap_du_data->cell[i].mnc,
|
||||
f1ap_du_data->cell[i].mnc_digit_length, &servedPLMN_item->pLMN_Identity);
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
|
||||
|
||||
@@ -306,8 +291,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
|
||||
OCTET_STRING_fromBuf(&served_cell_information->measurementTimingConfiguration,
|
||||
measurementTimingConfiguration,
|
||||
strlen(measurementTimingConfiguration));
|
||||
|
||||
asn1cCalloc(gnb_du_served_cells_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
|
||||
asn1cCalloc(gnb_du_served_cells_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
|
||||
/* 4.1.2 gNB-DU System Information */
|
||||
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
|
||||
(const char *)f1ap_du_data->mib[i], //f1ap_du_data->mib,
|
||||
@@ -555,327 +539,228 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
|
||||
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
instance_t du_mod_idP,
|
||||
f1ap_setup_req_t *f1ap_setup_req) {
|
||||
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;
|
||||
F1AP_F1AP_PDU_t pdu= {0};
|
||||
uint8_t *buffer=NULL;
|
||||
uint32_t len=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;
|
||||
asn1cCalloc(pdu.choice.initiatingMessage,F1AP_InitiatingMessage_t, initMsg);
|
||||
initMsg->procedureCode = F1AP_ProcedureCode_id_gNBDUConfigurationUpdate;
|
||||
initMsg->criticality = F1AP_Criticality_reject;
|
||||
initMsg->value.present = F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
|
||||
F1AP_GNBDUConfigurationUpdate_t *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(instance, du_mod_idP);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie1);
|
||||
ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie1->criticality = F1AP_Criticality_reject;
|
||||
ie1->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
|
||||
ie1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP);
|
||||
/* 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;
|
||||
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie2);
|
||||
ie2->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_List;
|
||||
ie2->criticality = F1AP_Criticality_reject;
|
||||
ie2->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List;
|
||||
|
||||
for (j=0;
|
||||
j<1;
|
||||
j++) {
|
||||
for (int 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));
|
||||
asn1cSequenceAdd(ie2->value.choice.Served_Cells_To_Add_List.list, F1AP_Served_Cells_To_Add_ItemIEs_t, served_cells_to_add_item_ies);
|
||||
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));
|
||||
F1AP_Served_Cells_To_Add_Item_t *served_cells_to_add_item= &served_cells_to_add_item_ies->value.choice.Served_Cells_To_Add_Item;
|
||||
F1AP_Served_Cell_Information_t *served_cell_information=&served_cells_to_add_item->served_Cell_Information;
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &nRCGI.pLMN_Identity);
|
||||
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
|
||||
nRCGI.nRCellIdentity.buf[0],
|
||||
nRCGI.nRCellIdentity.buf[1],
|
||||
nRCGI.nRCellIdentity.buf[2],
|
||||
nRCGI.nRCellIdentity.buf[3],
|
||||
nRCGI.nRCellIdentity.buf[4]);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
|
||||
served_cell_information.nRCGI = nRCGI;
|
||||
//addnRCGI(served_cell_information->nRCGI, f1ap_setup_req->cell[j]);
|
||||
/* - nRPCI */
|
||||
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
|
||||
/* 2.1.1 serverd cell Information */
|
||||
served_cell_information->nRPCI = f1ap_setup_req->cell[j].nr_pci; // int 0..1007
|
||||
/* - fiveGS_TAC */
|
||||
uint32_t tac=htonl(f1ap_du_data->tac[i]);
|
||||
served_cell_information.fiveGS_TAC=(F1AP_FiveGS_TAC_t *) calloc(1,sizeof(F1AP_FiveGS_TAC_t *));
|
||||
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, ((char *)&tac)+1, 3);
|
||||
uint32_t tac=htonl(f1ap_du_data->cell[j].tac);
|
||||
served_cell_information->fiveGS_TAC=(F1AP_FiveGS_TAC_t *) calloc(1,sizeof(F1AP_FiveGS_TAC_t *));
|
||||
OCTET_STRING_fromBuf(served_cell_information->fiveGS_TAC, ((char *)&tac)+1, 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);
|
||||
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);
|
||||
}
|
||||
|
||||
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
|
||||
memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
|
||||
asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t, servedPLMN_item);
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->cell[j].mcc, f1ap_du_data->cell[j].mnc, f1ap_du_data->cell[j].mnc_digit_length, &servedPLMN_item->pLMN_Identity);
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
F1AP_NR_Mode_Info_t *nR_Mode_Info=&served_cell_information->nR_Mode_Info;
|
||||
|
||||
if (f1ap_setup_req->fdd_flag) {
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_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));
|
||||
asn1cCalloc(nR_Mode_Info->choice.fDD, F1AP_FDD_Info_t, fDD_Info);
|
||||
/* >>> 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);
|
||||
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, ul_freqBandNrItem);
|
||||
ul_freqBandNrItem->freqBandIndicatorNr = 888L;
|
||||
asn1cSequenceAdd(ul_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, ul_supportedSULFreqBandItem);
|
||||
ul_supportedSULFreqBandItem->freqBandIndicatorNr = 777L;
|
||||
/* >>> 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);
|
||||
asn1cSequenceAdd(fDD_Info->dL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, dl_freqBandNrItem);
|
||||
dl_freqBandNrItem->freqBandIndicatorNr = 555L;
|
||||
asn1cSequenceAdd(dl_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, dl_supportedSULFreqBandItem);
|
||||
dl_supportedSULFreqBandItem->freqBandIndicatorNr = 444L;
|
||||
/* >>> 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;
|
||||
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));
|
||||
asn1cCalloc(nR_Mode_Info->choice.tDD, F1AP_TDD_Info_t, tDD_Info);
|
||||
/* >>> 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);
|
||||
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
|
||||
nr_freqBandNrItem->freqBandIndicatorNr = 555L;
|
||||
asn1cSequenceAdd(nr_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
|
||||
nr_supportedSULFreqBandItem->freqBandIndicatorNr = 444L;
|
||||
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,
|
||||
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));
|
||||
asn1cCalloc(served_cells_to_add_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
|
||||
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;
|
||||
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie3);
|
||||
ie3->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_List;
|
||||
ie3->criticality = F1AP_Criticality_reject;
|
||||
ie3->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
for (int 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));
|
||||
asn1cSequenceAdd(ie3->value.choice.Served_Cells_To_Modify_List.list, F1AP_Served_Cells_To_Modify_ItemIEs_t, served_cells_to_modify_item_ies);
|
||||
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));
|
||||
F1AP_Served_Cells_To_Modify_Item_t *served_cells_to_modify_item=&served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item;
|
||||
/* 3.1 oldNRCGI */
|
||||
F1AP_NRCGI_t oldNRCGI;
|
||||
memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
|
||||
&oldNRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity);
|
||||
served_cells_to_modify_item.oldNRCGI = oldNRCGI;
|
||||
//addnRGCI(served_cells_to_modify_item->oldNRCGI, f1ap_setup_req->cell[i]);
|
||||
/* 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));
|
||||
F1AP_Served_Cell_Information_t *served_cell_information= &served_cells_to_modify_item->served_Cell_Information;
|
||||
/* - nRCGI */
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
|
||||
served_cell_information.nRCGI = nRCGI;
|
||||
//addnRGCI(served_cell_information->nRCGI,f1ap_setup_req->cell[i]);
|
||||
/* - nRPCI */
|
||||
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
|
||||
served_cell_information->nRPCI = f1ap_setup_req->cell[i].nr_pci; // int 0..1007
|
||||
/* - fiveGS_TAC */
|
||||
served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
|
||||
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
|
||||
(const char *) &f1ap_setup_req->tac[i],
|
||||
asn1cCalloc(served_cell_information->fiveGS_TAC,F1AP_FiveGS_TAC_t, tac );
|
||||
OCTET_STRING_fromBuf(tac,
|
||||
(const char *) &f1ap_setup_req->cell[i].tac,
|
||||
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,
|
||||
asn1cCalloc(served_cell_information->configured_EPS_TAC, F1AP_Configured_EPS_TAC_t, tmp2);
|
||||
OCTET_STRING_fromBuf(tmp2,
|
||||
"2",
|
||||
2);
|
||||
}
|
||||
|
||||
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
|
||||
memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
|
||||
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
|
||||
asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t, servedPLMN_item);
|
||||
MCC_MNC_TO_PLMNID(f1ap_du_data->cell[i].mcc, f1ap_du_data->cell[i].mnc, f1ap_du_data->cell[i].mnc_digit_length, &servedPLMN_item->pLMN_Identity);
|
||||
// // /* - CHOICE NR-MODE-Info */
|
||||
F1AP_NR_Mode_Info_t nR_Mode_Info;
|
||||
F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
|
||||
|
||||
if (f1ap_setup_req->fdd_flag) {
|
||||
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_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));
|
||||
asn1cCalloc(nR_Mode_Info->choice.fDD, F1AP_FDD_Info_t, fDD_Info);
|
||||
/* >>> 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);
|
||||
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, ul_freqBandNrItem);
|
||||
ul_freqBandNrItem->freqBandIndicatorNr = 888L;
|
||||
asn1cSequenceAdd(ul_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, ul_supportedSULFreqBandItem);
|
||||
ul_supportedSULFreqBandItem->freqBandIndicatorNr = 777L;
|
||||
/* >>> 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;
|
||||
asn1cSequenceAdd(dl_freqBandNrItem->supportedSULBandList.list, F1AP_FreqBandNrItem_t, dl_freqBandNrItem);
|
||||
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;
|
||||
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));
|
||||
asn1cCalloc(nR_Mode_Info->choice.tDD, F1AP_TDD_Info_t, tDD_Info);
|
||||
/* >>> 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);
|
||||
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
|
||||
nr_freqBandNrItem->freqBandIndicatorNr = 555L;
|
||||
asn1cSequenceAdd(nr_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
|
||||
nr_supportedSULFreqBandItem->freqBandIndicatorNr = 444L;
|
||||
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,
|
||||
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));
|
||||
asn1cCalloc( served_cells_to_modify_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
|
||||
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;
|
||||
asn1cSequenceAdd(out, F1AP_GNBDUConfigurationUpdateIEs_t, ie4);
|
||||
ie4->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_List;
|
||||
ie4->criticality = F1AP_Criticality_reject;
|
||||
ie4->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Delete_List;
|
||||
|
||||
for (i=0;
|
||||
i<1;
|
||||
i++) {
|
||||
for (int 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));
|
||||
asn1cSequenceAdd(ie4->value.choice.Served_Cells_To_Delete_List.list, F1AP_Served_Cells_To_Delete_ItemIEs_t, served_cells_to_delete_item_ies);
|
||||
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));
|
||||
F1AP_Served_Cells_To_Delete_Item_t *served_cells_to_delete_item=&served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item;
|
||||
/* 3.1 oldNRCGI */
|
||||
F1AP_NRCGI_t oldNRCGI;
|
||||
memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t));
|
||||
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
|
||||
&oldNRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &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);
|
||||
//addnRGCI(served_cells_to_delete_item->oldNRCGI, f1ap_setup_req->cell[i]);
|
||||
}
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 gNB-DU CONFIGURATION UPDATE\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1074,26 +959,24 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs == 0,
|
||||
"%d DedicatedSIDeliveryNeededUEs\n",
|
||||
GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs);
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
F1AP_F1AP_PDU_t pdu= {0};
|
||||
uint8_t *buffer=NULL;
|
||||
uint32_t len=0;
|
||||
/* Create */
|
||||
/* 0. pdu 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_gNBCUConfigurationUpdate;
|
||||
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge;
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledge_t *out = &pdu.choice.successfulOutcome->value.choice.GNBCUConfigurationUpdateAcknowledge;
|
||||
asn1cCalloc(pdu.choice.successfulOutcome, F1AP_SuccessfulOutcome_t, tmp);
|
||||
tmp->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
|
||||
tmp->criticality = F1AP_Criticality_reject;
|
||||
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge;
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledge_t *out = &tmp->value.choice.GNBCUConfigurationUpdateAcknowledge;
|
||||
/* mandatory */
|
||||
/* c1. Transaction ID (integer value)*/
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *ie = (F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
|
||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t, ie);
|
||||
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID;
|
||||
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(0, 0);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
@@ -1101,6 +984,7 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
return -1;
|
||||
}
|
||||
|
||||
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -76,43 +76,43 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
|
||||
* gNB-DU Configuration Update
|
||||
*/
|
||||
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
instance_t du_mod_idP,
|
||||
f1ap_setup_req_t *f1ap_du_data);
|
||||
instance_t du_mod_idP,
|
||||
f1ap_setup_req_t *f1ap_du_data);
|
||||
|
||||
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/*
|
||||
* gNB-CU Configuration Update
|
||||
*/
|
||||
int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
|
||||
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
|
||||
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
|
||||
|
||||
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
|
||||
|
||||
|
||||
/*
|
||||
* gNB-DU Resource Coordination
|
||||
*/
|
||||
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
|
||||
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
|
||||
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
|
||||
|
||||
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -45,12 +45,12 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_messa
|
||||
int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg);
|
||||
|
||||
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
|
||||
int CC_idP,
|
||||
int UE_id,
|
||||
rnti_t rntiP,
|
||||
const uint8_t *sduP,
|
||||
sdu_size_t sdu_lenP,
|
||||
const int8_t *sdu2P,
|
||||
sdu_size_t sdu2_lenP);
|
||||
int CC_idP,
|
||||
int UE_id,
|
||||
rnti_t rntiP,
|
||||
const uint8_t *sduP,
|
||||
sdu_size_t sdu_lenP,
|
||||
const char *sdu2P,
|
||||
sdu_size_t sdu2_lenP);
|
||||
|
||||
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
|
||||
|
||||
@@ -44,63 +44,50 @@ f1ap_setup_req_t *f1ap_du_data;
|
||||
f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
|
||||
|
||||
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, 0, 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("nr_cellid : %llx (%lld)",f1ap_setup_req->nr_cellid[0],f1ap_setup_req->nr_cellid[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 %ld, cnx_id %u\n",
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
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
|
||||
}
|
||||
|
||||
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
|
||||
return; // exit -1 for debugging
|
||||
}
|
||||
|
||||
// save the assoc id
|
||||
// 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;
|
||||
f1ap_du_data->default_sctp_stream_id = 0;
|
||||
|
||||
/* setup parameters for F1U and start the server */
|
||||
const cudu_params_t params = {
|
||||
.local_ipv4_address = RC.nrmac[instance]->eth_params_n.my_addr,
|
||||
@@ -110,34 +97,25 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
|
||||
};
|
||||
AssertFatal(proto_agent_start(instance, ¶ms) == 0,
|
||||
"could not start PROTO_AGENT for F1U on instance %ld!\n", instance);
|
||||
|
||||
DU_send_F1_SETUP_REQUEST(instance);
|
||||
}
|
||||
|
||||
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind)
|
||||
{
|
||||
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
|
||||
int result;
|
||||
|
||||
DevAssert(sctp_data_ind != NULL);
|
||||
|
||||
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
||||
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
|
||||
|
||||
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(F1AP, "Starting F1AP at DU\n");
|
||||
|
||||
//f1ap_eNB_prepare_internal_data();
|
||||
|
||||
itti_mark_task_ready(TASK_DU_F1);
|
||||
|
||||
// SCTP
|
||||
@@ -145,58 +123,58 @@ void *F1AP_DU_task(void *arg) {
|
||||
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,
|
||||
// 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(F1AP, "DU Task Received F1AP_SETUP_REQ\n");
|
||||
du_task_send_sctp_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_SETUP_REQ(received_msg));
|
||||
&F1AP_SETUP_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
|
||||
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
|
||||
break;
|
||||
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE:
|
||||
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg));
|
||||
break;
|
||||
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg));
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP:
|
||||
// 1. store the respon
|
||||
// 2. send the f1setup_req
|
||||
LOG_I(F1AP, "DU Task Received SCTP_NEW_ASSOCIATION_RESP\n");
|
||||
du_task_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
break;
|
||||
|
||||
case SCTP_DATA_IND:
|
||||
case SCTP_DATA_IND:
|
||||
// ex: any F1 incoming message for DU ends here
|
||||
LOG_I(F1AP, "DU Task Received SCTP_DATA_IND\n");
|
||||
du_task_handle_sctp_data_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
break;
|
||||
|
||||
case F1AP_INITIAL_UL_RRC_MESSAGE: // to rrc
|
||||
LOG_I(F1AP, "DU Task Received F1AP_INITIAL_UL_RRC_MESSAGE\n");
|
||||
|
||||
f1ap_initial_ul_rrc_message_t *msg = &F1AP_INITIAL_UL_RRC_MESSAGE(received_msg);
|
||||
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(0,0,0,msg->crnti,
|
||||
msg->rrc_container,
|
||||
msg->rrc_container_length,
|
||||
(char*)msg->du2cu_rrc_container,
|
||||
msg->du2cu_rrc_container_length
|
||||
);
|
||||
msg->du2cu_rrc_container,
|
||||
msg->du2cu_rrc_container_length
|
||||
);
|
||||
break;
|
||||
|
||||
case F1AP_UL_RRC_MESSAGE: // to rrc
|
||||
case F1AP_UL_RRC_MESSAGE: // to rrc
|
||||
LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
|
||||
|
||||
if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
|
||||
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UL_RRC_MESSAGE(received_msg));
|
||||
@@ -204,6 +182,7 @@ void *F1AP_DU_task(void *arg) {
|
||||
DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_UL_RRC_MESSAGE(received_msg));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
|
||||
@@ -222,9 +201,9 @@ void *F1AP_DU_task(void *arg) {
|
||||
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
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -55,9 +55,9 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
|
||||
* UE Context Release Command (gNB-CU initiated)
|
||||
*/
|
||||
int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/*
|
||||
* UE Context Release Complete (gNB-DU initiated)
|
||||
@@ -70,9 +70,9 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
|
||||
* UE Context Modification (gNB-CU initiated)
|
||||
*/
|
||||
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance);
|
||||
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance);
|
||||
|
||||
@@ -82,9 +82,9 @@ int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance);
|
||||
*/
|
||||
int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance);
|
||||
int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
/*
|
||||
* UE Inactivity Notification
|
||||
|
||||
@@ -71,8 +71,7 @@ int f1ap_encode_ue_context_release_request(
|
||||
uint32_t *length);
|
||||
*/
|
||||
|
||||
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
|
||||
{
|
||||
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
|
||||
ssize_t encoded;
|
||||
DevAssert(pdu != NULL);
|
||||
DevAssert(buffer != NULL);
|
||||
@@ -92,7 +91,6 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
|
||||
}
|
||||
|
||||
*length = encoded;
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ extern f1ap_setup_req_t *f1ap_du_data_from_du;
|
||||
|
||||
/* Handlers matrix. Only f1 related procedure present here */
|
||||
f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
|
||||
|
||||
|
||||
|
||||
{ 0, 0, 0 }, /* Reset */
|
||||
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */
|
||||
@@ -73,25 +73,21 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
|
||||
};
|
||||
|
||||
const char *f1ap_direction2String(int f1ap_dir) {
|
||||
static const char *f1ap_direction_String[] = {
|
||||
"", /* Nothing */
|
||||
"Initiating message", /* initiating message */
|
||||
"Successfull outcome", /* successfull outcome */
|
||||
"UnSuccessfull outcome", /* successfull outcome */
|
||||
};
|
||||
return(f1ap_direction_String[f1ap_dir]);
|
||||
static const char *f1ap_direction_String[] = {
|
||||
"", /* Nothing */
|
||||
"Initiating message", /* initiating message */
|
||||
"Successfull outcome", /* successfull outcome */
|
||||
"UnSuccessfull outcome", /* successfull outcome */
|
||||
};
|
||||
return(f1ap_direction_String[f1ap_dir]);
|
||||
}
|
||||
|
||||
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
|
||||
const uint8_t * const data, const uint32_t data_length)
|
||||
{
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
const uint8_t *const data, const uint32_t data_length) {
|
||||
F1AP_F1AP_PDU_t pdu= {0};
|
||||
int ret;
|
||||
|
||||
DevAssert(data != NULL);
|
||||
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
|
||||
if (f1ap_decode_pdu(&pdu, data, data_length) < 0) {
|
||||
LOG_E(F1AP, "Failed to decode PDU\n");
|
||||
return -1;
|
||||
@@ -102,7 +98,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
|
||||
f1ap_message_decoded_callback))
|
||||
|| (pdu.present > F1AP_F1AP_PDU_PR_unsuccessfulOutcome)) {
|
||||
LOG_E(F1AP, "[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
|
||||
assoc_id, pdu.choice.initiatingMessage->procedureCode, pdu.present);
|
||||
assoc_id, pdu.choice.initiatingMessage->procedureCode, pdu.present);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
return -1;
|
||||
}
|
||||
@@ -112,8 +108,8 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
|
||||
*/
|
||||
if (f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) {
|
||||
LOG_E(F1AP, "[SCTP %d] No handler for procedureCode %ld in %s\n",
|
||||
assoc_id, pdu.choice.initiatingMessage->procedureCode,
|
||||
f1ap_direction2String(pdu.present - 1));
|
||||
assoc_id, pdu.choice.initiatingMessage->procedureCode,
|
||||
f1ap_direction2String(pdu.present - 1));
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,6 @@
|
||||
#define F1AP_HANDLERS_H_
|
||||
|
||||
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
|
||||
const uint8_t * const data, const uint32_t data_length);
|
||||
const uint8_t *const data, const uint32_t data_length);
|
||||
|
||||
#endif /* F1AP_HANDLERS_H_ */
|
||||
|
||||
@@ -23,51 +23,38 @@
|
||||
#include "f1ap_itti_messaging.h"
|
||||
|
||||
void cu_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
|
||||
uint32_t buffer_length, uint16_t stream)
|
||||
{
|
||||
uint32_t buffer_length, uint16_t stream) {
|
||||
MessageDef *message_p;
|
||||
sctp_data_req_t *sctp_data_req;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_CU_F1, 0, SCTP_DATA_REQ);
|
||||
|
||||
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
|
||||
|
||||
sctp_data_req->assoc_id = assoc_id;
|
||||
sctp_data_req->buffer = buffer;
|
||||
sctp_data_req->buffer_length = buffer_length;
|
||||
sctp_data_req->stream = stream;
|
||||
|
||||
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
|
||||
}
|
||||
|
||||
void du_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
|
||||
uint32_t buffer_length, uint16_t stream)
|
||||
{
|
||||
uint32_t buffer_length, uint16_t stream) {
|
||||
MessageDef *message_p;
|
||||
sctp_data_req_t *sctp_data_req;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_DU_F1, 0, 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;
|
||||
|
||||
LOG_I(F1AP, "Sending ITTI message to SCTP Task\n");
|
||||
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
|
||||
}
|
||||
|
||||
void f1ap_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id)
|
||||
{
|
||||
void f1ap_itti_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_S1AP, 0, 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
#define F1AP_ITTI_MESSAGING_H_
|
||||
|
||||
void cu_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
|
||||
uint32_t buffer_length, uint16_t stream);
|
||||
uint32_t buffer_length, uint16_t stream);
|
||||
|
||||
void du_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
|
||||
uint32_t buffer_length, uint16_t stream);
|
||||
uint32_t buffer_length, uint16_t stream);
|
||||
|
||||
void f1ap_eNB_itti_send_sctp_close_association(instance_t instance,
|
||||
int32_t assoc_id);
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* 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_messaging.c
|
||||
* \brief f1ap procedures
|
||||
* \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_messaging.h"
|
||||
|
||||
// void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
|
||||
// uint32_t buffer_length, uint16_t stream)
|
||||
// {
|
||||
// MessageDef *message_p;
|
||||
// sctp_data_req_t *sctp_data_req;
|
||||
|
||||
// message_p = itti_alloc_new_message(TASK_F1AP, SCTP_DATA_REQ);
|
||||
|
||||
// sctp_data_req = &message_p->ittiMsg.sctp_data_req;
|
||||
|
||||
// sctp_data_req->assoc_id = assoc_id;
|
||||
// sctp_data_req->buffer = buffer;
|
||||
// sctp_data_req->buffer_length = buffer_length;
|
||||
// sctp_data_req->stream = stream;
|
||||
|
||||
// itti_send_msg_to_task(TASK_SCTP, instance, message_p);
|
||||
// }
|
||||
|
||||
// void f1ap_send_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);
|
||||
// }
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#define 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);
|
||||
uint32_t buffer_length, uint16_t stream);
|
||||
|
||||
void f1ap_send_sctp_close_association(instance_t instance,
|
||||
int32_t assoc_id);
|
||||
int32_t assoc_id);
|
||||
|
||||
|
||||
#endif /* F1AP_MESSAGING_H_ */
|
||||
|
||||
@@ -1666,20 +1666,20 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
LOG_I(GNB_APP,"F1AP: gNB_DU_id[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_id);
|
||||
F1AP_SETUP_REQ (msg_p).gNB_DU_name = strdup(*(GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr));
|
||||
LOG_I(GNB_APP,"F1AP: gNB_DU_name[%d] %s\n",k,F1AP_SETUP_REQ (msg_p).gNB_DU_name);
|
||||
F1AP_SETUP_REQ (msg_p).tac[k] = *GNBParamList.paramarray[i][GNB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).tac[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mcc[k] = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mcc[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mnc[k] = *PLMNParamList.paramarray[0][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc[k]);
|
||||
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] = *PLMNParamList.paramarray[0][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
LOG_I(GNB_APP,"F1AP: mnc_digit_length[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
|
||||
AssertFatal((F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 2) ||
|
||||
(F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 3),
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].tac = *GNBParamList.paramarray[i][GNB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].tac);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mcc = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mcc);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mnc = *PLMNParamList.paramarray[0][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
LOG_I(GNB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length = *PLMNParamList.paramarray[0][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
LOG_I(GNB_APP,"F1AP: mnc_digit_length[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
|
||||
AssertFatal((F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 2) ||
|
||||
(F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 3),
|
||||
"BAD MNC DIGIT LENGTH %d",
|
||||
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]);
|
||||
F1AP_SETUP_REQ (msg_p).nr_cellid[k] = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr);
|
||||
LOG_I(GNB_APP,"F1AP: nr_cellid[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).nr_cellid[k]);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr);
|
||||
LOG_I(GNB_APP,"F1AP: nr_cellid[%d] %ld\n",k,F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid);
|
||||
LOG_I(GNB_APP,"F1AP: CU_ip4_address in DU %s\n",RC.nrmac[k]->eth_params_n.remote_addr);
|
||||
LOG_I(GNB_APP,"FIAP: CU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv4_address,(int)strlen(RC.nrmac[k]->eth_params_n.remote_addr));
|
||||
F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv6 = 0;
|
||||
@@ -1709,12 +1709,12 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
pthread_mutex_unlock(&rrc->cell_info_mutex);
|
||||
} while (cell_info_configured == 0);
|
||||
|
||||
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).mcc[k];
|
||||
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).mnc[k];
|
||||
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).tac[k];
|
||||
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).nr_cellid[k];
|
||||
F1AP_SETUP_REQ (msg_p).nr_pci[k] = *rrc->configuration.scc->physCellId;
|
||||
F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0;
|
||||
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mcc;
|
||||
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mnc;
|
||||
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).cell[k].tac;
|
||||
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid;
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].nr_pci = *rrc->configuration.scc->physCellId;
|
||||
F1AP_SETUP_REQ (msg_p).cell[k].num_ssi = 0;
|
||||
|
||||
if (rrc->configuration.scc->tdd_UL_DL_ConfigurationCommon) {
|
||||
LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
|
||||
|
||||
@@ -544,6 +544,7 @@ extern notifiedFIFO_t pdcp_sdu_list;
|
||||
(((hash_key_t)(0x0000000000000001)) << 63))
|
||||
|
||||
extern hash_table_t *pdcp_coll_p;
|
||||
void init_pdcp(void);
|
||||
|
||||
#endif
|
||||
/*@}*/
|
||||
|
||||
@@ -8518,9 +8518,9 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
for (int j=0; j<RC.nb_inst; j++) {
|
||||
eNB_RRC_INST *rrc = RC.rrc[j];
|
||||
|
||||
if (rrc->configuration.mcc[0] == f1_setup_req->mcc[i] &&
|
||||
rrc->configuration.mnc[0] == f1_setup_req->mnc[i] &&
|
||||
rrc->nr_cellid == f1_setup_req->nr_cellid[i]) {
|
||||
if (rrc->configuration.mcc[0] == f1_setup_req->cell[i].mcc &&
|
||||
rrc->configuration.mnc[0] == f1_setup_req->cell[i].mnc &&
|
||||
rrc->nr_cellid == f1_setup_req->cell[i].nr_cellid) {
|
||||
// check that CU rrc instance corresponds to mcc/mnc/cgi (normally cgi should be enough, but just in case)
|
||||
rrc->carrier[0].MIB = malloc(f1_setup_req->mib_length[i]);
|
||||
rrc->carrier[0].sizeof_MIB = f1_setup_req->mib_length[i];
|
||||
@@ -8560,7 +8560,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
AssertFatal(bcch_message->message.choice.c1.present == LTE_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1,
|
||||
"bcch_message->message.choice.c1.present != LTE_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1\n");
|
||||
rrc->carrier[0].sib1 = &bcch_message->message.choice.c1.choice.systemInformationBlockType1;
|
||||
rrc->carrier[0].physCellId = f1_setup_req->nr_pci[i];
|
||||
rrc->carrier[0].physCellId = f1_setup_req->cell[i].nr_pci;
|
||||
// prepare F1_SETUP_RESPONSE
|
||||
|
||||
if (msg_p == NULL) {
|
||||
@@ -8572,7 +8572,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mnc = rrc->configuration.mnc[0];
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mnc_digit_length = rrc->configuration.mnc_digit_length[0];
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].nr_cellid = rrc->nr_cellid;
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->nr_pci[i];
|
||||
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->cell[i].nr_pci;
|
||||
int num_SI= 0;
|
||||
|
||||
if (rrc->carrier[0].SIB23) {
|
||||
@@ -8594,7 +8594,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
break;
|
||||
} else {// setup_req mcc/mnc match rrc internal list element
|
||||
LOG_W(RRC,"[Inst %d] No matching MCC/MNC: rrc->mcc/f1_setup_req->mcc %d/%d rrc->mnc/f1_setup_req->mnc %d/%d \n",
|
||||
j, rrc->configuration.mcc[0], f1_setup_req->mcc[i],rrc->configuration.mnc[0], f1_setup_req->mnc[i]);
|
||||
j, rrc->configuration.mcc[0], f1_setup_req->cell[i].mcc,rrc->configuration.mnc[0], f1_setup_req->cell[i].mnc);
|
||||
}
|
||||
}// for (int j=0;j<RC.nb_inst;j++)
|
||||
|
||||
|
||||
@@ -431,7 +431,6 @@ rrc_gNB_generate_RRCSetup(
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
LOG_I(NR_RRC, "rrc_gNB_generate_RRCSetup \n");
|
||||
NR_SRB_ToAddModList_t **SRB_configList = NULL;
|
||||
MessageDef *message_p;
|
||||
|
||||
// T(T_GNB_RRC_SETUP,
|
||||
@@ -551,7 +550,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
LOG_I(NR_RRC, "generate RRCSetup for RRCReestablishmentRequest \n");
|
||||
NR_SRB_ToAddModList_t **SRB_configList = NULL;
|
||||
rrc_gNB_ue_context_t *ue_context_pP = NULL;
|
||||
gNB_RRC_INST *rrc_instance_p = RC.nrrrc[ctxt_pP->module_id];
|
||||
NR_ServingCellConfigCommon_t *scc=rrc_instance_p->carrier.servingcellconfigcommon;
|
||||
@@ -559,7 +557,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
|
||||
ue_context_pP = rrc_gNB_get_next_free_ue_context(ctxt_pP, rrc_instance_p, 0);
|
||||
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
SRB_configList = &ue_p->SRB_configList;
|
||||
ue_p->Srb0.Tx_buffer.payload_size = do_RRCSetup(ue_context_pP,
|
||||
(uint8_t *) ue_p->Srb0.Tx_buffer.Payload,
|
||||
rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id),
|
||||
@@ -2744,9 +2741,9 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
for (int j=0; j<RC.nb_nr_inst; j++) {
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[j];
|
||||
|
||||
if (rrc->configuration.mcc[0] == f1_setup_req->mcc[i] &&
|
||||
rrc->configuration.mnc[0] == f1_setup_req->mnc[i] &&
|
||||
rrc->nr_cellid == f1_setup_req->nr_cellid[i]) {
|
||||
if (rrc->configuration.mcc[0] == f1_setup_req->cell[i].mcc &&
|
||||
rrc->configuration.mnc[0] == f1_setup_req->cell[i].mnc &&
|
||||
rrc->nr_cellid == f1_setup_req->cell[i].nr_cellid) {
|
||||
// check that CU rrc instance corresponds to mcc/mnc/cgi (normally cgi should be enough, but just in case)
|
||||
rrc->carrier.MIB = malloc(f1_setup_req->mib_length[i]);
|
||||
rrc->carrier.sizeof_MIB = f1_setup_req->mib_length[i];
|
||||
@@ -2789,7 +2786,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
AssertFatal(bcch_message->message.choice.c1->present == NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1,
|
||||
"bcch_message->message.choice.c1->present != NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1\n");
|
||||
rrc->carrier.sib1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
|
||||
rrc->carrier.physCellId = f1_setup_req->nr_pci[i];
|
||||
rrc->carrier.physCellId = f1_setup_req->cell[i].nr_pci;
|
||||
if (cu_cell_ind == 0) {
|
||||
// prepare F1_SETUP_RESPONSE + GNB_CU_CONFIGURATION_UPDATE
|
||||
if (msg_p == NULL) {
|
||||
@@ -2809,7 +2806,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mnc = rrc->configuration.mnc[0];
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mnc_digit_length = rrc->configuration.mnc_digit_length[0];
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].nr_cellid = rrc->nr_cellid;
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->nr_pci[i];
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->cell[i].nr_pci;
|
||||
int num_SI= 0;
|
||||
|
||||
if (rrc->carrier.SIB23) {
|
||||
@@ -2826,9 +2823,9 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
break;
|
||||
} else {// setup_req mcc/mnc match rrc internal list element
|
||||
LOG_W(NR_RRC,"[Inst %d] No matching MCC/MNC: rrc->mcc/f1_setup_req->mcc %d/%d rrc->mnc/f1_setup_req->mnc %d/%d rrc->nr_cellid/f1_setup_req->nr_cellid %ld/%ld \n",
|
||||
j, rrc->configuration.mcc[0], f1_setup_req->mcc[i],
|
||||
rrc->configuration.mnc[0], f1_setup_req->mnc[i],
|
||||
rrc->nr_cellid, f1_setup_req->nr_cellid[i]);
|
||||
j, rrc->configuration.mcc[0], f1_setup_req->cell[i].mcc,
|
||||
rrc->configuration.mnc[0], f1_setup_req->cell[i].mnc,
|
||||
rrc->nr_cellid, f1_setup_req->cell[i].nr_cellid);
|
||||
}
|
||||
}// for (int j=0;j<RC.nb_inst;j++)
|
||||
|
||||
@@ -3060,7 +3057,6 @@ int get_dl_mimo_layers(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
|
||||
}
|
||||
void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
MessageDef *msg;
|
||||
int id;
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
FILE *fd=NULL;//fopen("nrRRCstats.log","w");
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) {
|
||||
|
||||
@@ -307,10 +307,7 @@ nr_rrc_pdcp_config_security(
|
||||
uint8_t *kRRCint = NULL;
|
||||
uint8_t *kUPenc = NULL;
|
||||
uint8_t *k_kdf = NULL;
|
||||
pdcp_t *pdcp_p = NULL;
|
||||
static int print_keys= 1;
|
||||
hashtable_rc_t h_rc;
|
||||
hash_key_t key;
|
||||
|
||||
#ifndef PHYSIM
|
||||
/* Derive the keys from kgnb */
|
||||
|
||||
Reference in New Issue
Block a user