INET Framework for OMNeT++/OMNEST
inet::rtp::RTP Class Reference

An RTP is the center of the RTP layer of an endsystem. More...

#include <RTP.h>

Inheritance diagram for inet::rtp::RTP:
inet::ILifecycle

Public Member Functions

virtual bool handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 

Protected Member Functions

virtual void initialize (int stage) override
 Initializes variables. More...
 
virtual int numInitStages () const override
 
virtual void handleMessage (cMessage *msg) override
 Handles incoming messages. More...
 
virtual void handleMessageFromApp (cMessage *msg)
 Handles messages received from the applicaiton. More...
 
virtual void handleMessageFromProfile (cMessage *msg)
 Handles messages received from the profile module. More...
 
virtual void handleMessageFromRTCP (cMessage *msg)
 Handles messages received from the rtcp module. More...
 
virtual void handleMessagefromUDP (cMessage *msg)
 Handles messages received from the UDP layer. More...
 
virtual void enterSession (RTPCIEnterSession *rifp)
 Creates the profile module and initializes it. More...
 
virtual void leaveSession (RTPCILeaveSession *rifp)
 Destroys the profile module and orders the rtcp module to send an rtcp bye packet. More...
 
virtual void createSenderModule (RTPCICreateSenderModule *rifp)
 
virtual void deleteSenderModule (RTPCIDeleteSenderModule *rifp)
 
virtual void senderModuleControl (RTPCISenderControl *rifp)
 
virtual void profileInitialized (RTPInnerPacket *rinp)
 Called when the profile module is initialized. More...
 
virtual void senderModuleCreated (RTPInnerPacket *rinp)
 
virtual void senderModuleDeleted (RTPInnerPacket *rinp)
 
virtual void senderModuleInitialized (RTPInnerPacket *rinp)
 
virtual void senderModuleStatus (RTPInnerPacket *rinp)
 
virtual void dataOut (RTPInnerPacket *rinp)
 Sends a RTP data packet to the UDP layer and a copy of it to the rtcp module. More...
 
virtual void rtcpInitialized (RTPInnerPacket *rinp)
 Informs the application that the session is entered. More...
 
virtual void sessionLeft (RTPInnerPacket *rinp)
 Informs the application that this end system has left the RTP session. More...
 
virtual void createProfile (const char *profileName)
 Creates the profile module. More...
 
virtual void createSocket ()
 Requests a server socket from the UDP layer. More...
 
virtual void socketRet ()
 Called when the socket layer returns a socket. More...
 
virtual void connectRet ()
 Called when the socket layer has connected a socket. More...
 
virtual void readRet (cMessage *sifp)
 Called when data from the socket layer has been received. More...
 
virtual void initializeProfile ()
 Initializes the profile module. More...
 
virtual void initializeRTCP ()
 Initializes the rtcp module-. More...
 
virtual int resolveMTU ()
 Determines the maximum transmission unit that can be uses for RTP. More...
 

Protected Attributes

std::string _commonName
 The CNAME of this end system. More...
 
int _bandwidth
 The available bandwidth for this session. More...
 
IPv4Address _destinationAddress
 The destination address. More...
 
int _port
 The RTP port. More...
 
int _mtu
 The maximum size of a packet. More...
 
int _rtcpPercentage
 The percentage of the bandwidth used for rtcp. More...
 
UDPSocket _udpSocket
 The UDP socket. More...
 
bool _leaveSession
 True when this end system is about to leave the session. More...
 
int appInGate
 
int profileInGate
 
int rtcpInGate
 
int udpInGate
 

Static Protected Attributes

static simsignal_t rcvdPkSignal = registerSignal("rcvdPk")
 

Detailed Description

An RTP is the center of the RTP layer of an endsystem.

It creates the profile module, sends and receives RTP data packets and forwards messages. It also communicates with the application.

Member Function Documentation

void inet::rtp::RTP::connectRet ( )
protectedvirtual

Called when the socket layer has connected a socket.

Referenced by createSocket().

