|
|
|
@ -78,22 +78,35 @@ struct rlc_amd_tx_sdu_nr_t {
|
|
|
|
|
explicit rlc_amd_tx_sdu_nr_t(uint32_t rlc_sn_) : rlc_sn(rlc_sn_) {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///< AM NR Status PDU header
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_header_ack_sn = 3; ///< header fixed part and ACK SN
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_sn_ext_12bit_sn = 2; ///< NACK SN and extension fields (12 bit SN)
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_sn_ext_18bit_sn = 3; ///< NACK SN and extension fields (18 bit SN)
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_so = 4; ///< NACK segment offsets (start and end)
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_range = 1; ///< NACK range (nof consecutively lost SDUs)
|
|
|
|
|
|
|
|
|
|
/// AM NR Status PDU header
|
|
|
|
|
class rlc_am_nr_status_pdu_t
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
rlc_am_nr_sn_size_t sn_size; ///< Stored SN size required to compute the packed size
|
|
|
|
|
std::vector<rlc_status_nack_t> nacks_; ///< Internal NACK container; keep in sync with packed_size_
|
|
|
|
|
uint32_t packed_size_; ///< Stores the current packed size; sync on each change of nacks_
|
|
|
|
|
/// Stored SN size required to compute the packed size
|
|
|
|
|
rlc_am_nr_sn_size_t sn_size = rlc_am_nr_sn_size_t::nulltype;
|
|
|
|
|
/// Internal NACK container; keep in sync with packed_size_
|
|
|
|
|
std::vector<rlc_status_nack_t> nacks_ = {};
|
|
|
|
|
/// Stores the current packed size; sync on each change of nacks_
|
|
|
|
|
uint32_t packed_size_ = rlc_am_nr_status_pdu_sizeof_header_ack_sn;
|
|
|
|
|
|
|
|
|
|
void refresh_packed_size();
|
|
|
|
|
uint32_t nack_size(const rlc_status_nack_t& nack) const;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
rlc_am_nr_control_pdu_type_t cpt; ///< CPT header
|
|
|
|
|
uint32_t ack_sn; ///< SN of the next not received RLC Data PDU
|
|
|
|
|
const std::vector<rlc_status_nack_t>& nacks; ///< Read-only reference to NACKs
|
|
|
|
|
const uint32_t& packed_size; ///< Read-only reference to packed size
|
|
|
|
|
/// CPT header
|
|
|
|
|
rlc_am_nr_control_pdu_type_t cpt = rlc_am_nr_control_pdu_type_t::status_pdu;
|
|
|
|
|
/// SN of the next not received RLC Data PDU
|
|
|
|
|
uint32_t ack_sn = INVALID_RLC_SN;
|
|
|
|
|
/// Read-only reference to NACKs
|
|
|
|
|
const std::vector<rlc_status_nack_t>& nacks = nacks_;
|
|
|
|
|
/// Read-only reference to packed size
|
|
|
|
|
const uint32_t& packed_size = packed_size_;
|
|
|
|
|
|
|
|
|
|
rlc_am_nr_status_pdu_t(rlc_am_nr_sn_size_t sn_size);
|
|
|
|
|
void reset();
|
|
|
|
@ -125,12 +138,6 @@ uint32_t rlc_am_nr_packed_length(const rlc_am_nr_pdu_header_t& header);
|
|
|
|
|
* Status PDU pack/unpack helper functions for NR
|
|
|
|
|
* Ref: 3GPP TS 38.322 v16.2.0 Section 6.2.2.5
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_header_ack_sn = 3; // header fixed part and ACK SN
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_sn_ext_12bit_sn = 2; // NACK SN and extension fields (12 bit SN)
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_sn_ext_18bit_sn = 3; // NACK SN and extension fields (18 bit SN)
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_so = 4; // NACK segment offsets (start and end)
|
|
|
|
|
constexpr uint32_t rlc_am_nr_status_pdu_sizeof_nack_range = 1; // NACK range (nof consecutively lost SDUs)
|
|
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
|
rlc_am_nr_read_status_pdu(const byte_buffer_t* pdu, const rlc_am_nr_sn_size_t sn_size, rlc_am_nr_status_pdu_t* status);
|
|
|
|
|
|
|
|
|
|