|
INET Framework for OMNeT++/OMNEST
|
00001 // 00002 // Copyright (C) 2008 Irene Ruengeler 00003 // 00004 // This program is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU 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 General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #ifndef __SCTPALGORITHM_H 00019 #define __SCTPALGORITHM_H 00020 00021 #include <omnetpp.h> 00022 #include "SCTPAssociation.h" 00023 #include "SCTPQueue.h" 00024 00025 00026 00033 class INET_API SCTPAlgorithm : public cPolymorphic 00034 { 00035 protected: 00036 SCTPAssociation *assoc; // we belong to this association 00037 SCTPQueue *transmissionQ; 00038 SCTPQueue *retransmissionQ; 00039 00040 public: 00044 SCTPAlgorithm() { assoc = NULL; transmissionQ = NULL; retransmissionQ = NULL; } 00045 00049 virtual ~SCTPAlgorithm() {} 00050 00051 inline void setAssociation(SCTPAssociation* _assoc) { 00052 assoc = _assoc; 00053 transmissionQ = assoc->getTransmissionQueue(); 00054 retransmissionQ = assoc->getRetransmissionQueue(); 00055 } 00056 00057 virtual void initialize() {} 00058 00059 virtual SCTPStateVariables *createStateVariables() = 0; 00060 00061 virtual void established(bool active) = 0; 00062 00063 virtual void connectionClosed() = 0; 00064 00065 virtual void processTimer(cMessage *timer, SCTPEventCode& event) = 0; 00066 00067 virtual void sendCommandInvoked(SCTPPathVariables* path) = 0; 00068 00069 virtual void receivedDataAck(uint32 firstSeqAcked) = 0; 00070 00071 virtual void receivedDuplicateAck() = 0; 00072 00073 virtual void receivedAckForDataNotYetSent(uint32 seq) = 0; 00074 00075 virtual void sackSent() = 0; 00076 00077 virtual void dataSent(uint32 fromseq) = 0; 00078 00079 }; 00080 00081 #endif 00082 00083