From f90b69e5f411e5a49467833556c236c04a477325 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 23 Jul 2019 16:12:01 +0100 Subject: [PATCH] More clang-format for PDCP --- lib/include/srslte/common/int_helpers.h | 2 +- lib/include/srslte/upper/pdcp.h | 2 - lib/include/srslte/upper/pdcp_entity_lte.h | 12 ++--- srsenb/hdr/stack/upper/pdcp.h | 58 +++++++++++----------- 4 files changed, 35 insertions(+), 39 deletions(-) diff --git a/lib/include/srslte/common/int_helpers.h b/lib/include/srslte/common/int_helpers.h index 945c3bf69..ea7e180ac 100644 --- a/lib/include/srslte/common/int_helpers.h +++ b/lib/include/srslte/common/int_helpers.h @@ -63,6 +63,6 @@ inline void uint24_to_uint8(uint32_t i, uint8_t* buf) buf[1] = (i >> 8) & 0xFF; buf[2] = i & 0xFF; } -}; //namespace +} // namespace srslte #endif // SRSLTE_INT_HELPERS_H diff --git a/lib/include/srslte/upper/pdcp.h b/lib/include/srslte/upper/pdcp.h index 14b90af05..9b0774b91 100644 --- a/lib/include/srslte/upper/pdcp.h +++ b/lib/include/srslte/upper/pdcp.h @@ -88,6 +88,4 @@ private: }; } // namespace srslte - - #endif // SRSLTE_PDCP_H diff --git a/lib/include/srslte/upper/pdcp_entity_lte.h b/lib/include/srslte/upper/pdcp_entity_lte.h index 144c311d6..be1af9a66 100644 --- a/lib/include/srslte/upper/pdcp_entity_lte.h +++ b/lib/include/srslte/upper/pdcp_entity_lte.h @@ -89,13 +89,13 @@ private: * Ref: 3GPP TS 36.323 v10.1.0 ***************************************************************************/ -void pdcp_pack_control_pdu(uint32_t sn, byte_buffer_t *sdu); -void pdcp_unpack_control_pdu(byte_buffer_t *sdu, uint32_t *sn); +void pdcp_pack_control_pdu(uint32_t sn, byte_buffer_t* sdu); +void pdcp_unpack_control_pdu(byte_buffer_t* sdu, uint32_t* sn); -void pdcp_pack_data_pdu_short_sn(uint32_t sn, byte_buffer_t *sdu); -void pdcp_unpack_data_pdu_short_sn(byte_buffer_t *sdu, uint32_t *sn); -void pdcp_pack_data_pdu_long_sn(uint32_t sn, byte_buffer_t *sdu); -void pdcp_unpack_data_pdu_long_sn(byte_buffer_t *sdu, uint32_t *sn); +void pdcp_pack_data_pdu_short_sn(uint32_t sn, byte_buffer_t* sdu); +void pdcp_unpack_data_pdu_short_sn(byte_buffer_t* sdu, uint32_t* sn); +void pdcp_pack_data_pdu_long_sn(uint32_t sn, byte_buffer_t* sdu); +void pdcp_unpack_data_pdu_long_sn(byte_buffer_t* sdu, uint32_t* sn); } // namespace srslte #endif // SRSLTE_PDCP_ENTITY_LTE_H diff --git a/srsenb/hdr/stack/upper/pdcp.h b/srsenb/hdr/stack/upper/pdcp.h index f7059d50a..df9918fa9 100644 --- a/srsenb/hdr/stack/upper/pdcp.h +++ b/srsenb/hdr/stack/upper/pdcp.h @@ -59,33 +59,32 @@ public: void enable_integrity(uint16_t rnti, uint32_t lcid); void enable_encryption(uint16_t rnti, uint32_t lcid); -private: - +private: class user_interface_rlc : public srsue::rlc_interface_pdcp { public: - uint16_t rnti; - srsenb::rlc_interface_pdcp *rlc; + uint16_t rnti; + srsenb::rlc_interface_pdcp* rlc; // rlc_interface_pdcp void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking); bool rb_is_um(uint32_t lcid); }; - + class user_interface_gtpu : public srsue::gw_interface_pdcp { - public: - uint16_t rnti; - srsenb::gtpu_interface_pdcp *gtpu; + public: + uint16_t rnti; + srsenb::gtpu_interface_pdcp* gtpu; // gw_interface_pdcp void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu); void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {} - }; - + }; + class user_interface_rrc : public srsue::rrc_interface_pdcp { - public: - uint16_t rnti; - srsenb::rrc_interface_pdcp *rrc; + public: + uint16_t rnti; + srsenb::rrc_interface_pdcp* rrc; // rrc_interface_pdcp void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu); void write_pdu_bcch_bch(srslte::unique_byte_buffer_t pdu); @@ -94,29 +93,28 @@ private: void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {} std::string get_rb_name(uint32_t lcid); }; - - class user_interface + + class user_interface { - public: - user_interface_rlc rlc_itf; + public: + user_interface_rlc rlc_itf; user_interface_gtpu gtpu_itf; - user_interface_rrc rrc_itf; - srslte::pdcp *pdcp; + user_interface_rrc rrc_itf; + srslte::pdcp* pdcp; }; - void clear_user(user_interface *ue); - - std::map users; + void clear_user(user_interface* ue); + + std::map users; pthread_rwlock_t rwlock; - - rlc_interface_pdcp *rlc; - rrc_interface_pdcp *rrc; - gtpu_interface_pdcp *gtpu; - srslte::log *log_h; - srslte::byte_buffer_pool *pool; -}; -} + rlc_interface_pdcp* rlc; + rrc_interface_pdcp* rrc; + gtpu_interface_pdcp* gtpu; + srslte::log* log_h; + srslte::byte_buffer_pool* pool; +}; +} // namespace srsenb #endif // SRSENB_PDCP_H