SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Attributes | List of all members
qrtplib::RTPAddress Class Reference

#include <rtpaddress.h>

Public Member Functions

 RTPAddress ()
 
 RTPAddress (const QHostAddress &address, uint16_t port)
 
QAbstractSocket::NetworkLayerProtocol GetAddressType () const
 
RTPAddressCreateCopy () const
 
bool IsSameAddress (const RTPAddress *addr) const
 
bool IsFromSameHost (const RTPAddress *addr) const
 
bool operator== (const RTPAddress &otherAddress) const
 
const QHostAddress & getAddress () const
 
void setAddress (const QHostAddress &address)
 
uint16_t getPort () const
 
void setPort (uint16_t port)
 
uint16_t getRtcpsendport () const
 
void setRtcpsendport (uint16_t rtcpsendport)
 

Private Attributes

QHostAddress address
 
uint16_t port
 
uint16_t rtcpsendport
 

Detailed Description

This class is an abstract class which is used to specify destinations, multicast groups etc.

Definition at line 52 of file rtpaddress.h.

Constructor & Destructor Documentation

◆ RTPAddress() [1/2]

qrtplib::RTPAddress::RTPAddress ( )
inline

Default constructor. Address and port set via setters

Definition at line 56 of file rtpaddress.h.

Referenced by CreateCopy().

56  : port(0), rtcpsendport(0)
57  {}
uint16_t rtcpsendport
Definition: rtpaddress.h:138
+ Here is the caller graph for this function:

◆ RTPAddress() [2/2]

qrtplib::RTPAddress::RTPAddress ( const QHostAddress &  address,
uint16_t  port 
)
inline

Constructor with address and port

Definition at line 60 of file rtpaddress.h.

60  :
62  port(port),
63  rtcpsendport(0)
64  {}
QHostAddress address
Definition: rtpaddress.h:136
uint16_t rtcpsendport
Definition: rtpaddress.h:138

Member Function Documentation

◆ CreateCopy()

RTPAddress * qrtplib::RTPAddress::CreateCopy ( ) const

Creates a copy of the RTPAddress instance. Creates a copy of the RTPAddress instance. If mgr is not NULL, the corresponding memory manager will be used to allocate the memory for the address copy.

Definition at line 38 of file rtpaddress.cpp.

References address, port, rtcpsendport, and RTPAddress().

Referenced by qrtplib::RTPInternalSourceData::SetRTCPDataAddress(), qrtplib::RTPInternalSourceData::SetRTPDataAddress(), and qrtplib::RTPCollisionList::UpdateAddress().

39 {
40  RTPAddress *a = new RTPAddress();
41  a->address = address;
42  a->port = port;
43  a->rtcpsendport = rtcpsendport;
44  return a;
45 }
QHostAddress address
Definition: rtpaddress.h:136
uint16_t rtcpsendport
Definition: rtpaddress.h:138
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAddress()

const QHostAddress& qrtplib::RTPAddress::getAddress ( ) const
inline

Get host address

Definition at line 100 of file rtpaddress.h.

Referenced by qrtplib::RTPUDPTransmitter::ComesFromThisTransmitter(), qrtplib::RTPUDPTransmitter::JoinMulticastGroup(), and qrtplib::RTPUDPTransmitter::LeaveMulticastGroup().

101  {
102  return address;
103  }
QHostAddress address
Definition: rtpaddress.h:136
+ Here is the caller graph for this function:

◆ GetAddressType()

QAbstractSocket::NetworkLayerProtocol qrtplib::RTPAddress::GetAddressType ( ) const
inline

Returns the type of address the actual implementation represents.

Definition at line 67 of file rtpaddress.h.

References leansdr::operator==().

68  {
69  return address.protocol();
70  }
QHostAddress address
Definition: rtpaddress.h:136
+ Here is the call graph for this function:

◆ getPort()

uint16_t qrtplib::RTPAddress::getPort ( ) const
inline

Get RTP port

Definition at line 112 of file rtpaddress.h.

Referenced by qrtplib::RTPUDPTransmitter::ComesFromThisTransmitter().

113  {
114  return port;
115  }
+ Here is the caller graph for this function:

◆ getRtcpsendport()

uint16_t qrtplib::RTPAddress::getRtcpsendport ( ) const
inline

