Removed srslte prefix from pdcp_config_t

master
Pedro Alvarez 5 years ago committed by Andre Puschmann
parent 0e7c5634f1
commit 6efa944b5e

@ -74,14 +74,14 @@ const uint8_t PDCP_SN_LEN_18 = 18;
typedef enum { PDCP_RB_IS_SRB, PDCP_RB_IS_DRB } pdcp_rb_type_t; typedef enum { PDCP_RB_IS_SRB, PDCP_RB_IS_DRB } pdcp_rb_type_t;
class srslte_pdcp_config_t class pdcp_config_t
{ {
public: public:
srslte_pdcp_config_t(uint8_t bearer_id_, pdcp_config_t(uint8_t bearer_id_,
pdcp_rb_type_t rb_type_, pdcp_rb_type_t rb_type_,
security_direction_t tx_direction_, security_direction_t tx_direction_,
security_direction_t rx_direction_, security_direction_t rx_direction_,
uint8_t sn_len_) : uint8_t sn_len_) :
bearer_id(bearer_id_), bearer_id(bearer_id_),
rb_type(rb_type_), rb_type(rb_type_),
tx_direction(tx_direction_), tx_direction(tx_direction_),

@ -211,7 +211,7 @@ public:
virtual void add_user(uint16_t rnti) = 0; virtual void add_user(uint16_t rnti) = 0;
virtual void rem_user(uint16_t rnti) = 0; virtual void rem_user(uint16_t rnti) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0; virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
virtual void add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_pdcp_config_t cnfg) = 0; virtual void add_bearer(uint16_t rnti, uint32_t lcid, srslte::pdcp_config_t cnfg) = 0;
virtual void config_security(uint16_t rnti, virtual void config_security(uint16_t rnti,
uint32_t lcid, uint32_t lcid,
uint8_t* k_rrc_enc_, uint8_t* k_rrc_enc_,

@ -232,7 +232,7 @@ public:
virtual void reestablish(uint32_t lcid) = 0; virtual void reestablish(uint32_t lcid) = 0;
virtual void reset() = 0; virtual void reset() = 0;
virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking = true) = 0; virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking = true) = 0;
virtual void add_bearer(uint32_t lcid, srslte::srslte_pdcp_config_t cnfg) = 0; virtual void add_bearer(uint32_t lcid, srslte::pdcp_config_t cnfg) = 0;
virtual void change_lcid(uint32_t old_lcid, uint32_t new_lcid) = 0; virtual void change_lcid(uint32_t old_lcid, uint32_t new_lcid) = 0;
virtual void config_security(uint32_t lcid, virtual void config_security(uint32_t lcid,
uint8_t* k_rrc_enc_, uint8_t* k_rrc_enc_,

@ -46,8 +46,8 @@ public:
void reset(); void reset();
void write_sdu(uint32_t lcid, unique_byte_buffer_t sdu, bool blocking = true); void write_sdu(uint32_t lcid, unique_byte_buffer_t sdu, bool blocking = true);
void write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu); void write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu);
void add_bearer(uint32_t lcid, srslte_pdcp_config_t cnfg); void add_bearer(uint32_t lcid, pdcp_config_t cnfg);
void add_bearer_mrb(uint32_t lcid, srslte_pdcp_config_t cnfg); void add_bearer_mrb(uint32_t lcid, pdcp_config_t cnfg);
void del_bearer(uint32_t lcid); void del_bearer(uint32_t lcid);
void change_lcid(uint32_t old_lcid, uint32_t new_lcid); void change_lcid(uint32_t old_lcid, uint32_t new_lcid);
void config_security(uint32_t lcid, void config_security(uint32_t lcid,

@ -97,8 +97,7 @@ protected:
bool do_integrity = false; bool do_integrity = false;
bool do_encryption = false; bool do_encryption = false;
srslte_pdcp_config_t cfg = { pdcp_config_t cfg = {1, PDCP_RB_IS_DRB, SECURITY_DIRECTION_DOWNLINK, SECURITY_DIRECTION_UPLINK, PDCP_SN_LEN_12};
1, PDCP_RB_IS_DRB, SECURITY_DIRECTION_DOWNLINK, SECURITY_DIRECTION_UPLINK, PDCP_SN_LEN_12};
std::mutex mutex; std::mutex mutex;

@ -53,7 +53,7 @@ public:
srsue::gw_interface_pdcp* gw_, srsue::gw_interface_pdcp* gw_,
srslte::log* log_, srslte::log* log_,
uint32_t lcid_, uint32_t lcid_,
srslte_pdcp_config_t cfg_); pdcp_config_t cfg_);
void reset(); void reset();
void reestablish(); void reestablish();

@ -46,7 +46,7 @@ public:
srsue::gw_interface_pdcp* gw_, srsue::gw_interface_pdcp* gw_,
srslte::log* log_, srslte::log* log_,
uint32_t lcid_, uint32_t lcid_,
srslte_pdcp_config_t cfg_); pdcp_config_t cfg_);
void reset(); void reset();
void reestablish(); void reestablish();

