00001 /*************************************************************************** 00002 RTPEndsystemModule.h - description 00003 ------------------- 00004 begin : Fri Oct 19 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 __RTPENDSYSTEMMODULE_H__ 00023 #define __RTPENDSYSTEMMODULE_H__ 00024 00025 #include "omnetpp.h" 00026 00027 #include "sockets.h" 00028 #include "in_addr.h" 00029 #include "in_port.h" 00030 00031 #include "RTPInterfacePacket.h" 00032 #include "RTPInnerPacket.h" 00033 00040 class RTPEndsystemModule : public cSimpleModule { 00041 00042 Module_Class_Members(RTPEndsystemModule, cSimpleModule, 0); 00043 00047 virtual void initialize(); 00048 00052 virtual void handleMessage(cMessage *msg); 00053 00054 protected: 00055 00059 virtual void handleMessageFromApp(cMessage *msg); 00060 00064 virtual void handleMessageFromProfile(cMessage *msg); 00065 00069 virtual void handleMessageFromRTCP(cMessage *msg); 00070 00074 virtual void handleMessageFromSocketLayer(cMessage *msg); 00075 00079 virtual void enterSession(RTPInterfacePacket *rifp); 00080 00085 virtual void leaveSession(RTPInterfacePacket *rifp); 00086 00087 virtual void createSenderModule(RTPInterfacePacket *rifp); 00088 virtual void deleteSenderModule(RTPInterfacePacket *rifp); 00089 virtual void senderModuleControl(RTPInterfacePacket *rifp); 00090 00091 00095 virtual void profileInitialized(RTPInnerPacket *rinp); 00096 00097 virtual void senderModuleCreated(RTPInnerPacket *rinp); 00098 virtual void senderModuleDeleted(RTPInnerPacket *rinp); 00099 virtual void senderModuleInitialized(RTPInnerPacket *rinp); 00100 virtual void senderModuleStatus(RTPInnerPacket *rinp); 00101 00106 virtual void dataOut(RTPInnerPacket *rinp); 00107 00111 virtual void rtcpInitialized(RTPInnerPacket *rinp); 00112 00117 virtual void sessionLeft(RTPInnerPacket *rinp); 00118 00119 00120 private: 00124 const char *_commonName; 00125 00129 const char *_profileName; 00130 00134 int _bandwidth; 00135 00139 IN_Addr _destinationAddress; 00140 00144 IN_Port _port; 00145 00149 int _mtu; 00150 00154 int _rtcpPercentage; 00155 00159 Socket::Filedesc _socketFdIn; 00160 00164 Socket::Filedesc _socketFdOut; 00165 00166 /* 00167 Creates the profile module. 00168 */ 00169 virtual void createProfile(); 00170 00174 virtual void createServerSocket(); 00175 00179 virtual void createClientSocket(); 00180 00184 virtual void socketRet(SocketInterfacePacket *sifp); 00185 00189 virtual void connectRet(SocketInterfacePacket *sifp); 00190 00194 virtual void readRet(SocketInterfacePacket *sifp); 00195 00199 virtual void initializeProfile(); 00200 00204 virtual void initializeRTCP(); 00205 00212 virtual int resolveMTU(); 00213 }; 00214 00215 #endif