e2ap: change e2ap::generate_setup_request func

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

@ -5,6 +5,14 @@
e2ap::e2ap(srslog::basic_logger& logger, srsenb::e2_interface_metrics* _gnb_metrics) : logger(logger), e2sm_(logger) e2ap::e2ap(srslog::basic_logger& logger, srsenb::e2_interface_metrics* _gnb_metrics) : logger(logger), e2sm_(logger)
{ {
gnb_metrics = _gnb_metrics; gnb_metrics = _gnb_metrics;
// add SMs to map
uint32_t local_ran_function_id = 147;
RANfunction_description add_func;
add_func.function_instance = 0;
add_func.sm_type = e2sm_type_t::E2SM_KPM;
add_func.sm_ptr = &e2sm_;
ran_functions[local_ran_function_id] = add_func;
} }
e2_ap_pdu_c e2ap::generate_setup_request() e2_ap_pdu_c e2ap::generate_setup_request()
@ -25,28 +33,26 @@ e2_ap_pdu_c e2ap::generate_setup_request()
// add all supported e2SM functions // add all supported e2SM functions
setup->ra_nfunctions_added.crit = asn1::crit_opts::reject; setup->ra_nfunctions_added.crit = asn1::crit_opts::reject;
auto& ra_nfunc_list = setup->ra_nfunctions_added.value; auto& ra_nfunc_list = setup->ra_nfunctions_added.value;
ra_nfunc_list.resize(1); ra_nfunc_list.resize(ran_functions.size());
// E2SM-KPM uint32_t idx = 0;
uint32_t local_ran_function_id = 147; for (auto& x : ran_functions) {
ra_nfunction_item_s& ran_func = ra_nfunc_list[0].value().ra_nfunction_item(); uint32_t local_ran_function_id = x.first;
ran_func.ran_function_id = local_ran_function_id; e2sm* sm_ptr = x.second.sm_ptr;
ran_func.ran_function_revision = e2sm_.get_revision();
ran_func.ran_function_oid.from_string(e2sm_.get_oid().c_str()); ra_nfunction_item_s& ran_func = ra_nfunc_list[idx].value().ra_nfunction_item();
ran_func.ran_function_id = local_ran_function_id;
// add function to map ran_func.ran_function_revision = sm_ptr->get_revision();
RANfunction_description add_func; ran_func.ran_function_oid.from_string(sm_ptr->get_oid().c_str());
add_func.function_instance = 0;
add_func.sm_type = e2sm_type_t::E2SM_KPM; auto& ran_func_def = ran_func.ran_function_definition;
add_func.sm_ptr = &e2sm_; srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer();
ran_functions[local_ran_function_id] = add_func; sm_ptr->generate_ran_function_description(x.second, buf);
ran_func_def.resize(buf->N_bytes);
auto& ran_func_def = ran_func.ran_function_definition; buf->msg[1] = 0x30; // TODO: needed to keep wireshak happy, need better fix
srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer(); std::copy(buf->msg, buf->msg + buf->N_bytes, ran_func_def.data());
e2sm_.generate_ran_function_description(add_func, buf); idx++;
ran_func_def.resize(buf->N_bytes); }
buf->msg[1] = 0x30; // TODO: needed to keep wireshak happy, need better fix
std::copy(buf->msg, buf->msg + buf->N_bytes, ran_func_def.data());
setup->e2node_component_cfg_addition.crit = asn1::crit_opts::reject; setup->e2node_component_cfg_addition.crit = asn1::crit_opts::reject;
auto& list1 = setup->e2node_component_cfg_addition.value; auto& list1 = setup->e2node_component_cfg_addition.value;

Loading…
Cancel
Save