@ -120,7 +120,7 @@ void pdcp::write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu)
pthread_rwlock_unlock(&rwlock); pthread_rwlock_unlock(&rwlock);
} }
void pdcp::add_bearer(uint32_t lcid, srslte_pdcp_config_t cfg) void pdcp::add_bearer(uint32_t lcid, pdcp_config_t cfg)
{ {
pthread_rwlock_wrlock(&rwlock); pthread_rwlock_wrlock(&rwlock);
if (not valid_lcid(lcid)) { if (not valid_lcid(lcid)) {
@ -141,7 +141,7 @@ unlock_and_exit:
pthread_rwlock_unlock(&rwlock); pthread_rwlock_unlock(&rwlock);
} }
void pdcp::add_bearer_mrb(uint32_t lcid, srslte_pdcp_config_t cfg) void pdcp::add_bearer_mrb(uint32_t lcid, pdcp_config_t cfg)
{ {
pthread_rwlock_wrlock(&rwlock); pthread_rwlock_wrlock(&rwlock);
if (not valid_mch_lcid(lcid)) { if (not valid_mch_lcid(lcid)) {

@ -33,7 +33,7 @@ void pdcp_entity_lte::init(srsue::rlc_interface_pdcp* rlc_,
srsue::gw_interface_pdcp* gw_, srsue::gw_interface_pdcp* gw_,
srslte::log* log_, srslte::log* log_,
uint32_t lcid_, uint32_t lcid_,
srslte_pdcp_config_t cfg_) pdcp_config_t cfg_)
{ {
rlc = rlc_; rlc = rlc_;
rrc = rrc_; rrc = rrc_;

@ -34,7 +34,7 @@ void pdcp_entity_nr::init(srsue::rlc_interface_pdcp* rlc_,
srsue::gw_interface_pdcp* gw_, srsue::gw_interface_pdcp* gw_,
srslte::log* log_, srslte::log* log_,
uint32_t lcid_, uint32_t lcid_,
srslte_pdcp_config_t cfg_) pdcp_config_t cfg_)
{ {
rlc = rlc_; rlc = rlc_;
rrc = rrc_; rrc = rrc_;

@ -33,7 +33,7 @@
} \ } \
} }
// Encription and Integrity Keys // Encryption and Integrity Keys
uint8_t k_int[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, uint8_t k_int[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31}; 0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31};
uint8_t k_enc[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, uint8_t k_enc[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
@ -139,8 +139,8 @@ int test_tx(uint32_t n_packets,
srslte::byte_buffer_pool* pool, srslte::byte_buffer_pool* pool,
srslte::log* log) srslte::log* log)
{ {
srslte::pdcp_entity_nr pdcp; srslte::pdcp_entity_nr pdcp;
srslte::srslte_pdcp_config_t cfg = { srslte::pdcp_config_t cfg = {
1, srslte::PDCP_RB_IS_DRB, srslte::SECURITY_DIRECTION_UPLINK, srslte::SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len}; 1, srslte::PDCP_RB_IS_DRB, srslte::SECURITY_DIRECTION_UPLINK, srslte::SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len};
rlc_dummy rlc(log); rlc_dummy rlc(log);
@ -262,11 +262,11 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log* log)
*/ */
int test_rx_in_sequence(uint64_t n_packets, uint8_t pdcp_sn_len, srslte::byte_buffer_pool* pool, srslte::log* log) int test_rx_in_sequence(uint64_t n_packets, uint8_t pdcp_sn_len, srslte::byte_buffer_pool* pool, srslte::log* log)
{ {
srslte::pdcp_entity_nr pdcp_tx; srslte::pdcp_entity_nr pdcp_tx;
srslte::pdcp_entity_nr pdcp_rx; srslte::pdcp_entity_nr pdcp_rx;
srslte::srslte_pdcp_config_t cfg_tx = { srslte::pdcp_config_t cfg_tx = {
1, srslte::PDCP_RB_IS_DRB, srslte::SECURITY_DIRECTION_UPLINK, srslte::SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len}; 1, srslte::PDCP_RB_IS_DRB, srslte::SECURITY_DIRECTION_UPLINK, srslte::SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len};
srslte::srslte_pdcp_config_t cfg_rx = { srslte::pdcp_config_t cfg_rx = {
1, srslte::PDCP_RB_IS_DRB, srslte::SECURITY_DIRECTION_DOWNLINK, srslte::SECURITY_DIRECTION_UPLINK, pdcp_sn_len}; 1, srslte::PDCP_RB_IS_DRB, srslte::SECURITY_DIRECTION_DOWNLINK, srslte::SECURITY_DIRECTION_UPLINK, pdcp_sn_len};
rlc_dummy rlc_tx(log); rlc_dummy rlc_tx(log);

@ -28,10 +28,8 @@
#define SRSENB_PDCP_H #define SRSENB_PDCP_H
namespace srsenb { namespace srsenb {
class pdcp : public pdcp_interface_rlc, class pdcp : public pdcp_interface_rlc, public pdcp_interface_gtpu, public pdcp_interface_rrc
public pdcp_interface_gtpu,
public pdcp_interface_rrc
{ {
public: public:
pdcp(srslte::log* pdcp_log_); pdcp(srslte::log* pdcp_log_);
@ -48,7 +46,7 @@ public:
void add_user(uint16_t rnti); void add_user(uint16_t rnti);
void rem_user(uint16_t rnti); void rem_user(uint16_t rnti);
void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu); void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu);
void add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_pdcp_config_t cnfg); void add_bearer(uint16_t rnti, uint32_t lcid, srslte::pdcp_config_t cnfg);
void config_security(uint16_t rnti, void config_security(uint16_t rnti,
uint32_t lcid, uint32_t lcid,
uint8_t* k_rrc_enc_, uint8_t* k_rrc_enc_,

@ -193,7 +193,7 @@ void rrc::add_user(uint16_t rnti)
} }
if (rnti == SRSLTE_MRNTI) { if (rnti == SRSLTE_MRNTI) {
srslte::srslte_pdcp_config_t cfg = { srslte::pdcp_config_t cfg = {
.bearer_id = 1, .bearer_id = 1,
.rb_type = srslte::PDCP_RB_IS_DRB, .rb_type = srslte::PDCP_RB_IS_DRB,
.tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK, .tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK,
@ -1532,11 +1532,11 @@ void rrc::ue::send_connection_setup(bool is_setup)
parent->rlc->add_bearer(rnti, 1, srslte::rlc_config_t::srb_config(1)); parent->rlc->add_bearer(rnti, 1, srslte::rlc_config_t::srb_config(1));
// Configure SRB1 in PDCP // Configure SRB1 in PDCP
srslte::srslte_pdcp_config_t pdcp_cnfg{.bearer_id = 1, srslte::pdcp_config_t pdcp_cnfg{.bearer_id = 1,
.rb_type = srslte::PDCP_RB_IS_SRB, .rb_type = srslte::PDCP_RB_IS_SRB,
.tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK, .tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK,
.rx_direction = srslte::SECURITY_DIRECTION_UPLINK, .rx_direction = srslte::SECURITY_DIRECTION_UPLINK,
.sn_len = srslte::PDCP_SN_LEN_5}; .sn_len = srslte::PDCP_SN_LEN_5};
parent->pdcp->add_bearer(rnti, 1, pdcp_cnfg); parent->pdcp->add_bearer(rnti, 1, pdcp_cnfg);
// Configure PHY layer // Configure PHY layer
@ -1741,11 +1741,11 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
parent->rlc->add_bearer(rnti, 2, srslte::rlc_config_t::srb_config(2)); parent->rlc->add_bearer(rnti, 2, srslte::rlc_config_t::srb_config(2));
// Configure SRB2 in PDCP // Configure SRB2 in PDCP
srslte::srslte_pdcp_config_t pdcp_cnfg_srb = {.bearer_id = 2, srslte::pdcp_config_t pdcp_cnfg_srb = {.bearer_id = 2,
.rb_type = srslte::PDCP_RB_IS_SRB, .rb_type = srslte::PDCP_RB_IS_SRB,
.tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK, .tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK,
.rx_direction = srslte::SECURITY_DIRECTION_UPLINK, .rx_direction = srslte::SECURITY_DIRECTION_UPLINK,
.sn_len = srslte::PDCP_SN_LEN_5}; .sn_len = srslte::PDCP_SN_LEN_5};
parent->pdcp->add_bearer(rnti, 2, pdcp_cnfg_srb); parent->pdcp->add_bearer(rnti, 2, pdcp_cnfg_srb);
parent->pdcp->config_security(rnti, 2, k_rrc_enc, k_rrc_int, k_up_enc, cipher_algo, integ_algo); parent->pdcp->config_security(rnti, 2, k_rrc_enc, k_rrc_int, k_up_enc, cipher_algo, integ_algo);
parent->pdcp->enable_integrity(rnti, 2); parent->pdcp->enable_integrity(rnti, 2);
@ -1755,11 +1755,11 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
parent->rlc->add_bearer(rnti, 3, srslte::make_rlc_config_t(conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].rlc_cfg)); parent->rlc->add_bearer(rnti, 3, srslte::make_rlc_config_t(conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].rlc_cfg));
// Configure DRB1 in PDCP // Configure DRB1 in PDCP
srslte::srslte_pdcp_config_t pdcp_cnfg_drb = {.bearer_id = 1, srslte::pdcp_config_t pdcp_cnfg_drb = {.bearer_id = 1,
.rb_type = srslte::PDCP_RB_IS_DRB, .rb_type = srslte::PDCP_RB_IS_DRB,
.tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK, .tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK,
.rx_direction = srslte::SECURITY_DIRECTION_UPLINK, .rx_direction = srslte::SECURITY_DIRECTION_UPLINK,
.sn_len = srslte::PDCP_SN_LEN_12}; .sn_len = srslte::PDCP_SN_LEN_12};
if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um_present) { if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um_present) {
if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um.pdcp_sn_size.value == if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um.pdcp_sn_size.value ==
pdcp_cfg_s::rlc_um_s_::pdcp_sn_size_e_::len7bits) { pdcp_cfg_s::rlc_um_s_::pdcp_sn_size_e_::len7bits) {
@ -1823,7 +1823,7 @@ void rrc::ue::send_connection_reconf_new_bearer(LIBLTE_S1AP_E_RABTOBESETUPLISTBE
parent->rlc->add_bearer(rnti, lcid, srslte::make_rlc_config_t(drb_item.rlc_cfg)); parent->rlc->add_bearer(rnti, lcid, srslte::make_rlc_config_t(drb_item.rlc_cfg));
// Configure DRB in PDCP // Configure DRB in PDCP
srslte::srslte_pdcp_config_t pdcp_config = { srslte::pdcp_config_t pdcp_config = {
.bearer_id = (uint8_t)(drb_item.drb_id - 1), // TODO: Review all ID mapping LCID DRB ERAB EPSBID Mapping .bearer_id = (uint8_t)(drb_item.drb_id - 1), // TODO: Review all ID mapping LCID DRB ERAB EPSBID Mapping
.rb_type = srslte::PDCP_RB_IS_DRB, .rb_type = srslte::PDCP_RB_IS_DRB,
.tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK, .tx_direction = srslte::SECURITY_DIRECTION_DOWNLINK,

@ -82,7 +82,7 @@ void pdcp::rem_user(uint16_t rnti)
pthread_rwlock_unlock(&rwlock); pthread_rwlock_unlock(&rwlock);
} }
void pdcp::add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_pdcp_config_t cfg) void pdcp::add_bearer(uint16_t rnti, uint32_t lcid, srslte::pdcp_config_t cfg)
{ {
pthread_rwlock_rdlock(&rwlock); pthread_rwlock_rdlock(&rwlock);
if (users.count(rnti)) { if (users.count(rnti)) {

Loading…
Cancel
Save