Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: libraries/nacl-mounts/ppapi/cpp/private/net_address_private.h

Issue 10392070: Socket subsystem implementation (Closed) Base URL: http://naclports.googlecode.com/svn/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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 PPAPI_CPP_PRIVATE_NET_ADDRESS_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_NET_ADDRESS_PRIVATE_H_
7
8 #include <string>
9
10 #include "ppapi/c/pp_stdint.h"
11 #include "ppapi/c/private/ppb_net_address_private.h"
12
13 namespace pp {
14
15 class NetAddressPrivate {
16 public:
17 // Returns true if the required interface is available.
18 static bool IsAvailable();
19
20 static bool AreEqual(const PP_NetAddress_Private& addr1,
21 const PP_NetAddress_Private& addr2);
22 static bool AreHostsEqual(const PP_NetAddress_Private& addr1,
23 const PP_NetAddress_Private& addr2);
24 static std::string Describe(const PP_NetAddress_Private& addr,
25 bool include_port);
26 static bool ReplacePort(const PP_NetAddress_Private& addr_in,
27 uint16_t port,
28 PP_NetAddress_Private* addr_out);
29 static bool GetAnyAddress(bool is_ipv6, PP_NetAddress_Private* addr);
30 static PP_NetAddressFamily_Private GetFamily(
31 const PP_NetAddress_Private& addr);
32 static uint16_t GetPort(const PP_NetAddress_Private& addr);
33 static bool GetAddress(const PP_NetAddress_Private& addr,
34 void* address,
35 uint16_t address_size);
36 static uint32_t GetScopeID(const PP_NetAddress_Private& addr);
37 static bool CreateFromIPv4Address(const uint8_t ip[4],
38 uint16_t port,
39 struct PP_NetAddress_Private* addr_out);
40 static bool CreateFromIPv6Address(const uint8_t ip[16],
41 uint32_t scope_id,
42 uint16_t port,
43 struct PP_NetAddress_Private* addr_out);
44 };
45
46 } // namespace pp
47
48 #endif // PPAPI_CPP_PRIVATE_NET_ADDRESS_PRIVATE_H_
49
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698