RTCPPacket Class Reference

#include <RTCPPacket.h>

Inheritance diagram for RTCPPacket:

RTCPByePacket RTCPReceiverReportPacket RTCPSDESPacket RTCPSenderReportPacket List of all members.

Detailed Description

This is a base class for all types (except RTCPCompoundPacket) of rtcp packets. It isn't intended to be used directly.


Public Types

 RTCP_PT_UNDEF = 0
 default value undefined
 RTCP_PT_SR = 200
 sender report
 RTCP_PT_RR = 201
 receiver report
 RTCP_PT_SDES = 202
 source description
 RTCP_PT_BYE = 203
 bye
enum  RTCP_PACKET_TYPE {
  RTCP_PT_UNDEF = 0, RTCP_PT_SR = 200, RTCP_PT_RR = 201, RTCP_PT_SDES = 202,
  RTCP_PT_BYE = 203
}

Public Member Functions

 RTCPPacket (const char *name=NULL)
 RTCPPacket (const RTCPPacket &rtcpPacket)
virtual ~RTCPPacket ()
RTCPPacketoperator= (const RTCPPacket &rtcpPacket)
virtual const char * className () const
virtual cObject * dup () const
virtual std::string info ()
virtual void writeContents (std::ostream &os) const
virtual int version ()
virtual int padding ()
virtual int count ()
virtual RTCP_PACKET_TYPE packetType ()
virtual int rtcpLength () const

Protected Attributes

int _version
int _padding
int _count
RTCP_PACKET_TYPE _packetType


Member Enumeration Documentation

enum RTCPPacket::RTCP_PACKET_TYPE

The values for the packet type field in the rtcp header as defined in the rfc.

Enumerator:
RTCP_PT_UNDEF  default value undefined
RTCP_PT_SR  sender report
RTCP_PT_RR  receiver report
RTCP_PT_SDES  source description
RTCP_PT_BYE  bye
00055                               {
00056             RTCP_PT_UNDEF =   0, 
00057             RTCP_PT_SR    = 200, 
00058             RTCP_PT_RR    = 201, 
00059             RTCP_PT_SDES  = 202, 
00060             RTCP_PT_BYE   = 203  
00061         };


Constructor & Destructor Documentation

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

Default constructor.

00039                                        : cPacket(name) {
00040     // initialize variables
00041     _version = 2;
00042     _padding = 0;
00043     _count = 0;
00044     _packetType = RTCP_PT_UNDEF;
00045     // rtcpLength can be calculated with cPacket::length()
00046 
00047     // RTCP header length size is 4 bytes
00048     // not all rtcp packets (in particular RTCPSDESPacket) have
00049     // the ssrc identifier stored in the header
00050     setLength(4);
00051 };

RTCPPacket::RTCPPacket ( const RTCPPacket rtcpPacket  ) 

Copy constructor.

00054                                                    : cPacket() {
00055     setName(rtcpPacket.name());
00056     operator=(rtcpPacket);
00057 };

RTCPPacket::~RTCPPacket (  )  [virtual]

Destructor.

00060                         {
00061 };


Member Function Documentation

const char * RTCPPacket::className (  )  const [virtual]

Return the class name "RTCPPacket".

Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, RTCPSDESPacket, and RTCPByePacket.

00075                                         {
00076     return "RTCPPacket";
00077 };

int RTCPPacket::count (  )  [virtual]

Returns the value of the count field in the rtcp header. Depending on the type of rtcp packet it stands for number of receiver reports or number of sdes chunks contained in this packet.

00112                       {
00113     return _count;
00114 };

cObject * RTCPPacket::dup (  )  const [virtual]

Duplicates the RTCPPacket by calling the copy constructor.

Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, RTCPSDESPacket, and RTCPByePacket.

00080                                {
00081     return new RTCPPacket(*this);
00082 };

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

Writes a short info about this RTCPPacket into the given buffer.

Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, and RTCPSDESPacket.

00085                            {
00086     std::stringstream out;
00087     out << "RTCPPacket.packetType=" << _packetType;
00088     return out.str();
00089 };

RTCPPacket & RTCPPacket::operator= ( const RTCPPacket rtcpPacket  ) 

Assignment operator.

00064                                                               {
00065     cPacket::operator=(rtcpPacket);
00066     setName(rtcpPacket.name());
00067     _version = rtcpPacket._version;
00068     _padding = rtcpPacket._padding;
00069     _count = rtcpPacket._count;
00070     _packetType = rtcpPacket._packetType;
00071     return *this;
00072 };

RTCPPacket::RTCP_PACKET_TYPE RTCPPacket::packetType (  )  [virtual]

Returns the packet type of this rtcp packet.

00117                                                   {
00118     return _packetType;
00119 };

int RTCPPacket::padding (  )  [virtual]

1 if padding exists, 0 otherwise. In this implementation only 0 is used.

00107                         {
00108     return _padding;
00109 };

int RTCPPacket::rtcpLength (  )  const [virtual]

Returns the value of the field length in the rtcp header. The value isn't stored because it can be calculated with the length() method inherited from cPacket.

00122                                  {
00123     // rtcpLength is the header field length
00124     // of an rtcp packet
00125     // in 32 bit words minus one
00126     return (int)(length() / 4) - 1;
00127 };

int RTCPPacket::version (  )  [virtual]

Returns the rtp version of the rtcp packet. It's always 2.

00102                         {
00103     return _version;
00104 };

void RTCPPacket::writeContents ( std::ostream &  os  )  const [virtual]

Writes a detailed report about this RTCPPacket into the given stream.

Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, and RTCPSDESPacket.

00092                                                    {
00093     os << "RTCPPacket:" << endl;
00094     os << "  version = " << _version << endl;
00095     os << "  padding = " << _padding << endl;
00096     os << "  count = " << _count << endl;
00097     os << "  packetType = " << _packetType << endl;
00098     os << "  rtcpLength = " << rtcpLength() << endl;
00099 };


Member Data Documentation

int RTCPPacket::_count [protected]

Depending on the packet type, here is stored how many receiver reports or sdes chunks are contained in the packet. Values from 0 to 31 are allowed.

RTCP_PACKET_TYPE RTCPPacket::_packetType [protected]

The packet type of the rtcp packet.

int RTCPPacket::_padding [protected]

Set to 1 if padding (bytes at the end of the packet to assure that the packet length in bytes is a multiple of a certain number; possibly needed for encryption) is used. In the simulation padding

int RTCPPacket::_version [protected]

The rtp version used. Always 2.


The documentation for this class was generated from the following files:
Generated on Wed Apr 4 13:20:23 2007 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.7