337 {
338  initializeRTCP();
339 }
virtual void initializeRTCP()
Initializes the rtcp module-.
Definition: RTP.cc:408
void inet::rtp::RTP::createProfile ( const char *  profileName)
protectedvirtual

Creates the profile module.

Referenced by enterSession().

375 {
376  cModuleType *moduleType = cModuleType::find(profileName);
377  if (moduleType == nullptr)
378  throw cRuntimeError("Profile type `%s' not found", profileName);
379 
380  RTPProfile *profile = check_and_cast<RTPProfile *>(moduleType->create("Profile", this));
381  profile->finalizeParameters();
382 
383  profile->setGateSize("payloadReceiverOut", 30);
384  profile->setGateSize("payloadReceiverIn", 30);
385 
386  this->gate("profileOut")->connectTo(profile->gate("rtpIn"));
387  profile->gate("rtpOut")->connectTo(this->gate("profileIn"));
388 
389  profile->callInitialize();
390  profile->scheduleStart(simTime());
391 }
std::vector< T >::iterator find(std::vector< T > &v, const T &a)
Definition: stlutils.h:48
void inet::rtp::RTP::createSenderModule ( RTPCICreateSenderModule rifp)
protectedvirtual

Referenced by handleMessageFromApp().

215 {
216  RTPInnerPacket *rinp = new RTPInnerPacket("createSenderModule()");
217  EV_INFO << rifp->getSsrc() << endl;
218  rinp->setCreateSenderModulePkt(rifp->getSsrc(), rifp->getPayloadType(), rifp->getFileName());
219  send(rinp, "profileOut");
220 
221  delete rifp;
222 }
void inet::rtp::RTP::createSocket ( )
protectedvirtual

Requests a server socket from the UDP layer.

Referenced by profileInitialized().

394 {
396  MulticastGroupList mgl = getModuleFromPar<IInterfaceTable>(par("interfaceTableModule"), this)->collectMulticastGroups();
397  _udpSocket.joinLocalMulticastGroups(mgl); //TODO make it parameter-dependent
398  connectRet();
399 }
UDPSocket _udpSocket
The UDP socket.
Definition: RTP.h:199
void joinLocalMulticastGroups(MulticastGroupList mgl)
Joins the socket to each multicast group that are registered with any of the interfaces.
Definition: UDPSocket.cc:194
virtual void connectRet()
Called when the socket layer has connected a socket.
Definition: RTP.cc:336
int _port
The RTP port.
Definition: RTP.h:184
void bind(int localPort)
Bind the socket to a local port number.
Definition: UDPSocket.cc:53
std::vector< MulticastGroup > MulticastGroupList
Definition: IInterfaceTable.h:36
void inet::rtp::RTP::dataOut ( RTPInnerPacket rinp)
protectedvirtual

Sends a RTP data packet to the UDP layer and a copy of it to the rtcp module.

Referenced by handleMessageFromProfile().

302 {
303  RTPPacket *msg = check_and_cast<RTPPacket *>(rinp->getEncapsulatedPacket()->dup());
304 
306 
307  // RTCP module must be informed about sent rtp data packet
308  send(rinp, "rtcpOut");
309 }
UDPSocket _udpSocket
The UDP socket.
Definition: RTP.h:199
void sendTo(cPacket *msg, L3Address destAddr, int destPort, const SendOptions *options=nullptr)
Sends a data packet to the given address and port.
Definition: UDPSocket.cc:88
IPv4Address _destinationAddress
The destination address.
Definition: RTP.h:179
int _port
The RTP port.
Definition: RTP.h:184
void inet::rtp::RTP::deleteSenderModule ( RTPCIDeleteSenderModule rifp)
protectedvirtual

Referenced by handleMessageFromApp().

225 {
226  RTPInnerPacket *rinp = new RTPInnerPacket("deleteSenderModule()");
227  rinp->setDeleteSenderModulePkt(rifp->getSsrc());
228  send(rinp, "profileOut");
229 
230  delete rifp;
231 }
void inet::rtp::RTP::enterSession ( RTPCIEnterSession rifp)
protectedvirtual

Creates the profile module and initializes it.

Referenced by handleMessageFromApp().

184 {
185  const char *profileName = rifp->getProfileName();
186  _commonName = rifp->getCommonName();
187  _bandwidth = rifp->getBandwidth();
188  _destinationAddress = rifp->getDestinationAddress();
189 
190  _port = rifp->getPort();
191  if (_port & 1)
192  _port--;
193 
194  _mtu = resolveMTU();
195 
196  createProfile(profileName);
198  delete rifp;
199 }
virtual void createProfile(const char *profileName)
Creates the profile module.
Definition: RTP.cc:374
virtual void initializeProfile()
Initializes the profile module.
Definition: RTP.cc:401
std::string _commonName
The CNAME of this end system.
Definition: RTP.h:169
virtual int resolveMTU()
Determines the maximum transmission unit that can be uses for RTP.
Definition: RTP.cc:359
int _bandwidth
The available bandwidth for this session.
Definition: RTP.h:174
IPv4Address _destinationAddress
The destination address.
Definition: RTP.h:179
int _port
The RTP port.
Definition: RTP.h:184
int _mtu
The maximum size of a packet.
Definition: RTP.h:189
void inet::rtp::RTP::handleMessage ( cMessage *  msg)
overrideprotectedvirtual

Handles incoming messages.

69 {
70  if (msg->getArrivalGateId() == appInGate) {
72  }
73  else if (msg->getArrivalGateId() == profileInGate) {
75  }
76  else if (msg->getArrivalGateId() == rtcpInGate) {
78  }
79  else if (msg->getArrivalGateId() == udpInGate) {
81  }
82  else {
83  throw cRuntimeError("Message from unknown gate");
84  }
85 }
virtual void handleMessagefromUDP(cMessage *msg)
Handles messages received from the UDP layer.
Definition: RTP.cc:174
int rtcpInGate
Definition: RTP.h:206
int appInGate
Definition: RTP.h:206
virtual void handleMessageFromRTCP(cMessage *msg)
Handles messages received from the rtcp module.
Definition: RTP.cc:156
int profileInGate
Definition: RTP.h:206
int udpInGate
Definition: RTP.h:206
virtual void handleMessageFromProfile(cMessage *msg)
Handles messages received from the profile module.
Definition: RTP.cc:121
virtual void handleMessageFromApp(cMessage *msg)
Handles messages received from the applicaiton.
Definition: RTP.cc:90
void inet::rtp::RTP::handleMessageFromApp ( cMessage *  msg)
protectedvirtual

Handles messages received from the applicaiton.

Referenced by handleMessage().

91 {
92  RTPControlInfo *ci = check_and_cast<RTPControlInfo *>(msg->removeControlInfo());
93  delete msg;
94 
95  switch (ci->getType()) {
97  enterSession(check_and_cast<RTPCIEnterSession *>(ci));
98  break;
99 
101  createSenderModule(check_and_cast<RTPCICreateSenderModule *>(ci));
102  break;
103 
105  deleteSenderModule(check_and_cast<RTPCIDeleteSenderModule *>(ci));
106  break;
107 
109  senderModuleControl(check_and_cast<RTPCISenderControl *>(ci));
110  break;
111 
113  leaveSession(check_and_cast<RTPCILeaveSession *>(ci));
114  break;
115 
116  default:
117  throw cRuntimeError("Unknown RTPControlInfo type from application");
118  }
119 }
Definition: RTPInterfacePacket_m.h:75
virtual void leaveSession(RTPCILeaveSession *rifp)
Destroys the profile module and orders the rtcp module to send an rtcp bye packet.
Definition: RTP.cc:201
virtual void enterSession(RTPCIEnterSession *rifp)
Creates the profile module and initializes it.
Definition: RTP.cc:183
Definition: RTPInterfacePacket_m.h:73
Definition: RTPInterfacePacket_m.h:77
virtual void deleteSenderModule(RTPCIDeleteSenderModule *rifp)
Definition: RTP.cc:224
Definition: RTPInterfacePacket_m.h:79
virtual void createSenderModule(RTPCICreateSenderModule *rifp)
Definition: RTP.cc:214
virtual void senderModuleControl(RTPCISenderControl *rifp)
Definition: RTP.cc:233
Definition: RTPInterfacePacket_m.h:71
void inet::rtp::RTP::handleMessageFromProfile ( cMessage *  msg)
protectedvirtual

Handles messages received from the profile module.

Referenced by handleMessage().

122 {
123  RTPInnerPacket *rinp = check_and_cast<RTPInnerPacket *>(msg);
124 
125  switch (rinp->getType()) {
127  profileInitialized(rinp);
128  break;
129 
131  senderModuleCreated(rinp);
132  break;
133 
135  senderModuleDeleted(rinp);
136  break;
137 
140  break;
141 
143  senderModuleStatus(rinp);
144  break;
145 
146  case RTP_INP_DATA_OUT:
147  dataOut(rinp);
148  break;
149 
150  default:
151  throw cRuntimeError("Unknown RTPInnerPacket type %d from profile", rinp->getType());
152  }
153  EV_DEBUG << "handleMessageFromProfile(cMessage *msg) Exit" << endl;
154 }
Definition: RTPInnerPacket_m.h:79
virtual void senderModuleDeleted(RTPInnerPacket *rinp)
Definition: RTP.cc:271
virtual void dataOut(RTPInnerPacket *rinp)
Sends a RTP data packet to the UDP layer and a copy of it to the rtcp module.
Definition: RTP.cc:301
Definition: RTPInnerPacket_m.h:81
virtual void senderModuleCreated(RTPInnerPacket *rinp)
Definition: RTP.cc:260
Definition: RTPInnerPacket_m.h:85
Definition: RTPInnerPacket_m.h:75
Definition: RTPInnerPacket_m.h:88
virtual void profileInitialized(RTPInnerPacket *rinp)
Called when the profile module is initialized.
Definition: RTP.cc:246
Definition: RTPInnerPacket_m.h:83
virtual void senderModuleInitialized(RTPInnerPacket *rinp)
Definition: RTP.cc:282
virtual void senderModuleStatus(RTPInnerPacket *rinp)
Definition: RTP.cc:287
void inet::rtp::RTP::handleMessageFromRTCP ( cMessage *  msg)
protectedvirtual

Handles messages received from the rtcp module.

Referenced by handleMessage().

157 {
158  RTPInnerPacket *rinp = check_and_cast<RTPInnerPacket *>(msg);
159 
160  switch (rinp->getType()) {
162  rtcpInitialized(rinp);
163  break;
164 
166  sessionLeft(rinp);
167  break;
168 
169  default:
170  throw cRuntimeError("Unknown RTPInnerPacket type %d from rtcp", rinp->getType());
171  }
172 }
Definition: RTPInnerPacket_m.h:87
virtual void rtcpInitialized(RTPInnerPacket *rinp)
Informs the application that the session is entered.
Definition: RTP.cc:311
virtual void sessionLeft(RTPInnerPacket *rinp)
Informs the application that this end system has left the RTP session.
Definition: RTP.cc:322
Definition: RTPInnerPacket_m.h:77
void inet::rtp::RTP::handleMessagefromUDP ( cMessage *  msg)
protectedvirtual

Handles messages received from the UDP layer.

Referenced by handleMessage().

175 {
176  readRet(msg);
177 }
virtual void readRet(cMessage *sifp)
Called when data from the socket layer has been received.
Definition: RTP.cc:341
bool inet::rtp::RTP::handleOperationStage ( LifecycleOperation operation,
int  stage,
IDoneCallback doneCallback 
)
overridevirtual

Perform one stage of a lifecycle operation.

Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.

Return value: true = "done"; false = "not yet done, will invoke doneCallback when done"

Implements inet::ILifecycle.

417 {
418  Enter_Method_Silent();
419 
420  throw cRuntimeError("Unsupported lifecycle operation '%s'", operation->getClassName());
421  return true;
422 }
void inet::rtp::RTP::initialize ( int  stage)
overrideprotectedvirtual

Initializes variables.

47 {
48  cSimpleModule::initialize(stage);
49 
50  if (stage == INITSTAGE_LOCAL) {
51  _commonName = "";
52  _leaveSession = false;
53  appInGate = findGate("appIn");
54  profileInGate = findGate("profileIn");
55  rtcpInGate = findGate("rtcpIn");
56  udpInGate = findGate("udpIn");
57  _udpSocket.setOutputGate(gate("udpOut"));
58  }
59  else if (stage == INITSTAGE_TRANSPORT_LAYER) {
60  bool isOperational;
61  NodeStatus *nodeStatus = dynamic_cast<NodeStatus *>(findContainingNode(this)->getSubmodule("status"));
62  isOperational = (!nodeStatus) || nodeStatus->getState() == NodeStatus::UP;
63  if (!isOperational)
64  throw cRuntimeError("This module doesn't support starting in node DOWN state");
65  }
66 }
Initialization of transport-layer protocols.
Definition: InitStages.h:90
int rtcpInGate
Definition: RTP.h:206
UDPSocket _udpSocket
The UDP socket.
Definition: RTP.h:199
int appInGate
Definition: RTP.h:206
int profileInGate
Definition: RTP.h:206
void setOutputGate(cGate *toUdp)
Sets the gate on which to send to UDP.
Definition: UDPSocket.h:110
bool _leaveSession
True when this end system is about to leave the session.
Definition: RTP.h:204
int udpInGate
Definition: RTP.h:206
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:56
Local initializations.
Definition: InitStages.h:35
std::string _commonName
The CNAME of this end system.
Definition: RTP.h:169
Definition: NodeStatus.h:40
void inet::rtp::RTP::initializeProfile ( )
protectedvirtual

Initializes the profile module.

Referenced by enterSession().

402 {
403  RTPInnerPacket *rinp = new RTPInnerPacket("initializeProfile()");
404  rinp->setInitializeProfilePkt(_mtu);
405  send(rinp, "profileOut");
406 }
int _mtu
The maximum size of a packet.
Definition: RTP.h:189
void inet::rtp::RTP::initializeRTCP ( )
protectedvirtual

Initializes the rtcp module-.

Referenced by connectRet().

409 {
410  RTPInnerPacket *rinp = new RTPInnerPacket("initializeRTCP()");
411  int rtcpPort = _port + 1;
412  rinp->setInitializeRTCPPkt(_commonName.c_str(), _mtu, _bandwidth, _rtcpPercentage, _destinationAddress, rtcpPort);
413  send(rinp, "rtcpOut");
414 }
int _rtcpPercentage
The percentage of the bandwidth used for rtcp.
Definition: RTP.h:194
std::string _commonName
The CNAME of this end system.
Definition: RTP.h:169
int _bandwidth
The available bandwidth for this session.
Definition: RTP.h:174
IPv4Address _destinationAddress
The destination address.
Definition: RTP.h:179
int _port
The RTP port.
Definition: RTP.h:184
int _mtu
The maximum size of a packet.
Definition: RTP.h:189
void inet::rtp::RTP::leaveSession ( RTPCILeaveSession rifp)
protectedvirtual

Destroys the profile module and orders the rtcp module to send an rtcp bye packet.

Referenced by handleMessageFromApp().

202 {
203  if (!_leaveSession) {
204  _leaveSession = true;
205  cModule *profileModule = gate("profileOut")->getNextGate()->getOwnerModule();
206  profileModule->deleteModule();
207  RTPInnerPacket *rinp = new RTPInnerPacket("leaveSession()");
208  rinp->setLeaveSessionPkt();
209  send(rinp, "rtcpOut");
210  }
211  delete rifp;
212 }
bool _leaveSession
True when this end system is about to leave the session.
Definition: RTP.h:204
virtual int inet::rtp::RTP::numInitStages ( ) const
inlineoverrideprotectedvirtual
48 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
void inet::rtp::RTP::profileInitialized ( RTPInnerPacket rinp)
protectedvirtual

Called when the profile module is initialized.

Referenced by handleMessageFromProfile().

247 {
248  _rtcpPercentage = rinp->getRtcpPercentage();
249  if (_port == PORT_UNDEF) {
250  _port = rinp->getPort();
251  if (_port & 1)
252  _port--;
253  }
254 
255  delete rinp;
256 
257  createSocket();
258 }
const short PORT_UNDEF
TCP/UDP port numbers.
Definition: IPv4Address.h:39
int _rtcpPercentage
The percentage of the bandwidth used for rtcp.
Definition: RTP.h:194
virtual void createSocket()
Requests a server socket from the UDP layer.
Definition: RTP.cc:393
int _port
The RTP port.
Definition: RTP.h:184
void inet::rtp::RTP::readRet ( cMessage *  sifp)
protectedvirtual

Called when data from the socket layer has been received.

Referenced by handleMessagefromUDP().

342 {
343  if (!_leaveSession) {
344  RTPPacket *msg = check_and_cast<RTPPacket *>(sifp);
345 
346  emit(rcvdPkSignal, msg);
347 
348  msg->dump();
349  RTPInnerPacket *rinp1 = new RTPInnerPacket("dataIn1()");
350  rinp1->setDataInPkt(new RTPPacket(*msg), IPv4Address(_destinationAddress), _port);
351  RTPInnerPacket *rinp2 = new RTPInnerPacket(*rinp1);
352  send(rinp2, "rtcpOut");
353  send(rinp1, "profileOut");
354  }
355 
356  delete sifp;
357 }
bool _leaveSession
True when this end system is about to leave the session.
Definition: RTP.h:204
static simsignal_t rcvdPkSignal
Definition: RTP.h:209
IPv4Address _destinationAddress
The destination address.
Definition: RTP.h:179
int _port
The RTP port.
Definition: RTP.h:184
int inet::rtp::RTP::resolveMTU ( )
protectedvirtual

Determines the maximum transmission unit that can be uses for RTP.

This implementation assumes that we use an ethernet with 1500 bytes mtu. The returned value is 1500 bytes minus header sizes for ip and udp.

Referenced by enterSession().

360 {
361  // it returns MTU bytelength (ethernet) minus ip
362  // and udp headers
363  // TODO: How to do get the valid length of IP and ETHERNET header?
364  IIPv4RoutingTable *rt = getModuleFromPar<IIPv4RoutingTable>(par("routingTableModule"), this);
365  const InterfaceEntry *rtie = rt->getInterfaceForDestAddr(_destinationAddress);
366 
367  if (rtie == nullptr)
368  throw cRuntimeError("No interface for remote address %s found!", _destinationAddress.str().c_str());
369 
370  int pmtu = rtie->getMTU();
371  return pmtu - 20 - 8;
372 }
std::string str(bool printUnspec=true) const
Returns the string representation of the address (e.g.
Definition: IPv4Address.cc:109
IPv4Address _destinationAddress
The destination address.
Definition: RTP.h:179
void inet::rtp::RTP::rtcpInitialized ( RTPInnerPacket rinp)
protectedvirtual

Informs the application that the session is entered.

Referenced by handleMessageFromRTCP().

312 {
313  RTPCISessionEntered *ci = new RTPCISessionEntered();
314  ci->setSsrc(rinp->getSsrc());
315  cMessage *msg = new RTPControlMsg("sessionEntered()");
316  msg->setControlInfo(ci);
317  send(msg, "appOut");
318 
319  delete rinp;
320 }
void inet::rtp::RTP::senderModuleControl ( RTPCISenderControl rifp)
protectedvirtual

Referenced by handleMessageFromApp().

234 {
235  RTPInnerPacket *rinp = new RTPInnerPacket("senderModuleControl()");
236  RTPSenderControlMessage *scm = new RTPSenderControlMessage();
237  scm->setCommand(rifp->getCommand());
238  scm->setCommandParameter1(rifp->getCommandParameter1());
239  scm->setCommandParameter2(rifp->getCommandParameter2());
240  rinp->setSenderModuleControlPkt(rinp->getSsrc(), scm);
241  send(rinp, "profileOut");
242 
243  delete rifp;
244 }
void inet::rtp::RTP::senderModuleCreated ( RTPInnerPacket rinp)
protectedvirtual

Referenced by handleMessageFromProfile().

261 {
262  RTPCISenderModuleCreated *ci = new RTPCISenderModuleCreated();
263  ci->setSsrc(rinp->getSsrc());
264  cMessage *msg = new RTPControlMsg("senderModuleCreated()");
265  msg->setControlInfo(ci);
266  send(msg, "appOut");
267 
268  delete rinp;
269 }
void inet::rtp::RTP::senderModuleDeleted ( RTPInnerPacket rinp)
protectedvirtual

Referenced by handleMessageFromProfile().

272 {
273  RTPCISenderModuleDeleted *ci = new RTPCISenderModuleDeleted();
274  ci->setSsrc(rinp->getSsrc());
275  cMessage *msg = new RTPControlMsg("senderModuleDeleted()");
276  msg->setControlInfo(ci);
277  send(msg, "appOut");
278  // perhaps we should send a message to rtcp module
279  delete rinp;
280 }
void inet::rtp::RTP::senderModuleInitialized ( RTPInnerPacket rinp)
protectedvirtual

Referenced by handleMessageFromProfile().

283 {
284  send(rinp, "rtcpOut");
285 }
void inet::rtp::RTP::senderModuleStatus ( RTPInnerPacket rinp)
protectedvirtual

Referenced by handleMessageFromProfile().

288 {
289  RTPSenderStatusMessage *ssm = (RTPSenderStatusMessage *)(rinp->decapsulate());
290  RTPCISenderStatus *ci = new RTPCISenderStatus();
291  ci->setSsrc(rinp->getSsrc());
292  ci->setStatus(ssm->getStatus());
293  ci->setTimeStamp(ssm->getTimeStamp());
294  cMessage *msg = new RTPControlMsg("senderModuleStatus()");
295  msg->setControlInfo(ci);
296  send(msg, "appOut");
297  delete ssm;
298  delete rinp;
299 }
void inet::rtp::RTP::sessionLeft ( RTPInnerPacket rinp)
protectedvirtual

Informs the application that this end system has left the RTP session.

Referenced by handleMessageFromRTCP().

323 {
324  RTPCISessionLeft *ci = new RTPCISessionLeft();
325  cMessage *msg = new RTPControlMsg("sessionLeft()");
326  msg->setControlInfo(ci);
327  send(msg, "appOut");
328 
329  delete rinp;
330 }
void inet::rtp::RTP::socketRet ( )
protectedvirtual

Called when the socket layer returns a socket.

333 {
334 }

Member Data Documentation

int inet::rtp::RTP::_bandwidth
protected

The available bandwidth for this session.

Referenced by enterSession(), and initializeRTCP().

std::string inet::rtp::RTP::_commonName
protected

The CNAME of this end system.

Referenced by enterSession(), initialize(), and initializeRTCP().

IPv4Address inet::rtp::RTP::_destinationAddress
protected

The destination address.

Referenced by dataOut(), enterSession(), initializeRTCP(), readRet(), and resolveMTU().

bool inet::rtp::RTP::_leaveSession
protected

True when this end system is about to leave the session.

Referenced by initialize(), leaveSession(), and readRet().

int inet::rtp::RTP::_mtu
protected

The maximum size of a packet.

Referenced by enterSession(), initializeProfile(), and initializeRTCP().

int inet::rtp::RTP::_port
protected
int inet::rtp::RTP::_rtcpPercentage
protected

The percentage of the bandwidth used for rtcp.

Referenced by initializeRTCP(), and profileInitialized().

UDPSocket inet::rtp::RTP::_udpSocket
protected

The UDP socket.

Referenced by createSocket(), dataOut(), and initialize().

int inet::rtp::RTP::appInGate
protected

Referenced by handleMessage(), and initialize().

int inet::rtp::RTP::profileInGate
protected

Referenced by handleMessage(), and initialize().

simsignal_t inet::rtp::RTP::rcvdPkSignal = registerSignal("rcvdPk")
staticprotected

Referenced by readRet().

int inet::rtp::RTP::rtcpInGate
protected

Referenced by handleMessage(), and initialize().

int inet::rtp::RTP::udpInGate
protected

Referenced by handleMessage(), and initialize().


The documentation for this class was generated from the following files: