Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __INET_TCPSENDQUEUE_OLD_H
00019 #define __INET_TCPSENDQUEUE_OLD_H
00020
00021 #include <omnetpp.h>
00022 #include "TCPConnection_old.h"
00023 #include "TCPSegment.h"
00024
00025 namespace tcp_old {
00026
00079 class INET_API TCPSendQueue : public cPolymorphic
00080 {
00081 protected:
00082 TCPConnection *conn;
00083
00084 public:
00088 TCPSendQueue() {conn=NULL;}
00089
00093 virtual ~TCPSendQueue() {}
00094
00098 virtual void setConnection(TCPConnection *_conn) {conn = _conn;}
00099
00108 virtual void init(uint32 startSeq) = 0;
00109
00118 virtual void enqueueAppData(cPacket *msg) = 0;
00119
00124 virtual uint32 getBufferEndSeq() = 0;
00125
00130 inline ulong getBytesAvailable(uint32 fromSeq)
00131 {
00132 uint32 bufEndSeq = getBufferEndSeq();
00133 return seqLess(fromSeq, bufEndSeq) ? bufEndSeq-fromSeq : 0;
00134 }
00135
00143 virtual TCPSegment *createSegmentWithBytes(uint32 fromSeq, ulong maxNumBytes) = 0;
00144
00149 virtual void discardUpTo(uint32 seqNum) = 0;
00150
00151 };
00152
00153 }
00154 #endif
00155
00156