Correct wrong usage of WebRtc_Word8 in rtp and udp module
BUG=http://code.google.com/p/webrtc/issues/detail?id=311&sort=-id TEST=build on all platforms Review URL: https://webrtc-codereview.appspot.com/418001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1798 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
2d124f3d88
commit
07c68b9c9d
@ -155,11 +155,12 @@ class MockRtpRtcp : public RtpRtcp {
|
||||
MOCK_METHOD1(SetRTCPStatus,
|
||||
WebRtc_Word32(const RTCPMethod method));
|
||||
MOCK_METHOD1(SetCNAME,
|
||||
WebRtc_Word32(const WebRtc_Word8 cName[RTCP_CNAME_SIZE]));
|
||||
WebRtc_Word32(const char cName[RTCP_CNAME_SIZE]));
|
||||
MOCK_METHOD1(CNAME,
|
||||
WebRtc_Word32(WebRtc_Word8 cName[RTCP_CNAME_SIZE]));
|
||||
WebRtc_Word32(char cName[RTCP_CNAME_SIZE]));
|
||||
MOCK_CONST_METHOD2(RemoteCNAME,
|
||||
WebRtc_Word32(const WebRtc_UWord32 remoteSSRC, WebRtc_Word8 cName[RTCP_CNAME_SIZE]));
|
||||
WebRtc_Word32(const WebRtc_UWord32 remoteSSRC,
|
||||
char cName[RTCP_CNAME_SIZE]));
|
||||
MOCK_CONST_METHOD4(RemoteNTP,
|
||||
WebRtc_Word32(WebRtc_UWord32 *ReceivedNTPsecs, WebRtc_UWord32 *ReceivedNTPfrac, WebRtc_UWord32 *RTCPArrivalTimeSecs, WebRtc_UWord32 *RTCPArrivalTimeFrac));
|
||||
MOCK_METHOD2(AddMixedCNAME,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -103,7 +103,7 @@ TEST_F(RtpRtcpAPITest, RTCP) {
|
||||
EXPECT_EQ(0, module->SetCNAME("john.doe@test.test"));
|
||||
EXPECT_EQ(-1, module->SetCNAME(NULL));
|
||||
|
||||
WebRtc_Word8 cName[RTCP_CNAME_SIZE];
|
||||
char cName[RTCP_CNAME_SIZE];
|
||||
EXPECT_EQ(0, module->CNAME(cName));
|
||||
EXPECT_STRCASEEQ(cName, "john.doe@test.test");
|
||||
EXPECT_EQ(-1, module->CNAME(NULL));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -77,7 +77,7 @@ class RTPCallback : public RtpFeedback {
|
||||
virtual WebRtc_Word32 OnInitializeDecoder(
|
||||
const WebRtc_Word32 id,
|
||||
const WebRtc_Word8 payloadType,
|
||||
const WebRtc_Word8 payloadName[RTP_PAYLOAD_NAME_SIZE],
|
||||
const char payloadName[RTP_PAYLOAD_NAME_SIZE],
|
||||
const int frequency,
|
||||
const WebRtc_UWord8 channels,
|
||||
const WebRtc_UWord32 rate) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -223,7 +223,7 @@ TEST_F(RtpRtcpRtcpTest, RTCP) {
|
||||
WebRtc_UWord32 receivedNTPfrac = 0;
|
||||
WebRtc_UWord32 RTCPArrivalTimeSecs = 0;
|
||||
WebRtc_UWord32 RTCPArrivalTimeFrac = 0;
|
||||
WebRtc_Word8 cName[RTCP_CNAME_SIZE];
|
||||
char cName[RTCP_CNAME_SIZE];
|
||||
|
||||
EXPECT_EQ(0, module2->RemoteNTP(&receivedNTPsecs, &receivedNTPfrac,
|
||||
&RTCPArrivalTimeSecs, &RTCPArrivalTimeFrac));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -98,12 +98,12 @@ public:
|
||||
|
||||
virtual void IncomingRTPPacket(const WebRtc_Word8* incomingRtpPacket,
|
||||
const WebRtc_Word32 rtpPacketLength,
|
||||
const WebRtc_Word8* fromIP,
|
||||
const char* fromIP,
|
||||
const WebRtc_UWord16 fromPort) = 0;
|
||||
|
||||
virtual void IncomingRTCPPacket(const WebRtc_Word8* incomingRtcpPacket,
|
||||
const WebRtc_Word32 rtcpPacketLength,
|
||||
const WebRtc_Word8* fromIP,
|
||||
const char* fromIP,
|
||||
const WebRtc_UWord16 fromPort) = 0;
|
||||
};
|
||||
|
||||
@ -147,7 +147,7 @@ public:
|
||||
// packets to ipAddr:rtpPort+1 if rtcpPort is zero. Otherwise to
|
||||
// ipAddr:rtcpPort.
|
||||
virtual WebRtc_Word32 InitializeSendSockets(
|
||||
const WebRtc_Word8* ipAddr,
|
||||
const char* ipAddr,
|
||||
const WebRtc_UWord16 rtpPort,
|
||||
const WebRtc_UWord16 rtcpPort = 0) = 0;
|
||||
|
||||
@ -158,8 +158,8 @@ public:
|
||||
virtual WebRtc_Word32 InitializeReceiveSockets(
|
||||
UdpTransportData* const packetCallback,
|
||||
const WebRtc_UWord16 rtpPort,
|
||||
const WebRtc_Word8* ipAddr = NULL,
|
||||
const WebRtc_Word8* multicastIpAddr = NULL,
|
||||
const char* ipAddr = NULL,
|
||||
const char* multicastIpAddr = NULL,
|
||||
const WebRtc_UWord16 rtcpPort = 0) = 0;
|
||||
|
||||
// Set local RTP port to rtpPort and RTCP port to rtcpPort or rtpPort + 1 if
|
||||
@ -180,23 +180,23 @@ public:
|
||||
// multicastIpAddr to the multicast IP address group joined (the address
|
||||
// is NULL terminated).
|
||||
virtual WebRtc_Word32 ReceiveSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort,
|
||||
WebRtc_Word8 multicastIpAddr[kIpAddressVersion6Length]) const = 0;
|
||||
char multicastIpAddr[kIpAddressVersion6Length]) const = 0;
|
||||
|
||||
// Set ipAddr to the IP address being sent from. rtpPort to the local RTP
|
||||
// port used for sending and rtcpPort to the local RTCP port used for
|
||||
// sending.
|
||||
virtual WebRtc_Word32 SendSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort) const = 0;
|
||||
|
||||
// Put the IP address, RTP port and RTCP port from the last received packet
|
||||
// into ipAddr, rtpPort and rtcpPort respectively.
|
||||
virtual WebRtc_Word32 RemoteSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort) const = 0;
|
||||
|
||||
@ -246,11 +246,11 @@ public:
|
||||
// Only allow packets received from filterIPAddress to be processed.
|
||||
// Note: must be called after EnableIPv6(), if IPv6 is used.
|
||||
virtual WebRtc_Word32 SetFilterIP(
|
||||
const WebRtc_Word8 filterIPAddress[kIpAddressVersion6Length]) = 0;
|
||||
const char filterIPAddress[kIpAddressVersion6Length]) = 0;
|
||||
|
||||
// Write the filter IP address (if any) to filterIPAddress.
|
||||
virtual WebRtc_Word32 FilterIP(
|
||||
WebRtc_Word8 filterIPAddress[kIpAddressVersion6Length]) const = 0;
|
||||
char filterIPAddress[kIpAddressVersion6Length]) const = 0;
|
||||
|
||||
// Only allow RTP packets from rtpFilterPort and RTCP packets from
|
||||
// rtcpFilterPort be processed.
|
||||
@ -294,7 +294,7 @@ public:
|
||||
WebRtc_UWord32 length,
|
||||
WebRtc_Word32 isRTCP,
|
||||
WebRtc_UWord16 portnr = 0,
|
||||
const WebRtc_Word8* ip = NULL) = 0;
|
||||
const char* ip = NULL) = 0;
|
||||
|
||||
// Send RTP data with size length to the address specified by to.
|
||||
virtual WebRtc_Word32 SendRTPPacketTo(const WebRtc_Word8* data,
|
||||
@ -322,7 +322,7 @@ public:
|
||||
|
||||
// Set the IP address to which packets are sent to ipaddr.
|
||||
virtual WebRtc_Word32 SetSendIP(
|
||||
const WebRtc_Word8 ipaddr[kIpAddressVersion6Length]) = 0;
|
||||
const char ipaddr[kIpAddressVersion6Length]) = 0;
|
||||
|
||||
// Set the send RTP and RTCP port to rtpPort and rtcpPort respectively.
|
||||
virtual WebRtc_Word32 SetSendPorts(const WebRtc_UWord16 rtpPort,
|
||||
@ -337,7 +337,7 @@ public:
|
||||
|
||||
// Put the local IP6 address in localIP.
|
||||
// Note: this API is for IPv6 only.
|
||||
static WebRtc_Word32 LocalHostAddressIPV6(WebRtc_UWord8 localIP[16]);
|
||||
static WebRtc_Word32 LocalHostAddressIPV6(char localIP[16]);
|
||||
|
||||
// Return a copy of hostOrder (host order) in network order.
|
||||
static WebRtc_UWord16 Htons(WebRtc_UWord16 hostOrder);
|
||||
@ -346,13 +346,13 @@ public:
|
||||
static WebRtc_UWord32 Htonl(WebRtc_UWord32 hostOrder);
|
||||
|
||||
// Return IPv4 address in ip as 32 bit integer.
|
||||
static WebRtc_UWord32 InetAddrIPV4(const WebRtc_Word8* ip);
|
||||
static WebRtc_UWord32 InetAddrIPV4(const char* ip);
|
||||
|
||||
// Convert the character string src into a network address structure in
|
||||
// the af address family and put it in dst.
|
||||
// Note: same functionality as inet_pton(..)
|
||||
static WebRtc_Word32 InetPresentationToNumeric(WebRtc_Word32 af,
|
||||
const WebRtc_Word8* src,
|
||||
const char* src,
|
||||
void* dst);
|
||||
|
||||
// Set ip and sourcePort according to address. As input parameter ipSize
|
||||
@ -360,7 +360,7 @@ public:
|
||||
// written to ip (not counting the '\0' character).
|
||||
// Note: this API is only implemented on Windows and Linux.
|
||||
static WebRtc_Word32 IPAddress(const SocketAddress& address,
|
||||
WebRtc_Word8* ip,
|
||||
char* ip,
|
||||
WebRtc_UWord32& ipSize,
|
||||
WebRtc_UWord16& sourcePort);
|
||||
|
||||
@ -372,14 +372,14 @@ public:
|
||||
// address is likley to be the same for multiple calls it may be beneficial
|
||||
// to call this API instead of IPAddress().
|
||||
virtual WebRtc_Word32 IPAddressCached(const SocketAddress& address,
|
||||
WebRtc_Word8* ip,
|
||||
char* ip,
|
||||
WebRtc_UWord32& ipSize,
|
||||
WebRtc_UWord16& sourcePort) = 0;
|
||||
|
||||
// Return true if ipaddr is a valid IP address.
|
||||
// If ipV6 is false ipaddr is interpreted as an IPv4 address otherwise it
|
||||
// is interptreted as IPv6.
|
||||
static bool IsIpAddressValid(const WebRtc_Word8* ipaddr, const bool ipV6);
|
||||
static bool IsIpAddressValid(const char* ipaddr, const bool ipV6);
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
|
@ -208,7 +208,7 @@ bool SameAddress(const SocketAddress& address1, const SocketAddress& address2)
|
||||
return (memcmp(&address1,&address2,sizeof(address1)) == 0);
|
||||
}
|
||||
|
||||
void UdpTransportImpl::GetCachedAddress(WebRtc_Word8* ip,
|
||||
void UdpTransportImpl::GetCachedAddress(char* ip,
|
||||
WebRtc_UWord32& ipSize,
|
||||
WebRtc_UWord16& sourcePort)
|
||||
{
|
||||
@ -222,7 +222,7 @@ void UdpTransportImpl::GetCachedAddress(WebRtc_Word8* ip,
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::IPAddressCached(const SocketAddress& address,
|
||||
WebRtc_Word8* ip,
|
||||
char* ip,
|
||||
WebRtc_UWord32& ipSize,
|
||||
WebRtc_UWord16& sourcePort)
|
||||
{
|
||||
@ -252,8 +252,8 @@ WebRtc_Word32 UdpTransportImpl::IPAddressCached(const SocketAddress& address,
|
||||
WebRtc_Word32 UdpTransportImpl::InitializeReceiveSockets(
|
||||
UdpTransportData* const packetCallback,
|
||||
const WebRtc_UWord16 portnr,
|
||||
const WebRtc_Word8* ip,
|
||||
const WebRtc_Word8* multicastIpAddr,
|
||||
const char* ip,
|
||||
const char* multicastIpAddr,
|
||||
const WebRtc_UWord16 rtcpPort)
|
||||
{
|
||||
|
||||
@ -379,10 +379,10 @@ WebRtc_Word32 UdpTransportImpl::InitializeReceiveSockets(
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::ReceiveSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort,
|
||||
WebRtc_Word8 multicastIpAddr[kIpAddressVersion6Length]) const
|
||||
char multicastIpAddr[kIpAddressVersion6Length]) const
|
||||
{
|
||||
CriticalSectionScoped cs(_crit);
|
||||
rtpPort = _localPort;
|
||||
@ -403,7 +403,7 @@ WebRtc_Word32 UdpTransportImpl::ReceiveSocketInformation(
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::SendSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort) const
|
||||
{
|
||||
@ -417,7 +417,7 @@ WebRtc_Word32 UdpTransportImpl::SendSocketInformation(
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::RemoteSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort) const
|
||||
{
|
||||
@ -1073,7 +1073,7 @@ WebRtc_Word32 UdpTransportImpl::EnableIpV6() {
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::FilterIP(
|
||||
WebRtc_Word8 filterIPAddress[kIpAddressVersion6Length]) const
|
||||
char filterIPAddress[kIpAddressVersion6Length]) const
|
||||
{
|
||||
|
||||
if(filterIPAddress == NULL)
|
||||
@ -1094,7 +1094,7 @@ WebRtc_Word32 UdpTransportImpl::FilterIP(
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::SetFilterIP(
|
||||
const WebRtc_Word8 filterIPAddress[kIpAddressVersion6Length])
|
||||
const char filterIPAddress[kIpAddressVersion6Length])
|
||||
{
|
||||
if(filterIPAddress == NULL)
|
||||
{
|
||||
@ -1643,7 +1643,7 @@ WebRtc_Word32 UdpTransportImpl::StopReceiving()
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::InitializeSendSockets(
|
||||
const WebRtc_Word8* ipaddr,
|
||||
const char* ipaddr,
|
||||
const WebRtc_UWord16 rtpPort,
|
||||
const WebRtc_UWord16 rtcpPort)
|
||||
{
|
||||
@ -1754,7 +1754,7 @@ WebRtc_Word32 UdpTransportImpl::InitializeSendSockets(
|
||||
}
|
||||
|
||||
void UdpTransportImpl::BuildSockaddrIn(WebRtc_UWord16 portnr,
|
||||
const WebRtc_Word8* ip,
|
||||
const char* ip,
|
||||
SocketAddress& remoteAddr) const
|
||||
{
|
||||
if(_ipV6Enabled)
|
||||
@ -1780,7 +1780,7 @@ void UdpTransportImpl::BuildSockaddrIn(WebRtc_UWord16 portnr,
|
||||
#endif
|
||||
remoteAddr._sockaddr_in.sin_port = Htons(portnr);
|
||||
remoteAddr._sockaddr_in.sin_addr= InetAddrIPV4(
|
||||
const_cast<WebRtc_Word8*>(ip));
|
||||
const_cast<char*>(ip));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1788,7 +1788,7 @@ WebRtc_Word32 UdpTransportImpl::SendRaw(const WebRtc_Word8 *data,
|
||||
WebRtc_UWord32 length,
|
||||
WebRtc_Word32 isRTCP,
|
||||
WebRtc_UWord16 portnr,
|
||||
const WebRtc_Word8 *ip)
|
||||
const char* ip)
|
||||
{
|
||||
CriticalSectionScoped cs(_crit);
|
||||
if(isRTCP)
|
||||
@ -2084,7 +2084,7 @@ int UdpTransportImpl::SendRTCPPacket(int /*channel*/, const void* data,
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransportImpl::SetSendIP(const WebRtc_Word8* ipaddr)
|
||||
WebRtc_Word32 UdpTransportImpl::SetSendIP(const char* ipaddr)
|
||||
{
|
||||
if(!IsIpAddressValid(ipaddr,IpV6Enabled()))
|
||||
{
|
||||
@ -2143,7 +2143,7 @@ void UdpTransportImpl::IncomingRTPFunction(const WebRtc_Word8* rtpPacket,
|
||||
WebRtc_Word32 rtpPacketLength,
|
||||
const SocketAddress* fromSocket)
|
||||
{
|
||||
WebRtc_Word8 ipAddress[kIpAddressVersion6Length];
|
||||
char ipAddress[kIpAddressVersion6Length];
|
||||
WebRtc_UWord32 ipAddressLength = kIpAddressVersion6Length;
|
||||
WebRtc_UWord16 portNr = 0;
|
||||
|
||||
@ -2204,7 +2204,7 @@ void UdpTransportImpl::IncomingRTCPFunction(const WebRtc_Word8* rtcpPacket,
|
||||
WebRtc_Word32 rtcpPacketLength,
|
||||
const SocketAddress* fromSocket)
|
||||
{
|
||||
WebRtc_Word8 ipAddress[kIpAddressVersion6Length];
|
||||
char ipAddress[kIpAddressVersion6Length];
|
||||
WebRtc_UWord32 ipAddressLength = kIpAddressVersion6Length;
|
||||
WebRtc_UWord16 portNr = 0;
|
||||
|
||||
@ -2339,13 +2339,13 @@ WebRtc_UWord32 UdpTransport::Htonl(const WebRtc_UWord32 a)
|
||||
return htonl(a);
|
||||
}
|
||||
|
||||
WebRtc_UWord32 UdpTransport::InetAddrIPV4(const WebRtc_Word8* ip)
|
||||
WebRtc_UWord32 UdpTransport::InetAddrIPV4(const char* ip)
|
||||
{
|
||||
return ::inet_addr(ip);
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransport::InetPresentationToNumeric(WebRtc_Word32 af,
|
||||
const WebRtc_Word8* src,
|
||||
const char* src,
|
||||
void* dst)
|
||||
{
|
||||
#if defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
|
||||
@ -2397,7 +2397,7 @@ WebRtc_Word32 UdpTransport::InetPresentationToNumeric(WebRtc_Word32 af,
|
||||
#endif
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransport::LocalHostAddressIPV6(WebRtc_UWord8 n_localIP[16])
|
||||
WebRtc_Word32 UdpTransport::LocalHostAddressIPV6(char n_localIP[16])
|
||||
{
|
||||
|
||||
#if defined(_WIN32)
|
||||
@ -2620,7 +2620,8 @@ WebRtc_Word32 UdpTransport::LocalHostAddressIPV6(WebRtc_UWord8 n_localIP[16])
|
||||
{
|
||||
n_localIP[i] = in6p->s6_addr[i];
|
||||
}
|
||||
if(n_localIP[0] == 0xfe && n_localIP[1] == 0x80)
|
||||
if(n_localIP[0] == static_cast<char> (0xfe)
|
||||
&& n_localIP[1] == static_cast<char>(0x80) )
|
||||
{
|
||||
// Auto configured IP.
|
||||
continue;
|
||||
@ -2742,7 +2743,7 @@ WebRtc_Word32 UdpTransport::LocalHostAddress(WebRtc_UWord32& localIP)
|
||||
}
|
||||
|
||||
WebRtc_Word32 UdpTransport::IPAddress(const SocketAddress& address,
|
||||
WebRtc_Word8* ip,
|
||||
char* ip,
|
||||
WebRtc_UWord32& ipSize,
|
||||
WebRtc_UWord16& sourcePort)
|
||||
{
|
||||
@ -2833,7 +2834,7 @@ WebRtc_Word32 UdpTransport::IPAddress(const SocketAddress& address,
|
||||
#endif
|
||||
}
|
||||
|
||||
bool UdpTransport::IsIpAddressValid(const WebRtc_Word8* ipadr, const bool ipV6)
|
||||
bool UdpTransport::IsIpAddressValid(const char* ipadr, const bool ipV6)
|
||||
{
|
||||
if(ipV6)
|
||||
{
|
||||
@ -2850,7 +2851,7 @@ bool UdpTransport::IsIpAddressValid(const WebRtc_Word8* ipadr, const bool ipV6)
|
||||
WebRtc_Word32 nDubbleColons = 0;
|
||||
WebRtc_Word32 nDots = 0;
|
||||
WebRtc_Word32 error = 0;
|
||||
WebRtc_Word8 c;
|
||||
char c;
|
||||
for(i = 0; i < len ; i++)
|
||||
{
|
||||
c=ipadr[i];
|
||||
@ -2933,7 +2934,7 @@ bool UdpTransport::IsIpAddressValid(const WebRtc_Word8* ipadr, const bool ipV6)
|
||||
|
||||
for (i = 0; (i < len) && (nDots < 4); i++)
|
||||
{
|
||||
if (ipadr[i] == (WebRtc_Word8)'.')
|
||||
if (ipadr[i] == (char)'.')
|
||||
{
|
||||
// Store index of dots and count number of dots.
|
||||
iDotPos[nDots++] = i;
|
||||
@ -2954,7 +2955,7 @@ bool UdpTransport::IsIpAddressValid(const WebRtc_Word8* ipadr, const bool ipV6)
|
||||
|
||||
if (iDotPos[0] <= 3)
|
||||
{
|
||||
WebRtc_Word8 nr[4];
|
||||
char nr[4];
|
||||
memset(nr,0,4);
|
||||
strncpy(nr,&ipadr[0],iDotPos[0]);
|
||||
WebRtc_Word32 num = atoi(nr);
|
||||
@ -2968,7 +2969,7 @@ bool UdpTransport::IsIpAddressValid(const WebRtc_Word8* ipadr, const bool ipV6)
|
||||
|
||||
if (iDotPos[1] - iDotPos[0] <= 4)
|
||||
{
|
||||
WebRtc_Word8 nr[4];
|
||||
char nr[4];
|
||||
memset(nr,0,4);
|
||||
strncpy(nr,&ipadr[iDotPos[0]+1], iDotPos[1] - iDotPos[0] - 1);
|
||||
WebRtc_Word32 num = atoi(nr);
|
||||
@ -2980,7 +2981,7 @@ bool UdpTransport::IsIpAddressValid(const WebRtc_Word8* ipadr, const bool ipV6)
|
||||
|
||||
if (iDotPos[2] - iDotPos[1] <= 4)
|
||||
{
|
||||
WebRtc_Word8 nr[4];
|
||||
char nr[4];
|
||||
memset(nr,0,4);
|
||||
strncpy(nr,&ipadr[iDotPos[1]+1], iDotPos[1] - iDotPos[0] - 1);
|
||||
WebRtc_Word32 num = atoi(nr);
|
||||
|
@ -33,14 +33,14 @@ public:
|
||||
|
||||
// UdpTransport functions
|
||||
virtual WebRtc_Word32 InitializeSendSockets(
|
||||
const WebRtc_Word8* ipAddr,
|
||||
const char* ipAddr,
|
||||
const WebRtc_UWord16 rtpPort,
|
||||
const WebRtc_UWord16 rtcpPort = 0);
|
||||
virtual WebRtc_Word32 InitializeReceiveSockets(
|
||||
UdpTransportData* const packetCallback,
|
||||
const WebRtc_UWord16 rtpPort,
|
||||
const WebRtc_Word8* ipAddr = NULL,
|
||||
const WebRtc_Word8* multicastIpAddr = NULL,
|
||||
const char* ipAddr = NULL,
|
||||
const char* multicastIpAddr = NULL,
|
||||
const WebRtc_UWord16 rtcpPort = 0);
|
||||
virtual WebRtc_Word32 InitializeSourcePorts(
|
||||
const WebRtc_UWord16 rtpPort,
|
||||
@ -48,16 +48,16 @@ public:
|
||||
virtual WebRtc_Word32 SourcePorts(WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort) const;
|
||||
virtual WebRtc_Word32 ReceiveSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort,
|
||||
WebRtc_Word8 multicastIpAddr[kIpAddressVersion6Length]) const;
|
||||
char multicastIpAddr[kIpAddressVersion6Length]) const;
|
||||
virtual WebRtc_Word32 SendSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort) const;
|
||||
virtual WebRtc_Word32 RemoteSocketInformation(
|
||||
WebRtc_Word8 ipAddr[kIpAddressVersion6Length],
|
||||
char ipAddr[kIpAddressVersion6Length],
|
||||
WebRtc_UWord16& rtpPort,
|
||||
WebRtc_UWord16& rtcpPort) const;
|
||||
virtual WebRtc_Word32 SetQoS(const bool QoS,
|
||||
@ -76,9 +76,9 @@ public:
|
||||
virtual WebRtc_Word32 EnableIpV6();
|
||||
virtual bool IpV6Enabled() const;
|
||||
virtual WebRtc_Word32 SetFilterIP(
|
||||
const WebRtc_Word8 filterIPAddress[kIpAddressVersion6Length]);
|
||||
const char filterIPAddress[kIpAddressVersion6Length]);
|
||||
virtual WebRtc_Word32 FilterIP(
|
||||
WebRtc_Word8 filterIPAddress[kIpAddressVersion6Length]) const;
|
||||
char filterIPAddress[kIpAddressVersion6Length]) const;
|
||||
virtual WebRtc_Word32 SetFilterPorts(const WebRtc_UWord16 rtpFilterPort,
|
||||
const WebRtc_UWord16 rtcpFilterPort);
|
||||
virtual WebRtc_Word32 FilterPorts(WebRtc_UWord16& rtpFilterPort,
|
||||
@ -93,7 +93,7 @@ public:
|
||||
virtual WebRtc_Word32 SendRaw(const WebRtc_Word8* data,
|
||||
WebRtc_UWord32 length, WebRtc_Word32 isRTCP,
|
||||
WebRtc_UWord16 portnr = 0,
|
||||
const WebRtc_Word8* ip = NULL);
|
||||
const char* ip = NULL);
|
||||
virtual WebRtc_Word32 SendRTPPacketTo(const WebRtc_Word8 *data,
|
||||
WebRtc_UWord32 length,
|
||||
const SocketAddress& to);
|
||||
@ -111,14 +111,14 @@ public:
|
||||
virtual int SendRTCPPacket(int channel, const void* data, int length);
|
||||
|
||||
// UdpTransport functions continue.
|
||||
virtual WebRtc_Word32 SetSendIP(const WebRtc_Word8* ipaddr);
|
||||
virtual WebRtc_Word32 SetSendIP(const char* ipaddr);
|
||||
virtual WebRtc_Word32 SetSendPorts(const WebRtc_UWord16 rtpPort,
|
||||
const WebRtc_UWord16 rtcpPort = 0);
|
||||
|
||||
virtual ErrorCode LastError() const;
|
||||
|
||||
virtual WebRtc_Word32 IPAddressCached(const SocketAddress& address,
|
||||
WebRtc_Word8* ip,
|
||||
char* ip,
|
||||
WebRtc_UWord32& ipSize,
|
||||
WebRtc_UWord16& sourcePort);
|
||||
|
||||
@ -143,7 +143,7 @@ protected:
|
||||
// Update _remoteRTCPAddr according to _destPortRTCP and _destIP
|
||||
void BuildRemoteRTCPAddr();
|
||||
|
||||
void BuildSockaddrIn(WebRtc_UWord16 portnr, const WebRtc_Word8* ip,
|
||||
void BuildSockaddrIn(WebRtc_UWord16 portnr, const char* ip,
|
||||
SocketAddress& remoteAddr) const;
|
||||
|
||||
ErrorCode BindLocalRTPSocket();
|
||||
@ -170,7 +170,7 @@ protected:
|
||||
WebRtc_Word32 DisableQoS();
|
||||
|
||||
private:
|
||||
void GetCachedAddress(WebRtc_Word8* ip, WebRtc_UWord32& ipSize,
|
||||
void GetCachedAddress(char* ip, WebRtc_UWord32& ipSize,
|
||||
WebRtc_UWord16& sourcePort);
|
||||
|
||||
WebRtc_Word32 _id;
|
||||
@ -199,10 +199,10 @@ private:
|
||||
WebRtc_UWord16 _fromPort;
|
||||
WebRtc_UWord16 _fromPortRTCP;
|
||||
|
||||
WebRtc_Word8 _fromIP[kIpAddressVersion6Length];
|
||||
WebRtc_Word8 _destIP[kIpAddressVersion6Length];
|
||||
WebRtc_Word8 _localIP[kIpAddressVersion6Length];
|
||||
WebRtc_Word8 _localMulticastIP[kIpAddressVersion6Length];
|
||||
char _fromIP[kIpAddressVersion6Length];
|
||||
char _destIP[kIpAddressVersion6Length];
|
||||
char _localIP[kIpAddressVersion6Length];
|
||||
char _localMulticastIP[kIpAddressVersion6Length];
|
||||
|
||||
UdpSocketWrapper* _ptrRtpSocket;
|
||||
UdpSocketWrapper* _ptrRtcpSocket;
|
||||
@ -231,7 +231,7 @@ private:
|
||||
// Cache used by GetCachedAddress(..).
|
||||
RWLockWrapper* _cachLock;
|
||||
SocketAddress _previousAddress;
|
||||
WebRtc_Word8 _previousIP[kIpAddressVersion6Length];
|
||||
char _previousIP[kIpAddressVersion6Length];
|
||||
WebRtc_UWord32 _previousIPSize;
|
||||
WebRtc_UWord16 _previousSourcePort;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -39,7 +39,7 @@ public:
|
||||
};
|
||||
virtual void IncomingRTPPacket(const WebRtc_Word8* incommingRtpPacket,
|
||||
const WebRtc_Word32 rtpPacketLength,
|
||||
const WebRtc_Word8* fromIP,
|
||||
const char* fromIP,
|
||||
const WebRtc_UWord16 fromPort)
|
||||
{
|
||||
_counterRTP++;
|
||||
@ -47,7 +47,7 @@ public:
|
||||
|
||||
virtual void IncomingRTCPPacket(const WebRtc_Word8* incommingRtcpPacket,
|
||||
const WebRtc_Word32 rtcpPacketLength,
|
||||
const WebRtc_Word8* fromIP,
|
||||
const char* fromIP,
|
||||
const WebRtc_UWord16 fromPort)
|
||||
{
|
||||
_counterRTCP++;
|
||||
@ -66,7 +66,7 @@ public:
|
||||
};
|
||||
virtual void IncomingRTPPacket(const WebRtc_Word8* incommingRtpPacket,
|
||||
const WebRtc_Word32 rtpPacketLength,
|
||||
const WebRtc_Word8* fromIP,
|
||||
const char* fromIP,
|
||||
const WebRtc_UWord16 fromPort)
|
||||
{
|
||||
_counterRTP++;
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
virtual void IncomingRTCPPacket(const WebRtc_Word8* incommingRtcpPacket,
|
||||
const WebRtc_Word32 rtcpPacketLength,
|
||||
const WebRtc_Word8* fromIP,
|
||||
const char* fromIP,
|
||||
const WebRtc_UWord16 fromPort)
|
||||
{
|
||||
_counterRTCP++;
|
||||
@ -106,21 +106,21 @@ int main(int argc, char* argv[])
|
||||
UdpTransportDataB* client2Callback = new UdpTransportDataB();
|
||||
|
||||
WebRtc_UWord32 localIP = 0;
|
||||
WebRtc_Word8 localIPAddr[64];
|
||||
char localIPAddr[64];
|
||||
assert( 0 == client1->LocalHostAddress(localIP)); // network host order aka big-endian
|
||||
|
||||
sprintf(localIPAddr,"%lu.%lu.%lu.%lu",(localIP>>24)& 0x0ff,(localIP>>16)& 0x0ff ,(localIP>>8)& 0x0ff, localIP & 0x0ff);
|
||||
printf("\tLocal IP:%s\n", localIPAddr);
|
||||
|
||||
WebRtc_UWord8 localIPV6[16];
|
||||
WebRtc_Word8 localIPAddrV6[128];
|
||||
char localIPV6[16];
|
||||
char localIPAddrV6[128];
|
||||
if( 0 == client1->LocalHostAddressIPV6(localIPV6))
|
||||
{
|
||||
sprintf(localIPAddrV6,"%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x", localIPV6[0],localIPV6[1],localIPV6[2],localIPV6[3],localIPV6[4],localIPV6[5],localIPV6[6],localIPV6[7], localIPV6[8],localIPV6[9],localIPV6[10],localIPV6[11],localIPV6[12],localIPV6[13],localIPV6[14],localIPV6[15]);
|
||||
printf("\tLocal IPV6:%s\n", localIPAddrV6);
|
||||
}
|
||||
|
||||
WebRtc_Word8 test[9] = "testtest";
|
||||
char test[9] = "testtest";
|
||||
assert( 0 == client1->InitializeReceiveSockets(client1Callback,1234, localIPAddr));
|
||||
|
||||
#if defined QOS_TEST_WITH_OVERRIDE || defined QOS_TEST || defined TOS_TEST || defined TOS_TEST_USING_SETSOCKOPT
|
||||
@ -273,9 +273,9 @@ int main(int argc, char* argv[])
|
||||
|
||||
printf("Sent 1 packet on one socket \n");
|
||||
|
||||
WebRtc_Word8 ipAddr[64];
|
||||
WebRtc_Word8 tempIpAddr[64];
|
||||
WebRtc_Word8 ipMulticastAddr[64];
|
||||
char ipAddr[64];
|
||||
char tempIpAddr[64];
|
||||
char ipMulticastAddr[64];
|
||||
WebRtc_UWord16 rtpPort = 0;
|
||||
WebRtc_UWord16 rtcpPort = 0;
|
||||
bool reusableSocket = true;
|
||||
|
@ -1319,8 +1319,8 @@ WebRtc_Word32 ViEChannel::SetSendDestination(
|
||||
"Running in loopback. Forcing fixed SSRC");
|
||||
}
|
||||
} else {
|
||||
WebRtc_UWord8 local_host_address[16];
|
||||
WebRtc_UWord8 current_ip_address[16];
|
||||
char local_host_address[16];
|
||||
char current_ip_address[16];
|
||||
|
||||
WebRtc_Word32 conv_result =
|
||||
UdpTransport::LocalHostAddressIPV6(local_host_address);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -373,9 +373,9 @@ int ViENetworkImpl::GetLocalIP(char ip_address[64], bool ipv6) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtc_Word8 local_ip_address[64];
|
||||
char local_ip_address[64];
|
||||
if (ipv6) {
|
||||
WebRtc_UWord8 local_ip[16];
|
||||
char local_ip[16];
|
||||
if (socket_transport->LocalHostAddressIPV6(local_ip) != 0) {
|
||||
UdpTransport::Destroy(socket_transport);
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
|
||||
|
@ -280,11 +280,11 @@ int VoENetworkImpl::GetLocalIP(char ipAddr[64], bool ipv6)
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtc_Word8 localIPAddr[64];
|
||||
char localIPAddr[64];
|
||||
|
||||
if (ipv6)
|
||||
{
|
||||
WebRtc_UWord8 localIP[16];
|
||||
char localIP[16];
|
||||
if (socketPtr->LocalHostAddressIPV6(localIP) != 0)
|
||||
{
|
||||
_engineStatistics.SetLastError(
|
||||
|
Loading…
x
Reference in New Issue
Block a user