OLD | NEW |
1 /* Copyright 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright 2013 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 dev/ppb_net_address_dev.idl modified Mon Jun 10 17:42:43 2013. */ | 6 /* From dev/ppb_net_address_dev.idl modified Thu Jun 20 12:10:09 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_NET_ADDRESS_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_NET_ADDRESS_DEV_H_ |
9 #define PPAPI_C_DEV_PPB_NET_ADDRESS_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_NET_ADDRESS_DEV_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 #include "ppapi/c/pp_var.h" | 16 #include "ppapi/c/pp_var.h" |
17 | 17 |
18 #define PPB_NETADDRESS_DEV_INTERFACE_0_1 "PPB_NetAddress(Dev);0.1" | 18 #define PPB_NETADDRESS_DEV_INTERFACE_0_1 "PPB_NetAddress(Dev);0.1" |
19 #define PPB_NETADDRESS_DEV_INTERFACE PPB_NETADDRESS_DEV_INTERFACE_0_1 | 19 #define PPB_NETADDRESS_DEV_INTERFACE PPB_NETADDRESS_DEV_INTERFACE_0_1 |
20 | 20 |
21 /** | 21 /** |
22 * @file | 22 * @file |
23 * This file defines the <code>PPB_NetAddress_Dev</code> interface. | 23 * This file defines the <code>PPB_NetAddress_Dev</code> interface. |
24 */ | 24 */ |
25 | 25 |
26 | 26 |
27 /** | 27 /** |
28 * @addtogroup Enums | 28 * @addtogroup Enums |
29 * @{ | 29 * @{ |
30 */ | 30 */ |
| 31 /** |
| 32 * Network address family types. |
| 33 */ |
31 typedef enum { | 34 typedef enum { |
32 /** | 35 /** |
33 * The address family is unspecified. | 36 * The address family is unspecified. |
34 */ | 37 */ |
35 PP_NETADDRESS_FAMILY_UNSPECIFIED = 0, | 38 PP_NETADDRESS_FAMILY_UNSPECIFIED = 0, |
36 /** | 39 /** |
37 * The Internet Protocol version 4 (IPv4) address family. | 40 * The Internet Protocol version 4 (IPv4) address family. |
38 */ | 41 */ |
39 PP_NETADDRESS_FAMILY_IPV4 = 1, | 42 PP_NETADDRESS_FAMILY_IPV4 = 1, |
40 /** | 43 /** |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 * @{ | 92 * @{ |
90 */ | 93 */ |
91 /** | 94 /** |
92 * The <code>PPB_NetAddress_Dev</code> interface provides operations on | 95 * The <code>PPB_NetAddress_Dev</code> interface provides operations on |
93 * network addresses. | 96 * network addresses. |
94 */ | 97 */ |
95 struct PPB_NetAddress_Dev_0_1 { | 98 struct PPB_NetAddress_Dev_0_1 { |
96 /** | 99 /** |
97 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv4 | 100 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv4 |
98 * address. | 101 * address. |
| 102 * |
| 103 * @param[in] instance A <code>PP_Instance</code> identifying one instance of |
| 104 * a module. |
| 105 * @param[in] ipv4_addr An IPv4 address. |
| 106 * |
| 107 * @return A <code>PP_Resource</code> representing the same address as |
| 108 * <code>ipv4_addr</code> or 0 on failure. |
99 */ | 109 */ |
100 PP_Resource (*CreateFromIPv4Address)( | 110 PP_Resource (*CreateFromIPv4Address)( |
101 PP_Instance instance, | 111 PP_Instance instance, |
102 const struct PP_NetAddress_IPv4_Dev* ipv4_addr); | 112 const struct PP_NetAddress_IPv4_Dev* ipv4_addr); |
103 /** | 113 /** |
104 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv6 | 114 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv6 |
105 * address. | 115 * address. |
| 116 * |
| 117 * @param[in] instance A <code>PP_Instance</code> identifying one instance of |
| 118 * a module. |
| 119 * @param[in] ipv6_addr An IPv6 address. |
| 120 * |
| 121 * @return A <code>PP_Resource</code> representing the same address as |
| 122 * <code>ipv6_addr</code> or 0 on failure. |
106 */ | 123 */ |
107 PP_Resource (*CreateFromIPv6Address)( | 124 PP_Resource (*CreateFromIPv6Address)( |
108 PP_Instance instance, | 125 PP_Instance instance, |
109 const struct PP_NetAddress_IPv6_Dev* ipv6_addr); | 126 const struct PP_NetAddress_IPv6_Dev* ipv6_addr); |
110 /** | 127 /** |
111 * Determines if a given resource is a network address. | 128 * Determines if a given resource is a network address. |
| 129 * |
| 130 * @param[in] resource A <code>PP_Resource</code> to check. |
| 131 * |
| 132 * @return <code>PP_TRUE</code> if the input is a |
| 133 * <code>PPB_NetAddress_Dev</code> resource; <code>PP_FALSE</code> otherwise. |
112 */ | 134 */ |
113 PP_Bool (*IsNetAddress)(PP_Resource addr); | 135 PP_Bool (*IsNetAddress)(PP_Resource resource); |
114 /** | 136 /** |
115 * Gets the address family. | 137 * Gets the address family. |
| 138 * |
| 139 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 140 * address. |
| 141 * |
| 142 * @return The address family on success; |
| 143 * <code>PP_NETADDRESS_FAMILY_UNSPECIFIED</code> on failure. |
116 */ | 144 */ |
117 PP_NetAddress_Family_Dev (*GetFamily)(PP_Resource addr); | 145 PP_NetAddress_Family_Dev (*GetFamily)(PP_Resource addr); |
118 /** | 146 /** |
119 * Returns a human-readable description of the network address. The | 147 * Returns a human-readable description of the network address. The |
120 * description is in the form of host [ ":" port ] and conforms to | 148 * description is in the form of host [ ":" port ] and conforms to |
121 * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses | 149 * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses |
122 * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). | 150 * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). |
123 * Returns an undefined var on failure. | 151 * |
| 152 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 153 * address. |
| 154 * @param[in] include_port Whether to include the port number in the |
| 155 * description. |
| 156 * |
| 157 * @return A string <code>PP_Var</code> on success; an undefined |
| 158 * <code>PP_Var</code> on failure. |
124 */ | 159 */ |
125 struct PP_Var (*DescribeAsString)(PP_Resource addr, PP_Bool include_port); | 160 struct PP_Var (*DescribeAsString)(PP_Resource addr, PP_Bool include_port); |
126 /** | 161 /** |
127 * Fills a <code>PP_NetAddress_IPv4_Dev</code> structure if the network | 162 * Fills a <code>PP_NetAddress_IPv4_Dev</code> structure if the network |
128 * address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. | 163 * address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. |
129 * Returns PP_FALSE on failure. Note that passing a network address of | 164 * Note that passing a network address of |
130 * <code>PP_NETADDRESS_FAMILY_IPV6</code> address family will fail even if the | 165 * <code>PP_NETADDRESS_FAMILY_IPV6</code> address family will fail even if the |
131 * address is an IPv4-mapped IPv6 address. | 166 * address is an IPv4-mapped IPv6 address. |
| 167 * |
| 168 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 169 * address. |
| 170 * @param[out] ipv4_addr A <code>PP_NetAddress_IPv4_Dev</code> structure to |
| 171 * store the result. |
| 172 * |
| 173 * @return A <code>PP_Bool</code> value indicating whether the operation |
| 174 * succeeded. |
132 */ | 175 */ |
133 PP_Bool (*DescribeAsIPv4Address)(PP_Resource addr, | 176 PP_Bool (*DescribeAsIPv4Address)(PP_Resource addr, |
134 struct PP_NetAddress_IPv4_Dev* ipv4_addr); | 177 struct PP_NetAddress_IPv4_Dev* ipv4_addr); |
135 /** | 178 /** |
136 * Fills a <code>PP_NetAddress_IPv6_Dev</code> structure if the network | 179 * Fills a <code>PP_NetAddress_IPv6_Dev</code> structure if the network |
137 * address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family. | 180 * address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family. |
138 * Returns PP_FALSE on failure. Note that passing a network address of | 181 * Note that passing a network address of |
139 * <code>PP_NETADDRESS_FAMILY_IPV4</code> address family will fail - this | 182 * <code>PP_NETADDRESS_FAMILY_IPV4</code> address family will fail - this |
140 * method doesn't map it to an IPv6 address. | 183 * method doesn't map it to an IPv6 address. |
| 184 * |
| 185 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 186 * address. |
| 187 * @param[out] ipv6_addr A <code>PP_NetAddress_IPv6_Dev</code> structure to |
| 188 * store the result. |
| 189 * |
| 190 * @return A <code>PP_Bool</code> value indicating whether the operation |
| 191 * succeeded. |
141 */ | 192 */ |
142 PP_Bool (*DescribeAsIPv6Address)(PP_Resource addr, | 193 PP_Bool (*DescribeAsIPv6Address)(PP_Resource addr, |
143 struct PP_NetAddress_IPv6_Dev* ipv6_addr); | 194 struct PP_NetAddress_IPv6_Dev* ipv6_addr); |
144 }; | 195 }; |
145 | 196 |
146 typedef struct PPB_NetAddress_Dev_0_1 PPB_NetAddress_Dev; | 197 typedef struct PPB_NetAddress_Dev_0_1 PPB_NetAddress_Dev; |
147 /** | 198 /** |
148 * @} | 199 * @} |
149 */ | 200 */ |
150 | 201 |
151 #endif /* PPAPI_C_DEV_PPB_NET_ADDRESS_DEV_H_ */ | 202 #endif /* PPAPI_C_DEV_PPB_NET_ADDRESS_DEV_H_ */ |
152 | 203 |
OLD | NEW |