|
INET Framework for OMNeT++/OMNEST
|
Receive queue that manages Chunks.
More...
#include <TcpReceiveQueue.h>
Receive queue that manages Chunks.
- See also
- TcpSendQueue
◆ TcpReceiveQueue()
| inet::tcp::TcpReceiveQueue::TcpReceiveQueue |
( |
| ) |
|
◆ ~TcpReceiveQueue()
| inet::tcp::TcpReceiveQueue::~TcpReceiveQueue |
( |
| ) |
|
|
virtual |
◆ extractBytesUpTo()
| Packet * inet::tcp::TcpReceiveQueue::extractBytesUpTo |
( |
uint32_t |
seq | ) |
|
|
virtual |
◆ getAmountOfBufferedBytes()
| uint32_t inet::tcp::TcpReceiveQueue::getAmountOfBufferedBytes |
( |
| ) |
|
|
virtual |
◆ getAmountOfFreeBytes()
| uint32_t inet::tcp::TcpReceiveQueue::getAmountOfFreeBytes |
( |
uint32_t |
maxRcvBuffer | ) |
|
|
virtual |
Returns the number of bytes currently free (=available) in queue.
freeRcvBuffer = maxRcvBuffer - usedRcvBuffer
116 uint32_t freeRcvBuffer = maxRcvBuffer - usedRcvBuffer;
117 return (maxRcvBuffer > usedRcvBuffer) ? freeRcvBuffer : 0;
Referenced by inet::tcp::TcpConnection::updateRcvQueueVars().
◆ getFirstSeqNo()
| uint32_t inet::tcp::TcpReceiveQueue::getFirstSeqNo |
( |
| ) |
|
|
virtual |
◆ getLE()
| uint32_t inet::tcp::TcpReceiveQueue::getLE |
( |
uint32_t |
fromSeqNum | ) |
|
|
virtual |
◆ getQueueLength()
| uint32_t inet::tcp::TcpReceiveQueue::getQueueLength |
( |
| ) |
|
|
virtual |
◆ getQueueStatus()
| void inet::tcp::TcpReceiveQueue::getQueueStatus |
( |
| ) |
|
|
virtual |
Shows current queue status.
◆ getRE()
| uint32_t inet::tcp::TcpReceiveQueue::getRE |
( |
uint32_t |
toSeqNum | ) |
|
|
virtual |
◆ getReorderBuffer()
| virtual ReorderBuffer& inet::tcp::TcpReceiveQueue::getReorderBuffer |
( |
| ) |
|
|
inlinevirtual |
◆ init()
| void inet::tcp::TcpReceiveQueue::init |
( |
uint32_t |
startSeq | ) |
|
|
virtual |
◆ insertBytesFromSegment()
| uint32_t inet::tcp::TcpReceiveQueue::insertBytesFromSegment |
( |
Packet * |
tcpSegment, |
|
|
const Ptr< const TcpHeader > & |
tcpHeader |
|
) |
| |
|
virtual |
Called when a TCP segment arrives, it should extract the payload from the segment and store it in the receive queue.
The segment object should not be deleted.
The method should return the sequence number to be ACKed.
46 B tcpHeaderLength = tcpHeader->getHeaderLength();
47 B tcpPayloadLength = tcpSegment->getDataLength() - tcpHeaderLength;
48 uint32_t seq = tcpHeader->getSequenceNo();
57 uint32_t ne = seq + tcpPayloadLength.get();
58 uint32_t minb =
seqMin(ob, nb);
59 uint32_t maxe =
seqMax(oe, ne);
61 throw cRuntimeError(
"The new segment is [%u, %u) out of the acceptable range at the queue %s",
62 nb, ne,
str().c_str());
64 #endif // ifndef NDEBUG
69 tcpPayloadLength -=
B(offs);
71 const auto& payload = tcpSegment->peekDataAt(tcpHeaderLength +
B(offs), tcpPayloadLength);
Referenced by inet::tcp::TcpConnection::processSegment1stThru8th(), inet::tcp::TcpConnection::processSegmentInSynSent(), and inet::tcp::TcpConnection::processSynInListen().
◆ offsetToSeq()
| uint32_t inet::tcp::TcpReceiveQueue::offsetToSeq |
( |
B |
offs | ) |
const |
|
inlineprotected |
◆ seqToOffset()
| B inet::tcp::TcpReceiveQueue::seqToOffset |
( |
uint32_t |
seq | ) |
const |
|
inlineprotected |
◆ setConnection()
| virtual void inet::tcp::TcpReceiveQueue::setConnection |
( |
TcpConnection * |
_conn | ) |
|
|
inlinevirtual |
◆ str()
| std::string inet::tcp::TcpReceiveQueue::str |
( |
| ) |
const |
|
overridevirtual |
◆ conn
◆ rcv_nxt
| uint32_t inet::tcp::TcpReceiveQueue::rcv_nxt = 0 |
|
protected |
◆ reorderBuffer
The documentation for this class was generated from the following files:
void replace(b offset, const Ptr< const Chunk > &chunk)
Replaces the stored data at the provided offset with the data in the chunk.
Definition: ChunkBuffer.cc:115
b getExpectedOffset() const
Returns the offset of the next expected data chunk.
Definition: ReorderBuffer.h:36
virtual std::string str() const override
Definition: TcpReceiveQueue.cc:33
int getNumRegions() const
Returns the number non-overlapping, non-connecting but continuous regions.
Definition: ChunkBuffer.h:94
bool seqLess(uint32_t a, uint32_t b)
Definition: TcpHeader.h:21
bool seqLE(uint32_t a, uint32_t b)
Definition: TcpHeader.h:22
b getRegionEndOffset(int index) const
Returns the end offset of the given region.
Definition: ChunkBuffer.h:109
uint32_t rcv_nxt
Definition: TcpReceiveQueue.h:38
ReorderBuffer reorderBuffer
Definition: TcpReceiveQueue.h:39
intscale< b, 1, 8 > B
Definition: Units.h:1168
bool seqGE(uint32_t a, uint32_t b)
Definition: TcpHeader.h:24
uint32_t offsetToSeq(B offs) const
Definition: TcpReceiveQueue.h:42
value< int64_t, units::b > b
Definition: Units.h:1241
uint32_t seqMax(uint32_t a, uint32_t b)
Definition: TcpHeader.h:26
b getRegionStartOffset(int index) const
Returns the start offset of the given region.
Definition: ChunkBuffer.h:104
TcpConnection * conn
Definition: TcpReceiveQueue.h:37
void setExpectedOffset(b expectedOffset)
Changes the offset of the next expected data chunk.
Definition: ReorderBuffer.h:41
B seqToOffset(uint32_t seq) const
Definition: TcpReceiveQueue.h:44
const Ptr< const Chunk > popAvailableData(b length=b(-1))
Returns the largest next available data chunk starting at the expected offset.
Definition: ReorderBuffer.cc:20
virtual uint32_t getAmountOfBufferedBytes()
Returns the number of bytes (out-of-order-segments) currently buffered in queue.
Definition: TcpReceiveQueue.cc:103
uint32_t seqMin(uint32_t a, uint32_t b)
Definition: TcpHeader.h:25
bool isEmpty() const
Returns true if the buffer is completely empty.
Definition: ChunkBuffer.h:89
b getRegionLength(int index) const
Returns the length of the given region.
Definition: ChunkBuffer.h:99
void clear(b offset, b length)
Erases the stored data at the provided offset and length.
Definition: ChunkBuffer.cc:149