Removed get_bearer_status in PDCP. Renamed get_state/set_state to

get_bearer_state/set_bearer_state.
master
Pedro Alvarez 5 years ago
parent 208a539499
commit 9c1a7d2cf1

@ -384,10 +384,8 @@ public:
virtual void config_security(uint16_t rnti, uint32_t lcid, srslte::as_security_config_t sec_cfg) = 0; virtual void config_security(uint16_t rnti, uint32_t lcid, srslte::as_security_config_t sec_cfg) = 0;
virtual void enable_integrity(uint16_t rnti, uint32_t lcid) = 0; virtual void enable_integrity(uint16_t rnti, uint32_t lcid) = 0;
virtual void enable_encryption(uint16_t rnti, uint32_t lcid) = 0; virtual void enable_encryption(uint16_t rnti, uint32_t lcid) = 0;
virtual bool virtual bool get_bearer_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state) = 0;
get_bearer_status(uint16_t rnti, uint32_t lcid, uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn) = 0; virtual bool set_bearer_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state) = 0;
virtual bool get_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state) = 0;
virtual bool set_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state) = 0;
}; };
// PDCP interface for RLC // PDCP interface for RLC

@ -55,9 +55,8 @@ public:
void enable_integrity(uint32_t lcid, srslte_direction_t direction); void enable_integrity(uint32_t lcid, srslte_direction_t direction);
void enable_encryption(uint32_t lcid, srslte_direction_t direction); void enable_encryption(uint32_t lcid, srslte_direction_t direction);
void enable_security_timed(uint32_t lcid, srslte_direction_t direction, uint32_t sn); void enable_security_timed(uint32_t lcid, srslte_direction_t direction, uint32_t sn);
bool get_bearer_status(uint32_t lcid, uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn); bool get_bearer_state(uint32_t lcid, srslte::pdcp_lte_state_t* state);
bool get_state(uint32_t lcid, srslte::pdcp_lte_state_t* state); bool set_bearer_state(uint32_t lcid, const srslte::pdcp_lte_state_t& state);
bool set_state(uint32_t lcid, const srslte::pdcp_lte_state_t& state);
// RLC interface // RLC interface
void write_pdu(uint32_t lcid, unique_byte_buffer_t sdu); void write_pdu(uint32_t lcid, unique_byte_buffer_t sdu);

@ -58,9 +58,8 @@ public:
// GW/RRC interface // GW/RRC interface
void write_sdu(unique_byte_buffer_t sdu, bool blocking); void write_sdu(unique_byte_buffer_t sdu, bool blocking);
void get_bearer_status(uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn); void get_bearer_state(pdcp_lte_state_t* state);
void get_state(pdcp_lte_state_t* state); void set_bearer_state(const pdcp_lte_state_t& state);
void set_state(const pdcp_lte_state_t& state);
// RLC interface // RLC interface
void write_pdu(unique_byte_buffer_t pdu); void write_pdu(unique_byte_buffer_t pdu);

@ -219,30 +219,21 @@ void pdcp::enable_security_timed(uint32_t lcid, srslte_direction_t direction, ui
} }
} }
bool pdcp::get_bearer_status(uint32_t lcid, uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn) bool pdcp::get_bearer_state(uint32_t lcid, srslte::pdcp_lte_state_t* state)
{ {
if (not valid_lcid(lcid)) { if (not valid_lcid(lcid)) {
return false; return false;
} }
pdcp_array[lcid]->get_bearer_status(dlsn, dlhfn, ulsn, ulhfn); pdcp_array[lcid]->get_bearer_state(state);
return true; return true;
} }
bool pdcp::get_state(uint32_t lcid, srslte::pdcp_lte_state_t* state) bool pdcp::set_bearer_state(uint32_t lcid, const srslte::pdcp_lte_state_t& state)
{ {
if (not valid_lcid(lcid)) { if (not valid_lcid(lcid)) {
return false; return false;
} }
pdcp_array[lcid]->get_state(state); pdcp_array[lcid]->set_bearer_state(state);
return true;
}
bool pdcp::set_state(uint32_t lcid, const srslte::pdcp_lte_state_t& state)
{
if (not valid_lcid(lcid)) {
return false;
}
pdcp_array[lcid]->set_state(state);
return true; return true;
} }

