INET Framework for OMNeT++/OMNEST
RTPInterfacePacket Class Reference

#include <RTPInterfacePacket.h>

List of all members.

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

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.


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().

RTPInterfacePacket::RTPInterfacePacket ( const RTPInterfacePacket rifp)

Copy constructor.

                                                                     : cPacket()
{
    setName(rifp.getName());
    operator=(rifp);
}
RTPInterfacePacket::~RTPInterfacePacket ( ) [virtual]

Destructor.

{
    if (opp_strcmp(_commonName, ""))
        delete _commonName;
    if (opp_strcmp(_profileName, ""))
        delete _profileName;
    if (opp_strcmp(_fileName, ""))
        delete _fileName;
}

Member Function Documentation

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

Referenced by RTPApplication::activity().

{
    _type = RTP_IFP_CREATE_SENDER_MODULE;
    _ssrc = ssrc;
    _payloadType =payloadType;
    _fileName = fileName;
}
void RTPInterfacePacket::deleteSenderModule ( uint32  ssrc) [virtual]
void RTPInterfacePacket::dump ( std::ostream &  os) [virtual]

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

{
    os << "RTPInterfacePacket:" << endl;
    os << "  type = " << _type << endl;
    os << "  commonName = " << _commonName << endl;
    os << "  profileName = " << _profileName << endl;
    os << "  bandwidth = " << _bandwidth << endl;
    os << "  destinationAddress = " << _destinationAddress << endl;
    os << "  port = " << _port << endl;
    os << "  ssrc = " << _ssrc << endl;
    os << "  payloadType = " << _payloadType << endl;
    os << "  fileName = " << _fileName << endl;
}
RTPInterfacePacket * RTPInterfacePacket::dup ( ) const [virtual]

Duplicates the RTPInterfacePacket by calling the copy constructor.

{
    return new RTPInterfacePacket(*this);
}
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().

{
    _type = RTP_IFP_ENTER_SESSION;
    _commonName = commonName;
    _profileName = profileName;
    _bandwidth = bandwidth;
    _destinationAddress = destinationAddress;
    _port = port;
}
int RTPInterfacePacket::getBandwidth ( ) [virtual]

Returns the bandidth stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

{
    return _bandwidth;
}
const char * RTPInterfacePacket::getCommonName ( ) [virtual]

Returns the CNAME stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

{
    return opp_strdup(_commonName);
}
IPAddress RTPInterfacePacket::getDestinationAddress ( ) [virtual]

Returns the address stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

{
    return _destinationAddress;
}
const char * RTPInterfacePacket::getFileName ( ) [virtual]

Returns the file name stored in this RTPInterfacePacket.

Referenced by RTP::createSenderModule().

{
    return opp_strdup(_fileName);
}
int RTPInterfacePacket::getPayloadType ( ) [virtual]

Returns the payload type stored in this RTPInterfacePacket.

Referenced by RTP::createSenderModule().

{
    return _payloadType;
}
int RTPInterfacePacket::getPort ( ) [virtual]

Returns the port stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

{
    return _port;
}
const char * RTPInterfacePacket::getProfileName ( ) [virtual]

Returns the profile name stored in this RTPInterfacePacket.

Referenced by RTP::enterSession().

{
    return opp_strdup(_profileName);
}
uint32 RTPInterfacePacket::getSSRC ( ) [virtual]

Returns the ssrc identifier stored in this RTPInterfacePacket.

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

{
    return _ssrc;
}
RTPInterfacePacket::RTP_IFP_TYPE RTPInterfacePacket::getType ( ) [virtual]

Returns the type of this RTPInterfacePacket.

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

{
    return _type;
}
std::string RTPInterfacePacket::info ( ) [virtual]

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

{
    std::stringstream out;
    out << "RTPInterfacePacket: type=" << _type;
    return out.str();
}
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().

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

Assignment operator.

Referenced by RTPInterfacePacket().

{
    cPacket::operator=(rifp);
    _type = rifp._type;
    _commonName = opp_strdup(rifp._commonName);
    _profileName = opp_strdup(rifp._profileName);
    _bandwidth = rifp._bandwidth;
    _destinationAddress = rifp._destinationAddress;
    _port = rifp._port;
    _ssrc = rifp._ssrc;
    _payloadType = rifp._payloadType;
    _fileName = opp_strdup(rifp._fileName);
    return *this;
}
void RTPInterfacePacket::senderModuleControl ( uint32  ssrc,
RTPSenderControlMessage *  msg 
) [virtual]

Referenced by RTPApplication::activity().

{
    _type = RTP_IFP_SENDER_CONTROL;
    _ssrc = ssrc;
    encapsulate(msg);
}
void RTPInterfacePacket::senderModuleCreated ( uint32  ssrc) [virtual]
void RTPInterfacePacket::senderModuleDeleted ( uint32  ssrc) [virtual]
void RTPInterfacePacket::senderModuleStatus ( uint32  ssrc,
RTPSenderStatusMessage *  msg 
) [virtual]

Referenced by RTP::senderModuleStatus().

{
    _type = RTP_IFP_SENDER_STATUS;
    _ssrc = ssrc;
    encapsulate(msg);
}
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().

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().


Member Data Documentation

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().


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