e2ap: update RIC indication generation

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent c564e18ef0
commit 83e7280010

@ -45,13 +45,13 @@ typedef struct {
} ric_subscription_reponse_t; } ric_subscription_reponse_t;
typedef struct { typedef struct {
uint32_t ric_requestor_id; uint32_t ric_requestor_id;
uint32_t ric_instance_id; uint32_t ric_instance_id;
uint32_t ra_nfunction_id; uint32_t ra_nfunction_id;
uint32_t ri_caction_id; uint32_t ri_caction_id;
ri_cind_type_e indication_type; ri_cind_type_e indication_type;
RIC_indication_header indication_header; srsran::unique_byte_buffer_t ri_cind_hdr;
RIC_indication_message indication_message; srsran::unique_byte_buffer_t ri_cind_msg;
} ric_indication_t; } ric_indication_t;
class e2ap class e2ap
@ -73,6 +73,7 @@ public:
int process_reset_response(reset_resp_s reset_response); int process_reset_response(reset_resp_s reset_response);
int get_reset_id(); int get_reset_id();
bool has_setup_response() { return setup_response_received; } bool has_setup_response() { return setup_response_received; }
bool get_func_desc(uint32_t ran_func_id, RANfunction_description& fdesc);
private: private:
srslog::basic_logger& logger; srslog::basic_logger& logger;

@ -18,7 +18,7 @@
#ifndef RIC_E2SM_KPM_H #ifndef RIC_E2SM_KPM_H
#define RIC_E2SM_KPM_H #define RIC_E2SM_KPM_H
struct RIC_indication_header { struct E2SM_KPM_RIC_ind_header {
uint32_t collet_start_time; uint32_t collet_start_time;
std::string file_formatversion; std::string file_formatversion;
std::string sender_name; std::string sender_name;
@ -26,7 +26,7 @@ struct RIC_indication_header {
std::string vendor_name; std::string vendor_name;
}; };
struct RIC_indication_message { struct E2SM_KPM_RIC_ind_message {
asn1::e2sm_kpm::e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types ind_msg_format; asn1::e2sm_kpm::e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types ind_msg_format;
asn1::e2sm_kpm::meas_data_l meas_data; asn1::e2sm_kpm::meas_data_l meas_data;
asn1::e2sm_kpm::meas_info_list_l meas_info_list; asn1::e2sm_kpm::meas_info_list_l meas_info_list;
@ -46,8 +46,8 @@ public:
virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf); virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf);
int process_ric_action_definition(); int process_ric_action_definition();
bool generate_indication_header(RIC_indication_header hdr, srsran::unique_byte_buffer_t& buf); bool generate_indication_header(E2SM_KPM_RIC_ind_header hdr, srsran::unique_byte_buffer_t& buf);
bool generate_indication_message(RIC_indication_message msg, srsran::unique_byte_buffer_t& buf); bool generate_indication_message(E2SM_KPM_RIC_ind_message msg, srsran::unique_byte_buffer_t& buf);
private: private:
srslog::basic_logger& logger; srslog::basic_logger& logger;

@ -15,6 +15,15 @@ e2ap::e2ap(srslog::basic_logger& logger, srsenb::e2_interface_metrics* _gnb_metr
ran_functions[local_ran_function_id] = add_func; ran_functions[local_ran_function_id] = add_func;
} }
bool e2ap::get_func_desc(uint32_t ran_func_id, RANfunction_description& fdesc)
{
if (ran_functions.count(ran_func_id)) {
fdesc = ran_functions.at(ran_func_id);
return true;
}
return false;
}
e2_ap_pdu_c e2ap::generate_setup_request() e2_ap_pdu_c e2ap::generate_setup_request()
{ {
e2_ap_pdu_c pdu; e2_ap_pdu_c pdu;
@ -188,17 +197,17 @@ e2_ap_pdu_c e2ap::generate_indication(ric_indication_t& ric_indication)
indication->ri_cind_type.crit = asn1::crit_opts::reject; indication->ri_cind_type.crit = asn1::crit_opts::reject;
indication->ri_cind_type.value = ric_indication.indication_type; indication->ri_cind_type.value = ric_indication.indication_type;
indication->ri_cind_hdr.crit = asn1::crit_opts::reject; indication->ri_cind_hdr.crit = asn1::crit_opts::reject;
srsran::unique_byte_buffer_t header_buf = srsran::make_byte_buffer(); indication->ri_cind_hdr->resize(ric_indication.ri_cind_hdr->N_bytes);
e2sm_.generate_indication_header(ric_indication.indication_header, header_buf); std::copy(ric_indication.ri_cind_hdr->msg,
indication->ri_cind_hdr->resize(header_buf->N_bytes); ric_indication.ri_cind_hdr->msg + ric_indication.ri_cind_hdr->N_bytes,
std::copy(header_buf->msg, header_buf->msg + header_buf->N_bytes, indication->ri_cind_hdr->data()); indication->ri_cind_hdr->data());
indication->ri_cind_msg.crit = asn1::crit_opts::reject; indication->ri_cind_msg.crit = asn1::crit_opts::reject;
srsran::unique_byte_buffer_t msg_buf = srsran::make_byte_buffer(); indication->ri_cind_msg->resize(ric_indication.ri_cind_msg->N_bytes);
e2sm_.generate_indication_message(ric_indication.indication_message, msg_buf); std::copy(ric_indication.ri_cind_msg->msg,
indication->ri_cind_msg->resize(msg_buf->N_bytes); ric_indication.ri_cind_msg->msg + ric_indication.ri_cind_msg->N_bytes,
std::copy(msg_buf->msg, msg_buf->msg + msg_buf->N_bytes, indication->ri_cind_msg->data()); indication->ri_cind_msg->data());
return pdu; return pdu;
} }

