e2sm_kpm: process ric action definition formats in separate funcs

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent e51871a626
commit 72fd9b4dfc

@ -56,6 +56,12 @@ public:
virtual bool execute_action_fill_ric_indication(E2AP_RIC_action_t& action_entry, ric_indication_t& ric_indication); virtual bool execute_action_fill_ric_indication(E2AP_RIC_action_t& action_entry, ric_indication_t& ric_indication);
private: private:
bool _process_ric_action_definition_format1(e2_sm_kpm_action_definition_format1_s& action_definition_format1);
bool _process_ric_action_definition_format2(e2_sm_kpm_action_definition_format2_s& action_definition_format2);
bool _process_ric_action_definition_format3(e2_sm_kpm_action_definition_format3_s& action_definition_format3);
bool _process_ric_action_definition_format4(e2_sm_kpm_action_definition_format4_s& action_definition_format4);
bool _process_ric_action_definition_format5(e2_sm_kpm_action_definition_format5_s& action_definition_format5);
void _fill_measurement_records(std::string meas_name, std::string label, meas_record_l& meas_record_list); void _fill_measurement_records(std::string meas_name, std::string label, meas_record_l& meas_record_list);
bool _generate_indication_header(E2SM_KPM_RIC_ind_header_t hdr, srsran::unique_byte_buffer_t& buf); bool _generate_indication_header(E2SM_KPM_RIC_ind_header_t hdr, srsran::unique_byte_buffer_t& buf);
bool _generate_indication_message(E2SM_KPM_RIC_ind_message_t msg, srsran::unique_byte_buffer_t& buf); bool _generate_indication_message(E2SM_KPM_RIC_ind_message_t msg, srsran::unique_byte_buffer_t& buf);

@ -111,52 +111,82 @@ bool e2sm_kpm::process_ric_event_trigger_definition(ricsubscription_request_s
bool e2sm_kpm::process_ric_action_definition(ri_caction_to_be_setup_item_s ric_action, E2AP_RIC_action_t& action_entry) bool e2sm_kpm::process_ric_action_definition(ri_caction_to_be_setup_item_s ric_action, E2AP_RIC_action_t& action_entry)
{ {
bool admit_action = false;
e2_sm_kpm_action_definition_s e2sm_kpm_action_def; e2_sm_kpm_action_definition_s e2sm_kpm_action_def;
asn1::cbit_ref bref(ric_action.ric_action_definition.data(), ric_action.ric_action_definition.size()); asn1::cbit_ref bref(ric_action.ric_action_definition.data(), ric_action.ric_action_definition.size());
uint64_t granul_period;
uint64_t eutra_cell_id;
uint64_t plmn_id;
ueid_c ue_id;
meas_info_list_l meas_info_list;
if (e2sm_kpm_action_def.unpack(bref) != asn1::SRSASN_SUCCESS) { if (e2sm_kpm_action_def.unpack(bref) != asn1::SRSASN_SUCCESS) {
return false; return false;
} }
switch (e2sm_kpm_action_def.ric_style_type) { switch (e2sm_kpm_action_def.ric_style_type) {
case 1: case 1:
granul_period = e2sm_kpm_action_def.action_definition_formats.action_definition_format1().granul_period; admit_action = _process_ric_action_definition_format1(
e2sm_kpm_action_def.action_definition_formats.action_definition_format1());
break;
case 2:
admit_action = _process_ric_action_definition_format2(
e2sm_kpm_action_def.action_definition_formats.action_definition_format2());
break;
case 3:
admit_action = _process_ric_action_definition_format3(
e2sm_kpm_action_def.action_definition_formats.action_definition_format3());
break;
case 4:
admit_action = _process_ric_action_definition_format4(
e2sm_kpm_action_def.action_definition_formats.action_definition_format4());
break;
case 5:
admit_action = _process_ric_action_definition_format5(
e2sm_kpm_action_def.action_definition_formats.action_definition_format5());
break;
default:
logger.info("Unknown RIC style type %i -> do not admit action %i (type %i)",
e2sm_kpm_action_def.ric_style_type,
ric_action.ric_action_id,
ric_action.ric_action_type);
return false;
}
if (admit_action) {
action_entry.sm_local_ric_action_id = _generate_local_action_id();
registered_actions.insert(
std::pair<uint32_t, e2_sm_kpm_action_definition_s>(action_entry.sm_local_ric_action_id, e2sm_kpm_action_def));
}
return true;
}
bool e2sm_kpm::_process_ric_action_definition_format1(e2_sm_kpm_action_definition_format1_s& action_definition_format1)
{
uint64_t granul_period;
uint64_t eutra_cell_id;
uint64_t plmn_id;
ueid_c ue_id;
meas_info_list_l meas_info_list;
granul_period = action_definition_format1.granul_period;
if (granul_period == 0) { if (granul_period == 0) {
logger.debug("Action granularity period of %i is not supported -> do not admitted action %i", logger.debug("Action granularity period of %i is not supported -> do not admitted action\n", granul_period);
granul_period,
ric_action.ric_action_id);
return false; return false;
} }
if (e2sm_kpm_action_def.action_definition_formats.action_definition_format1().cell_global_id_present) { if (action_definition_format1.cell_global_id_present) {
if (e2sm_kpm_action_def.action_definition_formats.action_definition_format1().cell_global_id.type() == if (action_definition_format1.cell_global_id.type() == cgi_c::types_opts::eutra_cgi) {
cgi_c::types_opts::eutra_cgi) { eutra_cell_id = action_definition_format1.cell_global_id.eutra_cgi().eutra_cell_id.to_number();
eutra_cell_id = e2sm_kpm_action_def.action_definition_formats.action_definition_format1() plmn_id = action_definition_format1.cell_global_id.eutra_cgi().plmn_id.to_number();
.cell_global_id.eutra_cgi()
.eutra_cell_id.to_number();
plmn_id = e2sm_kpm_action_def.action_definition_formats.action_definition_format1()
.cell_global_id.eutra_cgi()
.plmn_id.to_number();
logger.debug("plmn_id 0x%x, eutra_cell_id %i", plmn_id, eutra_cell_id); logger.debug("plmn_id 0x%x, eutra_cell_id %i", plmn_id, eutra_cell_id);
// TODO: check if E2 node has cell_id and plmn_id // TODO: check if E2 node has cell_id and plmn_id
} }
} }
meas_info_list = e2sm_kpm_action_def.action_definition_formats.action_definition_format1().meas_info_list; meas_info_list = action_definition_format1.meas_info_list;
for (uint32_t i = 0; i < meas_info_list.size(); i++) { for (uint32_t i = 0; i < meas_info_list.size(); i++) {
std::string meas_name = meas_info_list[i].meas_type.meas_name().to_string(); std::string meas_name = meas_info_list[i].meas_type.meas_name().to_string();
if (std::find(supported_meas_types.begin(), supported_meas_types.end(), meas_name.c_str()) == if (std::find(supported_meas_types.begin(), supported_meas_types.end(), meas_name.c_str()) ==
supported_meas_types.end()) { supported_meas_types.end()) {
printf("Unsupported measurement name: \"%s\" --> do not admit action %i \n", printf("Unsupported measurement name: \"%s\" --> do not admit action\n", meas_name.c_str());
meas_name.c_str(),
ric_action.ric_action_id);
return false; return false;
} }
@ -176,21 +206,30 @@ bool e2sm_kpm::process_ric_action_definition(ri_caction_to_be_setup_item_s ric_a
} }
} }
} }
action_entry.sm_local_ric_action_id = _generate_local_action_id();
registered_actions.insert(
std::pair<uint32_t, e2_sm_kpm_action_definition_s>(action_entry.sm_local_ric_action_id, e2sm_kpm_action_def));
break;
default:
logger.info("Unknown RIC style type %i -> do not admit action %i (type %i)",
e2sm_kpm_action_def.ric_style_type,
ric_action.ric_action_id,
ric_action.ric_action_type);
return false;
}
return true; return true;
} }
bool e2sm_kpm::_process_ric_action_definition_format2(e2_sm_kpm_action_definition_format2_s& action_definition_format2)
{
return false;
}
bool e2sm_kpm::_process_ric_action_definition_format3(e2_sm_kpm_action_definition_format3_s& action_definition_format3)
{
return false;
}
bool e2sm_kpm::_process_ric_action_definition_format4(e2_sm_kpm_action_definition_format4_s& action_definition_format4)
{
return false;
}
bool e2sm_kpm::_process_ric_action_definition_format5(e2_sm_kpm_action_definition_format5_s& action_definition_format5)
{
return false;
}
bool e2sm_kpm::remove_ric_action_definition(E2AP_RIC_action_t& action_entry) bool e2sm_kpm::remove_ric_action_definition(E2AP_RIC_action_t& action_entry)
{ {
if (registered_actions.count(action_entry.sm_local_ric_action_id)) { if (registered_actions.count(action_entry.sm_local_ric_action_id)) {

Loading…
Cancel
Save