diff --git a/srsgnb/hdr/stack/ric/e2sm_kpm_metrics.h b/srsgnb/hdr/stack/ric/e2sm_kpm_metrics.h new file mode 100644 index 000000000..162086c50 --- /dev/null +++ b/srsgnb/hdr/stack/ric/e2sm_kpm_metrics.h @@ -0,0 +1,78 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2022 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + * + */ + +#ifndef SRSRAN_E2SM_KPM_METRICS_H +#define SRSRAN_E2SM_KPM_METRICS_H + +#include "srsran/srsran.h" + +#define NO_LABEL 0x0001 +#define MIN_LABEL 0x0002 +#define MAX_LABEL 0x0004 +#define AVG_LABEL 0x0008 + +enum e2_metric_data_type_t { INTEGER, REAL }; + +struct E2SM_KPM_metric_t { + std::string name; + e2_metric_data_type_t data_type; + std::string units; + bool min_val_present; + double min_val; + bool max_val_present; + double max_val; + uint32_t supported_labels; + bool supported; +}; + +// Measurements defined in 3GPP TS 28.552 +std::vector get_e2sm_kpm_28_552_metrics() +{ + // TODO: add all metrics from 3GPP TS 28.552 + std::vector metrics; + // supported metrics + metrics.push_back({"RRU.PrbTotDl", REAL, "%", true, 0, true, 100, NO_LABEL | AVG_LABEL, true}); + metrics.push_back({"RRU.PrbTotUl", REAL, "%", true, 0, true, 100, NO_LABEL | AVG_LABEL, true}); + // not supported metrics + metrics.push_back({"RRU.RachPreambleDedMean", REAL, "%", false, 0, false, 100, NO_LABEL, false}); + return metrics; +} + +// Measurements defined in 3GPP TS 32.425 +std::vector get_e2sm_kpm_34_425_metrics() +{ + // TODO: add all metrics from 3GPP TS 32.425 + std::vector metrics; + return metrics; +} + +// E2SM_KPM O-RAN specific Measurements +std::vector e2sm_kpm_oran_metrics() +{ + // TODO: add all E2SM_KPM O-RAN specific Measurements + std::vector metrics; + return metrics; +} + +// Custom Measurements +std::vector e2sm_kpm_custom_metrics() +{ + std::vector metrics; + // supported metrics + metrics.push_back({"test", REAL, "", true, 0, true, 100, NO_LABEL, true}); + // not supported metrics + metrics.push_back({"test123", REAL, "", true, 0, true, 100, NO_LABEL, false}); + return metrics; +} + +#endif // SRSRAN_E2SM_KPM_METRICS_H diff --git a/srsgnb/src/stack/ric/e2sm_kpm.cc b/srsgnb/src/stack/ric/e2sm_kpm.cc index 9309b3aca..9897ac716 100644 --- a/srsgnb/src/stack/ric/e2sm_kpm.cc +++ b/srsgnb/src/stack/ric/e2sm_kpm.cc @@ -1,4 +1,5 @@ #include "srsgnb/hdr/stack/ric/e2sm_kpm.h" +#include "srsgnb/hdr/stack/ric/e2sm_kpm_metrics.h" const std::string e2sm_kpm::short_name = "ORAN-E2SM-KPM"; const std::string e2sm_kpm::oid = "1.3.6.1.4.1.53148.1.2.2.2"; @@ -9,9 +10,27 @@ e2sm_kpm::e2sm_kpm(srslog::basic_logger& logger_) : e2sm(short_name, oid, func_d { random_gen = srsran_random_init(1234); - supported_meas_types.push_back("RRU.PrbTotDl"); - supported_meas_types.push_back("RRU.PrbTotUl"); - supported_meas_types.push_back("test"); + // add supported metrics + for (auto& metric : get_e2sm_kpm_28_552_metrics()) { + if (metric.supported) { + supported_meas_types.push_back(metric.name); + } + } + for (auto& metric : get_e2sm_kpm_34_425_metrics()) { + if (metric.supported) { + supported_meas_types.push_back(metric.name); + } + } + for (auto& metric : e2sm_kpm_oran_metrics()) { + if (metric.supported) { + supported_meas_types.push_back(metric.name); + } + } + for (auto& metric : e2sm_kpm_custom_metrics()) { + if (metric.supported) { + supported_meas_types.push_back(metric.name); + } + } } bool e2sm_kpm::generate_ran_function_description(RANfunction_description& desc, ra_nfunction_item_s& ran_func)