OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef JINGLE_GLUE_UTILS_H_ | 5 #ifndef JINGLE_GLUE_UTILS_H_ |
6 #define JINGLE_GLUE_UTILS_H_ | 6 #define JINGLE_GLUE_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/base/ip_address_number.h" | |
11 #include "third_party/webrtc/base/ipaddress.h" | 10 #include "third_party/webrtc/base/ipaddress.h" |
12 | 11 |
13 namespace net { | 12 namespace net { |
| 13 class IPAddress; |
14 class IPEndPoint; | 14 class IPEndPoint; |
15 } // namespace net | 15 } // namespace net |
16 | 16 |
17 namespace rtc { | 17 namespace rtc { |
18 class SocketAddress; | 18 class SocketAddress; |
19 } // namespace rtc | 19 } // namespace rtc |
20 | 20 |
21 namespace cricket { | 21 namespace cricket { |
22 class Candidate; | 22 class Candidate; |
23 } // namespace cricket | 23 } // namespace cricket |
24 | 24 |
25 namespace jingle_glue { | 25 namespace jingle_glue { |
26 | 26 |
27 // Chromium and libjingle represent socket addresses differently. The | 27 // Chromium and libjingle represent socket addresses differently. The |
28 // following two functions are used to convert addresses from one | 28 // following two functions are used to convert addresses from one |
29 // representation to another. | 29 // representation to another. |
30 bool IPEndPointToSocketAddress(const net::IPEndPoint& ip_endpoint, | 30 bool IPEndPointToSocketAddress(const net::IPEndPoint& ip_endpoint, |
31 rtc::SocketAddress* address); | 31 rtc::SocketAddress* address); |
32 bool SocketAddressToIPEndPoint(const rtc::SocketAddress& address, | 32 bool SocketAddressToIPEndPoint(const rtc::SocketAddress& address, |
33 net::IPEndPoint* ip_endpoint); | 33 net::IPEndPoint* ip_endpoint); |
34 | 34 |
35 rtc::IPAddress IPAddressNumberToIPAddress( | 35 rtc::IPAddress NetIPAddressToRtcIPAddress(const net::IPAddress& ip_address); |
36 const net::IPAddressNumber& ip_address_number); | |
37 | 36 |
38 // Helper functions to serialize and deserialize P2P candidates. | 37 // Helper functions to serialize and deserialize P2P candidates. |
39 std::string SerializeP2PCandidate(const cricket::Candidate& candidate); | 38 std::string SerializeP2PCandidate(const cricket::Candidate& candidate); |
40 bool DeserializeP2PCandidate(const std::string& address, | 39 bool DeserializeP2PCandidate(const std::string& address, |
41 cricket::Candidate* candidate); | 40 cricket::Candidate* candidate); |
42 | 41 |
43 } // namespace jingle_glue | 42 } // namespace jingle_glue |
44 | 43 |
45 #endif // JINGLE_GLUE_UTILS_H_ | 44 #endif // JINGLE_GLUE_UTILS_H_ |
OLD | NEW |