@ -335,17 +335,6 @@ void pdcp_entity_lte::handle_am_drb_pdu(srslte::unique_byte_buffer_t pdu)
gw->write_pdu(lcid, std::move(pdu)); gw->write_pdu(lcid, std::move(pdu));
} }
/****************************************************************************
* Security functions
***************************************************************************/
void pdcp_entity_lte::get_bearer_status(uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn)
{
*dlsn = (uint16_t)st.next_pdcp_tx_sn;
*dlhfn = (uint16_t)st.tx_hfn;
*ulsn = (uint16_t)st.next_pdcp_rx_sn;
*ulhfn = (uint16_t)st.rx_hfn;
}
/**************************************************************************** /****************************************************************************
* Config checking helper * Config checking helper
***************************************************************************/ ***************************************************************************/
@ -373,12 +362,12 @@ bool pdcp_entity_lte::check_valid_config()
/**************************************************************************** /****************************************************************************
* Internal state getters/setters * Internal state getters/setters
***************************************************************************/ ***************************************************************************/
void pdcp_entity_lte::get_state(pdcp_lte_state_t* state) void pdcp_entity_lte::get_bearer_state(pdcp_lte_state_t* state)
{ {
*state = st; *state = st;
} }
void pdcp_entity_lte::set_state(const pdcp_lte_state_t& state) void pdcp_entity_lte::set_bearer_state(const pdcp_lte_state_t& state)
{ {
st = state; st = state;
} }

@ -77,7 +77,7 @@ public:
pdcp.enable_encryption(srslte::DIRECTION_TXRX); pdcp.enable_encryption(srslte::DIRECTION_TXRX);
} }
void set_pdcp_initial_state(const srslte::pdcp_lte_state_t& init_state) { pdcp.set_state(init_state); } void set_pdcp_initial_state(const srslte::pdcp_lte_state_t& init_state) { pdcp.set_bearer_state(init_state); }
rlc_dummy rlc; rlc_dummy rlc;
rrc_dummy rrc; rrc_dummy rrc;

@ -52,10 +52,8 @@ public:
void config_security(uint16_t rnti, uint32_t lcid, srslte::as_security_config_t cfg_sec) override; void config_security(uint16_t rnti, uint32_t lcid, srslte::as_security_config_t cfg_sec) override;
void enable_integrity(uint16_t rnti, uint32_t lcid) override; void enable_integrity(uint16_t rnti, uint32_t lcid) override;
void enable_encryption(uint16_t rnti, uint32_t lcid) override; void enable_encryption(uint16_t rnti, uint32_t lcid) override;
bool get_bearer_status(uint16_t rnti, uint32_t lcid, uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn) bool get_bearer_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state) override;
override; bool set_bearer_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state) override;
bool get_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state);
bool set_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state);
private: private:
class user_interface_rlc : public srsue::rlc_interface_pdcp class user_interface_rlc : public srsue::rlc_interface_pdcp

@ -816,10 +816,15 @@ bool rrc::ue::rrc_mobility::start_enb_status_transfer()
s1ap_interface_rrc::bearer_status_info b = {}; s1ap_interface_rrc::bearer_status_info b = {};
uint8_t lcid = erab_pair.second.id - 2u; uint8_t lcid = erab_pair.second.id - 2u;
b.erab_id = erab_pair.second.id; b.erab_id = erab_pair.second.id;
if (not rrc_enb->pdcp->get_bearer_status(rrc_ue->rnti, lcid, &b.pdcp_dl_sn, &b.dl_hfn, &b.pdcp_ul_sn, &b.ul_hfn)) { srslte::pdcp_lte_state_t pdcp_state = {};
if (not rrc_enb->pdcp->get_bearer_state(rrc_ue->rnti, lcid, &pdcp_state)) {
Error("PDCP bearer lcid=%d for rnti=0x%x was not found\n", lcid, rrc_ue->rnti); Error("PDCP bearer lcid=%d for rnti=0x%x was not found\n", lcid, rrc_ue->rnti);
return false; return false;
} }
b.dl_hfn = pdcp_state.tx_hfn;
b.pdcp_dl_sn = pdcp_state.next_pdcp_tx_sn;
b.ul_hfn = pdcp_state.rx_hfn;
b.pdcp_ul_sn = pdcp_state.next_pdcp_rx_sn;
s1ap_bearers.push_back(b); s1ap_bearers.push_back(b);
} }

@ -368,7 +368,7 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg)
for (const auto& erab_pair : parent->users[old_rnti]->bearer_list.get_erabs()) { for (const auto& erab_pair : parent->users[old_rnti]->bearer_list.get_erabs()) {
uint16_t lcid = erab_pair.second.id - 2; uint16_t lcid = erab_pair.second.id - 2;
old_reest_pdcp_state[lcid] = {}; old_reest_pdcp_state[lcid] = {};
parent->pdcp->get_state(old_rnti, lcid, &old_reest_pdcp_state[lcid]); parent->pdcp->get_bearer_state(old_rnti, lcid, &old_reest_pdcp_state[lcid]);
parent->rrc_log->debug("Getting PDCP state for E-RAB with LCID %d\n", lcid); parent->rrc_log->debug("Getting PDCP state for E-RAB with LCID %d\n", lcid);
parent->rrc_log->debug("Got PDCP state: TX HFN %d, NEXT_PDCP_TX_SN %d, RX_HFN %d, NEXT_PDCP_RX_SN %d, " parent->rrc_log->debug("Got PDCP state: TX HFN %d, NEXT_PDCP_TX_SN %d, RX_HFN %d, NEXT_PDCP_RX_SN %d, "
@ -576,7 +576,7 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
old_reest_pdcp_state[lcid].rx_hfn, old_reest_pdcp_state[lcid].rx_hfn,
old_reest_pdcp_state[lcid].next_pdcp_rx_sn, old_reest_pdcp_state[lcid].next_pdcp_rx_sn,
old_reest_pdcp_state[lcid].last_submitted_pdcp_rx_sn); old_reest_pdcp_state[lcid].last_submitted_pdcp_rx_sn);
parent->pdcp->set_state(rnti, lcid, old_reest_pdcp_state[lcid]); parent->pdcp->set_bearer_state(rnti, lcid, old_reest_pdcp_state[lcid]);
} }
} }
} }

