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

Side by Side Diff: ppapi/api/private/ppb_net_address_private.idl

Issue 9722008: Add CreateFromIPv[46]Address() in PPB_NetAddress_Private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 5
6 /** 6 /**
7 * This file defines the <code>PPB_NetAddress_Private</code> interface. 7 * This file defines the <code>PPB_NetAddress_Private</code> interface.
8 */ 8 */
9 9
10 label Chrome { 10 label Chrome {
11 M17 = 0.1, 11 M17 = 0.1,
12 M19 = 1.0 12 M19_0 = 1.0,
13 M19_1 = 1.1
13 }; 14 };
14 15
15 [assert_size(4)] 16 [assert_size(4)]
16 enum PP_NetAddressFamily_Private { 17 enum PP_NetAddressFamily_Private {
17 /** 18 /**
18 * The address family is unspecified. 19 * The address family is unspecified.
19 */ 20 */
20 PP_NETADDRESSFAMILY_UNSPECIFIED = 0, 21 PP_NETADDRESSFAMILY_UNSPECIFIED = 0,
21 /** 22 /**
22 * The Internet Protocol version 4 (IPv4) address family. 23 * The Internet Protocol version 4 (IPv4) address family.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 */ 62 */
62 PP_Var Describe([in] PP_Module module, 63 PP_Var Describe([in] PP_Module module,
63 [in] PP_NetAddress_Private addr, 64 [in] PP_NetAddress_Private addr,
64 [in] PP_Bool include_port); 65 [in] PP_Bool include_port);
65 66
66 /** 67 /**
67 * Replaces the port in the given source address. Returns PP_TRUE on success. 68 * Replaces the port in the given source address. Returns PP_TRUE on success.
68 */ 69 */
69 PP_Bool ReplacePort([in] PP_NetAddress_Private src_addr, 70 PP_Bool ReplacePort([in] PP_NetAddress_Private src_addr,
70 [in] uint16_t port, 71 [in] uint16_t port,
71 [out] PP_NetAddress_Private dest_addr); 72 [out] PP_NetAddress_Private addr_out);
72 73
73 /** 74 /**
74 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. 75 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind.
75 */ 76 */
76 void GetAnyAddress([in] PP_Bool is_ipv6, 77 void GetAnyAddress([in] PP_Bool is_ipv6,
77 [out] PP_NetAddress_Private addr); 78 [out] PP_NetAddress_Private addr);
78 79
79 /** 80 /**
80 * Gets the address family. 81 * Gets the address family.
81 */ 82 */
(...skipping 10 matching lines...) Expand all
92 * Gets the address. The output, address, must be large enough for the 93 * Gets the address. The output, address, must be large enough for the
93 * current socket family. The output will be the binary representation of an 94 * current socket family. The output will be the binary representation of an
94 * address for the current socket family. For IPv4 and IPv6 the address is in 95 * address for the current socket family. For IPv4 and IPv6 the address is in
95 * network byte order. PP_TRUE is returned if the address was successfully 96 * network byte order. PP_TRUE is returned if the address was successfully
96 * retrieved. 97 * retrieved.
97 */ 98 */
98 [version=1.0] 99 [version=1.0]
99 PP_Bool GetAddress([in] PP_NetAddress_Private addr, 100 PP_Bool GetAddress([in] PP_NetAddress_Private addr,
100 [out] mem_t address, 101 [out] mem_t address,
101 [in] uint16_t address_size); 102 [in] uint16_t address_size);
103
104 /**
105 * Creates NetAddress with the specified IPv4 address and port
106 * number.
107 */
108 [version=1.1]
109 void CreateFromIPv4Address([in] uint8_t[4] ip,
110 [in] uint16_t port,
111 [out] PP_NetAddress_Private addr_out);
112 /**
113 * Creates NetAddress with the specified IPv6 address, scope_id and
114 * port number.
115 */
116 [version=1.1]
117 void CreateFromIPv6Address([in] uint8_t[16] ip,
dmichael (off chromium) 2012/03/21 19:33:17 It seems like the natural way to represent this is
Sergey Ulanov 2012/03/21 19:44:51 I don't agree it's more natural than uint8_t. E.g.
Sergey Ulanov 2012/03/21 19:46:35 Sorry, I meant net::IPAddressNumber.
viettrungluu 2012/03/22 04:54:34 I agree that it should be an array of |uint8_t|s;
118 [in] uint32_t scope_id,
119 [in] uint16_t port,
120 [out] PP_NetAddress_Private addr_out);
102 }; 121 };
OLDNEW
« no previous file with comments | « no previous file | ppapi/c/private/ppb_net_address_private.h » ('j') | ppapi/cpp/private/net_address_private.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698