INET Framework for OMNeT++/OMNEST
|
Abstract base class for TCP receive queues. More...
#include <TCPReceiveQueue.h>
Public Member Functions | |
TCPReceiveQueue () | |
Ctor. More... | |
virtual | ~TCPReceiveQueue () |
Virtual dtor. More... | |
virtual void | setConnection (TCPConnection *_conn) |
Set the connection that owns this queue. More... | |
virtual void | init (uint32 startSeq)=0 |
Set initial receive sequence number. More... | |
virtual uint32 | insertBytesFromSegment (TCPSegment *tcpseg)=0 |
Called when a TCP segment arrives, it should extract the payload from the segment and store it in the receive queue. More... | |
virtual cPacket * | extractBytesUpTo (uint32 seq)=0 |
Should create a packet to be passed up to the app, up to (but NOT including) the given sequence no (usually rcv_nxt). More... | |
virtual uint32 | getAmountOfBufferedBytes ()=0 |
Returns the number of bytes (out-of-order-segments) currently buffered in queue. More... | |
virtual uint32 | getAmountOfFreeBytes (uint32 maxRcvBuffer)=0 |
Returns the number of bytes currently free (=available) in queue. More... | |
virtual uint32 | getQueueLength ()=0 |
Returns the number of blocks currently buffered in queue. More... | |
virtual void | getQueueStatus ()=0 |
Shows current queue status. More... | |
virtual uint32 | getLE (uint32 fromSeqNum)=0 |
Returns left edge of enqueued region. More... | |
virtual uint32 | getRE (uint32 toSeqNum)=0 |
Returns right edge of enqueued region. More... | |
virtual uint32 | getFirstSeqNo ()=0 |
Returns the minimum of first byte seq.no. More... | |
Protected Attributes | |
TCPConnection * | conn |
Abstract base class for TCP receive queues.
This class represents data received by TCP but not yet passed up to the application. The class also accomodates for selective retransmission, i.e. also acts as a segment buffer.
This class goes hand-in-hand with TCPSendQueue.
This class is polymorphic because depending on where and how you use the TCP model you might have different ideas about "sending data" on a simulated connection: you might want to transmit real bytes, "dummy" (byte count only), cMessage objects, etc; see discussion at TCPSendQueue. Different subclasses can be written to accomodate different needs.
|
inline |
Ctor.
|
pure virtual |
Should create a packet to be passed up to the app, up to (but NOT including) the given sequence no (usually rcv_nxt).
It should return nullptr if there's no more data to be passed up – this method is called several times until it returns nullptr.
Implemented in inet::tcp::TCPVirtualDataRcvQueue, inet::tcp::TCPByteStreamRcvQueue, and inet::tcp::TCPMsgBasedRcvQueue.
Referenced by inet::tcp::TCPConnection::process_READ_REQUEST(), and inet::tcp::TCPConnection::processSegment1stThru8th().
|
pure virtual |
Returns the number of bytes (out-of-order-segments) currently buffered in queue.
Implemented in inet::tcp::TCPVirtualDataRcvQueue.
Referenced by inet::tcp::TCPConnection::processSegment1stThru8th().
Returns the number of bytes currently free (=available) in queue.
freeRcvBuffer = maxRcvBuffer - usedRcvBuffer
Implemented in inet::tcp::TCPVirtualDataRcvQueue.
Referenced by inet::tcp::TCPConnection::updateRcvQueueVars().
|
pure virtual |
Returns the minimum of first byte seq.no.
in queue and rcv_nxt
Implemented in inet::tcp::TCPVirtualDataRcvQueue.
Referenced by inet::tcp::TCPConnection::hasEnoughSpaceForSegmentInReceiveQueue(), and inet::tcp::TCPConnection::writeHeaderOptions().
Returns left edge of enqueued region.
Implemented in inet::tcp::TCPVirtualDataRcvQueue.
Referenced by inet::tcp::TCPConnection::addSacks().
|
pure virtual |
Returns the number of blocks currently buffered in queue.
Implemented in inet::tcp::TCPVirtualDataRcvQueue.
Referenced by inet::tcp::TCPConnection::processSegment1stThru8th().
|
pure virtual |
Shows current queue status.
Implemented in inet::tcp::TCPVirtualDataRcvQueue.
Returns right edge of enqueued region.
Implemented in inet::tcp::TCPVirtualDataRcvQueue.
Referenced by inet::tcp::TCPConnection::addSacks().
|
pure virtual |
Set initial receive sequence number.
Implemented in inet::tcp::TCPVirtualDataRcvQueue, and inet::tcp::TCPMsgBasedRcvQueue.
Referenced by inet::tcp::TCPConnection::processSegmentInListen(), and inet::tcp::TCPConnection::processSegmentInSynSent().
|
pure 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.
Implemented in inet::tcp::TCPVirtualDataRcvQueue, and inet::tcp::TCPMsgBasedRcvQueue.
Referenced by inet::tcp::TCPConnection::processSegment1stThru8th(), inet::tcp::TCPConnection::processSegmentInListen(), and inet::tcp::TCPConnection::processSegmentInSynSent().
|
inlinevirtual |
Set the connection that owns this queue.
Referenced by inet::tcp::TCPConnection::cloneListeningConnection(), and inet::tcp::TCPConnection::initConnection().
|
protected |