diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index 4c30c8be9..58cdfe038 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -24,7 +24,7 @@ #include "rrc_cell_cfg.h" #include "rrc_metrics.h" -#include "rrc_ue.h" +#include "rrc_ue_cfg.h" #include "srsenb/hdr/stack/upper/common_enb.h" #include "srslte/common/block_queue.h" #include "srslte/common/buffer_pool.h" @@ -202,11 +202,7 @@ private: uint8_t transaction_id = 0; rrc_state_t state = RRC_STATE_IDLE; - std::map srbs; - std::map drbs; - asn1::s1ap::ue_aggregate_maximum_bitrate_s bitrates; - security_cfg_handler ue_security_cfg; bool eutra_capabilities_unpacked = false; asn1::rrc::ue_eutra_cap_s eutra_capabilities; srslte::rrc_ue_capabilities_t ue_capabilities; @@ -214,7 +210,8 @@ private: const static uint32_t UE_PCELL_CC_IDX = 0; cell_ctxt_dedicated_list cell_ded_list; - bearer_handler bearer_list; + bearer_cfg_handler bearer_list; + security_cfg_handler ue_security_cfg; ///< Helper to access a cell cfg based on ue_cc_idx cell_info_common* get_ue_cc_cfg(uint32_t ue_cc_idx); diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue_cfg.h similarity index 94% rename from srsenb/hdr/stack/rrc/rrc_ue.h rename to srsenb/hdr/stack/rrc/rrc_ue_cfg.h index 52b5f8148..fde833e23 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue_cfg.h @@ -19,8 +19,8 @@ * */ -#ifndef SRSLTE_RRC_UE_H -#define SRSLTE_RRC_UE_H +#ifndef SRSLTE_RRC_UE_CFG_H +#define SRSLTE_RRC_UE_CFG_H #include "srsenb/hdr/stack/rrc/rrc_config.h" #include "srslte/common/logmap.h" @@ -48,7 +48,7 @@ private: srslte::as_security_config_t sec_cfg = {}; }; -class bearer_handler +class bearer_cfg_handler { public: struct erab_t { @@ -59,7 +59,7 @@ public: uint32_t teid_in = 0; }; - bearer_handler(uint16_t rnti_, const rrc_cfg_t& cfg_, gtpu_interface_rrc* gtpu_); + bearer_cfg_handler(uint16_t rnti_, const rrc_cfg_t& cfg_, gtpu_interface_rrc* gtpu_); void add_srb(uint8_t srb_id); int add_erab(uint8_t erab_id, @@ -102,4 +102,4 @@ private: } // namespace srsenb -#endif // SRSLTE_RRC_UE_H +#endif // SRSLTE_RRC_UE_CFG_H diff --git a/srsenb/src/stack/rrc/CMakeLists.txt b/srsenb/src/stack/rrc/CMakeLists.txt index d7257eb42..ee3807b5c 100644 --- a/srsenb/src/stack/rrc/CMakeLists.txt +++ b/srsenb/src/stack/rrc/CMakeLists.txt @@ -18,5 +18,5 @@ # and at http://www.gnu.org/licenses/. # -set(SOURCES rrc.cc rrc_mobility.cc rrc_cell_cfg.cc rrc_ue.cc) +set(SOURCES rrc.cc rrc_mobility.cc rrc_cell_cfg.cc rrc_ue_cfg.cc) add_library(srsenb_rrc STATIC ${SOURCES}) diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue_cfg.cc similarity index 92% rename from srsenb/src/stack/rrc/rrc_ue.cc rename to srsenb/src/stack/rrc/rrc_ue_cfg.cc index a611c2019..e0307bb6f 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue_cfg.cc @@ -19,7 +19,7 @@ * */ -#include "srsenb/hdr/stack/rrc/rrc_ue.h" +#include "srsenb/hdr/stack/rrc/rrc_ue_cfg.h" #include "srsenb/hdr/stack/upper/common_enb.h" #include "srslte/asn1/rrc_asn1_utils.h" #include "srslte/interfaces/sched_interface.h" @@ -191,13 +191,13 @@ void security_cfg_handler::set_security_key(const asn1::fixed_bitstring<256, fal * Bearer Handler ****************************/ -bearer_handler::bearer_handler(uint16_t rnti_, const rrc_cfg_t& cfg_, gtpu_interface_rrc* gtpu_) : +bearer_cfg_handler::bearer_cfg_handler(uint16_t rnti_, const rrc_cfg_t& cfg_, gtpu_interface_rrc* gtpu_) : rnti(rnti_), cfg(&cfg_), gtpu(gtpu_) {} -void bearer_handler::add_srb(uint8_t srb_id) +void bearer_cfg_handler::add_srb(uint8_t srb_id) { if (srb_id > 2 or srb_id == 0) { log_h->error("Invalid SRB id=%d\n", srb_id); @@ -212,11 +212,11 @@ void bearer_handler::add_srb(uint8_t srb_id) srb_it->rlc_cfg.set(srb_to_add_mod_s::rlc_cfg_c_::types_opts::default_value); } -int bearer_handler::add_erab(uint8_t erab_id, - const asn1::s1ap::erab_level_qos_params_s& qos, - const asn1::bounded_bitstring<1, 160, true, true>& addr, - uint32_t teid_out, - const asn1::unbounded_octstring* nas_pdu) +int bearer_cfg_handler::add_erab(uint8_t erab_id, + const asn1::s1ap::erab_level_qos_params_s& qos, + const asn1::bounded_bitstring<1, 160, true, true>& addr, + uint32_t teid_out, + const asn1::unbounded_octstring* nas_pdu) { if (erab_id < 5) { log_h->error("ERAB id=%d is invalid\n", erab_id); @@ -271,7 +271,7 @@ int bearer_handler::add_erab(uint8_t return SRSLTE_SUCCESS; } -void bearer_handler::release_erab(uint8_t erab_id) +void bearer_cfg_handler::release_erab(uint8_t erab_id) { auto it = erabs.find(erab_id); if (it == erabs.end()) { @@ -286,7 +286,7 @@ void bearer_handler::release_erab(uint8_t erab_id) erab_info_list.erase(erab_id); } -void bearer_handler::release_erabs() +void bearer_cfg_handler::release_erabs() { // TODO: notify GTPU layer for each ERAB erabs.clear(); @@ -295,7 +295,7 @@ void bearer_handler::release_erabs() } } -void bearer_handler::rr_ded_cfg_complete() +void bearer_cfg_handler::rr_ded_cfg_complete() { // Apply changes in internal bearer_handler DRB/SRBtoAddModLists srslte::apply_addmodlist_diff(last_srbs, srbs_to_add, last_srbs); @@ -307,7 +307,7 @@ void bearer_handler::rr_ded_cfg_complete() drbs_to_release.resize(0); } -bool bearer_handler::fill_rr_cfg_ded(asn1::rrc::rr_cfg_ded_s& msg) +bool bearer_cfg_handler::fill_rr_cfg_ded(asn1::rrc::rr_cfg_ded_s& msg) { // Add altered bearers to message msg.srb_to_add_mod_list_present = srbs_to_add.size() > 0; @@ -319,7 +319,7 @@ bool bearer_handler::fill_rr_cfg_ded(asn1::rrc::rr_cfg_ded_s& msg) return msg.srb_to_add_mod_list_present or msg.drb_to_add_mod_list_present or msg.drb_to_release_list_present; } -void bearer_handler::apply_mac_bearer_updates(mac_interface_rrc* mac, sched_interface::ue_cfg_t* sched_ue_cfg) +void bearer_cfg_handler::apply_mac_bearer_updates(mac_interface_rrc* mac, sched_interface::ue_cfg_t* sched_ue_cfg) { srsenb::sched_interface::ue_bearer_cfg_t bearer_cfg = {}; for (const srb_to_add_mod_s& srb : srbs_to_add) { @@ -341,7 +341,7 @@ void bearer_handler::apply_mac_bearer_updates(mac_interface_rrc* mac, sched_inte } } -void bearer_handler::apply_pdcp_bearer_updates(pdcp_interface_rrc* pdcp, const security_cfg_handler& ue_sec_cfg) +void bearer_cfg_handler::apply_pdcp_bearer_updates(pdcp_interface_rrc* pdcp, const security_cfg_handler& ue_sec_cfg) { for (const srb_to_add_mod_s& srb : srbs_to_add) { pdcp->add_bearer(rnti, srb.srb_id, srslte::make_srb_pdcp_config_t(srb.srb_id, false)); @@ -374,7 +374,7 @@ void bearer_handler::apply_pdcp_bearer_updates(pdcp_interface_rrc* pdcp, const s } } -void bearer_handler::apply_rlc_bearer_updates(rlc_interface_rrc* rlc) +void bearer_cfg_handler::apply_rlc_bearer_updates(rlc_interface_rrc* rlc) { for (const srb_to_add_mod_s& srb : srbs_to_add) { rlc->add_bearer(rnti, srb.srb_id, srslte::rlc_config_t::srb_config(srb.srb_id)); @@ -390,7 +390,7 @@ void bearer_handler::apply_rlc_bearer_updates(rlc_interface_rrc* rlc) } } -void bearer_handler::fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_s* msg) +void bearer_cfg_handler::fill_pending_nas_info(asn1::rrc::rrc_conn_recfg_r8_ies_s* msg) { // Add space for NAS messages uint8_t n_nas = erab_info_list.size();