Public Member Functions | Protected Attributes

tcp_old::TCPReceiveQueue Class Reference

#include <TCPReceiveQueue_old.h>

Inheritance diagram for tcp_old::TCPReceiveQueue:
tcp_old::TCPVirtualDataRcvQueue tcp_old::TCPMsgBasedRcvQueue

List of all members.

Public Member Functions

 TCPReceiveQueue ()
virtual ~TCPReceiveQueue ()
virtual void setConnection (TCPConnection *_conn)
virtual void init (uint32 startSeq)=0
virtual uint32 insertBytesFromSegment (TCPSegment *tcpseg)=0
virtual cPacket * extractBytesUpTo (uint32 seq)=0

Protected Attributes

TCPConnectionconn

Detailed Description

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 accommodates 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.

See also:
TCPSendQueue

Definition at line 47 of file TCPReceiveQueue_old.h.


Constructor & Destructor Documentation

tcp_old::TCPReceiveQueue::TCPReceiveQueue (  )  [inline]

Ctor.

Definition at line 56 of file TCPReceiveQueue_old.h.

{conn=NULL;}

virtual tcp_old::TCPReceiveQueue::~TCPReceiveQueue (  )  [inline, virtual]

Virtual dtor.

Definition at line 61 of file TCPReceiveQueue_old.h.

{}


Member Function Documentation

virtual cPacket* tcp_old::TCPReceiveQueue::extractBytesUpTo ( uint32  seq  )  [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 NULL if there's no more data to be passed up -- this method is called several times until it returns NULL.

Implemented in tcp_old::TCPMsgBasedRcvQueue, and tcp_old::TCPVirtualDataRcvQueue.

Referenced by tcp_old::TCPConnection::processSegment1stThru8th().

virtual void tcp_old::TCPReceiveQueue::init ( uint32  startSeq  )  [pure virtual]
virtual uint32 tcp_old::TCPReceiveQueue::insertBytesFromSegment ( TCPSegment tcpseg  )  [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 tcp_old::TCPMsgBasedRcvQueue, and tcp_old::TCPVirtualDataRcvQueue.

Referenced by tcp_old::TCPConnection::processSegment1stThru8th(), tcp_old::TCPConnection::processSegmentInListen(), and tcp_old::TCPConnection::processSegmentInSynSent().

virtual void tcp_old::TCPReceiveQueue::setConnection ( TCPConnection _conn  )  [inline, virtual]

Set the connection that owns this queue.

Definition at line 66 of file TCPReceiveQueue_old.h.

Referenced by tcp_old::TCPConnection::cloneListeningConnection(), and tcp_old::TCPConnection::initConnection().

{conn = _conn;}


Member Data Documentation

Definition at line 50 of file TCPReceiveQueue_old.h.


The documentation for this class was generated from the following file: