|
INET Framework for OMNeT++/OMNEST
|
00001 // 00002 // Copyright (C) 2004 Andras Varga 00003 // 00004 // This program is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public License 00006 // as published by the Free Software Foundation; either version 2 00007 // of the License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU Lesser General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU Lesser General Public License 00015 // along with this program; if not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #ifndef __INET_TCPALGORITHM_OLD_H 00019 #define __INET_TCPALGORITHM_OLD_H 00020 00021 #include <omnetpp.h> 00022 #include "TCPConnection_old.h" 00023 #include "TCPSegment.h" 00024 00025 namespace tcp_old { 00026 00033 class INET_API TCPAlgorithm : public cPolymorphic 00034 { 00035 protected: 00036 TCPConnection *conn; // we belong to this connection 00037 TCPStateVariables *state; // our state variables 00038 00045 virtual TCPStateVariables *createStateVariables() = 0; 00046 00047 public: 00051 TCPAlgorithm() {state = NULL; conn = NULL;} 00052 00056 virtual ~TCPAlgorithm() {} 00057 00062 void setConnection(TCPConnection *_conn) {conn = _conn;} 00063 00067 TCPStateVariables *getStateVariables() { 00068 if (!state) state = createStateVariables(); 00069 return state; 00070 } 00071 00077 virtual void initialize() {} 00078 00086 virtual void established(bool active) = 0; 00087 00091 virtual void connectionClosed() = 0; 00092 00102 virtual void processTimer(cMessage *timer, TCPEventCode& event) = 0; 00103 00107 virtual void sendCommandInvoked() = 0; 00108 00116 virtual void receivedOutOfOrderSegment() = 0; 00117 00124 virtual void receiveSeqChanged() = 0; 00125 00134 virtual void receivedDataAck(uint32 firstSeqAcked) = 0; 00135 00142 virtual void receivedDuplicateAck() = 0; 00143 00148 virtual void receivedAckForDataNotYetSent(uint32 seq) = 0; 00149 00154 virtual void ackSent() = 0; 00155 00161 virtual void dataSent(uint32 fromseq) = 0; 00162 00166 virtual void restartRexmitTimer() = 0; 00167 00168 }; 00169 00170 } 00171 #endif 00172 00173