| 1648 | } |
| 1649 | |
| 1650 | void FECFilterBuiltin::MarkCellReceived(int32_t seq, ECellReceived is_received) |
| 1651 | { |
| 1652 | // Mark the packet as received. This will allow later to |
| 1653 | // determine, which exactly packet is lost and needs rebuilding. |
| 1654 | const int cellsize = int(rcv.cells.size()); |
| 1655 | const int cell_offset = CSeqNo::seqoff(rcv.cell_base, seq); |
| 1656 | bool resized SRT_ATR_UNUSED = false; |
| 1657 | if (cell_offset >= cellsize) |
| 1658 | { |
| 1659 | // Expand the cell container with zeros, excluding the 'cell_offset'. |
| 1660 | // Resize normally up to the required size, just set the lastmost |
| 1661 | // item to true. |
| 1662 | resized = true; |
| 1663 | rcv.cells.resize(cell_offset+1, false); |
| 1664 | } |
| 1665 | |
| 1666 | if (resized || is_received != CELL_EXTEND) |
| 1667 | { |
| 1668 | // In both RECEIVED and REMOVE cases, forcefully set the value always. |
| 1669 | // In EXTEND, only if it was received |
| 1670 | // Value set should be true only if RECEIVED, false otherwise |
| 1671 | rcv.cells[cell_offset] = (is_received == CELL_RECEIVED); |
| 1672 | } |
| 1673 | |
| 1674 | #if ENABLE_HEAVY_LOGGING |
| 1675 | static string const cellop [] = { "RECEIVED", "EXTEND", "REMOVE" }; |
| 1676 | LOGC(pflog.Debug, log << "FEC: MARK CELL " << cellop[is_received] |
| 1677 | << "(" << (rcv.cells[cell_offset] ? "SET" : "CLR") << ")" |
| 1678 | << ": %" << seq << " - cells base=%" |
| 1679 | << rcv.cell_base << "[" << cell_offset << "]+" << rcv.cells.size() |
| 1680 | << (resized ? "(resized)":"") << " :"); |
| 1681 | #endif |
| 1682 | |
| 1683 | DebugPrintCells(rcv.cell_base, rcv.cells, sizeRow()); |
| 1684 | } |
| 1685 | |
| 1686 | bool FECFilterBuiltin::IsLost(int32_t seq) const |
| 1687 | { |
nothing calls this directly
no test coverage detected