e2sm_kpm: move struct types to e2sm_kpm_common.h

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent 26b61b57db
commit 8ed3497bc8

@ -11,6 +11,7 @@
*
*/
#include "e2sm.h"
#include "e2sm_kpm_common.h"
#include "srsran/asn1/e2ap.h"
#include "srsran/asn1/e2sm.h"
#include "srsran/asn1/e2sm_kpm_v2.h"
@ -22,61 +23,6 @@
using namespace asn1::e2ap;
using namespace asn1::e2sm_kpm;
typedef struct {
uint16_t action_id;
e2_sm_kpm_action_definition_s action_definition;
e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types ind_msg_format;
e2_sm_kpm_ind_hdr_s ric_ind_header;
e2_sm_kpm_ind_msg_s ric_ind_message;
} E2SM_KPM_action_data_t;
enum e2_metric_data_type_t { INTEGER, REAL };
typedef struct {
std::string name;
bool supported;
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;
uint32_t supported_scopes;
} E2SM_KPM_metric_t;
// TODO: define all labels and scopes
/* Labels supported for a metric */
enum e2sm_kpm_label_enum {
NO_LABEL = 0x0001,
MIN_LABEL = 0x0002,
MAX_LABEL = 0x0004,
AVG_LABEL = 0x0008,
SUM_LABEL = 0x0010,
UNKNOWN_LABEL = 0x8000
};
e2sm_kpm_label_enum str2kpm_label(const std::string& label_str);
/* Scopes supported for a metric */
enum e2sm_kpm_metric_scope_enum {
ENB_LEVEL = 0x0001,
CELL_LEVEL = 0x0002,
UE_LEVEL = 0x0004,
BEARER_LEVEL = 0x0008,
UNKNOWN_LEVEL = 0xffff
};
typedef struct {
std::string name;
e2sm_kpm_label_enum label;
e2sm_kpm_metric_scope_enum scope;
meas_record_item_c::types data_type;
int32_t integer_value;
float real_value;
} E2SM_KPM_meas_value_t;
class e2sm_kpm : public e2sm
{
public:

@ -0,0 +1,80 @@
/**
*
* \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.
*
*
*/
#include "srsran/asn1/e2ap.h"
#include "srsran/asn1/e2sm.h"
#include "srsran/asn1/e2sm_kpm_v2.h"
#include "srsran/srsran.h"
#ifndef SRSRAN_E2SM_KPM_COMMON_H
#define SRSRAN_E2SM_KPM_COMMON_H
using namespace asn1::e2ap;
using namespace asn1::e2sm_kpm;
typedef struct {
uint16_t action_id;
e2_sm_kpm_action_definition_s action_definition;
e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types ind_msg_format;
e2_sm_kpm_ind_hdr_s ric_ind_header;
e2_sm_kpm_ind_msg_s ric_ind_message;
} E2SM_KPM_action_data_t;
enum e2_metric_data_type_t { INTEGER, REAL };
typedef struct {
std::string name;
bool supported;
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;
uint32_t supported_scopes;
} E2SM_KPM_metric_t;
// TODO: define all labels and scopes
/* Labels supported for a metric */
enum e2sm_kpm_label_enum {
NO_LABEL = 0x0001,
MIN_LABEL = 0x0002,
MAX_LABEL = 0x0004,
AVG_LABEL = 0x0008,
SUM_LABEL = 0x0010,
UNKNOWN_LABEL = 0x8000
};
e2sm_kpm_label_enum str2kpm_label(const std::string& label_str);
/* Scopes supported for a metric */
enum e2sm_kpm_metric_scope_enum {
ENB_LEVEL = 0x0001,
CELL_LEVEL = 0x0002,
UE_LEVEL = 0x0004,
BEARER_LEVEL = 0x0008,
UNKNOWN_LEVEL = 0xffff
};
typedef struct {
std::string name;
e2sm_kpm_label_enum label;
e2sm_kpm_metric_scope_enum scope;
meas_record_item_c::types data_type;
int32_t integer_value;
float real_value;
} E2SM_KPM_meas_value_t;
#endif // SRSRAN_E2SM_KPM_COMMON_H

@ -14,7 +14,7 @@
#ifndef SRSRAN_E2SM_KPM_METRICS_H
#define SRSRAN_E2SM_KPM_METRICS_H
#include "e2sm_kpm.h"
#include "e2sm_kpm_common.h"
#include "srsran/srsran.h"
// clang-format off

Loading…
Cancel
Save