37 #ifndef RTPIPV4ADDRESS_H 39 #define RTPIPV4ADDRESS_H 41 #include "rtpconfig.h" 48 class RTPMemoryManager;
64 RTPIPv4Address::ip = ip;
65 RTPIPv4Address::port = port;
69 rtcpsendport = port+1;
77 RTPIPv4Address::ip = ip;
78 RTPIPv4Address::port = port;
79 RTPIPv4Address::rtcpsendport = rtcpsendport;
87 RTPIPv4Address::ip = (uint32_t)ip[3];
88 RTPIPv4Address::ip |= (((uint32_t)ip[2])<<8);
89 RTPIPv4Address::ip |= (((uint32_t)ip[1])<<16);
90 RTPIPv4Address::ip |= (((uint32_t)ip[0])<<24);
92 RTPIPv4Address::port = port;
96 rtcpsendport = port+1;
104 RTPIPv4Address::ip = (uint32_t)ip[3];
105 RTPIPv4Address::ip |= (((uint32_t)ip[2])<<8);
106 RTPIPv4Address::ip |= (((uint32_t)ip[1])<<16);
107 RTPIPv4Address::ip |= (((uint32_t)ip[0])<<24);
109 RTPIPv4Address::port = port;
110 RTPIPv4Address::rtcpsendport = rtcpsendport;
116 void SetIP(uint32_t ip) { RTPIPv4Address::ip = ip; }
119 void SetIP(
const uint8_t ip[4]) { RTPIPv4Address::ip = (uint32_t)ip[3]; RTPIPv4Address::ip |= (((uint32_t)ip[2])<<8); RTPIPv4Address::ip |= (((uint32_t)ip[1])<<16); RTPIPv4Address::ip |= (((uint32_t)ip[0])<<24); }
122 void SetPort(uint16_t port) { RTPIPv4Address::port = port; }
125 uint32_t
GetIP()
const {
return ip; }
138 bool IsSameAddress(
const RTPAddress *addr)
const;
139 bool IsFromSameHost(
const RTPAddress *addr)
const;
141 std::string GetAddressString()
const;
146 uint16_t rtcpsendport;
151 #endif // RTPIPV4ADDRESS_H void SetIP(uint32_t ip)
Sets the IP address for this instance to ip which is assumed to be in host byte order.
Definition: rtpipv4address.h:116
uint16_t GetPort() const
Returns the port number of this instance in host byte order.
Definition: rtpipv4address.h:128
uint16_t GetRTCPSendPort() const
For outgoing packets, this indicates to which port RTCP packets will be sent (can, be the same port as the RTP packets in case RTCP multiplexing is used).
Definition: rtpipv4address.h:132
RTPIPv4Address(uint32_t ip=0, uint16_t port=0, bool rtcpmux=false)
Creates an instance with IP address ip and port number port (both are interpreted in host byte order)...
Definition: rtpipv4address.h:62
This class is an abstract class which is used to specify destinations, multicast groups etc...
Definition: rtpaddress.h:50
uint32_t GetIP() const
Returns the IP address contained in this instance in host byte order.
Definition: rtpipv4address.h:125
RTPIPv4Address(const uint8_t ip[4], uint16_t port, uint16_t rtcpsendport)
Creates an instance with IP address ip and port number port (both are interpreted in host byte order)...
Definition: rtpipv4address.h:102
Represents an IPv4 IP address and port.
Definition: rtpipv4address.h:56
Definition: rtpfaketransmitter.h:64
A memory manager.
Definition: rtpmemorymanager.h:150
RTPIPv4Address(uint32_t ip, uint16_t port, uint16_t rtcpsendport)
Creates an instance with IP address ip and port number port (both are interpreted in host byte order)...
Definition: rtpipv4address.h:75
RTPIPv4Address(const uint8_t ip[4], uint16_t port=0, bool rtcpmux=false)
Creates an instance with IP address ip and port number port (port is interpreted in host byte order) ...
Definition: rtpipv4address.h:85
void SetPort(uint16_t port)
Sets the port number for this instance to port which is interpreted in host byte order.
Definition: rtpipv4address.h:122
void SetIP(const uint8_t ip[4])
Sets the IP address of this instance to ip.
Definition: rtpipv4address.h:119