TCPReceiveQueue.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2004 Andras Varga
00003 // Copyright (C) 2009 Thomas Reschka
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with this program; if not, see <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 #ifndef __INET_TCPRECEIVEQUEUE_H
00020 #define __INET_TCPRECEIVEQUEUE_H
00021 
00022 #include <omnetpp.h>
00023 #include "TCPConnection.h"
00024 
00025 
00026 class TCPSegment;
00027 class TCPCommand;
00028 
00029 
00047 class INET_API TCPReceiveQueue : public cPolymorphic
00048 {
00049   protected:
00050     TCPConnection *conn; // the connection that owns this queue
00051 
00052   public:
00056     TCPReceiveQueue()  {conn=NULL;}
00057 
00061     virtual ~TCPReceiveQueue() {}
00062 
00066     virtual void setConnection(TCPConnection *_conn)  {conn = _conn;}
00067 
00071     virtual void init(uint32 startSeq) = 0;
00072 
00080     virtual uint32 insertBytesFromSegment(TCPSegment *tcpseg) = 0;
00081 
00088     virtual cPacket *extractBytesUpTo(uint32 seq) = 0;
00089 
00093     virtual uint32 getAmountOfBufferedBytes() = 0;
00094 
00098     virtual uint32 getAmountOfFreeBytes(uint32 maxRcvBuffer) = 0;
00099 
00103     virtual uint32 getQueueLength() = 0;
00104 
00108     virtual void getQueueStatus() = 0;
00109 
00113     virtual uint32 getLE(uint32 fromSeqNum) = 0;
00114 
00118     virtual uint32 getRE(uint32 toSeqNum) = 0;
00119 };
00120 
00121 #endif