@ -88,7 +88,7 @@ int e2sm_kpm::process_ric_action_definition()
return 0; return 0;
} }
bool e2sm_kpm::generate_indication_header(RIC_indication_header hdr, srsran::unique_byte_buffer_t& buf) bool e2sm_kpm::generate_indication_header(E2SM_KPM_RIC_ind_header hdr, srsran::unique_byte_buffer_t& buf)
{ {
using namespace asn1::e2sm_kpm; using namespace asn1::e2sm_kpm;
e2_sm_kpm_ind_hdr_s e2_sm_kpm_ind_hdr; e2_sm_kpm_ind_hdr_s e2_sm_kpm_ind_hdr;
@ -108,7 +108,7 @@ bool e2sm_kpm::generate_indication_header(RIC_indication_header hdr, srsran::uni
return true; return true;
} }
bool e2sm_kpm::generate_indication_message(RIC_indication_message msg, srsran::unique_byte_buffer_t& buf) bool e2sm_kpm::generate_indication_message(E2SM_KPM_RIC_ind_message msg, srsran::unique_byte_buffer_t& buf)
{ {
using namespace asn1::e2sm_kpm; using namespace asn1::e2sm_kpm;
e2_sm_kpm_ind_msg_s e2_sm_kpm_ind_msg; e2_sm_kpm_ind_msg_s e2_sm_kpm_ind_msg;

@ -70,26 +70,40 @@ void ric_client::ric_subscription::send_ric_indication()
ric_indication.ric_instance_id = ric_instance_id; ric_indication.ric_instance_id = ric_instance_id;
ric_indication.ra_nfunction_id = ra_nfunction_id; ric_indication.ra_nfunction_id = ra_nfunction_id;
ric_indication.ri_caction_id = ri_caction_id; ric_indication.ri_caction_id = ri_caction_id;
ric_indication.indication_type = ri_cind_type_opts::report;
ric_indication.indication_type = ri_cind_type_opts::report; RANfunction_description ran_func_desc;
ric_indication.indication_header.collet_start_time = 0x12345; e2sm* sm_ptr = nullptr;
if (!parent->e2ap_.get_func_desc(ra_nfunction_id, ran_func_desc)) {
return;
}
e2sm_kpm* sm_kpm_ptr = dynamic_cast<e2sm_kpm*>(ran_func_desc.sm_ptr);
ric_indication.indication_message.ind_msg_format = E2SM_KPM_RIC_ind_header ric_ind_header;
e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types_opts::ind_msg_format1; ric_ind_header.collet_start_time = 0x12345;
ric_indication.ri_cind_hdr = srsran::make_byte_buffer();
sm_kpm_ptr->generate_indication_header(ric_ind_header, ric_indication.ri_cind_hdr);
ric_indication.indication_message.meas_data.resize(1); E2SM_KPM_RIC_ind_message ric_ind_message;
ric_indication.indication_message.meas_data[0].meas_record.resize(5); ric_ind_message.ind_msg_format = e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types_opts::ind_msg_format1;
for (uint32_t i = 0; i < ric_indication.indication_message.meas_data[0].meas_record.size(); i++) {
ric_indication.indication_message.meas_data[0].meas_record[i].set_integer() = i * 1000; ric_ind_message.meas_data.resize(1);
ric_ind_message.meas_data[0].meas_record.resize(5);
for (uint32_t i = 0; i < ric_ind_message.meas_data[0].meas_record.size(); i++) {
ric_ind_message.meas_data[0].meas_record[i].set_integer() = i * 1000;
} }
ric_indication.indication_message.meas_info_list.resize(1); ric_ind_message.meas_info_list.resize(1);
ric_indication.indication_message.meas_info_list[0].meas_type.set_meas_name().from_string("RRU.PrbTotDl"); ric_ind_message.meas_info_list[0].meas_type.set_meas_name().from_string("RRU.PrbTotDl");
ric_indication.indication_message.meas_info_list[0].label_info_list.resize(1); ric_ind_message.meas_info_list[0].label_info_list.resize(1);
ric_indication.indication_message.meas_info_list[0].label_info_list[0].meas_label.no_label_present = true; ric_ind_message.meas_info_list[0].label_info_list[0].meas_label.no_label_present = true;
ric_indication.indication_message.meas_info_list[0].label_info_list[0].meas_label.no_label = ric_ind_message.meas_info_list[0].label_info_list[0].meas_label.no_label =
asn1::e2sm_kpm::meas_label_s::no_label_opts::true_value; asn1::e2sm_kpm::meas_label_s::no_label_opts::true_value;
ric_indication.ri_cind_msg = srsran::make_byte_buffer();
sm_kpm_ptr->generate_indication_message(ric_ind_message, ric_indication.ri_cind_msg);
e2_ap_pdu_c send_pdu = parent->e2ap_.generate_indication(ric_indication); e2_ap_pdu_c send_pdu = parent->e2ap_.generate_indication(ric_indication);
parent->queue_send_e2ap_pdu(send_pdu); parent->queue_send_e2ap_pdu(send_pdu);

Loading…
Cancel
Save