mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
3.5 KiB
C
104 lines
3.5 KiB
C
6 years ago
|
/*
|
||
|
* Copyright 2013-2019 Software Radio Systems Limited
|
||
8 years ago
|
*
|
||
6 years ago
|
* This file is part of srsLTE.
|
||
8 years ago
|
*
|
||
6 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
8 years ago
|
* it under the terms of the GNU Affero General Public License as
|
||
|
* published by the Free Software Foundation, either version 3 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
6 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
8 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU Affero General Public License for more details.
|
||
|
*
|
||
|
* A copy of the GNU Affero General Public License can be found in
|
||
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
|
*/
|
||
|
|
||
5 years ago
|
#ifndef SRSLTE_PDCP_ENTITY_NR_H
|
||
|
#define SRSLTE_PDCP_ENTITY_NR_H
|
||
8 years ago
|
|
||
8 years ago
|
#include "srslte/common/buffer_pool.h"
|
||
|
#include "srslte/common/log.h"
|
||
|
#include "srslte/common/common.h"
|
||
5 years ago
|
#include "srslte/common/interfaces_common.h"
|
||
8 years ago
|
#include "srslte/common/security.h"
|
||
7 years ago
|
#include "srslte/common/threads.h"
|
||
5 years ago
|
#include "pdcp_entity_base.h"
|
||
8 years ago
|
|
||
|
|
||
8 years ago
|
namespace srslte {
|
||
8 years ago
|
|
||
|
/****************************************************************************
|
||
|
* PDCP Entity interface
|
||
|
* Common interface for all PDCP entities
|
||
|
***************************************************************************/
|
||
5 years ago
|
class pdcp_entity_nr : public pdcp_entity_base
|
||
8 years ago
|
{
|
||
|
public:
|
||
5 years ago
|
pdcp_entity_nr();
|
||
|
~pdcp_entity_nr();
|
||
|
void init(srsue::rlc_interface_pdcp* rlc_,
|
||
|
srsue::rrc_interface_pdcp* rrc_,
|
||
|
srsue::gw_interface_pdcp* gw_,
|
||
|
srslte::log* log_,
|
||
|
uint32_t lcid_,
|
||
|
srslte_pdcp_config_nr_t cfg_);
|
||
8 years ago
|
void reset();
|
||
7 years ago
|
void reestablish();
|
||
8 years ago
|
|
||
|
// RRC interface
|
||
5 years ago
|
void write_sdu(unique_byte_buffer_t sdu, bool blocking);
|
||
|
void config_security(uint8_t* k_rrc_enc_,
|
||
|
uint8_t* k_rrc_int_,
|
||
|
uint8_t* k_up_enc_,
|
||
|
uint8_t* k_up_int_,
|
||
8 years ago
|
CIPHERING_ALGORITHM_ID_ENUM cipher_algo_,
|
||
|
INTEGRITY_ALGORITHM_ID_ENUM integ_algo_);
|
||
7 years ago
|
void enable_integrity();
|
||
7 years ago
|
void enable_encryption();
|
||
5 years ago
|
|
||
6 years ago
|
uint32_t get_dl_count();
|
||
|
uint32_t get_ul_count();
|
||
8 years ago
|
|
||
|
// RLC interface
|
||
6 years ago
|
void write_pdu(unique_byte_buffer_t pdu);
|
||
8 years ago
|
|
||
|
private:
|
||
5 years ago
|
srsue::rlc_interface_pdcp* rlc = nullptr;
|
||
|
srsue::rrc_interface_pdcp* rrc = nullptr;
|
||
|
srsue::gw_interface_pdcp* gw = nullptr;
|
||
|
|
||
|
uint32_t rx_count = 0;
|
||
|
uint32_t tx_count = 0;
|
||
|
|
||
|
uint32_t rx_hfn = 0;
|
||
|
uint32_t next_pdcp_rx_sn = 0;
|
||
|
uint32_t reordering_window = 0;
|
||
|
uint32_t last_submitted_pdcp_rx_sn = 0;
|
||
|
uint32_t maximum_pdcp_sn = 0;
|
||
|
|
||
5 years ago
|
void handle_um_drb_pdu(const srslte::unique_byte_buffer_t& pdu);
|
||
|
void handle_am_drb_pdu(const srslte::unique_byte_buffer_t& pdu);
|
||
8 years ago
|
};
|
||
|
|
||
|
/****************************************************************************
|
||
|
* Pack/Unpack helper functions
|
||
|
* 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_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);
|
||
|
|
||
7 years ago
|
} // namespace srslte
|
||
5 years ago
|
#endif // SRSLTE_PDCP_ENTITY_NR_H
|