|
INET Framework for OMNeT++/OMNEST
|
#include <TCPVirtualDataSendQueue_old.h>
Public Member Functions | |
| TCPVirtualDataSendQueue () | |
| virtual | ~TCPVirtualDataSendQueue () |
| virtual void | init (uint32 startSeq) |
| virtual std::string | info () const |
| virtual void | enqueueAppData (cPacket *msg) |
| virtual uint32 | getBufferStartSeq () |
| virtual uint32 | getBufferEndSeq () |
| virtual TCPSegment * | createSegmentWithBytes (uint32 fromSeq, ulong numBytes) |
| virtual void | discardUpTo (uint32 seqNum) |
Protected Attributes | |
| uint32 | begin |
| uint32 | end |
Send queue that manages "virtual bytes", that is, byte counts only. It uses the length() field of the messages only, everything else is ignored.
Definition at line 32 of file TCPVirtualDataSendQueue_old.h.
Ctor
Definition at line 25 of file old/queues/TCPVirtualDataSendQueue.cc.
: TCPSendQueue() { begin = end = 0; }
| TCPVirtualDataSendQueue::~TCPVirtualDataSendQueue | ( | ) | [virtual] |
| TCPSegment * TCPVirtualDataSendQueue::createSegmentWithBytes | ( | uint32 | fromSeq, |
| ulong | maxNumBytes | ||
| ) | [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 than maxNumBytes bytes if the subclass wants to reproduce the original segment boundaries when retransmitting.
Implements tcp_old::TCPSendQueue.
Definition at line 64 of file old/queues/TCPVirtualDataSendQueue.cc.
{
//tcpEV << "sendQ: " << info() << " createSeg(seq=" << fromSeq << " len=" << numBytes << ")\n";
ASSERT(seqLE(begin,fromSeq) && seqLE(fromSeq+numBytes,end));
char msgname[32];
sprintf(msgname, "tcpseg(l=%lu)", numBytes);
TCPSegment *tcpseg = conn->createTCPSegment(msgname);
tcpseg->setSequenceNo(fromSeq);
tcpseg->setPayloadLength(numBytes);
return tcpseg;
}
| 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 tcp_old::TCPSendQueue.
Definition at line 78 of file old/queues/TCPVirtualDataSendQueue.cc.
| void TCPVirtualDataSendQueue::enqueueAppData | ( | cPacket * | 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 tcp_old::TCPSendQueue.
Definition at line 47 of file old/queues/TCPVirtualDataSendQueue.cc.
{
//tcpEV << "sendQ: " << info() << " enqueueAppData(bytes=" << msg->getByteLength() << ")\n";
end += msg->getByteLength();
delete msg;
}
| uint32 TCPVirtualDataSendQueue::getBufferEndSeq | ( | ) | [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 tcp_old::TCPSendQueue.
Definition at line 59 of file old/queues/TCPVirtualDataSendQueue.cc.
{
return end;
}
| uint32 TCPVirtualDataSendQueue::getBufferStartSeq | ( | ) | [virtual] |
Definition at line 54 of file old/queues/TCPVirtualDataSendQueue.cc.
{
return begin;
}
| std::string TCPVirtualDataSendQueue::info | ( | ) | const [virtual] |
Returns a string with the region stored.
Definition at line 40 of file old/queues/TCPVirtualDataSendQueue.cc.
| 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 tcp_old::TCPSendQueue.
Definition at line 34 of file old/queues/TCPVirtualDataSendQueue.cc.
uint32 tcp_old::TCPVirtualDataSendQueue::begin [protected] |
Definition at line 35 of file TCPVirtualDataSendQueue_old.h.
Referenced by createSegmentWithBytes(), discardUpTo(), getBufferStartSeq(), info(), init(), and TCPVirtualDataSendQueue().
uint32 tcp_old::TCPVirtualDataSendQueue::end [protected] |
Definition at line 36 of file TCPVirtualDataSendQueue_old.h.
Referenced by createSegmentWithBytes(), discardUpTo(), enqueueAppData(), getBufferEndSeq(), info(), init(), and TCPVirtualDataSendQueue().