gnb,ngap: Added simple allocation of lcids to ngap_ue_bearer_manager.

master
Pedro Alvarez 3 years ago committed by Francisco Paisana
parent 194fb4fabf
commit 9f7ae7a2b2

@ -61,13 +61,16 @@ private:
std::map<uint8_t, pdu_session_t> pdu_session_list; std::map<uint8_t, pdu_session_t> pdu_session_list;
srslog::basic_logger& logger; srslog::basic_logger& logger;
int add_gtpu_bearer(uint16_t rnti, std::map<uint32_t, uint32_t> next_lcid_list; // Map RNTI to next LCID to be allocated
uint32_t pdu_session_id,
uint32_t teid_out, int add_gtpu_bearer(uint16_t rnti,
asn1::bounded_bitstring<1, 160, true, true> address, uint32_t pdu_session_id,
pdu_session_t::gtpu_tunnel& tunnel, // out parameter uint32_t teid_out,
const gtpu_interface_rrc::bearer_props* props = nullptr); asn1::bounded_bitstring<1, 160, true, true> address,
void rem_gtpu_bearer(uint16_t rnti, uint32_t pdu_session_id); pdu_session_t::gtpu_tunnel& tunnel, // out parameter
const gtpu_interface_rrc::bearer_props* props = nullptr);
void rem_gtpu_bearer(uint16_t rnti, uint32_t pdu_session_id);
uint8_t allocate_lcid(uint32_t rnti);
}; };
} // namespace srsenb } // namespace srsenb
#endif // SRSENB_NGAP_UE_BEARER_MANAGER_H #endif // SRSENB_NGAP_UE_BEARER_MANAGER_H

@ -37,6 +37,8 @@ int ngap_ue_bearer_manager::add_pdu_session(uint16_t
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
lcid = allocate_lcid(rnti);
// TODO: remove lcid and just use pdu_session_id and rnti as id for GTP tunnel // TODO: remove lcid and just use pdu_session_id and rnti as id for GTP tunnel
int rtn = add_gtpu_bearer(rnti, pdu_session_id, teid_out, addr_out, tunnel); int rtn = add_gtpu_bearer(rnti, pdu_session_id, teid_out, addr_out, tunnel);
if (rtn != SRSRAN_SUCCESS) { if (rtn != SRSRAN_SUCCESS) {
@ -62,6 +64,7 @@ int ngap_ue_bearer_manager::reset_pdu_sessions(uint16_t rnti)
auto pdu_session_id = iter->first; auto pdu_session_id = iter->first;
rem_gtpu_bearer(pdu_session_id, rnti); rem_gtpu_bearer(pdu_session_id, rnti);
} }
next_lcid_list.erase(rnti);
return true; return true;
} }
@ -110,4 +113,12 @@ void ngap_ue_bearer_manager::rem_gtpu_bearer(uint16_t rnti, uint32_t pdu_session
gtpu->rem_bearer(rnti, it->second.lcid); gtpu->rem_bearer(rnti, it->second.lcid);
} }
uint8_t ngap_ue_bearer_manager::allocate_lcid(uint32_t rnti)
{
if (next_lcid_list.find(rnti) == next_lcid_list.end()) {
next_lcid_list[rnti] = 4;
}
return next_lcid_list[rnti]++;
}
} // namespace srsenb } // namespace srsenb

@ -143,8 +143,8 @@ proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap_nr::pdu
// TODO: Check cause // TODO: Check cause
asn1::ngap_nr::cause_c cause; asn1::ngap_nr::cause_c cause;
uint32_t teid_in; uint32_t teid_in = {};
uint16_t lcid; uint16_t lcid = {};
asn1::bounded_bitstring<1, 160, true, true> addr_in; asn1::bounded_bitstring<1, 160, true, true> addr_in;
if (bearer_manager->add_pdu_session( if (bearer_manager->add_pdu_session(

Loading…
Cancel
Save