|
INET Framework for OMNeT++/OMNEST
|
00001 /*************************************************************************** 00002 RTPInnerPacket.h - description 00003 ------------------- 00004 begin : Sat Oct 20 2001 00005 copyright : (C) 2001 by Matthias Oppitz 00006 email : Matthias.Oppitz@gmx.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00022 #ifndef __INET_RTPINNERPACKET_H 00023 #define __INET_RTPINNERPACKET_H 00024 00025 #include "INETDefs.h" 00026 #include "IPAddress.h" 00027 #include "RTPPacket.h" 00028 #include "RTPSenderControlMessage_m.h" 00029 #include "RTPSenderStatusMessage_m.h" 00030 00031 00035 class INET_API RTPInnerPacket : public cPacket 00036 { 00037 00038 public: 00039 00044 enum RTP_INP_TYPE { 00045 RTP_INP_UNDEF, 00046 RTP_INP_INITIALIZE_PROFILE, 00047 RTP_INP_PROFILE_INITIALIZED, 00048 RTP_INP_INITIALIZE_RTCP, 00049 RTP_INP_RTCP_INITIALIZED, 00050 RTP_INP_CREATE_SENDER_MODULE, 00051 RTP_INP_SENDER_MODULE_CREATED, 00052 RTP_INP_DELETE_SENDER_MODULE, 00053 RTP_INP_SENDER_MODULE_DELETED, 00054 RTP_INP_INITIALIZE_SENDER_MODULE, 00055 RTP_INP_SENDER_MODULE_INITIALIZED, 00056 RTP_INP_SENDER_MODULE_CONTROL, 00057 RTP_INP_SENDER_MODULE_STATUS, 00058 RTP_INP_LEAVE_SESSION, 00059 RTP_INP_SESSION_LEFT, 00060 RTP_INP_DATA_OUT, 00061 RTP_INP_DATA_IN 00062 }; 00063 00067 RTPInnerPacket(const char *name = NULL); 00068 00072 RTPInnerPacket(const RTPInnerPacket& rinp); 00073 00077 virtual ~RTPInnerPacket(); 00078 00082 RTPInnerPacket& operator=(const RTPInnerPacket& rinp); 00083 00087 virtual RTPInnerPacket *dup() const; 00088 00092 virtual std::string info(); 00093 00097 virtual void dump(std::ostream& os) const; 00098 00103 virtual void initializeProfile(int mtu); 00104 00110 virtual void profileInitialized(int rtcpPercentage, int port); 00111 00116 virtual void initializeRTCP(const char *commonName, int mtu, int bandwidth, int rtcpPercentage, IPAddress address, int port); 00117 00123 virtual void rtcpInitialized(uint32 ssrc); 00124 00125 virtual void createSenderModule(uint32 ssrc, int payloadType, const char *fileName); 00126 virtual void senderModuleCreated(uint32 ssrc); 00127 00128 virtual void deleteSenderModule(uint32 ssrc); 00129 virtual void senderModuleDeleted(uint32 ssrc); 00130 00131 virtual void initializeSenderModule(uint32 ssrc, const char *fileName, int mtu); 00132 virtual void senderModuleInitialized(uint32 ssrc, int payloadType, int clockRate, int timeStampBase, int sequenceNumberBase); 00133 00134 virtual void senderModuleControl(uint32 ssrc, RTPSenderControlMessage *msg); 00135 virtual void senderModuleStatus(uint32 ssrc, RTPSenderStatusMessage *msg); 00136 00141 virtual void leaveSession(); 00142 00147 virtual void sessionLeft(); 00148 00153 virtual void dataOut(RTPPacket *packet); 00154 00159 virtual void dataIn(RTPPacket *packet, IPAddress address, int port); 00160 00164 virtual RTP_INP_TYPE getType(); 00165 00169 virtual const char *getCommonName(); 00170 00174 virtual int getMTU(); 00175 00179 virtual int getBandwidth(); 00180 00184 virtual int getRtcpPercentage(); 00185 00189 virtual IPAddress getAddress(); 00190 00194 virtual int getPort(); 00195 00199 virtual uint32 getSSRC(); 00200 00204 virtual int getPayloadType(); 00205 00209 virtual const char *getFileName(); 00210 00214 virtual int getClockRate(); 00215 00219 virtual int getTimeStampBase(); 00220 00224 virtual int getSequenceNumberBase(); 00225 00226 00227 protected: 00228 00232 RTP_INP_TYPE _type; 00233 00237 const char *_commonName; 00238 00242 int _mtu; 00243 00247 int _bandwidth; 00248 00252 int _rtcpPercentage; 00253 00257 IPAddress _address; 00258 00262 int _port; 00263 00267 uint32 _ssrc; 00268 00272 int _payloadType; 00273 00277 const char *_fileName; 00278 00282 int _clockRate; 00283 00287 int _timeStampBase; 00288 00292 int _sequenceNumberBase; 00293 }; 00294 00295 #endif 00296