Commit 71191fb9 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'develop_integration_2019_w23' into 'develop'

Develop: integration 2019 week 23

See merge request oai/openairinterface5g!607
parents ebd40e8d b5aac45a
...@@ -63,3 +63,4 @@ v1.0.0 -> January 2019. This version first implements the architectural split de ...@@ -63,3 +63,4 @@ v1.0.0 -> January 2019. This version first implements the architectural split de
A lot of bugfixes and a proper automated Continuous Integration process validates contributions. A lot of bugfixes and a proper automated Continuous Integration process validates contributions.
v1.0.1 -> February 2019: Bug fix for the UE L1 simulator. v1.0.1 -> February 2019: Bug fix for the UE L1 simulator.
v1.0.2 -> February 2019: Full OAI support for 3.13.1 UHD v1.0.2 -> February 2019: Full OAI support for 3.13.1 UHD
v1.0.3 -> June 2019: Bug fix for LimeSuite v19.04.0 API
...@@ -1277,8 +1277,7 @@ function run_test_on_vm { ...@@ -1277,8 +1277,7 @@ function run_test_on_vm {
do do
for BW in ${BW_CASES[@]} for BW in ${BW_CASES[@]}
do do
# Not Running in TDD-10MHz and TDD-20MHz : too unstable # Not Running in TDD-20MHz : too unstable
#if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then continue; fi
if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi
if [[ $BW =~ .*05.* ]]; then PRB=25; fi if [[ $BW =~ .*05.* ]]; then PRB=25; fi
...@@ -1300,15 +1299,9 @@ function run_test_on_vm { ...@@ -1300,15 +1299,9 @@ function run_test_on_vm {
if [ $UE_SYNC -eq 0 ] if [ $UE_SYNC -eq 0 ]
then then
echo "Problem w/ eNB and UE not syncing" echo "Problem w/ eNB and UE not syncing"
terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0 full_terminate
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
full_basic_sim_destroy
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
STATUS=-1 STATUS=-1
return continue
fi fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1 get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1
...@@ -1739,14 +1732,8 @@ function run_test_on_vm { ...@@ -1739,14 +1732,8 @@ function run_test_on_vm {
terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2
scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
if [ $S1_NOS1_CFG -eq 1 ]
then
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
fi
full_l2_sim_destroy
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
STATUS=-1 STATUS=-1
return continue
fi fi
if [ $S1_NOS1_CFG -eq 1 ] if [ $S1_NOS1_CFG -eq 1 ]
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
int parse_stringlist(paramdef_t *cfgoptions, char *val) { int parse_stringlist(paramdef_t *cfgoptions, char *val) {
char *atoken; char *atoken;
char *tokctx; char *tokctx = NULL;
char *tmpval=strdup(val); char *tmpval=strdup(val);
int numelt=0; int numelt=0;
cfgoptions->numelt=0; cfgoptions->numelt=0;
...@@ -214,7 +214,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) ...@@ -214,7 +214,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
/* first check help options, either --help, -h or --help_<section> */ /* first check help options, either --help, -h or --help_<section> */
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) { if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
char *tokctx; char *tokctx = NULL;
pp=strtok_r(oneargv, "_",&tokctx); pp=strtok_r(oneargv, "_",&tokctx);
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED; config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
......
...@@ -36,11 +36,7 @@ The oai softmodem supports many use cases, and new ones are regularly added. Mos ...@@ -36,11 +36,7 @@ The oai softmodem supports many use cases, and new ones are regularly added. Mos
- all simulators, with exception of PHY simulators, which are distinct executables. - all simulators, with exception of PHY simulators, which are distinct executables.
Calling the `build_oai` script with the -h option gives the list of all available options, but a process to simplify and check the requirements of all these options is on-going. Check the Calling the `build_oai` script with the -h option gives the list of all available options, but a process to simplify and check the requirements of all these options is on-going. Check the [table](BUILD.md "# `build_oai` options") At the end of this page to know the status of `buid_oai` options which are not described hereafter.
[table]: BUILD.md "`build_oai` options"
At the end of this page to know the status of `buid_oai` options which are not described hereafter.
# Building PHY Simulators # Building PHY Simulators
...@@ -53,7 +49,7 @@ After downloading the source files, a single build command can be used to get th ...@@ -53,7 +49,7 @@ After downloading the source files, a single build command can be used to get th
``` ```
cd <your oai installation directory>/openairinterface5g/ cd <your oai installation directory>/openairinterface5g/
source oaienv source oaienv
cd ../cmake_targets/ cd cmake_targets/
./build_oai -I -w USRP --eNB --UE ./build_oai -I -w USRP --eNB --UE
``` ```
...@@ -78,10 +74,16 @@ or ...@@ -78,10 +74,16 @@ or
`./build_oai --build-lib telnetsrv` `./build_oai --build-lib telnetsrv`
You can get documentation about the telnet server [here](common/utils/telnetsrv/DOC/telnetsrv.md)
## USRP record player ## USRP record player
The USRP record player today needs a specific build. Work to make it available as a run time option is under consideration The USRP record player today needs a specific build. Work to make it available as a run time option is under consideration
## Other optional libraries
Using the help option of the build script you can get the list of available optional libraries. Those which haven't been mentioned above are known to need more tests and documentation
# `build_oai` options # `build_oai` options
| Option | Status | Description | | Option | Status | Description |
...@@ -89,7 +91,7 @@ The USRP record player today needs a specific build. Work to make it available a ...@@ -89,7 +91,7 @@ The USRP record player today needs a specific build. Work to make it available a
| -h | maintained | get help | | -h | maintained | get help |
| -c | maintained | erase all previously built files for this target before starting the new build. | | -c | maintained | erase all previously built files for this target before starting the new build. |
| -C | maintained, needs improvement | erase all previously built files for any target before starting the new build. | | -C | maintained, needs improvement | erase all previously built files for any target before starting the new build. |
| --verbose-compile | maintained | | | --verbose-compile | maintained | get compilation messages, as when running `make` or `gcc` directly. |
| --cflags_processor | maintained | used to pass options to the compiler | | --cflags_processor | maintained | used to pass options to the compiler |
| --clean-kernel | unknown | no code in the script corresponding to this option | | --clean-kernel | unknown | no code in the script corresponding to this option |
| --install-system-files | maintained | install oai built binaries in linux system files repositories | | --install-system-files | maintained | install oai built binaries in linux system files repositories |
......
...@@ -151,6 +151,15 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol ...@@ -151,6 +151,15 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
return msg; return msg;
error: error:
if (stats_reply_msg) {
if (stats_reply_msg->ue_report) {
free(stats_reply_msg->ue_report);
}
if (stats_reply_msg->cell_report) {
free(stats_reply_msg->cell_report);
}
free(stats_reply_msg);
}
return NULL; return NULL;
} }
...@@ -233,6 +242,12 @@ Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * ...@@ -233,6 +242,12 @@ Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport *
return copy; return copy;
error: error:
if (copy){
if (copy->bsr){
free(copy->bsr);
}
free(copy);
}
return NULL; return NULL;
} }
...@@ -303,6 +318,20 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi ...@@ -303,6 +318,20 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi
return full_ul_report; return full_ul_report;
error: error:
if (full_ul_report){
if (ul_report){
for (i = 0; i < full_ul_report->n_cqi_meas; i++){
if (ul_report[i]){
if ( ul_report[i]->sinr ){
free(ul_report[i]->sinr);
}
free(ul_report[i]);
}
}
free(ul_report);
}
free(full_ul_report);
}
return NULL; return NULL;
} }
...@@ -369,6 +398,18 @@ Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagin ...@@ -369,6 +398,18 @@ Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagin
error: error:
/*TODO: free memory properly*/ /*TODO: free memory properly*/
if (copy){
if (p_info){
for (i = 0; i < copy->n_paging_info; i++){
if (p_info[i]){
free(p_info[i]);
}
}
free(p_info);
}
free(copy);
copy = NULL;
}
return NULL; return NULL;
} }
...@@ -902,6 +943,13 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name) { ...@@ -902,6 +943,13 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name) {
LOG_I(FLEXRAN_AGENT, "Scheduler could not be loaded\n"); LOG_I(FLEXRAN_AGENT, "Scheduler could not be loaded\n");
} }
if (flexran_agent_get_mac_xface(mod_id)) {
if (flexran_agent_get_mac_xface(mod_id)->dl_scheduler_loaded_lib != lib) {
dlclose(lib);
}
} else {
dlclose(lib);
}
return 0; return 0;
error: error:
......
...@@ -44,6 +44,8 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch ...@@ -44,6 +44,8 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
int size; int size;
Protocol__FlexranMessage *msg = NULL; Protocol__FlexranMessage *msg = NULL;
Protocol__FlexHeader *header = NULL; Protocol__FlexHeader *header = NULL;
Protocol__FlexUeStateChange *ue_state_change_msg = NULL;
Protocol__FlexUeConfig *config = NULL;
void *data; void *data;
int priority = 0; int priority = 0;
err_code_t err_code=0; err_code_t err_code=0;
...@@ -53,7 +55,6 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch ...@@ -53,7 +55,6 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UE_STATE_CHANGE, &header) != 0) if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UE_STATE_CHANGE, &header) != 0)
goto error; goto error;
Protocol__FlexUeStateChange *ue_state_change_msg;
ue_state_change_msg = malloc(sizeof(Protocol__FlexUeStateChange)); ue_state_change_msg = malloc(sizeof(Protocol__FlexUeStateChange));
if(ue_state_change_msg == NULL) { if(ue_state_change_msg == NULL) {
goto error; goto error;
...@@ -62,7 +63,6 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch ...@@ -62,7 +63,6 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
ue_state_change_msg->has_type = 1; ue_state_change_msg->has_type = 1;
ue_state_change_msg->type = state_change; ue_state_change_msg->type = state_change;
Protocol__FlexUeConfig *config;
config = malloc(sizeof(Protocol__FlexUeConfig)); config = malloc(sizeof(Protocol__FlexUeConfig));
if (config == NULL) { if (config == NULL) {
goto error; goto error;
...@@ -103,11 +103,24 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch ...@@ -103,11 +103,24 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch
} }
LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size);
free(header);
return; return;
error: error:
if (err_code != 0) if (err_code != 0)
LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d for RNTI %x\n", LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d for RNTI %x\n",
err_code, rnti); err_code, rnti);
if (header){
free(header);
}
if (ue_state_change_msg) {
free(ue_state_change_msg);
}
if (config) {
free(config);
}
if (msg) {
free(msg);
}
} }
...@@ -405,8 +418,13 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -405,8 +418,13 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){ for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){
eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements)); eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements));
if (eutra_meas[j] == NULL) if (eutra_meas[j] == NULL) {
for (int k = 0 ; k < j ; k++) {
free(eutra_meas[k]);
}
free(eutra_meas);
goto error; goto error;
}
protocol__flex_eutra_measurements__init(eutra_meas[j]); protocol__flex_eutra_measurements__init(eutra_meas[j]);
......
...@@ -2572,6 +2572,8 @@ int RCconfig_parallel(void) { ...@@ -2572,6 +2572,8 @@ int RCconfig_parallel(void) {
set_worker_conf(worker_conf); set_worker_conf(worker_conf);
} }
free(worker_conf);
free(parallel_conf);
return 0; return 0;
} }
......
...@@ -84,6 +84,9 @@ flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, c ...@@ -84,6 +84,9 @@ flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, c
error: error:
LOG_I(FLEXRAN_AGENT, "%s(): there was an error\n", __func__); LOG_I(FLEXRAN_AGENT, "%s(): there was an error\n", __func__);
if (channel){
free(channel);
}
return NULL; return NULL;
} }
......
...@@ -514,8 +514,13 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -514,8 +514,13 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl
// Fill the config for each UE // Fill the config for each UE
for (int i = 0; i < lc_config_reply_msg->n_lc_ue_config; i++) { for (int i = 0; i < lc_config_reply_msg->n_lc_ue_config; i++) {
lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig)); lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig));
if (!lc_ue_config[i]){
if (!lc_ue_config[i]) goto error; for (int j = 0; j < i; j++){
free(lc_ue_config[j]);
}
free(lc_ue_config);
goto error;
}
protocol__flex_lc_ue_config__init(lc_ue_config[i]); protocol__flex_lc_ue_config__init(lc_ue_config[i]);
const int UE_id = flexran_get_mac_ue_id(mod_id, i); const int UE_id = flexran_get_mac_ue_id(mod_id, i);
...@@ -527,8 +532,13 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -527,8 +532,13 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl
*msg = malloc(sizeof(Protocol__FlexranMessage)); *msg = malloc(sizeof(Protocol__FlexranMessage));
if (*msg == NULL) if (*msg == NULL){
for (int k = 0; k < lc_config_reply_msg->n_lc_ue_config; k++){
free(lc_ue_config[k]);
}
free(lc_ue_config);
goto error; goto error;
}
protocol__flexran_message__init(*msg); protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG; (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG;
...@@ -736,7 +746,13 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F ...@@ -736,7 +746,13 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F
for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++) { for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++) {
cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig)); cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig));
if (!cell_conf[i]) goto error; if (!cell_conf[i]) {
for (int j = 0; j < i; j++) {
free(cell_conf[j]);
}
free(cell_conf);
goto error;
}
protocol__flex_cell_config__init(cell_conf[i]); protocol__flex_cell_config__init(cell_conf[i]);
...@@ -758,8 +774,13 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F ...@@ -758,8 +774,13 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F
*msg = malloc(sizeof(Protocol__FlexranMessage)); *msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL) if(*msg == NULL) {
for (int k = 0; k < enb_config_reply_msg->n_cell_config; k++) {
free(cell_conf[k]);
}
free(cell_conf);
goto error; goto error;
}
protocol__flexran_message__init(*msg); protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG; (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG;
...@@ -789,6 +810,8 @@ int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__Fl ...@@ -789,6 +810,8 @@ int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__Fl
Protocol__FlexRrcTriggering *triggering = input->rrc_triggering; Protocol__FlexRrcTriggering *triggering = input->rrc_triggering;
agent_reconf_rrc *reconf_param = malloc(sizeof(agent_reconf_rrc)); agent_reconf_rrc *reconf_param = malloc(sizeof(agent_reconf_rrc));
reconf_param->trigger_policy = triggering->rrc_trigger; reconf_param->trigger_policy = triggering->rrc_trigger;
reconf_param->report_interval = 0;
reconf_param->report_amount = 0;
struct rrc_eNB_ue_context_s *ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[mod_id]->rrc_ue_head)) { RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[mod_id]->rrc_ue_head)) {
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, ue_context_p->ue_context.rnti, flexran_get_current_frame(mod_id), flexran_get_current_subframe (mod_id), mod_id); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, ue_context_p->ue_context.rnti, flexran_get_current_frame(mod_id), flexran_get_current_subframe (mod_id), mod_id);
......
...@@ -293,7 +293,7 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr ...@@ -293,7 +293,7 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
/* Check if request was periodical */ /* Check if request was periodical */
if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_PERIODICAL) { if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_PERIODICAL) {
/* Create a one off flexran message as an argument for the periodical task */ /* Create a one off flexran message as an argument for the periodical task */
Protocol__FlexranMessage *timer_msg; Protocol__FlexranMessage *timer_msg = NULL;
stats_request_config_t request_config; stats_request_config_t request_config;
request_config.report_type = PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS; request_config.report_type = PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS;
request_config.report_frequency = PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE; request_config.report_frequency = PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE;
...@@ -311,7 +311,10 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr ...@@ -311,7 +311,10 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
report_config.ue_report_type[0].ue_report_flags = ue_flags; report_config.ue_report_type[0].ue_report_flags = ue_flags;
} }
request_config.config = &report_config; request_config.config = &report_config;
flexran_agent_stats_request(enb_id, xid, &request_config, &timer_msg); if (flexran_agent_stats_request(enb_id, xid, &request_config, &timer_msg) == -1) {
err_code = -100;
goto error;
}
/* Create a timer */ /* Create a timer */
long timer_id = 0; long timer_id = 0;
flexran_agent_timer_args_t *timer_args = malloc(sizeof(flexran_agent_timer_args_t)); flexran_agent_timer_args_t *timer_args = malloc(sizeof(flexran_agent_timer_args_t));
...@@ -420,19 +423,21 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr ...@@ -420,19 +423,21 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg){ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg){
Protocol__FlexHeader *header = NULL; Protocol__FlexHeader *header = NULL;
err_code_t err_code; Protocol__FlexUeStatsReport **ue_report = NULL;
int i; Protocol__FlexCellStatsReport **cell_report = NULL;
Protocol__FlexStatsReply *stats_reply_msg = NULL;
err_code_t err_code = PROTOCOL__FLEXRAN_ERR__UNEXPECTED;
int i,j;
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) {
goto error; goto error;
}
Protocol__FlexStatsReply *stats_reply_msg;
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply)); stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
if (stats_reply_msg == NULL) if (stats_reply_msg == NULL) {
goto error; goto error;
}
protocol__flex_stats_reply__init(stats_reply_msg); protocol__flex_stats_reply__init(stats_reply_msg);
stats_reply_msg->header = header; stats_reply_msg->header = header;
...@@ -442,16 +447,18 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re ...@@ -442,16 +447,18 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re
// UE report // UE report
Protocol__FlexUeStatsReport **ue_report;
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *) * report_config->nr_ue); ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *) * report_config->nr_ue);
if (ue_report == NULL)
goto error; if (ue_report == NULL) {
goto error;
}
for (i = 0; i < report_config->nr_ue; i++) { for (i = 0; i < report_config->nr_ue; i++) {
ue_report[i] = malloc(sizeof(Protocol__FlexUeStatsReport)); ue_report[i] = malloc(sizeof(Protocol__FlexUeStatsReport));
if (ue_report[i] == NULL) {
goto error;
}
protocol__flex_ue_stats_report__init(ue_report[i]); protocol__flex_ue_stats_report__init(ue_report[i]);
ue_report[i]->rnti = report_config->ue_report_type[i].ue_rnti; ue_report[i]->rnti = report_config->ue_report_type[i].ue_rnti;
ue_report[i]->has_rnti = 1; ue_report[i]->has_rnti = 1;
...@@ -460,19 +467,18 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re ...@@ -460,19 +467,18 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re
} }
// cell rpoert // cell rpoert
Protocol__FlexCellStatsReport **cell_report;
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *) * report_config->nr_cc); cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *) * report_config->nr_cc);
if (cell_report == NULL) if (cell_report == NULL) {
goto error; goto error;
}
for (i = 0; i < report_config->nr_cc; i++) { for (i = 0; i < report_config->nr_cc; i++) {
cell_report[i] = malloc(sizeof(Protocol__FlexCellStatsReport)); cell_report[i] = malloc(sizeof(Protocol__FlexCellStatsReport));
if(cell_report[i] == NULL) if(cell_report[i] == NULL) {
goto error; goto error;
}
protocol__flex_cell_stats_report__init(cell_report[i]); protocol__flex_cell_stats_report__init(cell_report[i]);
cell_report[i]->carrier_index = report_config->cc_report_type[i].cc_id; cell_report[i]->carrier_index = report_config->cc_report_type[i].cc_id;
...@@ -507,8 +513,9 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re ...@@ -507,8 +513,9 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re
stats_reply_msg->ue_report = ue_report; stats_reply_msg->ue_report = ue_report;
*msg = malloc(sizeof(Protocol__FlexranMessage)); *msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL) if(*msg == NULL) {
goto error; goto error;
}
protocol__flexran_message__init(*msg); protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG; (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME;
...@@ -518,8 +525,38 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re ...@@ -518,8 +525,38 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re
error : error :
LOG_E(FLEXRAN_AGENT, "errno %d occured\n", err_code); LOG_E(FLEXRAN_AGENT, "errno %d occured\n", err_code);
return err_code;
if (header != NULL) {
free(header);
header = NULL;
}
if (stats_reply_msg != NULL) {
free(stats_reply_msg);
stats_reply_msg = NULL;
}
if (ue_report != NULL) {
for (j = 0; j < report_config->nr_ue; j++) {
if (ue_report[j] != NULL) {
free(ue_report[j]);
}
}
free(ue_report);
ue_report = NULL;
}
if (cell_report != NULL) {
for (j = 0; j < report_config->nr_cc; j++) {
if (cell_report[j] != NULL) {
free(cell_report[j]);
}
}
free(cell_report);
cell_report = NULL;
}
return err_code;
} }
/* /*
...@@ -705,7 +742,7 @@ err_code_t flexran_agent_enable_cont_stats_update(mid_t mod_id, ...@@ -705,7 +742,7 @@ err_code_t flexran_agent_enable_cont_stats_update(mid_t mod_id,
goto error; goto error;
} }
Protocol__FlexranMessage *req_msg; Protocol__FlexranMessage *req_msg = NULL;
flexran_agent_stats_request(mod_id, xid, stats_req, &req_msg); flexran_agent_stats_request(mod_id, xid, stats_req, &req_msg);
stats_context[mod_id].stats_req = req_msg; stats_context[mod_id].stats_req = req_msg;
......
...@@ -177,7 +177,7 @@ int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst, ...@@ -177,7 +177,7 @@ 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) 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 +187,7 @@ int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst, ...@@ -187,7 +187,7 @@ 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) 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;
......
...@@ -327,6 +327,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -327,6 +327,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity);
...@@ -562,6 +563,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -562,6 +563,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
...@@ -611,6 +613,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -611,6 +613,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
...@@ -787,6 +790,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -787,6 +790,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI,0,sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
......
...@@ -95,6 +95,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -95,6 +95,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_NRCGI; ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_NRCGI;
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_ue_context_setup_req->mcc, MCC_MNC_TO_PLMNID(f1ap_ue_context_setup_req->mcc,
f1ap_ue_context_setup_req->mnc, f1ap_ue_context_setup_req->mnc,
f1ap_ue_context_setup_req->mnc_digit_length, f1ap_ue_context_setup_req->mnc_digit_length,
...@@ -1183,6 +1184,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { ...@@ -1183,6 +1184,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
// /* - sCell_ID */ // /* - sCell_ID */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
...@@ -1222,6 +1224,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { ...@@ -1222,6 +1224,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
/* - sCell_ID */ /* - sCell_ID */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
......
...@@ -169,6 +169,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -169,6 +169,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity); MCC_MNC_TO_PLMNID(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]); LOG_D(F1AP, "plmn: (%d,%d)\n",f1ap_du_data->mcc[i],f1ap_du_data->mnc[i]);
//MCC_MNC_TO_PLMNID(208, 95, 2, &nRCGI.pLMN_Identity); //MCC_MNC_TO_PLMNID(208, 95, 2, &nRCGI.pLMN_Identity);
...@@ -619,6 +620,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -619,6 +620,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
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); 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", LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
nRCGI.nRCellIdentity.buf[0], nRCGI.nRCellIdentity.buf[0],
...@@ -778,6 +780,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -778,6 +780,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t 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], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity);
...@@ -790,6 +793,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -790,6 +793,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t 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], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
...@@ -944,6 +948,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -944,6 +948,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t 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], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity);
...@@ -980,6 +985,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -980,6 +985,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
/* 3.1 oldNRCGI */ /* 3.1 oldNRCGI */
F1AP_NRCGI_t 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], MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
......
...@@ -799,6 +799,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, ...@@ -799,6 +799,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI; ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI;
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
......
...@@ -470,6 +470,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) { ...@@ -470,6 +470,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) {
/* sCell_ID */ /* sCell_ID */
F1AP_NRCGI_t nRCGI; // issue here F1AP_NRCGI_t nRCGI; // issue here
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity); MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
...@@ -1155,6 +1156,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) { ...@@ -1155,6 +1156,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
/* - sCell_ID */ /* - sCell_ID */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
......
...@@ -98,7 +98,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, ...@@ -98,7 +98,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
} }
/* Checking procedure Code and direction of message */ /* Checking procedure Code and direction of message */
if (pdu.choice.initiatingMessage->procedureCode > sizeof(f1ap_messages_callback) / (3 * sizeof( if (pdu.choice.initiatingMessage->procedureCode >= sizeof(f1ap_messages_callback) / (3 * sizeof(
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",
......
...@@ -1399,7 +1399,6 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, ...@@ -1399,7 +1399,6 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP,
// //
for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) {
LOG_D(MAC, "Running preprocessor for UE %d (%x)\n", UE_id,(int)(UE_RNTI(module_idP, UE_id)));
// initialize harq_pid and round // initialize harq_pid and round
cc = &RC.mac[module_idP]->common_channels[CC_id]; cc = &RC.mac[module_idP]->common_channels[CC_id];
N_RBG[CC_id] = to_rbg(cc->mib->message.dl_Bandwidth); N_RBG[CC_id] = to_rbg(cc->mib->message.dl_Bandwidth);
......
...@@ -499,7 +499,7 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) ...@@ -499,7 +499,7 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
(void)data_p; (void)data_p;
pdcp_t *pdcp_p = NULL; pdcp_t *pdcp_p = NULL;
//TTN for D2D (PC5S) //TTN for D2D (PC5S)
int prose_addr_len; int prose_addr_len = sizeof(prose_pdcp_addr);
char send_buf[BUFSIZE], receive_buf[BUFSIZE]; char send_buf[BUFSIZE], receive_buf[BUFSIZE];
//int optval; //int optval;
int bytes_received; int bytes_received;
......
...@@ -112,7 +112,7 @@ signed int rlc_um_get_pdu_infos( ...@@ -112,7 +112,7 @@ signed int rlc_um_get_pdu_infos(
// PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs ", // PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs ",
// PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), // PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
// pdu_info_pP->sn); // pdu_info_pP->sn);
if(pdu_info_pP->num_li > RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) { if(pdu_info_pP->num_li >= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) {
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs \n", LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs \n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
pdu_info_pP->sn); pdu_info_pP->sn);
......
...@@ -3915,6 +3915,27 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt ...@@ -3915,6 +3915,27 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
size, size,
buffer, buffer,
PDCP_TRANSMISSION_MODE_CONTROL); PDCP_TRANSMISSION_MODE_CONTROL);
free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ);
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = NULL;
free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP);
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP = NULL;
free(quantityConfig->quantityConfigEUTRA);
quantityConfig->quantityConfigEUTRA = NULL;
free(quantityConfig);
quantityConfig = NULL;
free(mac_MainConfig->ul_SCH_Config);
mac_MainConfig->ul_SCH_Config = NULL;
free(mac_MainConfig->phr_Config);
mac_MainConfig->phr_Config = NULL;
free(mac_MainConfig);
mac_MainConfig = NULL;
} }
...@@ -7736,9 +7757,9 @@ void *rrc_enb_process_itti_msg(void *notUsed) { ...@@ -7736,9 +7757,9 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
&ctxt, &ctxt,
RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size); RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size);
if (RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size >= RRC_BUFFER_SIZE_MAX) { if (RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size >= CCCH_SDU_SIZE) {
LOG_I(RRC, "CCCH message has size %d > %d\n", LOG_I(RRC, "CCCH message has size %d > %d\n",
RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size,RRC_BUFFER_SIZE_MAX); RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size,CCCH_SDU_SIZE);
break; break;
} }
...@@ -8154,7 +8175,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink( ...@@ -8154,7 +8175,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
uint8_t buffer[RRC_BUF_SIZE]; uint8_t buffer[RRC_BUF_SIZE];
uint16_t size = -1; uint16_t size = 0;
memset(buffer, 0, RRC_BUF_SIZE); memset(buffer, 0, RRC_BUF_SIZE);
// allocate dedicated pools for UE -sl-CommConfig/sl-DiscConfig (sl-V2X-ConfigDedicated) // allocate dedicated pools for UE -sl-CommConfig/sl-DiscConfig (sl-V2X-ConfigDedicated)
...@@ -8291,6 +8312,7 @@ LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool( const protocol_ctxt_t * ...@@ -8291,6 +8312,7 @@ LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool( const protocol_ctxt_t *
LTE_SL_DiscConfig_r12_t rrc_eNB_get_sidelink_discTXPool( const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, int n_discoveryMessages ) { LTE_SL_DiscConfig_r12_t rrc_eNB_get_sidelink_discTXPool( const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, int n_discoveryMessages ) {
//TODO //TODO
LTE_SL_DiscConfig_r12_t sl_DiscConfig; LTE_SL_DiscConfig_r12_t sl_DiscConfig;
memset(&sl_DiscConfig,0,sizeof(LTE_SL_DiscConfig_r12_t));
sl_DiscConfig.discTxResources_r12 = CALLOC(1,sizeof(*sl_DiscConfig.discTxResources_r12)); sl_DiscConfig.discTxResources_r12 = CALLOC(1,sizeof(*sl_DiscConfig.discTxResources_r12));
sl_DiscConfig.discTxResources_r12->present = LTE_SL_DiscConfig_r12__discTxResources_r12_PR_setup; sl_DiscConfig.discTxResources_r12->present = LTE_SL_DiscConfig_r12__discTxResources_r12_PR_setup;
sl_DiscConfig.discTxResources_r12->choice.setup.present = LTE_SL_DiscConfig_r12__discTxResources_r12__setup_PR_scheduled_r12; sl_DiscConfig.discTxResources_r12->choice.setup.present = LTE_SL_DiscConfig_r12__discTxResources_r12__setup_PR_scheduled_r12;
......
...@@ -846,6 +846,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( ...@@ -846,6 +846,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
uint8_t srb_id; uint8_t srb_id;
struct rrc_eNB_ue_context_s *ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
memset(&ctxt, 0, sizeof(protocol_ctxt_t));
ue_initial_id = S1AP_DOWNLINK_NAS (msg_p).ue_initial_id; ue_initial_id = S1AP_DOWNLINK_NAS (msg_p).ue_initial_id;
eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id; eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id;
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id); ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id);
......
...@@ -228,7 +228,7 @@ socket_link_t *new_link_udp_client(const char *server, int port){ ...@@ -228,7 +228,7 @@ socket_link_t *new_link_udp_client(const char *server, int port){
struct sockaddr_in si_other; struct sockaddr_in si_other;
int s; int s;
socklen_t slen; socklen_t slen = sizeof(si_other);
if ( (s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1){ if ( (s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1){
goto error; goto error;
...@@ -402,7 +402,7 @@ static int socket_udp_receive(int socket_fd, void *buf, int size) ...@@ -402,7 +402,7 @@ static int socket_udp_receive(int socket_fd, void *buf, int size)
LOG_D(PROTO_AGENT,"UDP RECEIVE\n"); LOG_D(PROTO_AGENT,"UDP RECEIVE\n");
struct sockaddr_in client; struct sockaddr_in client;
socklen_t slen; socklen_t slen = sizeof(client);
int l; int l;
l = recvfrom(socket_fd, buf, size, 0, (struct sockaddr *) &client, &slen); l = recvfrom(socket_fd, buf, size, 0, (struct sockaddr *) &client, &slen);
......
...@@ -192,7 +192,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre ...@@ -192,7 +192,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre
case X2AP_X2AP_PDU_PR_initiatingMessage: case X2AP_X2AP_PDU_PR_initiatingMessage:
/* Checking procedure Code and direction of message */ /* Checking procedure Code and direction of message */
if (pdu.choice.initiatingMessage.procedureCode > sizeof(x2ap_messages_callback) / (3 * sizeof( if (pdu.choice.initiatingMessage.procedureCode >= sizeof(x2ap_messages_callback) / (3 * sizeof(
x2ap_message_decoded_callback))) { x2ap_message_decoded_callback))) {
//|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) { //|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) {
X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n", X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n",
...@@ -218,7 +218,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre ...@@ -218,7 +218,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre
case X2AP_X2AP_PDU_PR_successfulOutcome: case X2AP_X2AP_PDU_PR_successfulOutcome:
/* Checking procedure Code and direction of message */ /* Checking procedure Code and direction of message */
if (pdu.choice.successfulOutcome.procedureCode > sizeof(x2ap_messages_callback) / (3 * sizeof( if (pdu.choice.successfulOutcome.procedureCode >= sizeof(x2ap_messages_callback) / (3 * sizeof(
x2ap_message_decoded_callback))) { x2ap_message_decoded_callback))) {
//|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) { //|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) {
X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n", X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n",
...@@ -244,7 +244,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre ...@@ -244,7 +244,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre
case X2AP_X2AP_PDU_PR_unsuccessfulOutcome: case X2AP_X2AP_PDU_PR_unsuccessfulOutcome:
/* Checking procedure Code and direction of message */ /* Checking procedure Code and direction of message */
if (pdu.choice.unsuccessfulOutcome.procedureCode > sizeof(x2ap_messages_callback) / (3 * sizeof( if (pdu.choice.unsuccessfulOutcome.procedureCode >= sizeof(x2ap_messages_callback) / (3 * sizeof(
x2ap_message_decoded_callback))) { x2ap_message_decoded_callback))) {
//|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) { //|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) {
X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n", X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n",
......
...@@ -986,7 +986,7 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { ...@@ -986,7 +986,7 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) {
if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) {
LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti);
} else { } else {
if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id <= max_val_LTE_DRB_Identity)) { if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id < max_val_LTE_DRB_Identity)) {
enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB;
sgw_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_sgw; sgw_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_sgw;
stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU;
......
...@@ -220,7 +220,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream, ...@@ -220,7 +220,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
} }
/* Checking procedure Code and direction of message */ /* Checking procedure Code and direction of message */
if (pdu.choice.initiatingMessage.procedureCode > sizeof(messages_callback) / (3 * sizeof( if (pdu.choice.initiatingMessage.procedureCode >= sizeof(messages_callback) / (3 * sizeof(
s1ap_message_decoded_callback)) s1ap_message_decoded_callback))
|| (pdu.present > S1AP_S1AP_PDU_PR_unsuccessfulOutcome)) { || (pdu.present > S1AP_S1AP_PDU_PR_unsuccessfulOutcome)) {
S1AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n", S1AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
......
...@@ -193,7 +193,7 @@ int trx_lms_start(openair0_device *device){ ...@@ -193,7 +193,7 @@ int trx_lms_start(openair0_device *device){
LMS_EnableChannel(lms_device,LMS_CH_RX,1,true); LMS_EnableChannel(lms_device,LMS_CH_RX,1,true);
LMS_EnableChannel(lms_device,LMS_CH_TX,1,true); LMS_EnableChannel(lms_device,LMS_CH_TX,1,true);
} */ } */
LMS_VCTCXOWrite(lms_device,129, true); LMS_VCTCXOWrite(lms_device, 129);
if (LMS_SetSampleRate(lms_device,device->openair0_cfg->sample_rate,2)!=0) if (LMS_SetSampleRate(lms_device,device->openair0_cfg->sample_rate,2)!=0)
{ {
......
...@@ -678,6 +678,7 @@ static void *emulatedRF_thread(void *param) { ...@@ -678,6 +678,7 @@ static void *emulatedRF_thread(void *param) {
req.tv_sec = 0; req.tv_sec = 0;
req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2; req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2;
cpu_set_t cpuset; cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(1,&cpuset); CPU_SET(1,&cpuset);
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
int policy; int policy;
......
...@@ -618,6 +618,8 @@ int main( int argc, char **argv ) { ...@@ -618,6 +618,8 @@ int main( int argc, char **argv ) {
ctxt.instance = 0; ctxt.instance = 0;
ctxt.rnti = 0; ctxt.rnti = 0;
ctxt.enb_flag = 1; ctxt.enb_flag = 1;
ctxt.frame = 0;
ctxt.subframe = 0;
pdcp_run(&ctxt); pdcp_run(&ctxt);
} }
......
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