Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TCPVirtualDataSendQueue Class Reference

#include <TCPVirtualDataSendQueue.h>

Inheritance diagram for TCPVirtualDataSendQueue:

TCPSendQueue List of all members.

Detailed Description

Send queue that manages "virtual bytes", that is, byte counts only. It uses the length() field of the messages only, everything else is ignored.

See also:
TCPVirtualDataRcvQueue


Public Member Functions

 TCPVirtualDataSendQueue ()
virtual ~TCPVirtualDataSendQueue ()
virtual void init (uint32 startSeq)
virtual std::string info () const
virtual void enqueueAppData (cMessage *msg)
virtual uint32 bufferEndSeq ()
virtual TCPSegmentcreateSegmentWithBytes (uint32 fromSeq, ulong numBytes)
virtual void discardUpTo (uint32 seqNum)

Protected Attributes

uint32 begin
uint32 end


Constructor & Destructor Documentation

TCPVirtualDataSendQueue::TCPVirtualDataSendQueue  ) 
 

Ctor

00024                                                  : TCPSendQueue()
00025 {
00026     begin = end = 0;
00027 }

TCPVirtualDataSendQueue::~TCPVirtualDataSendQueue  )  [virtual]
 

Virtual dtor.

00030 {
00031 }


Member Function Documentation

uint32 TCPVirtualDataSendQueue::bufferEndSeq  )  [virtual]
 

Returns the sequence number of the last byte stored in the buffer plus one. (The first byte of the next send operation would get this sequence number.)

Implements TCPSendQueue.

00054 {
00055     return end;
00056 }

TCPSegment * TCPVirtualDataSendQueue::createSegmentWithBytes uint32  fromSeq,
ulong  numBytes
[virtual]
 

Called when the TCP wants to send or retransmit data, it constructs a TCP segment which contains the data from the requested sequence number range. The actually returned segment may contain less then maxNumBytes bytes if the subclass wants to reproduce the original segment boundaries when retransmitting.

Implements TCPSendQueue.

00059 {
00060     //tcpEV << "sendQ: " << info() << " createSeg(seq=" << fromSeq << " len=" << numBytes << ")\n";
00061     ASSERT(seqLE(begin,fromSeq) && seqLE(fromSeq+numBytes,end));
00062 
00063     char msgname[32];
00064     sprintf(msgname, "tcpseg(l=%lu)", numBytes);
00065 
00066     TCPSegment *tcpseg = new TCPSegment(msgname);
00067     tcpseg->setSequenceNo(fromSeq);
00068     tcpseg->setPayloadLength(numBytes);
00069     return tcpseg;
00070 }

void TCPVirtualDataSendQueue::discardUpTo uint32  seqNum  )  [virtual]
 

Tells the queue that bytes up to (but NOT including) seqNum have been transmitted and ACKed, so they can be removed from the queue.

Implements TCPSendQueue.

00073 {
00074     //tcpEV << "sendQ: " << info() << " discardUpTo(seq=" << seqNum << ")\n";
00075     ASSERT(seqLE(begin,seqNum) && seqLE(seqNum,end));
00076     begin = seqNum;
00077 }

void TCPVirtualDataSendQueue::enqueueAppData cMessage *  msg  )  [virtual]
 

Called on SEND app command, it inserts in the queue the data the user wants to send. Implementations of this abstract class will decide what this means: copying actual bytes, just increasing the "last byte queued" variable, or storing cMessage object(s). The msg object should not be referenced after this point (sendQueue may delete it.)

Implements TCPSendQueue.

00047 {
00048     //tcpEV << "sendQ: " << info() << " enqueueAppData(bytes=" << msg->byteLength() << ")\n";
00049     end += msg->byteLength();
00050     delete msg;
00051 }

std::string TCPVirtualDataSendQueue::info  )  const [virtual]
 

Returns a string with the region stored.

00040 {
00041     std::stringstream out;
00042     out << "[" << begin << ".." << end << ")";
00043     return out.str();
00044 }

void TCPVirtualDataSendQueue::init uint32  startSeq  )  [virtual]
 

Initialize the object. The startSeq parameter tells what sequence number the first byte of app data should get. This is usually ISS+1 because SYN consumes one byte in the sequence number space.

init() may be called more than once; every call flushes the existing contents of the queue.

Implements TCPSendQueue.

00034 {
00035     begin = startSeq;
00036     end = startSeq;
00037 }


Member Data Documentation

uint32 TCPVirtualDataSendQueue::begin [protected]
 

uint32 TCPVirtualDataSendQueue::end [protected]
 


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 18:22:31 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.0