sipxmedialib  Version 3.3
RTCPHeader.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2013 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2006 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 
14 // Border Guard
15 #ifndef _RTCPHeader_h
16 #define _RTCPHeader_h
17 
18 #include "rtcp/RtcpConfig.h"
19 
20 // Includes
21 #include "BaseClass.h"
22 #include "IRTCPHeader.h"
23 
24 
25 // Defines
26 #define MAX_SOURCE_LENGTH 256 // Max Length of a NULL terminated SDES element
27 #define HEADER_LENGTH 8 // Header Size
28 
29 #define PAYLOAD_OFFSET 1
30 #define LENGTH_OFFSET 2
31 #define SSRC_OFFSET 4
32 #define COUNT_MASK 0x1F
33 
34 
52 {
53 
54 // Public Methods
55 public:
56 
80  CRTCPHeader(ssrc_t ulSSRC,
81  RTCP_REPORTS_ET etPayloadType,
82  unsigned long ulVersion=2);
83 
84 
85 
104  virtual ~CRTCPHeader(void);
105 
142  static int VetPacket(unsigned char* buffer, int bufferLen);
143 
162  virtual unsigned long GetHeaderLength(void);
163 
181  virtual unsigned long GetVersion(void);
182 
200  virtual unsigned long GetPadding(void);
201 
219  virtual RTCP_REPORTS_ET GetPayload(void);
220 
221 
239  virtual unsigned long GetReportCount(void);
240 
241 
259  virtual unsigned long GetReportLength(void);
260 
278  virtual ssrc_t GetSSRC(void);
279 
298  virtual void SetSSRC(ssrc_t ulSSRC);
299 
319  virtual bool IsOurSSRC(ssrc_t ulSSRC);
320 
321 protected: // Protected Methods
322 
323 
347  unsigned long FormatRTCPHeader(unsigned char *puchRTCPBuffer,
348  unsigned long ulPadding,
349  unsigned long ulCount,
350  unsigned long ulPayloadLength);
351 
352 
374  bool ParseRTCPHeader(unsigned char *puchRTCPBuffer);
375 
376 
377 
378 protected: // Protected Data Members
379 
380 
381 
391  unsigned long m_ulVersion;
392 
402  unsigned long m_ulPadding;
403 
413  unsigned long m_ulCount;
414 
415 
426 
436  unsigned long m_ulLength;
437 
448  unsigned long m_ulSSRC;
449 
450 
451 };
452 
453 
454 #endif
unsigned long m_ulPadding
Definition: RTCPHeader.h:402
virtual bool IsOurSSRC(ssrc_t ulSSRC)
virtual unsigned long GetReportCount(void)
unsigned long m_ulSSRC
Definition: RTCPHeader.h:448
unsigned long m_ulLength
Definition: RTCPHeader.h:436
virtual ~CRTCPHeader(void)
virtual RTCP_REPORTS_ET GetPayload(void)
RTCP_REPORTS_ET
Definition: IRTCPHeader.h:23
unsigned long FormatRTCPHeader(unsigned char *puchRTCPBuffer, unsigned long ulPadding, unsigned long ulCount, unsigned long ulPayloadLength)
unsigned long m_ulCount
Definition: RTCPHeader.h:413
virtual void SetSSRC(ssrc_t ulSSRC)
virtual unsigned long GetHeaderLength(void)
virtual unsigned long GetPadding(void)
Definition: RTCPHeader.h:51
RTCP_REPORTS_ET m_etPayloadType
Definition: RTCPHeader.h:425
bool ParseRTCPHeader(unsigned char *puchRTCPBuffer)
uint32_t ssrc_t
Definition: RtcpConfig.h:62
unsigned long m_ulVersion
Definition: RTCPHeader.h:391
virtual unsigned long GetReportLength(void)
CRTCPHeader(ssrc_t ulSSRC, RTCP_REPORTS_ET etPayloadType, unsigned long ulVersion=2)
static int VetPacket(unsigned char *buffer, int bufferLen)
virtual ssrc_t GetSSRC(void)
virtual unsigned long GetVersion(void)