nr,gnb,pdcp: extend the use of local rb_name member to pdcp nr

This commit is contained in:
Francisco 2021-10-28 17:37:51 +01:00 committed by Francisco Paisana
parent c64be663d2
commit dfc2ea0a3e
3 changed files with 9 additions and 7 deletions

View File

@ -165,6 +165,8 @@ public:
status_report_required == other.status_report_required;
}
bool operator!=(const pdcp_config_t& other) const { return not(*this == other); }
std::string get_rb_name() const { return (rb_type == PDCP_RB_IS_DRB ? "DRB" : "SRB") + std::to_string(bearer_id); }
};
// Specifies in which direction security (integrity and ciphering) are enabled for PDCP

View File

@ -61,8 +61,7 @@ bool pdcp_entity_lte::configure(const pdcp_config_t& cnfg_)
}
cfg = cnfg_;
rb_name = cfg.rb_type == PDCP_RB_IS_DRB ? "DRB" : "SRB";
rb_name += std::to_string(cfg.bearer_id);
rb_name = cfg.get_rb_name();
maximum_pdcp_sn = (1u << cfg.sn_len) - 1u;
st.last_submitted_pdcp_rx_sn = maximum_pdcp_sn;

View File

@ -37,7 +37,7 @@ pdcp_entity_nr::~pdcp_entity_nr() {}
// Reestablishment procedure: 38.323 5.2
void pdcp_entity_nr::reestablish()
{
logger.info("Re-establish %s with bearer ID: %d", rrc->get_rb_name(lcid), cfg.bearer_id);
logger.info("Re-establish %s with bearer ID: %d", rb_name.c_str(), cfg.bearer_id);
// TODO
}
@ -46,13 +46,14 @@ bool pdcp_entity_nr::configure(const pdcp_config_t& cnfg_)
if (active) {
// Already configured
if (cnfg_ != cfg) {
logger.error("Bearer reconfiguration not supported. LCID=%s.", rrc->get_rb_name(lcid));
logger.error("Bearer reconfiguration not supported. LCID=%s.", rb_name.c_str());
return false;
}
return true;
}
cfg = cnfg_;
rb_name = cfg.get_rb_name();
window_size = 1 << (cfg.sn_len - 1);
// Timers
@ -70,7 +71,7 @@ bool pdcp_entity_nr::configure(const pdcp_config_t& cnfg_)
void pdcp_entity_nr::reset()
{
active = false;
logger.debug("Reset %s", rrc->get_rb_name(lcid));
logger.debug("Reset %s", rb_name.c_str());
}
// SDAP/RRC interface
@ -80,7 +81,7 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, int sn)
logger.info(sdu->msg,
sdu->N_bytes,
"TX %s SDU, integrity=%s, encryption=%s",
rrc->get_rb_name(lcid),
rb_name.c_str(),
srsran_direction_text[integrity_direction],
srsran_direction_text[encryption_direction]);
@ -136,7 +137,7 @@ void pdcp_entity_nr::write_pdu(unique_byte_buffer_t pdu)
logger.info(pdu->msg,
pdu->N_bytes,
"RX %s PDU (%d B), integrity=%s, encryption=%s",
rrc->get_rb_name(lcid),
rb_name.c_str(),
pdu->N_bytes,
srsran_direction_text[integrity_direction],
srsran_direction_text[encryption_direction]);