e2sm: make process_ric_event_trigger_definition() virtual

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent ff3fb050ef
commit 2b5f393ea0

@ -10,6 +10,8 @@
*
*
*/
#include "srsran/asn1/e2ap.h"
#include "srsran/common/byte_buffer.h"
#include "srsran/srsran.h"
@ -20,6 +22,12 @@ enum e2sm_type_t { E2SM_KPM, UNKNOWN };
struct RANfunction_description;
struct RIC_event_trigger_definition {
enum e2sm_event_trigger_type_t { E2SM_REPORT, E2SM_INSERT, E2SM_POLICY, UNKNOWN_TRIGGER };
e2sm_event_trigger_type_t type;
uint64_t report_period;
};
class e2sm
{
public:
@ -34,6 +42,8 @@ public:
uint32_t get_revision() { return _revision; };
virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf) = 0;
virtual bool process_ric_event_trigger_definition(asn1::e2ap::ricsubscription_request_s subscription_request,
RIC_event_trigger_definition& event_def) = 0;
private:
const std::string _short_name;

@ -19,10 +19,6 @@
#ifndef RIC_E2SM_KPM_H
#define RIC_E2SM_KPM_H
struct E2SM_KPM_RIC_event_definition {
uint64_t report_period;
};
struct E2SM_KPM_RIC_ind_header {
uint32_t collet_start_time;
std::string file_formatversion;
@ -50,8 +46,8 @@ public:
~e2sm_kpm() = default;
virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf);
bool process_subscription_request(asn1::e2ap::ricsubscription_request_s subscription_request,
E2SM_KPM_RIC_event_definition& event_def);
virtual bool process_ric_event_trigger_definition(asn1::e2ap::ricsubscription_request_s subscription_request,
RIC_event_trigger_definition& event_def);
bool process_ric_action_definition(asn1::e2ap::ri_caction_to_be_setup_item_s ric_action);
bool generate_indication_header(E2SM_KPM_RIC_ind_header hdr, srsran::unique_byte_buffer_t& buf);
bool generate_indication_message(E2SM_KPM_RIC_ind_message msg, srsran::unique_byte_buffer_t& buf);

@ -86,8 +86,8 @@ bool e2sm_kpm::generate_ran_function_description(RANfunction_description& desc,
return true;
}
bool e2sm_kpm::process_subscription_request(asn1::e2ap::ricsubscription_request_s subscription_request,
E2SM_KPM_RIC_event_definition& event_def)
bool e2sm_kpm::process_ric_event_trigger_definition(asn1::e2ap::ricsubscription_request_s subscription_request,
RIC_event_trigger_definition& event_def)
{
using namespace asn1::e2sm_kpm;
e2_sm_kpm_event_trigger_definition_s trigger_def;
@ -98,6 +98,7 @@ bool e2sm_kpm::process_subscription_request(asn1::e2ap::ricsubscription_request_
return false;
}
event_def.type = RIC_event_trigger_definition::e2sm_event_trigger_type_t::E2SM_REPORT;
event_def.report_period = trigger_def.event_definition_formats.event_definition_format1().report_period;
return true;
}

@ -31,13 +31,15 @@ ric_client::ric_subscription::ric_subscription(ric_client* ric_cli
return;
}
E2SM_KPM_RIC_event_definition event_def;
e2sm_kpm* sm_kpm_ptr = dynamic_cast<e2sm_kpm*>(ran_func_desc.sm_ptr);
if (sm_kpm_ptr->process_subscription_request(ric_subscription_request, event_def)) {
reporting_period = event_def.report_period;
RIC_event_trigger_definition event_trigger;
if (ran_func_desc.sm_ptr->process_ric_event_trigger_definition(ric_subscription_request, event_trigger)) {
if (event_trigger.type == RIC_event_trigger_definition::e2sm_event_trigger_type_t::E2SM_REPORT) {
reporting_period = event_trigger.report_period;
reporting_period = 1000; // TODO: to remove, keep it 1s for testing
}
}
e2sm_kpm* sm_kpm_ptr = dynamic_cast<e2sm_kpm*>(ran_func_desc.sm_ptr);
ri_cactions_to_be_setup_list_l& action_list =
ric_subscription_request->ricsubscription_details->ric_action_to_be_setup_list;

Loading…
Cancel
Save