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 PPAPI_SHARED_IMPL_PRIVATE_NET_ADDRESS_PRIVATE_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PRIVATE_NET_ADDRESS_PRIVATE_IMPL_H_ |
6 #define PPAPI_SHARED_IMPL_PRIVATE_NET_ADDRESS_PRIVATE_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_PRIVATE_NET_ADDRESS_PRIVATE_IMPL_H_ |
7 | 7 |
| 8 #include <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
12 #include "ppapi/shared_impl/ppapi_shared_export.h" | 13 #include "ppapi/shared_impl/ppapi_shared_export.h" |
13 | 14 |
14 struct PP_NetAddress_Private; | 15 struct PP_NetAddress_Private; |
15 struct sockaddr; | 16 struct sockaddr; |
16 | 17 |
17 namespace ppapi { | 18 namespace ppapi { |
18 | 19 |
19 class PPAPI_SHARED_EXPORT NetAddressPrivateImpl { | 20 class PPAPI_SHARED_EXPORT NetAddressPrivateImpl { |
20 public: | 21 public: |
21 static bool ValidateNetAddress(const PP_NetAddress_Private& addr); | 22 static bool ValidateNetAddress(const PP_NetAddress_Private& addr); |
22 | 23 |
23 static bool SockaddrToNetAddress(const sockaddr* sa, | 24 static bool SockaddrToNetAddress(const sockaddr* sa, |
24 uint32_t sa_length, | 25 uint32_t sa_length, |
25 PP_NetAddress_Private* net_addr); | 26 PP_NetAddress_Private* net_addr); |
26 | 27 |
27 static bool IPEndPointToNetAddress(const std::vector<unsigned char>& address, | 28 static bool IPEndPointToNetAddress(const std::vector<unsigned char>& address, |
28 int port, | 29 int port, |
29 PP_NetAddress_Private* net_addr); | 30 PP_NetAddress_Private* net_addr); |
30 | 31 |
31 static bool NetAddressToIPEndPoint(const PP_NetAddress_Private& net_addr, | 32 static bool NetAddressToIPEndPoint(const PP_NetAddress_Private& net_addr, |
32 std::vector<unsigned char>* address, | 33 std::vector<unsigned char>* address, |
33 int* port); | 34 int* port); |
34 | 35 |
| 36 static std::string DescribeNetAddress(const PP_NetAddress_Private& addr, |
| 37 bool include_port); |
| 38 |
35 static const PP_NetAddress_Private kInvalidNetAddress; | 39 static const PP_NetAddress_Private kInvalidNetAddress; |
36 | 40 |
37 private: | 41 private: |
38 DISALLOW_IMPLICIT_CONSTRUCTORS(NetAddressPrivateImpl); | 42 DISALLOW_IMPLICIT_CONSTRUCTORS(NetAddressPrivateImpl); |
39 }; | 43 }; |
40 | 44 |
41 } // namespace ppapi | 45 } // namespace ppapi |
42 | 46 |
43 #endif // PPAPI_SHARED_IMPL_PRIVATE_NET_ADDRESS_PRIVATE_IMPL_H_ | 47 #endif // PPAPI_SHARED_IMPL_PRIVATE_NET_ADDRESS_PRIVATE_IMPL_H_ |
OLD | NEW |