Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

RTCPPacket.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           RTCPPacket.h  -  description
00003                              -------------------
00004     begin                : Sun Oct 21 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 
00032 #ifndef __RTCPPACKET_H__
00033 #define __RTCPPACKET_H__
00034 
00035 #include <iostream.h>
00036 
00037 #include "omnetpp.h"
00038 
00039 #include "types.h"
00040 #include "reports.h"
00041 #include "sdes.h"
00042 
00047 class RTCPPacket : public cPacket {
00048 
00049         public:
00050         
00055                 enum RTCP_PACKET_TYPE {
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                 };
00062 
00066                 RTCPPacket(const char *name = NULL);
00067                 
00071                 RTCPPacket(const RTCPPacket& rtcpPacket);
00072                 
00076                 virtual ~RTCPPacket();
00077                 
00081                 RTCPPacket& operator=(const RTCPPacket& rtcpPacket);
00082                 
00086                 virtual const char *className() const;
00087                 
00091                 virtual cObject *dup() const;
00092                 
00096                 virtual void info(char *buf) const;
00097                 
00101                 virtual void writeContents(ostream& os) const;
00102                 
00106                 virtual int version();
00107                 
00112                 virtual int padding();
00113                 
00119                 virtual int count();
00120                 
00124                 virtual RTCP_PACKET_TYPE packetType();
00125                 
00131                 virtual int rtcpLength() const;
00132                 
00133         
00134         protected:
00135                 
00139                 int _version;
00140                 
00147                 int _padding;
00148                 
00154                 int _count;
00155                 
00159                 RTCP_PACKET_TYPE _packetType;
00160 };
00161 
00162 
00168 class RTCPReceiverReportPacket : public RTCPPacket {
00169 
00170         public:
00171         
00175                 RTCPReceiverReportPacket(const char *name = NULL);
00176                 
00180                 RTCPReceiverReportPacket(const RTCPReceiverReportPacket& rtcpReceiverReportPacket);
00181                 
00185                 virtual ~RTCPReceiverReportPacket();
00186                 
00190                 RTCPReceiverReportPacket& operator=(const RTCPReceiverReportPacket& rtcpReceiverReportPacket);
00191                 
00195                 virtual cObject *dup() const;
00196                 
00200                 virtual const char *className() const;
00201                 
00205                 virtual void info(char *buf) const;
00206                 
00210                 virtual void writeContents(ostream& os) const;
00211                 
00216                 virtual u_int32 ssrc();
00217                 
00221                 virtual void setSSRC(u_int32 ssrc);
00222                 
00226                 virtual void addReceptionReport(ReceptionReport *report);
00227                 
00232                 virtual cArray *receptionReports();
00233         
00234         protected:
00235                 
00239                 u_int32 _ssrc;
00240                 
00244                 cArray *_receptionReports;
00245 
00246 };
00247 
00248 
00257 class RTCPSenderReportPacket : public RTCPReceiverReportPacket {
00258 
00259         public:
00260         
00264                 RTCPSenderReportPacket(const char *name = NULL);
00265                 
00269                 RTCPSenderReportPacket(const RTCPSenderReportPacket& rtcpSenderReportPacket);
00270                 
00274                 virtual ~RTCPSenderReportPacket();
00275                 
00279                 RTCPSenderReportPacket& operator=(const RTCPSenderReportPacket& rtcpSenderReportPacket);
00280                 
00284                 virtual cObject *dup() const;
00285                 
00289                 virtual const char *className() const;
00290                 
00294                 virtual void info(char *buf) const;
00295                 
00299                 virtual void writeContents(ostream& os) const;
00300                 
00305                 virtual SenderReport *senderReport();
00306                 
00311                 virtual void setSenderReport(SenderReport *senderReport);
00312 
00313         private:
00314         
00319                 SenderReport *_senderReport;
00320 };
00321 
00322 
00328 class RTCPSDESPacket : public RTCPPacket {
00329         
00330         public:
00334                 RTCPSDESPacket(const char *name = NULL);
00335                 
00339                 RTCPSDESPacket(const RTCPSDESPacket& rtcpSDESPacket);
00340                 
00344                 virtual ~RTCPSDESPacket();
00345                 
00349                 RTCPSDESPacket& operator=(const RTCPSDESPacket& rtcpSDESPacket);
00350                 
00354                 virtual cObject *dup() const;
00355                 
00359                 virtual const char *className() const;
00360                 
00364                 virtual void info(char *buf) const;
00365                 
00369                 virtual void writeContents(ostream& os) const;
00370                 
00374                 virtual cArray *sdesChunks();
00375                 
00380                 virtual void addSDESChunk(SDESChunk *sdesChunk);
00381                 
00382         private:
00383         
00387                 cArray *_sdesChunks;
00388 };
00389 
00390 
00398 class RTCPByePacket : public RTCPPacket {
00399 
00400         public:
00404                 RTCPByePacket(const char *name = NULL);
00405                 
00409                 RTCPByePacket(const RTCPByePacket& rtcpByePacket);
00410                 
00414                 virtual ~RTCPByePacket();
00415                 
00419                 RTCPByePacket& operator=(const RTCPByePacket& rtcpByePacket);
00420                 
00424                 virtual cObject *dup() const;
00425                 
00429                 virtual const char *className() const;
00430                 
00434                 virtual u_int32 ssrc();
00435                 
00439                 virtual void setSSRC(u_int32 ssrc);
00440                 
00441         protected:
00445                 u_int32 _ssrc;
00446 };
00447 
00448 
00456 class RTCPCompoundPacket : public cPacket {
00457 
00458         public:
00462                 RTCPCompoundPacket(const char *name = NULL);
00463                 
00467                 RTCPCompoundPacket(const RTCPCompoundPacket& rtcpCompoundPacket);
00468                 
00472                 virtual ~RTCPCompoundPacket();
00473                 
00477                 RTCPCompoundPacket& operator=(const RTCPCompoundPacket& rtcpCompoundPacket);
00478                 
00482                 virtual cObject *dup() const;
00483                 
00487                 virtual const char *className() const;
00488                 
00492                 virtual void info(char *buf) const;
00493                 
00497                 virtual void writeContents(ostream& os) const;
00498                 
00502                 virtual void addRTCPPacket(RTCPPacket *rtcpPacket);
00503                 
00508                 virtual cArray *rtcpPackets();
00509                 
00510         private:
00511                 
00515                 cArray *_rtcpPackets;
00516 
00517 };
00518 #endif

Generated on Tue Sep 12 12:20:20 2006 for RTP model for OMNeT++ by  doxygen 1.4.2