e2sm: process RIC action definition

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

@ -52,6 +52,7 @@ public:
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);
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);

@ -46,6 +46,9 @@ private:
uint32_t reporting_period = 0; // ms
srsran::unique_timer reporting_timer; // for RIC indication reporting
std::vector<uint32_t> admitted_actions;
std::vector<uint32_t> not_admitted_actions;
};
} // namespace srsenb

@ -102,6 +102,87 @@ bool e2sm_kpm::process_subscription_request(asn1::e2ap::ricsubscription_request_
return true;
}
bool e2sm_kpm::process_ric_action_definition(asn1::e2ap::ri_caction_to_be_setup_item_s ric_action)
{
using namespace asn1::e2sm_kpm;
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());
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) {
return false;
}
switch (e2sm_kpm_action_def.ric_style_type) {
case 1:
granul_period = e2sm_kpm_action_def.action_definition_formats.action_definition_format1().granul_period;
if (granul_period == 0) {
logger.debug("Action granularity period of %i is not supported -> do not admitted action %i",
granul_period,
ric_action.ric_action_id);
return false;
}
if (e2sm_kpm_action_def.action_definition_formats.action_definition_format1().cell_global_id_present) {
if (e2sm_kpm_action_def.action_definition_formats.action_definition_format1().cell_global_id.type() ==
cgi_c::types_opts::eutra_cgi) {
eutra_cell_id = e2sm_kpm_action_def.action_definition_formats.action_definition_format1()
.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);
// 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;
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();
if (std::find(supported_meas_types.begin(), supported_meas_types.end(), meas_name.c_str()) ==
supported_meas_types.end()) {
printf("Unsupported measurement name: %s --> do not admit action %i \n",
meas_name.c_str(),
ric_action.ric_action_id);
return false;
}
printf("Admitted action: measurement name: %s with the following labels: \n", meas_name.c_str());
for (uint32_t l = 0; l < meas_info_list[i].label_info_list.size(); l++) {
if (meas_info_list[i].label_info_list[l].meas_label.no_label_present) {
printf("--- Label %i: NO LABEL\n", i);
}
if (meas_info_list[i].label_info_list[l].meas_label.min_present) {
printf("--- Label %i: MIN\n", i);
}
if (meas_info_list[i].label_info_list[l].meas_label.max_present) {
printf("--- Label %i: MAX\n", i);
}
if (meas_info_list[i].label_info_list[l].meas_label.avg_present) {
printf("--- Label %i: AVG\n", i);
}
}
}
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;
}
bool e2sm_kpm::generate_indication_header(E2SM_KPM_RIC_ind_header hdr, srsran::unique_byte_buffer_t& buf)
{
using namespace asn1::e2sm_kpm;

@ -37,6 +37,30 @@ ric_client::ric_subscription::ric_subscription(ric_client* ric_cli
reporting_period = event_def.report_period;
reporting_period = 1000; // TODO: to remove, keep it 1s for testing
}
ri_cactions_to_be_setup_list_l& action_list =
ric_subscription_request->ricsubscription_details->ric_action_to_be_setup_list;
for (uint32_t i = 0; i < action_list.size(); i++) {
ri_caction_to_be_setup_item_s action_item = action_list[i]->ri_caction_to_be_setup_item();
if (sm_kpm_ptr->process_ric_action_definition(action_item)) {
parent->logger.debug("Admitted action %i (type: %i)\n", action_item.ric_action_id, action_item.ric_action_type);
admitted_actions.push_back(action_item.ric_action_id);
if (action_item.ric_subsequent_action_present) {
parent->logger.debug("--Action %i (type: %i) contains subsequent action of type %i with wait time: %i\n",
action_item.ric_action_id,
action_item.ric_action_type,
action_item.ric_subsequent_action.ric_subsequent_action_type,
action_item.ric_subsequent_action.ric_time_to_wait);
} else {
parent->logger.debug(
"Not admitted action %i (type: %i)\n", action_item.ric_action_id, action_item.ric_action_type);
not_admitted_actions.push_back(action_item.ric_action_id);
}
}
}
}
void ric_client::ric_subscription::start_ric_indication_reporting()
@ -47,8 +71,13 @@ void ric_client::ric_subscription::start_ric_indication_reporting()
ric_subscription_reponse.ric_instance_id = ric_instance_id;
ric_subscription_reponse.ra_nfunction_id = ra_nfunction_id;
ric_subscription_reponse.admitted_actions.push_back(0);
ric_subscription_reponse.not_admitted_actions.push_back(10);
for (auto& action : admitted_actions) {
ric_subscription_reponse.admitted_actions.push_back(action);
}
for (auto& action : not_admitted_actions) {
ric_subscription_reponse.not_admitted_actions.push_back(action);
}
e2_ap_pdu_c send_pdu = parent->e2ap_.generate_subscription_response(ric_subscription_reponse);
parent->queue_send_e2ap_pdu(send_pdu);

Loading…
Cancel
Save