Get RTCP port

Definition at line 124 of file rtpaddress.h.

Referenced by qrtplib::RTPUDPTransmitter::ComesFromThisTransmitter().

125  {
126  return rtcpsendport;
127  }
uint16_t rtcpsendport
Definition: rtpaddress.h:138
+ Here is the caller graph for this function:

◆ IsFromSameHost()

bool qrtplib::RTPAddress::IsFromSameHost ( const RTPAddress addr) const

Checks if the address addr represents the same host as this instance. Checks if the address addr represents the same host as this instance. Implementations must be able to handle a NULL argument.

Note that this function is only used for received packets.

Definition at line 67 of file rtpaddress.cpp.

References address.

Referenced by qrtplib::RTPSources::CheckCollision().

68 {
69  if (addr == 0) {
70  return false;
71  }
72 
73  if (addr->address.protocol() != address.protocol()) {
74  return false;
75  }
76 
77  return addr->address == address;
78 }
QHostAddress address
Definition: rtpaddress.h:136
+ Here is the caller graph for this function:

◆ IsSameAddress()

bool qrtplib::RTPAddress::IsSameAddress ( const RTPAddress addr) const

Checks if the address addr is the same address as the one this instance represents. Checks if the address addr is the same address as the one this instance represents. Implementations must be able to handle a NULL argument.

Note that this function is only used for received packets, and for those the rtcpsendport variable is not important and should be ignored.

Definition at line 47 of file rtpaddress.cpp.

References address, and port.

Referenced by qrtplib::RTPSources::CheckCollision(), and operator==().

48 {
49  if (addr == 0) {
50  return false;
51  }
52 
53  if (addr->address.protocol() != address.protocol()) {
54  return false;
55  }
56 
57  if (addr->address == address)
58  {
59  return addr->port == port;
60  }
61  else
62  {
63  return false;
64  }
65 }
QHostAddress address
Definition: rtpaddress.h:136
+ Here is the caller graph for this function:

◆ operator==()

bool qrtplib::RTPAddress::operator== ( const RTPAddress otherAddress) const

Equality

Definition at line 80 of file rtpaddress.cpp.

References IsSameAddress().

81 {
82  return IsSameAddress(&otherAddress);
83 }
bool IsSameAddress(const RTPAddress *addr) const
Definition: rtpaddress.cpp:47
+ Here is the call graph for this function:

◆ setAddress()

void qrtplib::RTPAddress::setAddress ( const QHostAddress &  address)
inline

Set host address

Definition at line 106 of file rtpaddress.h.

Referenced by qrtplib::RTPUDPTransmitter::readRTCPPendingDatagrams(), and qrtplib::RTPUDPTransmitter::readRTPPendingDatagrams().

107  {
108  this->address = address;
109  }
QHostAddress address
Definition: rtpaddress.h:136
+ Here is the caller graph for this function:

◆ setPort()

void qrtplib::RTPAddress::setPort ( uint16_t  port)
inline

Set RTP port

Definition at line 118 of file rtpaddress.h.

Referenced by qrtplib::RTPUDPTransmitter::readRTCPPendingDatagrams(), and qrtplib::RTPUDPTransmitter::readRTPPendingDatagrams().

119  {
120  this->port = port;
121  }
+ Here is the caller graph for this function:

◆ setRtcpsendport()

void qrtplib::RTPAddress::setRtcpsendport ( uint16_t  rtcpsendport)
inline

Set RTCP port

Definition at line 130 of file rtpaddress.h.

131  {
132  this->rtcpsendport = rtcpsendport;
133  }
uint16_t rtcpsendport
Definition: rtpaddress.h:138

Member Data Documentation

◆ address

QHostAddress qrtplib::RTPAddress::address
private

Definition at line 136 of file rtpaddress.h.

Referenced by CreateCopy(), IsFromSameHost(), and IsSameAddress().

◆ port

uint16_t qrtplib::RTPAddress::port
private

Definition at line 137 of file rtpaddress.h.

Referenced by CreateCopy(), and IsSameAddress().

◆ rtcpsendport

uint16_t qrtplib::RTPAddress::rtcpsendport
private

Definition at line 138 of file rtpaddress.h.

Referenced by CreateCopy().


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