|
|
@ -1221,15 +1221,22 @@ void rlc_am::print_rx_segments()
|
|
|
|
|
|
|
|
|
|
|
|
bool rlc_am::add_segment_and_check(rlc_amd_rx_pdu_segments_t *pdu, rlc_amd_rx_pdu_t *segment)
|
|
|
|
bool rlc_am::add_segment_and_check(rlc_amd_rx_pdu_segments_t *pdu, rlc_amd_rx_pdu_t *segment)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Ordered insert
|
|
|
|
// Check segment offset
|
|
|
|
std::list<rlc_amd_rx_pdu_t>::iterator tmpit;
|
|
|
|
uint32_t n = 0;
|
|
|
|
std::list<rlc_amd_rx_pdu_t>::iterator it = pdu->segments.begin();
|
|
|
|
if(!pdu->segments.empty()) {
|
|
|
|
while(it != pdu->segments.end() && it->header.so < segment->header.so)
|
|
|
|
rlc_amd_rx_pdu_t &back = pdu->segments.back();
|
|
|
|
it++;
|
|
|
|
n = back.header.so + back.buf->N_bytes;
|
|
|
|
pdu->segments.insert(it, *segment);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(segment->header.so != n) {
|
|
|
|
|
|
|
|
pool->deallocate(segment->buf);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
pdu->segments.push_back(*segment);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check for complete
|
|
|
|
// Check for complete
|
|
|
|
uint32_t so = 0;
|
|
|
|
uint32_t so = 0;
|
|
|
|
|
|
|
|
std::list<rlc_amd_rx_pdu_t>::iterator it, tmpit;
|
|
|
|
for(it = pdu->segments.begin(); it != pdu->segments.end(); it++) {
|
|
|
|
for(it = pdu->segments.begin(); it != pdu->segments.end(); it++) {
|
|
|
|
if(so != it->header.so)
|
|
|
|
if(so != it->header.so)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|