@ -117,33 +117,20 @@ void pdcp::enable_encryption(uint16_t rnti, uint32_t lcid)
users[rnti].pdcp->enable_encryption(lcid, srslte::DIRECTION_TXRX); users[rnti].pdcp->enable_encryption(lcid, srslte::DIRECTION_TXRX);
} }
bool pdcp::get_bearer_status(uint16_t rnti, bool pdcp::get_bearer_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state)
uint32_t lcid,
uint16_t* dlsn,
uint16_t* dlhfn,
uint16_t* ulsn,
uint16_t* ulhfn)
{ {
if (users.count(rnti) == 0) { if (users.count(rnti) == 0) {
return false; return false;
} }
return users[rnti].pdcp->get_bearer_status(lcid, dlsn, dlhfn, ulsn, ulhfn); return users[rnti].pdcp->get_bearer_state(lcid, state);
} }
bool pdcp::get_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state) bool pdcp::set_bearer_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state)
{ {
if (users.count(rnti) == 0) { if (users.count(rnti) == 0) {
return false; return false;
} }
return users[rnti].pdcp->get_state(lcid, state); return users[rnti].pdcp->set_bearer_state(lcid, state);
}
bool pdcp::set_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state)
{
if (users.count(rnti) == 0) {
return false;
}
return users[rnti].pdcp->set_state(lcid, state);
} }
void pdcp::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) void pdcp::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu)

@ -72,13 +72,8 @@ public:
void config_security(uint16_t rnti, uint32_t lcid, srslte::as_security_config_t sec_cfg_) override {} void config_security(uint16_t rnti, uint32_t lcid, srslte::as_security_config_t sec_cfg_) override {}
void enable_integrity(uint16_t rnti, uint32_t lcid) override {} void enable_integrity(uint16_t rnti, uint32_t lcid) override {}
void enable_encryption(uint16_t rnti, uint32_t lcid) override {} void enable_encryption(uint16_t rnti, uint32_t lcid) override {}
bool get_bearer_status(uint16_t rnti, uint32_t lcid, uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn) bool get_bearer_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state) override { return true; }
override bool set_bearer_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state) override { return true; }
{
return true;
}
bool get_state(uint16_t rnti, uint32_t lcid, srslte::pdcp_lte_state_t* state) { return true; }
bool set_state(uint16_t rnti, uint32_t lcid, const srslte::pdcp_lte_state_t& state) { return true; }
}; };
class s1ap_dummy : public s1ap_interface_rrc class s1ap_dummy : public s1ap_interface_rrc

@ -1140,9 +1140,12 @@ ttcn3_helpers::pdcp_count_map_t ttcn3_syssim::get_pdcp_count()
if (pdcp.is_lcid_enabled(i)) { if (pdcp.is_lcid_enabled(i)) {
ttcn3_helpers::pdcp_count_t bearer; ttcn3_helpers::pdcp_count_t bearer;
uint16_t tmp; // not handling HFN uint16_t tmp; // not handling HFN
pdcp.get_bearer_status(i, &bearer.dl_value, &tmp, &bearer.ul_value, &tmp); srslte::pdcp_lte_state_t pdcp_state;
pdcp.get_bearer_state(i, &pdcp_state);
bearer.rb_is_srb = i <= 2; bearer.rb_is_srb = i <= 2;
bearer.rb_id = i; bearer.rb_id = i;
bearer.dl_value = pdcp_state.next_pdcp_tx_sn;
bearer.ul_value = pdcp_state.next_pdcp_rx_sn;
log->debug("PDCP count lcid=%d, dl=%d, ul=%d\n", bearer.rb_id, bearer.dl_value, bearer.ul_value); log->debug("PDCP count lcid=%d, dl=%d, ul=%d\n", bearer.rb_id, bearer.dl_value, bearer.ul_value);
bearers.push_back(bearer); bearers.push_back(bearer);
} }

Loading…
Cancel
Save