|
|
|
@ -44,7 +44,7 @@ enb_stack_lte::enb_stack_lte(srslog::sink& log_sink) :
|
|
|
|
|
rlc_nr(rlc_nr_logger),
|
|
|
|
|
gtpu(&task_sched, gtpu_logger, &rx_sockets),
|
|
|
|
|
s1ap(&task_sched, s1ap_logger, &rx_sockets),
|
|
|
|
|
rrc(&task_sched),
|
|
|
|
|
rrc(this, &task_sched),
|
|
|
|
|
rrc_nr(&task_sched),
|
|
|
|
|
mac_pcap(),
|
|
|
|
|
pending_stack_metrics(64)
|
|
|
|
@ -278,17 +278,40 @@ void enb_stack_lte::run_thread()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void enb_stack_lte::write_sdu(uint16_t rnti,
|
|
|
|
|
uint32_t lcid /* to be replaced with eps_bearer_id */,
|
|
|
|
|
srsran::unique_byte_buffer_t sdu,
|
|
|
|
|
int pdcp_sn)
|
|
|
|
|
void enb_stack_lte::write_sdu(uint16_t rnti, uint32_t eps_bearer_id, srsran::unique_byte_buffer_t sdu, int pdcp_sn)
|
|
|
|
|
{
|
|
|
|
|
pdcp.write_sdu(rnti, lcid, std::move(sdu), pdcp_sn);
|
|
|
|
|
auto bearer = bearers.get_radio_bearer(rnti, eps_bearer_id);
|
|
|
|
|
auto task = [this, rnti, eps_bearer_id, bearer, pdcp_sn](srsran::unique_byte_buffer_t& sdu) {
|
|
|
|
|
// route SDU to PDCP entity
|
|
|
|
|
if (bearer.rat == srsran_rat_t::lte) {
|
|
|
|
|
pdcp.write_sdu(rnti, bearer.lcid, std::move(sdu), pdcp_sn);
|
|
|
|
|
} else if (bearer.rat == srsran_rat_t::nr) {
|
|
|
|
|
pdcp_nr.write_sdu(rnti, bearer.lcid, std::move(sdu), pdcp_sn);
|
|
|
|
|
} else {
|
|
|
|
|
stack_logger.warning("Can't deliver SDU for EPS bearer %d. Dropping it.", eps_bearer_id);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::map<uint32_t, srsran::unique_byte_buffer_t> enb_stack_lte::get_buffered_pdus(uint16_t rnti, uint32_t lcid)
|
|
|
|
|
{
|
|
|
|
|
// TODO: use eps_bearer_id as lookup too
|
|
|
|
|
return pdcp.get_buffered_pdus(rnti, lcid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void enb_stack_lte::add_eps_bearer(uint16_t rnti, uint8_t eps_bearer_id, srsran::srsran_rat_t rat, uint32_t lcid)
|
|
|
|
|
{
|
|
|
|
|
bearers.add_eps_bearer(rnti, eps_bearer_id, rat, lcid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void enb_stack_lte::remove_eps_bearer(uint16_t rnti, uint8_t eps_bearer_id)
|
|
|
|
|
{
|
|
|
|
|
bearers.remove_eps_bearer(rnti, eps_bearer_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void enb_stack_lte::reset_eps_bearers(uint16_t rnti)
|
|
|
|
|
{
|
|
|
|
|
bearers.reset(rnti);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace srsenb
|
|
|
|
|