[email protected] | e174c49b | 2012-04-08 02:58:45 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | c708db4 | 2010-07-16 13:34:08 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef REMOTING_CLIENT_PLUGIN_PLUGIN_UTIL_H_ | ||||
6 | #define REMOTING_CLIENT_PLUGIN_PLUGIN_UTIL_H_ | ||||
7 | |||||
[email protected] | da3e7b23 | 2013-08-24 15:20:15 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
[email protected] | 8ef6922 | 2011-12-20 03:12:54 | [diff] [blame] | 10 | #include "base/callback_forward.h" |
[email protected] | c708db4 | 2010-07-16 13:34:08 | [diff] [blame] | 11 | |
[email protected] | da3e7b23 | 2013-08-24 15:20:15 | [diff] [blame] | 12 | namespace pp { |
13 | class InstanceHandle; | ||||
14 | class NetAddress; | ||||
15 | } | ||||
[email protected] | 0807c35 | 2012-05-16 03:50:55 | [diff] [blame] | 16 | |
[email protected] | e758d4c | 2014-08-06 16:48:16 | [diff] [blame] | 17 | namespace rtc { |
[email protected] | 0807c35 | 2012-05-16 03:50:55 | [diff] [blame] | 18 | class SocketAddress; |
[email protected] | da3e7b23 | 2013-08-24 15:20:15 | [diff] [blame] | 19 | } |
[email protected] | 0807c35 | 2012-05-16 03:50:55 | [diff] [blame] | 20 | |
[email protected] | c708db4 | 2010-07-16 13:34:08 | [diff] [blame] | 21 | namespace remoting { |
22 | |||||
[email protected] | 0807c35 | 2012-05-16 03:50:55 | [diff] [blame] | 23 | // Helpers to convert between different socket address representations. |
[email protected] | da3e7b23 | 2013-08-24 15:20:15 | [diff] [blame] | 24 | bool SocketAddressToPpNetAddressWithPort( |
25 | const pp::InstanceHandle& instance, | ||||
[email protected] | e758d4c | 2014-08-06 16:48:16 | [diff] [blame] | 26 | const rtc::SocketAddress& address, |
[email protected] | da3e7b23 | 2013-08-24 15:20:15 | [diff] [blame] | 27 | pp::NetAddress* pp_net_address, |
28 | uint16_t port); | ||||
29 | bool SocketAddressToPpNetAddress(const pp::InstanceHandle& instance, | ||||
[email protected] | e758d4c | 2014-08-06 16:48:16 | [diff] [blame] | 30 | const rtc::SocketAddress& address, |
[email protected] | da3e7b23 | 2013-08-24 15:20:15 | [diff] [blame] | 31 | pp::NetAddress* pp_net_address); |
32 | void PpNetAddressToSocketAddress(const pp::NetAddress& pp_net_address, | ||||
[email protected] | e758d4c | 2014-08-06 16:48:16 | [diff] [blame] | 33 | rtc::SocketAddress* address); |
[email protected] | 0807c35 | 2012-05-16 03:50:55 | [diff] [blame] | 34 | |
[email protected] | c708db4 | 2010-07-16 13:34:08 | [diff] [blame] | 35 | } // namespace remoting |
36 | |||||
37 | #endif // REMOTING_CLIENT_PLUGIN_PLUGIN_UTIL_H_ |