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

Side by Side Diff: ppapi/c/private/ppb_net_address_private.h

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 /* From private/ppb_net_address_private.idl, 6 /* From private/ppb_net_address_private.idl,
7 * modified Tue Feb 14 17:56:23 2012. 7 * modified Fri Mar 16 11:51:17 2012.
8 */ 8 */
9 9
10 #ifndef PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ 10 #ifndef PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ 11 #define PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_
12 12
13 #include "ppapi/c/pp_bool.h" 13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_macros.h" 14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_module.h" 15 #include "ppapi/c/pp_module.h"
16 #include "ppapi/c/pp_stdint.h" 16 #include "ppapi/c/pp_stdint.h"
17 #include "ppapi/c/pp_var.h" 17 #include "ppapi/c/pp_var.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 * or an undefined var on failure. 90 * or an undefined var on failure.
91 */ 91 */
92 struct PP_Var (*Describe)(PP_Module module, 92 struct PP_Var (*Describe)(PP_Module module,
93 const struct PP_NetAddress_Private* addr, 93 const struct PP_NetAddress_Private* addr,
94 PP_Bool include_port); 94 PP_Bool include_port);
95 /** 95 /**
96 * Replaces the port in the given source address. Returns PP_TRUE on success. 96 * Replaces the port in the given source address. Returns PP_TRUE on success.
97 */ 97 */
98 PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr, 98 PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr,
99 uint16_t port, 99 uint16_t port,
100 struct PP_NetAddress_Private* dest_addr); 100 struct PP_NetAddress_Private* addr_out);
101 /** 101 /**
102 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. 102 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind.
103 */ 103 */
104 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr); 104 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr);
105 /** 105 /**
106 * Gets the address family. 106 * Gets the address family.
107 */ 107 */
108 PP_NetAddressFamily_Private (*GetFamily)( 108 PP_NetAddressFamily_Private (*GetFamily)(
109 const struct PP_NetAddress_Private* addr); 109 const struct PP_NetAddress_Private* addr);
110 /** 110 /**
111 * Gets the port. The port is returned in host byte order. 111 * Gets the port. The port is returned in host byte order.
112 */ 112 */
113 uint16_t (*GetPort)(const struct PP_NetAddress_Private* addr); 113 uint16_t (*GetPort)(const struct PP_NetAddress_Private* addr);
114 /** 114 /**
115 * Gets the address. The output, address, must be large enough for the 115 * Gets the address. The output, address, must be large enough for the
116 * current socket family. The output will be the binary representation of an 116 * current socket family. The output will be the binary representation of an
117 * address for the current socket family. For IPv4 and IPv6 the address is in 117 * address for the current socket family. For IPv4 and IPv6 the address is in
118 * network byte order. PP_TRUE is returned if the address was successfully 118 * network byte order. PP_TRUE is returned if the address was successfully
119 * retrieved. 119 * retrieved.
120 */ 120 */
121 PP_Bool (*GetAddress)(const struct PP_NetAddress_Private* addr, 121 PP_Bool (*GetAddress)(const struct PP_NetAddress_Private* addr,
122 void* address, 122 void* address,
123 uint16_t address_size); 123 uint16_t address_size);
124 /**
125 * Creates NetAddress with the specified IPv4 address and port
126 * number.
127 */
128 void (*CreateFromIPv4Address)(const uint8_t ip[4],
129 uint16_t port,
130 struct PP_NetAddress_Private* addr_out);
131 /**
132 * Creates NetAddress with the specified IPv6 address, scope_id and
133 * port number.
134 */
135 void (*CreateFromIPv6Address)(const uint8_t ip[16],
136 uint32_t scope_id,
137 uint16_t port,
138 struct PP_NetAddress_Private* addr_out);
124 }; 139 };
125 140
126 typedef struct PPB_NetAddress_Private_1_0 PPB_NetAddress_Private; 141 typedef struct PPB_NetAddress_Private_1_0 PPB_NetAddress_Private;
127 142
128 struct PPB_NetAddress_Private_0_1 { 143 struct PPB_NetAddress_Private_0_1 {
129 PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1, 144 PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1,
130 const struct PP_NetAddress_Private* addr2); 145 const struct PP_NetAddress_Private* addr2);
131 PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1, 146 PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1,
132 const struct PP_NetAddress_Private* addr2); 147 const struct PP_NetAddress_Private* addr2);
133 struct PP_Var (*Describe)(PP_Module module, 148 struct PP_Var (*Describe)(PP_Module module,
134 const struct PP_NetAddress_Private* addr, 149 const struct PP_NetAddress_Private* addr,
135 PP_Bool include_port); 150 PP_Bool include_port);
136 PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr, 151 PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr,
137 uint16_t port, 152 uint16_t port,
138 struct PP_NetAddress_Private* dest_addr); 153 struct PP_NetAddress_Private* addr_out);
139 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr); 154 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr);
140 }; 155 };
141 /** 156 /**
142 * @} 157 * @}
143 */ 158 */
144 159
145 #endif /* PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ */ 160 #endif /* PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ */
146 161
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698