|
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 00019 #ifndef _SCTPMESSAGE_H_ 00020 #define _SCTPMESSAGE_H_ 00021 00022 #include <list> 00023 #include "INETDefs.h" 00024 #include "SCTPMessage_m.h" 00025 00030 class INET_API SCTPMessage : public SCTPMessage_Base 00031 { 00032 protected: 00033 std::list<cPacket*> chunkList; 00034 00035 public: 00036 SCTPMessage(const char *name=NULL, int32 kind=0) : SCTPMessage_Base(name,kind) {} 00037 SCTPMessage(const SCTPMessage& other) : SCTPMessage_Base(other.getName()) {operator=(other);} 00038 ~SCTPMessage(); 00039 SCTPMessage& operator=(const SCTPMessage& other); 00040 virtual SCTPMessage *dup() const {return new SCTPMessage(*this);} 00042 virtual void setChunksArraySize(uint32 size); 00044 virtual void setChunks(uint32 k, const cPacketPtr& chunks_var); 00048 virtual uint32 getChunksArraySize() const; 00049 00053 virtual cPacketPtr& getChunks(uint32 k); 00057 virtual void addChunk(cPacket* msg); 00058 00062 virtual cPacket *removeChunk(); 00063 virtual cPacket *removeLastChunk(); 00064 virtual cPacket *peekFirstChunk(); 00065 virtual cPacket *peekLastChunk(); 00073 }; 00074 00075 /*class SCTPErrorChunk : public SCTPErrorChunk_Base 00076 { 00077 protected: 00078 std::list<cPacket*> parameterList; 00079 00080 public: 00081 SCTPErrorChunk(const char *name=NULL, int32 kind=0) : SCTPErrorChunk_Base(name, kind) {}; 00082 SCTPErrorChunk(const SCTPErrorChunk& other) : SCTPErrorChunk_Base(other.name()) {operator=(other);}; 00083 SCTPErrorChunk& operator=(const SCTPErrorChunk& other); 00084 00085 virtual cObject *dup() const {return new SCTPErrorChunk(*this);} 00086 virtual void setParametersArraySize(uint32 size); 00087 virtual uint32 getParametersArraySize() const; 00088 virtual void setParameters(uint32 k, const cPacketPtr& parameters_var); 00089 00090 00091 virtual cPacketPtr& getParameters(uint32 k); 00092 00093 virtual void addParameter(cPacket* msg); 00094 00095 virtual cPacket *removeParameter(); 00096 };*/ 00097 00098 class INET_API SCTPErrorChunk : public SCTPErrorChunk_Base 00099 { 00100 protected: 00101 std::list<cPacket*> parameterList; 00102 00103 public: 00104 SCTPErrorChunk(const char *name=NULL, int32 kind=0) : SCTPErrorChunk_Base(name, kind) {}; 00105 SCTPErrorChunk(const SCTPErrorChunk& other) : SCTPErrorChunk_Base(other.getName()) {operator=(other);}; 00106 SCTPErrorChunk& operator=(const SCTPErrorChunk& other); 00107 00108 virtual SCTPErrorChunk *dup() const {return new SCTPErrorChunk(*this);} 00109 virtual void setParametersArraySize(uint32 size); 00110 virtual uint32 getParametersArraySize() const; 00112 virtual void setParameters(uint32 k, const cPacketPtr& parameters_var); 00113 00117 virtual cPacketPtr& getParameters(uint32 k); 00121 virtual void addParameters(cPacket* msg); 00122 00126 virtual cPacket *removeParameter(); 00127 }; 00128 #endif 00129 00130