1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
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
8#include <stdint.h>
9
10#include "base/callback_forward.h"
11
12namespace pp {
13class InstanceHandle;
14class NetAddress;
15}
16
17namespace rtc {
18class SocketAddress;
19}
20
21namespace remoting {
22
23// Helpers to convert between different socket address representations.
24bool SocketAddressToPpNetAddressWithPort(
25    const pp::InstanceHandle& instance,
26    const rtc::SocketAddress& address,
27    pp::NetAddress* pp_net_address,
28    uint16_t port);
29bool SocketAddressToPpNetAddress(const pp::InstanceHandle& instance,
30                                 const rtc::SocketAddress& address,
31                                 pp::NetAddress* pp_net_address);
32void PpNetAddressToSocketAddress(const pp::NetAddress& pp_net_address,
33                                 rtc::SocketAddress* address);
34
35}  // namespace remoting
36
37#endif  // REMOTING_CLIENT_PLUGIN_PLUGIN_UTIL_H_
38