Commit 6ce958f7 authored by Laurent THOMAS's avatar Laurent THOMAS

Coarse grain cleanup: a lot of errors fixed

parent 305a2681
...@@ -102,12 +102,8 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb) { ...@@ -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_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
NR_gNB_COMMON *common_vars = &gNB->common_vars; NR_gNB_COMMON *common_vars = &gNB->common_vars;
PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements; 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; uint32_t *rb_mask = gNB->rb_mask_ul;
int rb, offset, offset0, nb_rb, len; int rb, offset, offset0, nb_rb, len;
uint32_t n0_subband_power_temp = 0;
int32_t *ul_ch; int32_t *ul_ch;
int32_t n0_power_tot; int32_t n0_power_tot;
int64_t n0_power_tot2; int64_t n0_power_tot2;
......
...@@ -71,6 +71,29 @@ typedef struct f1ap_cu_setup_req_s { ...@@ -71,6 +71,29 @@ typedef struct f1ap_cu_setup_req_s {
// //
} f1ap_cu_setup_req_t; } 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 { typedef struct f1ap_setup_req_s {
// Midhaul networking parameters // Midhaul networking parameters
...@@ -100,26 +123,7 @@ typedef struct f1ap_setup_req_s { ...@@ -100,26 +123,7 @@ typedef struct f1ap_setup_req_s {
/// number of DU cells available /// number of DU cells available
uint16_t num_cells_available; //0< num_cells_available <= 512; uint16_t num_cells_available; //0< num_cells_available <= 512;
cellIDs_t cell[F1AP_MAX_NB_CELLS];
// 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];
// fdd_flag = 1 means FDD, 0 means TDD // fdd_flag = 1 means FDD, 0 means TDD
int fdd_flag; int fdd_flag;
......
...@@ -1930,20 +1930,20 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) { ...@@ -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); 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)); 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); 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; 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).tac[k]); LOG_I(ENB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].tac);
F1AP_SETUP_REQ (msg_p).mcc[k] = *PLMNParamList.paramarray[0][ENB_MOBILE_COUNTRY_CODE_IDX].uptr; 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).mcc[k]); LOG_I(ENB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mcc);
F1AP_SETUP_REQ (msg_p).mnc[k] = *PLMNParamList.paramarray[0][ENB_MOBILE_NETWORK_CODE_IDX].uptr; 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).mnc[k]); LOG_I(ENB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc);
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] = *PLMNParamList.paramarray[0][ENB_MNC_DIGIT_LENGTH].u8ptr; 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).mnc_digit_length[k]); 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).mnc_digit_length[k] == 2) || AssertFatal((F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 2) ||
(F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 3), (F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 3),
"BAD MNC DIGIT LENGTH %d", "BAD MNC DIGIT LENGTH %d",
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]); F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
F1AP_SETUP_REQ (msg_p).nr_cellid[k] = (uint64_t)*(ENBParamList.paramarray[i][ENB_NRCELLID_IDX].u64ptr); 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).nr_cellid[k]); 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,"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)); 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; 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) { ...@@ -1974,12 +1974,12 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
pthread_mutex_unlock(&rrc->cell_info_mutex); pthread_mutex_unlock(&rrc->cell_info_mutex);
} while (cell_info_configured ==0); } while (cell_info_configured ==0);
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).mcc[k]; rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mcc;
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).mnc[k]; rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mnc;
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).tac[k]; rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).cell[k].tac;
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).nr_cellid[k]; rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid;
F1AP_SETUP_REQ (msg_p).nr_pci[k] = rrc->carrier[0].physCellId; F1AP_SETUP_REQ (msg_p).cell[k].nr_pci = rrc->carrier[0].physCellId;
F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0; F1AP_SETUP_REQ (msg_p).cell[k].num_ssi = 0;
if (rrc->carrier[0].sib1->tdd_Config) { if (rrc->carrier[0].sib1->tdd_Config) {
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k); LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
......
...@@ -36,15 +36,15 @@ ...@@ -36,15 +36,15 @@
int asn_debug = 0; int asn_debug = 0;
int asn1_xer_print = 0; int asn1_xer_print = 0;
inline void ASN_DEBUG(const char *fmt, ...) inline void ASN_DEBUG(const char *fmt, ...) {
{
if (asn_debug) { if (asn_debug) {
int adi = asn_debug_indent; int adi = asn_debug_indent;
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
fprintf(stderr, "[ASN1]"); fprintf(stderr, "[ASN1]");
while(adi--) fprintf(stderr, " "); while(adi--)
fprintf(stderr, " ");
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
...@@ -53,11 +53,10 @@ inline void ASN_DEBUG(const char *fmt, ...) ...@@ -53,11 +53,10 @@ inline void ASN_DEBUG(const char *fmt, ...)
} }
#endif #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]; 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] =
(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]); //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]; return transaction_identifier[enb_mod_idP+cu_mod_idP];
} }
...@@ -75,6 +74,7 @@ int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst, ...@@ -75,6 +74,7 @@ int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
return i; return i;
} }
} }
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == 0 ) { if (f1_inst->f1ap_ue[i].rnti == 0 ) {
f1_inst->f1ap_ue[i].rnti = rntiP; f1_inst->f1ap_ue[i].rnti = rntiP;
...@@ -87,6 +87,7 @@ int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst, ...@@ -87,6 +87,7 @@ int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
return i; return i;
} }
} }
return -1; return -1;
} }
...@@ -99,27 +100,30 @@ int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst, ...@@ -99,27 +100,30 @@ int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
break; break;
} }
} }
f1_inst->num_ues--; f1_inst->num_ues--;
return 0; return 0;
} }
int f1ap_get_du_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst, 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++) { for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) { if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].du_ue_f1ap_id; return f1_inst->f1ap_ue[i].du_ue_f1ap_id;
} }
} }
return -1; return -1;
} }
int f1ap_get_cu_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst, 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++) { for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) { if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].cu_ue_f1ap_id; return f1_inst->f1ap_ue[i].cu_ue_f1ap_id;
} }
} }
return -1; return -1;
} }
...@@ -130,6 +134,7 @@ int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst, ...@@ -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 f1_inst->f1ap_ue[i].rnti;
} }
} }
return -1; return -1;
} }
...@@ -140,6 +145,7 @@ int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst, ...@@ -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 f1_inst->f1ap_ue[i].rnti;
} }
} }
return -1; return -1;
} }
...@@ -150,6 +156,7 @@ int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst, ...@@ -150,6 +156,7 @@ int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
return i; return i;
} }
} }
return -1; return -1;
} }
...@@ -160,6 +167,7 @@ int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst, ...@@ -160,6 +167,7 @@ int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
return i; return i;
} }
} }
return -1; return -1;
} }
...@@ -170,6 +178,7 @@ int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst, ...@@ -170,6 +178,7 @@ int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
return i; return i;
} }
} }
return -1; return -1;
} }
...@@ -177,7 +186,10 @@ int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst, ...@@ -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 du_ue_f1ap_id,
module_id_t cu_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); 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; 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); 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; return 0;
...@@ -187,7 +199,10 @@ int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst, ...@@ -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 cu_ue_f1ap_id,
module_id_t du_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); 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; 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); 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; return 0;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
*/ */
#if HAVE_CONFIG_H_ #if HAVE_CONFIG_H_
# include "config.h" #include "config.h"
#endif #endif
#ifndef F1AP_COMMON_H_ #ifndef F1AP_COMMON_H_
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3 #define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
#if defined(EMIT_ASN_DEBUG_EXTERN) #if defined(EMIT_ASN_DEBUG_EXTERN)
inline void ASN_DEBUG(const char *fmt, ...); inline void ASN_DEBUG(const char *fmt, ...);
#endif #endif
#include "F1AP_RAT-FrequencyPriorityInformation.h" #include "F1AP_RAT-FrequencyPriorityInformation.h"
...@@ -360,14 +360,14 @@ inline void ASN_DEBUG(const char *fmt, ...); ...@@ -360,14 +360,14 @@ inline void ASN_DEBUG(const char *fmt, ...);
/* Checking version of ASN1C compiler */ /* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION) #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 #endif
#ifndef FALSE #ifndef FALSE
# define FALSE (0) #define FALSE (0)
#endif #endif
#ifndef TRUE #ifndef TRUE
# define TRUE (!FALSE) #define TRUE (!FALSE)
#endif #endif
#define F1AP_UE_ID_FMT "0x%06"PRIX32 #define F1AP_UE_ID_FMT "0x%06"PRIX32
...@@ -375,20 +375,20 @@ inline void ASN_DEBUG(const char *fmt, ...); ...@@ -375,20 +375,20 @@ inline void ASN_DEBUG(const char *fmt, ...);
#include "assertions.h" #include "assertions.h"
#if defined(ENB_MODE) #if defined(ENB_MODE)
# include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
# include "f1ap_default_values.h" #include "f1ap_default_values.h"
# define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args) #define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
# define F1AP_WARN(x, args...) LOG_W(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_TRAF(x, args...) LOG_I(F1AP, x, ##args)
# define F1AP_INFO(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) #define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
#else #else
//# include "mme_default_values.h" //# include "mme_default_values.h"
# define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0) #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_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_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_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) #define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
#endif #endif
//Forward declaration //Forward declaration
...@@ -476,4 +476,17 @@ int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst, ...@@ -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 cu_ue_f1ap_id,
module_id_t du_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_ */ #endif /* F1AP_COMMON_H_ */
...@@ -72,39 +72,39 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance); ...@@ -72,39 +72,39 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance);
* gNB-DU Configuration Update * gNB-DU Configuration Update
*/ */
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, 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, int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge); F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
/* /*
* gNB-CU Configuration Update * 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_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, int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
/* /*
* gNB-DU Resource Coordination * gNB-DU Resource Coordination
*/ */
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance, 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_ */ #endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_ #define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance, 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);
......
...@@ -49,28 +49,27 @@ void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_associati ...@@ -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) { 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); DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) { 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", LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
sctp_new_association_resp->sctp_state, sctp_new_association_resp->sctp_state,
instance, instance,
sctp_new_association_resp->ulp_cnx_id); sctp_new_association_resp->ulp_cnx_id);
if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN) if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN)
proto_agent_stop(instance); 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 // go to an init func
f1ap_du_data_from_du = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t)); 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->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_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams; f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
/* setup parameters for F1U and start the server */ /* setup parameters for F1U and start the server */
const cudu_params_t params = { const cudu_params_t params = {
.local_ipv4_address = RC.nrrrc[instance]->eth_params_s.my_addr, .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 ...@@ -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) { void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
int result; int result;
DevAssert(sctp_data_ind != NULL); DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream, 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); result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); 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) { ...@@ -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 // 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 // 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port
// 3. creat an itti message to init // 3. creat an itti message to init
LOG_I(F1AP, "F1AP_CU_SCTP_REQ(create socket)\n"); LOG_I(F1AP, "F1AP_CU_SCTP_REQ(create socket)\n");
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
message_p = itti_alloc_new_message (TASK_CU_F1, 0, SCTP_INIT_MSG); 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.port = F1AP_PORT_NUMBER;
message_p->ittiMsg.sctp_init.ppid = F1AP_SCTP_PPID; message_p->ittiMsg.sctp_init.ppid = F1AP_SCTP_PPID;
message_p->ittiMsg.sctp_init.ipv4 = 1; message_p->ittiMsg.sctp_init.ipv4 = 1;
message_p->ittiMsg.sctp_init.ipv6 = 0; message_p->ittiMsg.sctp_init.ipv6 = 0;
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1; message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
if (RC.nrrrc[0]->node_type == ngran_gNB_CU) { 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); 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); 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. * SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* * * * Disable it for now. * * * * Disable it for now.
*/ */
message_p->ittiMsg.sctp_init.nb_ipv6_addr = 0; 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"; 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); itti_send_msg_to_task(TASK_SCTP, enb_id, message_p);
} }
void *F1AP_CU_task(void *arg) { void *F1AP_CU_task(void *arg) {
MessageDef *received_msg = NULL; MessageDef *received_msg = NULL;
int result; int result;
LOG_I(F1AP, "Starting F1AP at CU\n"); LOG_I(F1AP, "Starting F1AP at CU\n");
// no RLC in CU, initialize mem pool for PDCP // no RLC in CU, initialize mem pool for PDCP
pool_buffer_init(); pool_buffer_init();
itti_mark_task_ready(TASK_CU_F1); itti_mark_task_ready(TASK_CU_F1);
cu_task_send_sctp_init_req(0); cu_task_send_sctp_init_req(0);
while (1) { while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg); 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: case SCTP_NEW_ASSOCIATION_IND:
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_IND for instance %ld\n", LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_IND for instance %ld\n",
ITTI_MSG_DESTINATION_INSTANCE(received_msg)); ITTI_MSG_DESTINATION_INSTANCE(received_msg));
cu_task_handle_sctp_association_ind(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; break;
case SCTP_NEW_ASSOCIATION_RESP: case SCTP_NEW_ASSOCIATION_RESP:
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_RESP for instance %ld\n", LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_RESP for instance %ld\n",
ITTI_MSG_DESTINATION_INSTANCE(received_msg)); ITTI_MSG_DESTINATION_INSTANCE(received_msg));
cu_task_handle_sctp_association_resp(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; break;
case SCTP_DATA_IND: case SCTP_DATA_IND:
LOG_I(F1AP, "CU Task Received SCTP_DATA_IND for Instance %ld\n", LOG_I(F1AP, "CU Task Received SCTP_DATA_IND for Instance %ld\n",
ITTI_MSG_DESTINATION_INSTANCE(received_msg)); ITTI_MSG_DESTINATION_INSTANCE(received_msg));
cu_task_handle_sctp_data_ind(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; break;
case F1AP_SETUP_RESP: // from rrc case F1AP_SETUP_RESP: // from rrc
...@@ -169,7 +159,7 @@ void *F1AP_CU_task(void *arg) { ...@@ -169,7 +159,7 @@ void *F1AP_CU_task(void *arg) {
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg), // CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg)); // &F1AP_SETUP_RESP(received_msg));
CU_send_F1_SETUP_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_F1_SETUP_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_SETUP_RESP(received_msg)); &F1AP_SETUP_RESP(received_msg));
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc
...@@ -177,19 +167,19 @@ void *F1AP_CU_task(void *arg) { ...@@ -177,19 +167,19 @@ void *F1AP_CU_task(void *arg) {
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg), // CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg)); // &F1AP_SETUP_RESP(received_msg));
CU_send_gNB_CU_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(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; break;
case F1AP_DL_RRC_MESSAGE: // from rrc case F1AP_DL_RRC_MESSAGE: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n"); LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg), 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; break;
case F1AP_UE_CONTEXT_SETUP_REQ: // from rrc case F1AP_UE_CONTEXT_SETUP_REQ: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_SETUP_REQ\n"); LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_SETUP_REQ\n");
CU_send_UE_CONTEXT_SETUP_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg), 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; break;
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
...@@ -198,13 +188,13 @@ void *F1AP_CU_task(void *arg) { ...@@ -198,13 +188,13 @@ void *F1AP_CU_task(void *arg) {
&F1AP_UE_CONTEXT_RELEASE_CMD(received_msg)); &F1AP_UE_CONTEXT_RELEASE_CMD(received_msg));
break; break;
// case F1AP_SETUP_RESPONSE: // This is from RRC // case F1AP_SETUP_RESPONSE: // This is from RRC
// CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp) // CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
// break; // break;
// case F1AP_SETUP_FAILURE: // This is from RRC // case F1AP_SETUP_FAILURE: // This is from RRC
// CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure) // CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure)
// break; // break;
case TERMINATE_MESSAGE: case TERMINATE_MESSAGE:
LOG_W(F1AP, " *** Exiting F1AP thread\n"); LOG_W(F1AP, " *** Exiting F1AP thread\n");
...@@ -216,9 +206,9 @@ void *F1AP_CU_task(void *arg) { ...@@ -216,9 +206,9 @@ void *F1AP_CU_task(void *arg) {
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break; break;
} // switch } // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg); result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL; received_msg = NULL;
} // while } // while
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -54,9 +54,9 @@ int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance, ...@@ -54,9 +54,9 @@ int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
* UE Context Release Request (gNB-DU initiated) * UE Context Release Request (gNB-DU initiated)
*/ */
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
/* /*
* UE Context Release (gNB-CU initiated) * UE Context Release (gNB-CU initiated)
...@@ -65,32 +65,32 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, ...@@ -65,32 +65,32 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
f1ap_ue_context_release_cmd_t *cmd); f1ap_ue_context_release_cmd_t *cmd);
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
/* /*
* UE Context Modification (gNB-CU initiated) * UE Context Modification (gNB-CU initiated)
*/ */
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance); int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance, int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
/* /*
* UE Context Modification Required (gNB-DU initiated) * UE Context Modification Required (gNB-DU initiated)
*/ */
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t); F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
/* /*
* UE Inactivity Notification * UE Inactivity Notification
......
...@@ -35,15 +35,13 @@ ...@@ -35,15 +35,13 @@
int asn1_decoder_xer_print = 0; 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; //MessageDef *message_p;
//MessagesIds message_id; //MessagesIds message_id;
//asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} }; //asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage->procedureCode) { switch(pdu->choice.initiatingMessage->procedureCode) {
case F1AP_ProcedureCode_id_F1Setup: case F1AP_ProcedureCode_id_F1Setup:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); //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__); 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) ...@@ -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); //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__); LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_ULRRCMessageTransfer\n", __func__);
break; break;
case F1AP_ProcedureCode_id_UEContextRelease: case F1AP_ProcedureCode_id_UEContextRelease:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__); LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__);
break; break;
case F1AP_ProcedureCode_id_UEContextReleaseRequest: case F1AP_ProcedureCode_id_UEContextReleaseRequest:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextReleaseRequest\n", __func__); LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextReleaseRequest\n", __func__);
break; break;
case F1AP_ProcedureCode_id_UEContextSetup: case F1AP_ProcedureCode_id_UEContextSetup:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__); LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
break; break;
// case F1AP_ProcedureCode_id_InitialContextSetup: // case F1AP_ProcedureCode_id_InitialContextSetup:
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); // res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
// message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG; // message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
...@@ -92,7 +94,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) ...@@ -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", // F1AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
// (int)pdu->choice.initiatingMessage->procedureCode); // (int)pdu->choice.initiatingMessage->procedureCode);
LOG_E(F1AP, "Unknown procedure ID (%d) for initiating message\n", 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", AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode); (int)pdu->choice.initiatingMessage->procedureCode);
return -1; return -1;
...@@ -101,8 +103,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) ...@@ -101,8 +103,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
return 0; 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); DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome->procedureCode) { switch(pdu->choice.successfulOutcome->procedureCode) {
...@@ -120,39 +121,35 @@ static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) ...@@ -120,39 +121,35 @@ static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu)
default: default:
LOG_E(F1AP,"Unknown procedure ID (%d) for successfull outcome message\n", 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 -1;
} }
return 0; 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); DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome->procedureCode) { switch(pdu->choice.unsuccessfulOutcome->procedureCode) {
case F1AP_ProcedureCode_id_F1Setup: case F1AP_ProcedureCode_id_F1Setup:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__); LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
break; break;
default: default:
// F1AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n", // F1AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
// (int)pdu->choice.unsuccessfulOutcome->procedureCode); // (int)pdu->choice.unsuccessfulOutcome->procedureCode);
LOG_E(F1AP, "Unknown procedure ID (%d) for unsuccessfull outcome message\n", 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 -1;
} }
return 0; 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; asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL); DevAssert(buffer != NULL);
dec_ret = aper_decode(NULL, dec_ret = aper_decode(NULL,
&asn_DEF_F1AP_F1AP_PDU, &asn_DEF_F1AP_F1AP_PDU,
(void **)&pdu, (void **)&pdu,
...@@ -166,6 +163,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t ...@@ -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); xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n"); LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
} }
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code); //LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
if (dec_ret.code != RC_OK) { 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 ...@@ -188,6 +186,5 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
break; break;
} }
return -1; return -1;
} }
...@@ -76,43 +76,43 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, ...@@ -76,43 +76,43 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
* gNB-DU Configuration Update * gNB-DU Configuration Update
*/ */
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
instance_t du_mod_idP, instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data); f1ap_setup_req_t *f1ap_du_data);
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
/* /*
* gNB-CU Configuration Update * gNB-CU Configuration Update
*/ */
int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, 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, 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 * gNB-DU Resource Coordination
*/ */
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, 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, int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */ #endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
...@@ -45,12 +45,12 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_messa ...@@ -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_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 DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
int CC_idP, int CC_idP,
int UE_id, int UE_id,
rnti_t rntiP, rnti_t rntiP,
const uint8_t *sduP, const uint8_t *sduP,
sdu_size_t sdu_lenP, sdu_size_t sdu_lenP,
const int8_t *sdu2P, const char *sdu2P,
sdu_size_t sdu2_lenP); sdu_size_t sdu2_lenP);
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */ #endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
...@@ -44,63 +44,50 @@ f1ap_setup_req_t *f1ap_du_data; ...@@ -44,63 +44,50 @@ f1ap_setup_req_t *f1ap_du_data;
f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB]; 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) { void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
DevAssert(f1ap_setup_req != NULL); DevAssert(f1ap_setup_req != NULL);
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL; sctp_new_association_req_t *sctp_new_association_req_p = NULL;
message_p = itti_alloc_new_message(TASK_DU_F1, 0, SCTP_NEW_ASSOCIATION_REQ); 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 = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->ulp_cnx_id = instance; sctp_new_association_req_p->ulp_cnx_id = instance;
sctp_new_association_req_p->port = F1AP_PORT_NUMBER; sctp_new_association_req_p->port = F1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = F1AP_SCTP_PPID; sctp_new_association_req_p->ppid = F1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = f1ap_setup_req->sctp_in_streams; 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; sctp_new_association_req_p->out_streams = f1ap_setup_req->sctp_out_streams;
// remote // remote
memcpy(&sctp_new_association_req_p->remote_address, memcpy(&sctp_new_association_req_p->remote_address,
&f1ap_setup_req->CU_f1_ip_address, &f1ap_setup_req->CU_f1_ip_address,
sizeof(f1ap_setup_req->CU_f1_ip_address)); sizeof(f1ap_setup_req->CU_f1_ip_address));
// local // local
memcpy(&sctp_new_association_req_p->local_address, memcpy(&sctp_new_association_req_p->local_address,
&f1ap_setup_req->DU_f1_ip_address, &f1ap_setup_req->DU_f1_ip_address,
sizeof(f1ap_setup_req->DU_f1_ip_address)); sizeof(f1ap_setup_req->DU_f1_ip_address));
// store data // store data
f1ap_du_data = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t)); f1ap_du_data = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
*f1ap_du_data = *f1ap_setup_req; *f1ap_du_data = *f1ap_setup_req;
//printf("sib itti message %s\n", f1ap_setup_req_t->sib1[0]); //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]); //printf("nr_cellid : %llx (%lld)",f1ap_setup_req->nr_cellid[0],f1ap_setup_req->nr_cellid[0]);
//du_f1ap_register_to_sctp //du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p); 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) { 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); DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) { 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", LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
sctp_new_association_resp->sctp_state, sctp_new_association_resp->sctp_state,
instance, instance,
sctp_new_association_resp->ulp_cnx_id); sctp_new_association_resp->ulp_cnx_id);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN); return; // exit -1 for debugging
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->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams; 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->sctp_out_streams = sctp_new_association_resp->out_streams;
f1ap_du_data->default_sctp_stream_id = 0; f1ap_du_data->default_sctp_stream_id = 0;
/* setup parameters for F1U and start the server */ /* setup parameters for F1U and start the server */
const cudu_params_t params = { const cudu_params_t params = {
.local_ipv4_address = RC.nrmac[instance]->eth_params_n.my_addr, .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 ...@@ -110,34 +97,25 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
}; };
AssertFatal(proto_agent_start(instance, &params) == 0, AssertFatal(proto_agent_start(instance, &params) == 0,
"could not start PROTO_AGENT for F1U on instance %ld!\n", instance); "could not start PROTO_AGENT for F1U on instance %ld!\n", instance);
DU_send_F1_SETUP_REQUEST(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; int result;
DevAssert(sctp_data_ind != NULL); DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream, 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); result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} }
void *F1AP_DU_task(void *arg) { void *F1AP_DU_task(void *arg) {
//sctp_cu_init(); //sctp_cu_init();
MessageDef *received_msg = NULL; MessageDef *received_msg = NULL;
int result; int result;
LOG_I(F1AP, "Starting F1AP at DU\n"); LOG_I(F1AP, "Starting F1AP at DU\n");
//f1ap_eNB_prepare_internal_data(); //f1ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_DU_F1); itti_mark_task_ready(TASK_DU_F1);
// SCTP // SCTP
...@@ -145,58 +123,58 @@ void *F1AP_DU_task(void *arg) { ...@@ -145,58 +123,58 @@ void *F1AP_DU_task(void *arg) {
itti_receive_msg(TASK_DU_F1, &received_msg); itti_receive_msg(TASK_DU_F1, &received_msg);
switch (ITTI_MSG_ID(received_msg)) { switch (ITTI_MSG_ID(received_msg)) {
// case TERMINATE_MESSAGE: // case TERMINATE_MESSAGE:
// //F1AP_WARN(" *** Exiting F1AP DU thread\n"); // //F1AP_WARN(" *** Exiting F1AP DU thread\n");
// itti_exit_task(); // itti_exit_task();
// break; // break;
case F1AP_SETUP_REQ: // this is not a true F1 message, but rather an ITTI message sent by enb_app 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. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req // 2. send a sctp_association req
LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n"); LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n");
du_task_send_sctp_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg), du_task_send_sctp_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_SETUP_REQ(received_msg)); &F1AP_SETUP_REQ(received_msg));
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE: case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg), DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg)); &F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE: case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg), DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg)); &F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg));
break; break;
case SCTP_NEW_ASSOCIATION_RESP: case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon // 1. store the respon
// 2. send the f1setup_req // 2. send the f1setup_req
LOG_I(F1AP, "DU Task Received SCTP_NEW_ASSOCIATION_RESP\n"); LOG_I(F1AP, "DU Task Received SCTP_NEW_ASSOCIATION_RESP\n");
du_task_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg), 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; break;
case SCTP_DATA_IND: case SCTP_DATA_IND:
// ex: any F1 incoming message for DU ends here // ex: any F1 incoming message for DU ends here
LOG_I(F1AP, "DU Task Received SCTP_DATA_IND\n"); LOG_I(F1AP, "DU Task Received SCTP_DATA_IND\n");
du_task_handle_sctp_data_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg), 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; break;
case F1AP_INITIAL_UL_RRC_MESSAGE: // to rrc case F1AP_INITIAL_UL_RRC_MESSAGE: // to rrc
LOG_I(F1AP, "DU Task Received F1AP_INITIAL_UL_RRC_MESSAGE\n"); 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); 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, DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(0,0,0,msg->crnti,
msg->rrc_container, msg->rrc_container,
msg->rrc_container_length, msg->rrc_container_length,
(char*)msg->du2cu_rrc_container, msg->du2cu_rrc_container,
msg->du2cu_rrc_container_length msg->du2cu_rrc_container_length
); );
break; 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"); LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
if (RC.nrrrc[0]->node_type == ngran_gNB_DU) { if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg), DU_send_UL_NR_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_UL_RRC_MESSAGE(received_msg)); &F1AP_UL_RRC_MESSAGE(received_msg));
...@@ -204,6 +182,7 @@ void *F1AP_DU_task(void *arg) { ...@@ -204,6 +182,7 @@ void *F1AP_DU_task(void *arg) {
DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg), DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_UL_RRC_MESSAGE(received_msg)); &F1AP_UL_RRC_MESSAGE(received_msg));
} }
break; break;
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
...@@ -222,9 +201,9 @@ void *F1AP_DU_task(void *arg) { ...@@ -222,9 +201,9 @@ void *F1AP_DU_task(void *arg) {
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break; break;
} // switch } // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg); result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL; received_msg = NULL;
} // while } // while
......
...@@ -55,9 +55,9 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, ...@@ -55,9 +55,9 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
* UE Context Release Command (gNB-CU initiated) * UE Context Release Command (gNB-CU initiated)
*/ */
int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
/* /*
* UE Context Release Complete (gNB-DU initiated) * UE Context Release Complete (gNB-DU initiated)
...@@ -70,9 +70,9 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, ...@@ -70,9 +70,9 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
* UE Context Modification (gNB-CU initiated) * UE Context Modification (gNB-CU initiated)
*/ */
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance); int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance);
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(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); ...@@ -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_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance);
int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
/* /*
* UE Inactivity Notification * UE Inactivity Notification
......
...@@ -71,8 +71,7 @@ int f1ap_encode_ue_context_release_request( ...@@ -71,8 +71,7 @@ int f1ap_encode_ue_context_release_request(
uint32_t *length); 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; ssize_t encoded;
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
DevAssert(buffer != NULL); DevAssert(buffer != NULL);
...@@ -92,7 +91,6 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) ...@@ -92,7 +91,6 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
} }
*length = encoded; *length = encoded;
return encoded; return encoded;
} }
......
...@@ -44,7 +44,7 @@ extern f1ap_setup_req_t *f1ap_du_data_from_du; ...@@ -44,7 +44,7 @@ extern f1ap_setup_req_t *f1ap_du_data_from_du;
/* Handlers matrix. Only f1 related procedure present here */ /* Handlers matrix. Only f1 related procedure present here */
f1ap_message_decoded_callback f1ap_messages_callback[][3] = { f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* Reset */ { 0, 0, 0 }, /* Reset */
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */ { 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] = { ...@@ -73,25 +73,21 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
}; };
const char *f1ap_direction2String(int f1ap_dir) { const char *f1ap_direction2String(int f1ap_dir) {
static const char *f1ap_direction_String[] = { static const char *f1ap_direction_String[] = {
"", /* Nothing */ "", /* Nothing */
"Initiating message", /* initiating message */ "Initiating message", /* initiating message */
"Successfull outcome", /* successfull outcome */ "Successfull outcome", /* successfull outcome */
"UnSuccessfull outcome", /* successfull outcome */ "UnSuccessfull outcome", /* successfull outcome */
}; };
return(f1ap_direction_String[f1ap_dir]); return(f1ap_direction_String[f1ap_dir]);
} }
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, 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) {
{ F1AP_F1AP_PDU_t pdu= {0};
F1AP_F1AP_PDU_t pdu;
int ret; int ret;
DevAssert(data != NULL); DevAssert(data != NULL);
memset(&pdu, 0, sizeof(pdu));
if (f1ap_decode_pdu(&pdu, data, data_length) < 0) { if (f1ap_decode_pdu(&pdu, data, data_length) < 0) {
LOG_E(F1AP, "Failed to decode PDU\n"); LOG_E(F1AP, "Failed to decode PDU\n");
return -1; return -1;
...@@ -102,7 +98,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, ...@@ -102,7 +98,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
f1ap_message_decoded_callback)) f1ap_message_decoded_callback))
|| (pdu.present > F1AP_F1AP_PDU_PR_unsuccessfulOutcome)) { || (pdu.present > F1AP_F1AP_PDU_PR_unsuccessfulOutcome)) {
LOG_E(F1AP, "[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n", 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); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return -1; return -1;
} }
...@@ -112,8 +108,8 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, ...@@ -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) { 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", LOG_E(F1AP, "[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id, pdu.choice.initiatingMessage->procedureCode, assoc_id, pdu.choice.initiatingMessage->procedureCode,
f1ap_direction2String(pdu.present - 1)); f1ap_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return -1; return -1;
} }
......
...@@ -34,6 +34,6 @@ ...@@ -34,6 +34,6 @@
#define F1AP_HANDLERS_H_ #define F1AP_HANDLERS_H_
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, 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_ */ #endif /* F1AP_HANDLERS_H_ */
...@@ -23,51 +23,38 @@ ...@@ -23,51 +23,38 @@
#include "f1ap_itti_messaging.h" #include "f1ap_itti_messaging.h"
void cu_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, 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; MessageDef *message_p;
sctp_data_req_t *sctp_data_req; sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_CU_F1, 0, 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 = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id; sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer; sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length; sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream; sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_SCTP, instance, message_p); itti_send_msg_to_task(TASK_SCTP, instance, message_p);
} }
void du_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, 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; MessageDef *message_p;
sctp_data_req_t *sctp_data_req; sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_DU_F1, 0, 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 = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id; sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer; sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length; sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream; sctp_data_req->stream = stream;
LOG_I(F1AP, "Sending ITTI message to SCTP Task\n"); LOG_I(F1AP, "Sending ITTI message to SCTP Task\n");
itti_send_msg_to_task(TASK_SCTP, instance, message_p); 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; MessageDef *message_p = NULL;
sctp_close_association_t *sctp_close_association_p = NULL; sctp_close_association_t *sctp_close_association_p = NULL;
message_p = itti_alloc_new_message(TASK_S1AP, 0, SCTP_CLOSE_ASSOCIATION); 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 = &message_p->ittiMsg.sctp_close_association;
sctp_close_association_p->assoc_id = assoc_id; sctp_close_association_p->assoc_id = assoc_id;
itti_send_msg_to_task(TASK_SCTP, instance, message_p); itti_send_msg_to_task(TASK_SCTP, instance, message_p);
} }
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#define F1AP_ITTI_MESSAGING_H_ #define F1AP_ITTI_MESSAGING_H_
void cu_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, 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, 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, void f1ap_eNB_itti_send_sctp_close_association(instance_t instance,
int32_t assoc_id); int32_t assoc_id);
......
/*
* 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 @@ ...@@ -35,10 +35,10 @@
#define F1AP_MESSAGING_H_ #define F1AP_MESSAGING_H_
void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, 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, void f1ap_send_sctp_close_association(instance_t instance,
int32_t assoc_id); int32_t assoc_id);
#endif /* F1AP_MESSAGING_H_ */ #endif /* F1AP_MESSAGING_H_ */
...@@ -1666,20 +1666,20 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) { ...@@ -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); 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)); 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); 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; 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).tac[k]); LOG_I(GNB_APP,"F1AP: tac[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].tac);
F1AP_SETUP_REQ (msg_p).mcc[k] = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr; 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).mcc[k]); LOG_I(GNB_APP,"F1AP: mcc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mcc);
F1AP_SETUP_REQ (msg_p).mnc[k] = *PLMNParamList.paramarray[0][GNB_MOBILE_NETWORK_CODE_IDX].uptr; 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).mnc[k]); LOG_I(GNB_APP,"F1AP: mnc[%d] %d\n",k,F1AP_SETUP_REQ (msg_p).cell[k].mnc);
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] = *PLMNParamList.paramarray[0][GNB_MNC_DIGIT_LENGTH].u8ptr; 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).mnc_digit_length[k]); 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).mnc_digit_length[k] == 2) || AssertFatal((F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 2) ||
(F1AP_SETUP_REQ (msg_p).mnc_digit_length[k] == 3), (F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length == 3),
"BAD MNC DIGIT LENGTH %d", "BAD MNC DIGIT LENGTH %d",
F1AP_SETUP_REQ (msg_p).mnc_digit_length[k]); F1AP_SETUP_REQ (msg_p).cell[k].mnc_digit_length);
F1AP_SETUP_REQ (msg_p).nr_cellid[k] = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr); 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).nr_cellid[k]); 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,"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)); 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; 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) { ...@@ -1709,12 +1709,12 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
pthread_mutex_unlock(&rrc->cell_info_mutex); pthread_mutex_unlock(&rrc->cell_info_mutex);
} while (cell_info_configured == 0); } while (cell_info_configured == 0);
rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).mcc[k]; rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mcc;
rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).mnc[k]; rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mnc;
rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).tac[k]; rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).cell[k].tac;
rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).nr_cellid[k]; rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid;
F1AP_SETUP_REQ (msg_p).nr_pci[k] = *rrc->configuration.scc->physCellId; F1AP_SETUP_REQ (msg_p).cell[k].nr_pci = *rrc->configuration.scc->physCellId;
F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0; F1AP_SETUP_REQ (msg_p).cell[k].num_ssi = 0;
if (rrc->configuration.scc->tdd_UL_DL_ConfigurationCommon) { if (rrc->configuration.scc->tdd_UL_DL_ConfigurationCommon) {
LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k); LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
......
...@@ -544,6 +544,7 @@ extern notifiedFIFO_t pdcp_sdu_list; ...@@ -544,6 +544,7 @@ extern notifiedFIFO_t pdcp_sdu_list;
(((hash_key_t)(0x0000000000000001)) << 63)) (((hash_key_t)(0x0000000000000001)) << 63))
extern hash_table_t *pdcp_coll_p; extern hash_table_t *pdcp_coll_p;
void init_pdcp(void);
#endif #endif
/*@}*/ /*@}*/
...@@ -8518,9 +8518,9 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -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++) { for (int j=0; j<RC.nb_inst; j++) {
eNB_RRC_INST *rrc = RC.rrc[j]; eNB_RRC_INST *rrc = RC.rrc[j];
if (rrc->configuration.mcc[0] == f1_setup_req->mcc[i] && if (rrc->configuration.mcc[0] == f1_setup_req->cell[i].mcc &&
rrc->configuration.mnc[0] == f1_setup_req->mnc[i] && rrc->configuration.mnc[0] == f1_setup_req->cell[i].mnc &&
rrc->nr_cellid == f1_setup_req->nr_cellid[i]) { 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) // 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].MIB = malloc(f1_setup_req->mib_length[i]);
rrc->carrier[0].sizeof_MIB = 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) { ...@@ -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, 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"); "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].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 // prepare F1_SETUP_RESPONSE
if (msg_p == NULL) { if (msg_p == NULL) {
...@@ -8572,7 +8572,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -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 = 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].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].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; int num_SI= 0;
if (rrc->carrier[0].SIB23) { if (rrc->carrier[0].SIB23) {
...@@ -8594,7 +8594,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -8594,7 +8594,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
break; break;
} else {// setup_req mcc/mnc match rrc internal list element } 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", 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++) }// for (int j=0;j<RC.nb_inst;j++)
......
...@@ -431,7 +431,6 @@ rrc_gNB_generate_RRCSetup( ...@@ -431,7 +431,6 @@ rrc_gNB_generate_RRCSetup(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_I(NR_RRC, "rrc_gNB_generate_RRCSetup \n"); LOG_I(NR_RRC, "rrc_gNB_generate_RRCSetup \n");
NR_SRB_ToAddModList_t **SRB_configList = NULL;
MessageDef *message_p; MessageDef *message_p;
// T(T_GNB_RRC_SETUP, // T(T_GNB_RRC_SETUP,
...@@ -551,7 +550,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( ...@@ -551,7 +550,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_I(NR_RRC, "generate RRCSetup for RRCReestablishmentRequest \n"); 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; rrc_gNB_ue_context_t *ue_context_pP = NULL;
gNB_RRC_INST *rrc_instance_p = RC.nrrrc[ctxt_pP->module_id]; gNB_RRC_INST *rrc_instance_p = RC.nrrrc[ctxt_pP->module_id];
NR_ServingCellConfigCommon_t *scc=rrc_instance_p->carrier.servingcellconfigcommon; NR_ServingCellConfigCommon_t *scc=rrc_instance_p->carrier.servingcellconfigcommon;
...@@ -559,7 +557,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( ...@@ -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); 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; 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, ue_p->Srb0.Tx_buffer.payload_size = do_RRCSetup(ue_context_pP,
(uint8_t *) ue_p->Srb0.Tx_buffer.Payload, (uint8_t *) ue_p->Srb0.Tx_buffer.Payload,
rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id), 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) { ...@@ -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++) { for (int j=0; j<RC.nb_nr_inst; j++) {
gNB_RRC_INST *rrc = RC.nrrrc[j]; gNB_RRC_INST *rrc = RC.nrrrc[j];
if (rrc->configuration.mcc[0] == f1_setup_req->mcc[i] && if (rrc->configuration.mcc[0] == f1_setup_req->cell[i].mcc &&
rrc->configuration.mnc[0] == f1_setup_req->mnc[i] && rrc->configuration.mnc[0] == f1_setup_req->cell[i].mnc &&
rrc->nr_cellid == f1_setup_req->nr_cellid[i]) { 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) // 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.MIB = malloc(f1_setup_req->mib_length[i]);
rrc->carrier.sizeof_MIB = 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) { ...@@ -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, 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"); "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.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) { if (cu_cell_ind == 0) {
// prepare F1_SETUP_RESPONSE + GNB_CU_CONFIGURATION_UPDATE // prepare F1_SETUP_RESPONSE + GNB_CU_CONFIGURATION_UPDATE
if (msg_p == NULL) { if (msg_p == NULL) {
...@@ -2809,7 +2806,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -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 = 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].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].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; int num_SI= 0;
if (rrc->carrier.SIB23) { if (rrc->carrier.SIB23) {
...@@ -2826,9 +2823,9 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) { ...@@ -2826,9 +2823,9 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
break; break;
} else {// setup_req mcc/mnc match rrc internal list element } 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", 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], j, rrc->configuration.mcc[0], f1_setup_req->cell[i].mcc,
rrc->configuration.mnc[0], f1_setup_req->mnc[i], rrc->configuration.mnc[0], f1_setup_req->cell[i].mnc,
rrc->nr_cellid, f1_setup_req->nr_cellid[i]); rrc->nr_cellid, f1_setup_req->cell[i].nr_cellid);
} }
}// for (int j=0;j<RC.nb_inst;j++) }// 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) { ...@@ -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) { void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
MessageDef *msg; MessageDef *msg;
int id;
rrc_gNB_ue_context_t *ue_context_p = NULL; rrc_gNB_ue_context_t *ue_context_p = NULL;
FILE *fd=NULL;//fopen("nrRRCstats.log","w"); 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)) { 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( ...@@ -307,10 +307,7 @@ nr_rrc_pdcp_config_security(
uint8_t *kRRCint = NULL; uint8_t *kRRCint = NULL;
uint8_t *kUPenc = NULL; uint8_t *kUPenc = NULL;
uint8_t *k_kdf = NULL; uint8_t *k_kdf = NULL;
pdcp_t *pdcp_p = NULL;
static int print_keys= 1; static int print_keys= 1;
hashtable_rc_t h_rc;
hash_key_t key;
#ifndef PHYSIM #ifndef PHYSIM
/* Derive the keys from kgnb */ /* Derive the keys from kgnb */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment