RTPInterfacePacket Class Reference

#include <RTPInterfacePacket.h>

List of all members.


Detailed Description

The class RTPInterfacePacket is used for communication between an RTPApplication and an RTPLayer module. Its offers functionality for starting and stopping of an rtp session, transmission of files and feedback about the success of the operations.

Public Types

enum  RTP_IFP_TYPE {
  RTP_IFP_UNDEF, RTP_IFP_ENTER_SESSION, RTP_IFP_SESSION_ENTERED, RTP_IFP_CREATE_SENDER_MODULE,
  RTP_IFP_SENDER_MODULE_CREATED, RTP_IFP_DELETE_SENDER_MODULE, RTP_IFP_SENDER_MODULE_DELETED, RTP_IFP_SENDER_CONTROL,
  RTP_IFP_SENDER_STATUS, RTP_IFP_LEAVE_SESSION, RTP_IFP_SESSION_LEFT
}

Public Member Functions

 RTPInterfacePacket (const char *name=NULL)
 RTPInterfacePacket (const RTPInterfacePacket &rifp)
virtual ~RTPInterfacePacket ()
RTPInterfacePacketoperator= (const RTPInterfacePacket &rifp)
virtual RTPInterfacePacketdup () const
virtual std::string info ()
virtual void dump (std::ostream &os)
virtual void enterSession (const char *commonName, const char *profileName, int bandwidth, IPAddress destinationAddress, int port)
virtual void sessionEntered (uint32 ssrc)
virtual void createSenderModule (uint32 ssrc, int payloadType, const char *fileName)
virtual void senderModuleCreated (uint32 ssrc)
virtual void deleteSenderModule (uint32 ssrc)
virtual void senderModuleDeleted (uint32 ssrc)
virtual void senderModuleControl (uint32 ssrc, RTPSenderControlMessage *msg)
virtual void senderModuleStatus (uint32 ssrc, RTPSenderStatusMessage *msg)
virtual void leaveSession ()
virtual void sessionLeft ()
virtual RTP_IFP_TYPE getType ()
virtual const char * getCommonName ()
virtual const char * getProfileName ()
virtual int getBandwidth ()
virtual IPAddress getDestinationAddress ()
virtual int getPort ()
virtual uint32 getSSRC ()
virtual int getPayloadType ()
virtual const char * getFileName ()

Protected Attributes

RTP_IFP_TYPE _type
const char * _commonName
const char * _profileName
int _bandwidth
IPAddress _destinationAddress
int _port
uint32 _ssrc
int _payloadType
const char * _fileName

Member Enumeration Documentation

An enumeration to distinguish the different functions of the RTPInterfacePacket.

Enumerator:
RTP_IFP_UNDEF 
RTP_IFP_ENTER_SESSION 
RTP_IFP_SESSION_ENTERED 
RTP_IFP_CREATE_SENDER_MODULE 
RTP_IFP_SENDER_MODULE_CREATED 
RTP_IFP_DELETE_SENDER_MODULE 
RTP_IFP_SENDER_MODULE_DELETED 
RTP_IFP_SENDER_CONTROL 
RTP_IFP_SENDER_STATUS 
RTP_IFP_LEAVE_SESSION 
RTP_IFP_SESSION_LEFT 


Constructor & Destructor Documentation

RTPInterfacePacket::RTPInterfacePacket ( const char *  name = NULL  ) 

Default constructor.

Referenced by dup().

00027                                                        : cPacket(name) {
00028     _type = RTP_IFP_UNDEF;
00029     _commonName = NULL;
00030     _profileName = NULL;
00031     _bandwidth = 0;
00032     _destinationAddress = IPAddress::UNSPECIFIED_ADDRESS;
00033     _port = PORT_UNDEF;
00034     _ssrc = 0;
00035     _payloadType = 0;
00036     _fileName = NULL;
00037 };

RTPInterfacePacket::RTPInterfacePacket ( const RTPInterfacePacket rifp  ) 

Copy constructor.

00040                                                                      : cPacket() {
00041     setName(rifp.getName());
00042     operator=(rifp);
00043 };

RTPInterfacePacket::~RTPInterfacePacket (  )  [virtual]

Destructor.

00046                                         {
00047     if (opp_strcmp(_commonName, ""))
00048         delete _commonName;
00049     if (opp_strcmp(_profileName, ""))
00050         delete _profileName;
00051     if (opp_strcmp(_fileName, ""))
00052         delete _fileName;
00053 };


Member Function Documentation

RTPInterfacePacket & RTPInterfacePacket::operator= ( const RTPInterfacePacket rifp  ) 

Assignment operator.

Referenced by RTPInterfacePacket().

00056                                                                                 {
00057     cPacket::operator=(rifp);
00058     _type = rifp._type;
00059     _commonName = opp_strdup(rifp._commonName);
00060     _profileName = opp_strdup(rifp._profileName);
00061     _bandwidth = rifp._bandwidth;
00062     _destinationAddress = rifp._destinationAddress;
00063     _port = rifp._port;
00064     _ssrc = rifp._ssrc;
00065     _payloadType = rifp._payloadType;
00066     _fileName = opp_strdup(rifp._fileName);
00067     return *this;
00068 };

RTPInterfacePacket * RTPInterfacePacket::dup (  )  const [virtual]

Duplicates the RTPInterfacePacket by calling the copy constructor.

00071                                                   {
00072     return new RTPInterfacePacket(*this);
00073 };

std::string RTPInterfacePacket::info (  )  [virtual]

Writes a one line info about this RTPInterfacePacket into the given string.

00076                                    {
00077     std::stringstream out;
00078     out << "RTPInterfacePacket: type=" << _type;
00079     return out.str();
00080 };

void RTPInterfacePacket::dump ( std::ostream &  os  )  [virtual]

Writes a longer info about this RTPInterfacePacket into the given stream.

00083                                             {
00084     os << "RTPInterfacePacket:" << endl;
00085     os << "  type = " << _type << endl;
00086     os << "  commonName = " << _commonName << endl;
00087     os << "  profileName = " << _profileName << endl;
00088     os << "  bandwidth = " << _bandwidth << endl;
00089     os << "  destinationAddress = " << _destinationAddress << endl;
00090     os << "  port = " << _port << endl;
00091     os << "  ssrc = " << _ssrc << endl;
00092     os << "  payloadType = " << _payloadType << endl;
00093     os << "  fileName = " << _fileName << endl;
00094 };

void RTPInterfacePacket::enterSession ( const char *  commonName,
const char *  profileName,
int  bandwidth,
IPAddress  destinationAddress,
int  port 
) [virtual]

Called by the rtp application to make the rtp layer enter an rtp session with the given parameters.

Referenced by RTPApplication::activity().

00097                                                                                                                                             {
00098     _type = RTP_IFP_ENTER_SESSION;
00099     _commonName = commonName;
00100     _profileName = profileName;
00101     _bandwidth = bandwidth;
00102     _destinationAddress = destinationAddress;
00103     _port = port;
00104 };

void RTPInterfacePacket::sessionEntered ( uint32  ssrc  )  [virtual]

Called by the rtp module to inform the application that the rtp session has been entered.

Referenced by RTP::rtcpInitialized().

00107                                                    {
00108     _type = RTP_IFP_SESSION_ENTERED;
00109     _ssrc = ssrc;
00110 };

void RTPInterfacePacket::createSenderModule ( uint32  ssrc,
int  payloadType,
const char *  fileName 
) [virtual]

Referenced by RTPApplication::activity().

00113                                                                                               {
00114     _type = RTP_IFP_CREATE_SENDER_MODULE;
00115     _ssrc = ssrc;
00116     _payloadType =payloadType;
00117     _fileName = fileName;
00118 };

void RTPInterfacePacket::senderModuleCreated ( uint32  ssrc  )  [virtual]

Referenced by RTP::senderModuleCreated().

00121                                                         {
00122     _type = RTP_IFP_SENDER_MODULE_CREATED;
00123     _ssrc = ssrc;
00124 };

void RTPInterfacePacket::deleteSenderModule ( uint32  ssrc  )  [virtual]

00127                                                        {
00128     _type = RTP_IFP_DELETE_SENDER_MODULE;
00129     _ssrc = ssrc;
00130 };

void RTPInterfacePacket::senderModuleDeleted ( uint32  ssrc  )  [virtual]

Referenced by RTP::senderModuleDeleted().

00133                                                         {
00134     _type = RTP_IFP_SENDER_MODULE_DELETED;
00135     _ssrc = ssrc;
00136 };

void RTPInterfacePacket::senderModuleControl ( uint32  ssrc,
RTPSenderControlMessage *  msg 
) [virtual]

Referenced by RTPApplication::activity().

00139                                                                                       {
00140     _type = RTP_IFP_SENDER_CONTROL;
00141     _ssrc = ssrc;
00142     encapsulate(msg);
00143 };

void RTPInterfacePacket::senderModuleStatus ( uint32  ssrc,
RTPSenderStatusMessage *  msg 
) [virtual]

Referenced by RTP::senderModuleStatus().

00146                                                                                     {
00147     _type = RTP_IFP_SENDER_STATUS;
00148     _ssrc = ssrc;
00149     encapsulate(msg);
00150 };

void RTPInterfacePacket::leaveSession (  )  [virtual]

Called by the application to order the rtp layer to start transmitting a file. Called by the rtp module to inform the application that the transmitting has begun. Called by the rtp module to inform the application that the transmission has been finished because the end of the file has been reached. Called by the application to order the rtp layer to stop transmitting. Called by the rtp module to inform the application that the transmission has been stopped as ordered. Called by the application to order the rtp layer to stop participating in this rtp session.

Referenced by RTPApplication::activity().

00186                                       {
00187     _type = RTP_IFP_LEAVE_SESSION;
00188 };

void RTPInterfacePacket::sessionLeft (  )  [virtual]

Called by the rtp module to inform the application that this end system stop participating in this rtp session.

Referenced by RTP::sessionLeft().

00191                                      {
00192     _type = RTP_IFP_SESSION_LEFT;
00193 };

RTPInterfacePacket::RTP_IFP_TYPE RTPInterfacePacket::getType (  )  [virtual]

Returns the type of this RTPInterfacePacket.

Referenced by RTPApplication::activity(), and RTP::handleMessageFromApp().

00196                                                            {
00197     return _type;
00198 };

const char * RTPInterfacePacket::getCommonName (  )  [virtual]

Returns the CNAME stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

00201                                               {
00202     return opp_strdup(_commonName);
00203 };

const char * RTPInterfacePacket::getProfileName (  )  [virtual]

Returns the profile name stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

00206                                                {
00207     return opp_strdup(_profileName);
00208 };

int RTPInterfacePacket::getBandwidth (  )  [virtual]

Returns the bandidth stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

00226                                      {
00227     return _bandwidth;
00228 };

IPAddress RTPInterfacePacket::getDestinationAddress (  )  [virtual]

Returns the address stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

00231                                                     {
00232     return _destinationAddress;
00233 };

int RTPInterfacePacket::getPort (  )  [virtual]

Returns the port stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

00236                                 {
00237     return _port;
00238 };

uint32 RTPInterfacePacket::getSSRC (  )  [virtual]

Returns the ssrc identifier stored in this RTPInterfacePacket.

Referenced by RTPApplication::activity(), RTP::createSenderModule(), and RTP::deleteSenderModule().

00211                                    {
00212     return _ssrc;
00213 };

int RTPInterfacePacket::getPayloadType (  )  [virtual]

Returns the payload type stored in this RTPInterfacePacket.

Referenced by RTP::createSenderModule().

00216                                        {
00217     return _payloadType;
00218 };

const char * RTPInterfacePacket::getFileName (  )  [virtual]

Returns the file name stored in this RTPInterfacePacket.

Referenced by RTP::createSenderModule().

00221                                             {
00222     return opp_strdup(_fileName);
00223 };


Member Data Documentation

const char* RTPInterfacePacket::_commonName [protected]

const char* RTPInterfacePacket::_profileName [protected]

The bandwidth stored in this RTPInterfacePacket.

Referenced by dump(), enterSession(), getBandwidth(), operator=(), and RTPInterfacePacket().

int RTPInterfacePacket::_port [protected]

The port stored in this RTPInterfacePacket.

Referenced by dump(), enterSession(), getPort(), operator=(), and RTPInterfacePacket().

uint32 RTPInterfacePacket::_ssrc [protected]

The payload type stored in this RTPInterfacePacket.

Referenced by createSenderModule(), dump(), getPayloadType(), operator=(), and RTPInterfacePacket().

const char* RTPInterfacePacket::_fileName [protected]


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

Generated on Fri Mar 20 18:51:21 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5