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

Made it compile with FlexRIC release v2

parent 3faaf888
...@@ -300,8 +300,8 @@ set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version") ...@@ -300,8 +300,8 @@ set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version")
set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3") set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3")
message(STATUS "Selected E2AP_VERSION: ${E2AP_VERSION}") message(STATUS "Selected E2AP_VERSION: ${E2AP_VERSION}")
set(KPM_VERSION "KPM_V2" CACHE STRING "The KPM SM version to use") set(KPM_VERSION "KPM_V2_03" CACHE STRING "The KPM SM version to use")
set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2" "KPM_V3") set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2_03" "KPM_V3_00")
message(STATUS "Selected KPM Version: ${KPM_VERSION}") message(STATUS "Selected KPM Version: ${KPM_VERSION}")
......
...@@ -613,9 +613,9 @@ kpm_ric_ind_hdr_format_1_t kpm_ind_hdr_frm_1(void) ...@@ -613,9 +613,9 @@ kpm_ric_ind_hdr_format_1_t kpm_ind_hdr_frm_1(void)
kpm_ric_ind_hdr_format_1_t hdr_frm_1 = {0}; kpm_ric_ind_hdr_format_1_t hdr_frm_1 = {0};
int64_t const t = time_now_us(); int64_t const t = time_now_us();
#if defined KPM_V2 #if defined KPM_V2_03
hdr_frm_1.collectStartTime = t/1000000; // seconds hdr_frm_1.collectStartTime = t/1000000; // seconds
#elif defined KPM_V3 #elif defined KPM_V3_00
hdr_frm_1.collectStartTime = t; // microseconds hdr_frm_1.collectStartTime = t; // microseconds
#else #else
static_assert(0!=0, "Undefined KPM SM Version"); static_assert(0!=0, "Undefined KPM SM Version");
...@@ -690,26 +690,28 @@ static void capture_sst_sd(test_info_lst_t* test, uint8_t *sst, uint32_t **sd) ...@@ -690,26 +690,28 @@ static void capture_sst_sd(test_info_lst_t* test, uint8_t *sst, uint32_t **sd)
// we made a mistake in the past: NSSAI is supposed to be an OCTET_STRING, // we made a mistake in the past: NSSAI is supposed to be an OCTET_STRING,
// but earlier version of the RAN function and the xApp used integer, so // but earlier version of the RAN function and the xApp used integer, so
// handle this gracefully by accepting integer as well // handle this gracefully by accepting integer as well
switch (*test->test_cond_value) { switch (test->test_cond_value->type) {
case INTEGER_TEST_COND_VALUE: case INTEGER_TEST_COND_VALUE:
AssertFatal(*test->int_value <= 0xff, "illegal SST %ld\n", *test->int_value); printf("test cond value before = %ld\n", *test->test_cond_value->int_value);
*sst = *test->int_value; AssertFatal(*test->test_cond_value->int_value <= 0xff, "illegal SST %ld\n", *test->test_cond_value->int_value);
*sst = *test->test_cond_value->int_value;
printf("test cond value after = %d\n", *sst);
*sd = NULL; *sd = NULL;
break; break;
case OCTET_STRING_TEST_COND_VALUE: case OCTET_STRING_TEST_COND_VALUE:
if (test->octet_string_value->len == 1) { if (test->test_cond_value->octet_string_value->len == 1) {
*sst = test->octet_string_value->buf[0]; *sst = test->test_cond_value->octet_string_value->buf[0];
*sd = NULL; *sd = NULL;
} else { } else {
DevAssert(test->octet_string_value->len == 4); DevAssert(test->test_cond_value->octet_string_value->len == 4);
uint8_t *buf = test->octet_string_value->buf; uint8_t *buf = test->test_cond_value->octet_string_value->buf;
*sst = buf[0]; *sst = buf[0];
*sd = malloc(**sd); *sd = malloc(**sd);
**sd = buf[1] << 16 | buf[2] << 8 | buf[3]; **sd = buf[1] << 16 | buf[2] << 8 | buf[3];
} }
break; break;
default: default:
AssertFatal(false, "test condition value %d impossible\n", *test->test_cond_value); AssertFatal(false, "test condition value %d impossible\n", test->test_cond_value->type);
break; break;
} }
} }
...@@ -786,7 +788,7 @@ void read_kpm_sm(void* data) ...@@ -786,7 +788,7 @@ void read_kpm_sm(void* data)
case S_NSSAI_TEST_COND_TYPE: { case S_NSSAI_TEST_COND_TYPE: {
assert(frm_4->matching_cond_lst[i].test_info_lst.S_NSSAI == TRUE_TEST_COND_TYPE && "Must be true"); assert(frm_4->matching_cond_lst[i].test_info_lst.S_NSSAI == TRUE_TEST_COND_TYPE && "Must be true");
assert(frm_4->matching_cond_lst[i].test_info_lst.test_cond != NULL && "Even though is optional.."); assert(frm_4->matching_cond_lst[i].test_info_lst.test_cond != NULL && "Even though is optional..");
assert(frm_4->matching_cond_lst[i].test_info_lst.int_value != NULL && "Even though is optional.."); assert(frm_4->matching_cond_lst[i].test_info_lst.test_cond_value != NULL && "Even though is optional..");
test_cond_e const test_cond = *frm_4->matching_cond_lst[i].test_info_lst.test_cond; test_cond_e const test_cond = *frm_4->matching_cond_lst[i].test_info_lst.test_cond;
uint8_t sst = 0; uint8_t sst = 0;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +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 <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -31,7 +32,60 @@ void read_setup_ran(void* data) ...@@ -31,7 +32,60 @@ void read_setup_ran(void* data)
#ifdef E2AP_V1 #ifdef E2AP_V1
#elif defined(E2AP_V2) || defined(E2AP_V3) #elif defined(E2AP_V2) || defined(E2AP_V3)
*((e2ap_node_component_config_add_t*)data) = fill_e2ap_node_component_config_add();
arr_node_component_config_add_t* dst = (arr_node_component_config_add_t*)data;
// Value assigned by CMakeLists.txt
const ngran_node_t node_type = get_node_type();
if(node_type == ngran_gNB){
dst->len_cca = 1;
dst->cca = calloc(1, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_CU){
dst->len_cca = 2;
dst->cca = calloc(2, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
// F1AP
dst->cca[1] = fill_f1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_DU){
dst->len_cca = 1;
dst->cca = calloc(1, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// F1AP
dst->cca[0] = fill_f1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_CUCP){
dst->len_cca = 3;
dst->cca = calloc(3, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
// F1AP
dst->cca[1] = fill_f1ap_e2ap_node_component_config_add();
// E1AP
dst->cca[2] = fill_e1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_CUUP){
dst->len_cca = 3;
dst->cca = calloc(3, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
// F1AP
dst->cca[1] = fill_f1ap_e2ap_node_component_config_add();
// E1AP
dst->cca[2] = fill_e1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_eNB){
dst->len_cca = 1;
dst->cca = calloc(1, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// S1AP
dst->cca[0] = fill_s1ap_e2ap_node_component_config_add();
} else {
assert(0 != 0 && "Not implemented");
}
#else #else
static_assert(0!=0, "Unknown E2AP version"); static_assert(0!=0, "Unknown E2AP version");
#endif #endif
......
...@@ -89,7 +89,7 @@ git submodule update ...@@ -89,7 +89,7 @@ git submodule update
```bash ```bash
git clone https://gitlab.eurecom.fr/mosaic5g/flexric flexric git clone https://gitlab.eurecom.fr/mosaic5g/flexric flexric
cd flexric/ cd flexric/
git checkout 93961d2480b2c7a5721e03435cb34cf9446d1ad1 git checkout 1f04cc558ebc8da9de6a620762bc02f5db4ecb4a
``` ```
### 2.2.2 Build FlexRIC ### 2.2.2 Build FlexRIC
......
flexric @ 1f04cc55
Subproject commit 93961d2480b2c7a5721e03435cb34cf9446d1ad1 Subproject commit 1f04cc558ebc8da9de6a620762bc02f5db4ecb4a
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