Commit 5bb18622 authored by Teodora's avatar Teodora Committed by Chieh-Chun Chen

Fix warnings, read functions in SMs should return bool

parent dbb08a9c
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
static static
const int mod_id = 0; const int mod_id = 0;
void read_gtp_sm(void * data) bool read_gtp_sm(void * data)
{ {
assert(data != NULL); assert(data != NULL);
...@@ -80,6 +80,7 @@ void read_gtp_sm(void * data) ...@@ -80,6 +80,7 @@ void read_gtp_sm(void * data)
i++; i++;
} }
return (num_ues > 0);
} }
void read_gtp_setup_sm(void* data) void read_gtp_setup_sm(void* data)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h" #include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
void read_gtp_sm(void*); bool read_gtp_sm(void*);
void read_gtp_setup_sm(void*); void read_gtp_setup_sm(void*);
......
...@@ -27,7 +27,7 @@ static ...@@ -27,7 +27,7 @@ static
const int mod_id = 0; const int mod_id = 0;
void read_mac_sm(void* data) bool read_mac_sm(void* data)
{ {
assert(data != NULL); assert(data != NULL);
...@@ -110,6 +110,8 @@ void read_mac_sm(void* data) ...@@ -110,6 +110,8 @@ void read_mac_sm(void* data)
++i; ++i;
} }
return (num_ues > 0);
} }
void read_mac_setup_sm(void* data) void read_mac_setup_sm(void* data)
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "openair2/E2AP/flexric/src/util/time_now_us.h" #include "openair2/E2AP/flexric/src/util/time_now_us.h"
void read_mac_sm(void*); bool read_mac_sm(void*);
void read_mac_setup_sm(void*); void read_mac_setup_sm(void*);
......
...@@ -55,7 +55,7 @@ static ...@@ -55,7 +55,7 @@ static
return act_rb; return act_rb;
} }
void read_pdcp_sm(void* data) bool read_pdcp_sm(void* data)
{ {
assert(data != NULL); assert(data != NULL);
//assert(data->type == PDCP_STATS_V0); //assert(data->type == PDCP_STATS_V0);
...@@ -123,6 +123,9 @@ void read_pdcp_sm(void* data) ...@@ -123,6 +123,9 @@ void read_pdcp_sm(void* data)
++i; ++i;
} }
} }
return (act_rb > 0);
} else { } else {
//assert(0!=0 && "Calling PDCP"); //assert(0!=0 && "Calling PDCP");
...@@ -176,6 +179,8 @@ void read_pdcp_sm(void* data) ...@@ -176,6 +179,8 @@ void read_pdcp_sm(void* data)
++i; ++i;
} }
} }
return (act_rb > 0);
} }
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h" #include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
void read_pdcp_sm(void*); bool read_pdcp_sm(void*);
void read_pdcp_setup_sm(void* data); void read_pdcp_setup_sm(void* data);
......
...@@ -67,7 +67,7 @@ void active_avg_to_tx(NR_UEs_t* const UE_info) ...@@ -67,7 +67,7 @@ void active_avg_to_tx(NR_UEs_t* const UE_info)
} }
} }
void read_rlc_sm(void* data) bool read_rlc_sm(void* data)
{ {
assert(data != NULL); assert(data != NULL);
// assert(data->type == RLC_STATS_V0); // assert(data->type == RLC_STATS_V0);
...@@ -161,6 +161,8 @@ void read_rlc_sm(void* data) ...@@ -161,6 +161,8 @@ void read_rlc_sm(void* data)
++i; ++i;
} }
} }
return (act_rb > 0);
} }
void read_rlc_setup_sm(void* data) void read_rlc_setup_sm(void* data)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h" #include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
void read_rlc_sm(void*); bool read_rlc_sm(void*);
void read_rlc_setup_sm(void* data); void read_rlc_setup_sm(void* data);
......
...@@ -24,13 +24,15 @@ ...@@ -24,13 +24,15 @@
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
void read_slice_sm(void* data) bool read_slice_sm(void* data)
{ {
assert(data != NULL); assert(data != NULL);
// assert(data->type == SLICE_STATS_V0); // assert(data->type == SLICE_STATS_V0);
slice_ind_data_t* slice = (slice_ind_data_t*)data; slice_ind_data_t* slice = (slice_ind_data_t*)data;
fill_slice_ind_data(slice); fill_slice_ind_data(slice);
return true;
} }
void read_slice_setup_sm(void* data) void read_slice_setup_sm(void* data)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h" #include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
void read_slice_sm(void*); bool read_slice_sm(void*);
void read_slice_setup_sm(void* data); void read_slice_setup_sm(void* data);
......
...@@ -23,13 +23,15 @@ ...@@ -23,13 +23,15 @@
#include "../../flexric/test/rnd/fill_rnd_data_tc.h" #include "../../flexric/test/rnd/fill_rnd_data_tc.h"
#include <assert.h> #include <assert.h>
void read_tc_sm(void* data) bool read_tc_sm(void* data)
{ {
assert(data != NULL); assert(data != NULL);
//assert(data->type == TC_STATS_V0); //assert(data->type == TC_STATS_V0);
tc_ind_data_t* tc = (tc_ind_data_t*)data; tc_ind_data_t* tc = (tc_ind_data_t*)data;
fill_tc_ind_data(tc); fill_tc_ind_data(tc);
return true;
} }
void read_tc_setup_sm(void* data) void read_tc_setup_sm(void* data)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h" #include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
void read_tc_sm(void*); bool read_tc_sm(void*);
void read_tc_setup_sm(void* data); void read_tc_setup_sm(void* data);
......
...@@ -73,7 +73,7 @@ static size_t filter_ues_by_s_nssai_in_du_or_monolithic(test_cond_e const condit ...@@ -73,7 +73,7 @@ static size_t filter_ues_by_s_nssai_in_du_or_monolithic(test_cond_e const condit
} }
matches->num_ues = i; matches->num_ues = i;
assert(matches->num_ues >= 1 && "The number of filtered UEs must be at least equal to 1");
return i; return i;
} }
...@@ -716,7 +716,7 @@ static void capture_sst_sd(test_info_lst_t* test, uint8_t *sst, uint32_t **sd) ...@@ -716,7 +716,7 @@ static void capture_sst_sd(test_info_lst_t* test, uint8_t *sst, uint32_t **sd)
} }
} }
void read_kpm_sm(void* data) bool read_kpm_sm(void* data)
{ {
assert(data != NULL); assert(data != NULL);
// assert(data->type == KPM_STATS_V3_0); // assert(data->type == KPM_STATS_V3_0);
...@@ -770,7 +770,7 @@ void read_kpm_sm(void* data) ...@@ -770,7 +770,7 @@ void read_kpm_sm(void* data)
case CQI_TEST_COND_TYPE: { case CQI_TEST_COND_TYPE: {
// This is a bad idea. Done only to check FlexRIC xAPP // This is a bad idea. Done only to check FlexRIC xAPP
printf("CQI not implemented!. Randomly filling the data \n"); // printf("CQI not implemented!. Randomly filling the data \n");
goto rnd_data_label; goto rnd_data_label;
break; break;
} }
...@@ -798,14 +798,17 @@ void read_kpm_sm(void* data) ...@@ -798,14 +798,17 @@ void read_kpm_sm(void* data)
if (NODE_IS_DU(RC.nrrrc[0]->node_type)) { if (NODE_IS_DU(RC.nrrrc[0]->node_type)) {
matched_ues_mac_t matched_ues = {0}; matched_ues_mac_t matched_ues = {0};
matched_ues.num_ues = filter_ues_by_s_nssai_in_du_or_monolithic(test_cond, sst, sd, &matched_ues); matched_ues.num_ues = filter_ues_by_s_nssai_in_du_or_monolithic(test_cond, sst, sd, &matched_ues);
if (matched_ues.num_ues == 0) return false;
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_du(&matched_ues, &frm_4->action_def_format_1); kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_du(&matched_ues, &frm_4->action_def_format_1);
} else if (NODE_IS_CU(RC.nrrrc[0]->node_type)) { } else if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
matched_ues_rrc_t matched_ues = {0}; matched_ues_rrc_t matched_ues = {0};
matched_ues.num_ues = filter_ues_by_s_nssai_in_cu(test_cond, sst, sd, &matched_ues); matched_ues.num_ues = filter_ues_by_s_nssai_in_cu(test_cond, sst, sd, &matched_ues);
if (matched_ues.num_ues == 0) return false;
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_cu(&matched_ues, &frm_4->action_def_format_1); kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_cu(&matched_ues, &frm_4->action_def_format_1);
} else if (NODE_IS_MONOLITHIC(RC.nrrrc[0]->node_type)) { } else if (NODE_IS_MONOLITHIC(RC.nrrrc[0]->node_type)) {
matched_ues_mac_t matched_ues = {0}; matched_ues_mac_t matched_ues = {0};
matched_ues.num_ues = filter_ues_by_s_nssai_in_du_or_monolithic(test_cond, sst, sd, &matched_ues); matched_ues.num_ues = filter_ues_by_s_nssai_in_du_or_monolithic(test_cond, sst, sd, &matched_ues);
if (matched_ues.num_ues == 0) return false;
kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_monolithic(&matched_ues, &frm_4->action_def_format_1); kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3_in_monolithic(&matched_ues, &frm_4->action_def_format_1);
} else { } else {
assert(false && "NG-RAN Type not implemented"); assert(false && "NG-RAN Type not implemented");
...@@ -825,12 +828,17 @@ void read_kpm_sm(void* data) ...@@ -825,12 +828,17 @@ void read_kpm_sm(void* data)
default: { default: {
rnd_data_label: rnd_data_label:
return false;
// Only for testing new xApps, but not existing ones in FlexRIC
kpm->ind.hdr = fill_rnd_kpm_ind_hdr(); kpm->ind.hdr = fill_rnd_kpm_ind_hdr();
kpm->ind.msg = fill_rnd_kpm_ind_msg(); kpm->ind.msg = fill_rnd_kpm_ind_msg();
printf("[E2 Agent]: Filling random KPM Indication Message\n");
break; break;
} }
} }
return true;
} }
void read_kpm_setup_sm(void* e2ap) void read_kpm_setup_sm(void* e2ap)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h" #include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
void read_kpm_sm(void*); bool read_kpm_sm(void*);
void read_kpm_setup_sm(void*); void read_kpm_setup_sm(void*);
......
...@@ -36,11 +36,13 @@ ...@@ -36,11 +36,13 @@
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <unistd.h>
void read_rc_sm(void* data) bool read_rc_sm(void* data)
{ {
assert(data != NULL); assert(data != NULL);
// assert(data->type == RAN_CTRL_STATS_V1_03); // assert(data->type == RAN_CTRL_STATS_V1_03);
assert(0!=0 && "Not implemented"); assert(0!=0 && "Not implemented");
return true;
} }
void read_rc_setup_sm(void* data) void read_rc_setup_sm(void* data)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h" #include "openair2/E2AP/flexric/src/agent/../sm/sm_io.h"
void read_rc_sm(void *); bool read_rc_sm(void *);
void read_rc_setup_sm(void* data); void read_rc_setup_sm(void* data);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "read_setup_ran.h" #include "read_setup_ran.h"
#include "../../E2AP/flexric/src/lib/e2ap/e2ap_node_component_config_add_wrapper.h" #include "../../E2AP/flexric/src/lib/e2ap/e2ap_node_component_config_add_wrapper.h"
#include "../../E2AP/flexric/test/rnd/fill_rnd_data_e2_setup_req.h" #include "../../E2AP/flexric/test/rnd/fill_rnd_data_e2_setup_req.h"
#include "../../E2AP/flexric/src/util/ngran_types.h" #include "../../../openair2/GNB_APP/gnb_config.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
......
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