sipxmedialib  Version 3.3
ByeReport.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 // Border Guard
14 #ifndef _ByeReport_h
15 #define _ByeReport_h
16 
17 #include "rtcp/RtcpConfig.h"
18 
19 // Includes
20 #include "RTCPHeader.h"
21 #include "IByeReport.h"
22 #include "IGetByeInfo.h"
23 
24 
25 #define MAX_CSRCS 64
26 
44 class CByeReport : public CBaseClass, // Inherits the CBaseClass Impl
45  public CRTCPHeader, // Inherits the CRTCPHeader impl
46  public IByeReport, // Bye Report Control Interface
47  public IGetByeInfo // Interface for retrieving Bye Info
48 
49  {
50 
51 // Public Methods
52 public:
53 
73  CByeReport(ssrc_t ulSSRC=0);
74 
75 
76 
95  ~CByeReport(void);
96 
97 
120  unsigned long FormatByeReport(unsigned char *puchReportBuffer,
121  unsigned long ulBufferSize=0);
122 
123 
144  unsigned long ParseByeReport(unsigned char *puchReportBuffer);
145 
164  ssrc_t GetSSRC(void);
165 
184  virtual void SetSSRC(ssrc_t ulSSRC);
185 
186 
209  unsigned long GetCSRC(ssrc_t *paulCSRC, bool bNBO=FALSE);
210 
233  void SetCSRC(ssrc_t *paulCSRC, unsigned long ulCSRCCount,
234  bool bNBO=FALSE);
235 
236 
260  void SetReason(unsigned char *puchReason, unsigned long ulLength=0);
261 
262 
286  unsigned long GetReason(unsigned char *puchReason);
287 
304  IByeReport * GetByeInterface(void);
305 
325 
326 private: // Private Member Functions
327 
347  unsigned long ExtractPadding(unsigned char *puchReportBuffer);
348 
368  unsigned long LoadPadding(unsigned char *puchReportBuffer, bool *pbPadded);
369 
370 
371 
372 private: // Private Data Members
373 
374 
385  unsigned long m_ulReasonLength;
386 
387 
399 
409  unsigned long m_ulCSRCCount;
410 
421 
422 };
423 
443 {
444 
445  return(CRTCPHeader::GetSSRC());
446 }
447 
448 #endif
unsigned long LoadPadding(unsigned char *puchReportBuffer, bool *pbPadded)
ssrc_t GetSSRC(void)
Definition: ByeReport.h:442
#define MAX_SOURCE_LENGTH
Definition: RTCPHeader.h:26
CByeReport(ssrc_t ulSSRC=0)
interface unsigned long ulBufferSize
Definition: INetworkSource.h:54
unsigned long m_ulCSRCCount
Definition: ByeReport.h:409
unsigned long ExtractPadding(unsigned char *puchReportBuffer)
~CByeReport(void)
unsigned long GetCSRC(ssrc_t *paulCSRC, bool bNBO=FALSE)
void SetReason(unsigned char *puchReason, unsigned long ulLength=0)
unsigned long ParseByeReport(unsigned char *puchReportBuffer)
ssrc_t m_aulCSRC[MAX_CSRCS]
Definition: ByeReport.h:420
#define MAX_CSRCS
Definition: ByeReport.h:25
interface long unsigned char * puchReportBuffer
Definition: ISDESReport.h:79
virtual void SetSSRC(ssrc_t ulSSRC)
unsigned long m_ulReasonLength
Definition: ByeReport.h:385
Definition: RTCPHeader.h:51
#define DECLARE_IBASE_M
Definition: BaseClass.h:368
void SetCSRC(ssrc_t *paulCSRC, unsigned long ulCSRCCount, bool bNBO=FALSE)
uint32_t ssrc_t
Definition: RtcpConfig.h:62
unsigned char m_uchReason[MAX_SOURCE_LENGTH]
Definition: ByeReport.h:398
Definition: ByeReport.h:44
Definition: BaseClass.h:118
IByeReport * GetByeInterface(void)
unsigned long GetReason(unsigned char *puchReason)
virtual ssrc_t GetSSRC(void)
#define FALSE
Definition: PlgDefsV1.h:37
unsigned long FormatByeReport(unsigned char *puchReportBuffer, unsigned long ulBufferSize=0)