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 /** | 6 /** |
7 * This file defines the <code>PPB_NetAddress_Dev</code> interface. | 7 * This file defines the <code>PPB_NetAddress_Dev</code> interface. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
11 M29 = 0.1 | 11 M29 = 0.1 |
12 }; | 12 }; |
13 | 13 |
| 14 /** |
| 15 * Network address family types. |
| 16 */ |
14 [assert_size(4)] | 17 [assert_size(4)] |
15 enum PP_NetAddress_Family_Dev { | 18 enum PP_NetAddress_Family_Dev { |
16 /** | 19 /** |
17 * The address family is unspecified. | 20 * The address family is unspecified. |
18 */ | 21 */ |
19 PP_NETADDRESS_FAMILY_UNSPECIFIED = 0, | 22 PP_NETADDRESS_FAMILY_UNSPECIFIED = 0, |
20 /** | 23 /** |
21 * The Internet Protocol version 4 (IPv4) address family. | 24 * The Internet Protocol version 4 (IPv4) address family. |
22 */ | 25 */ |
23 PP_NETADDRESS_FAMILY_IPV4 = 1, | 26 PP_NETADDRESS_FAMILY_IPV4 = 1, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 }; | 61 }; |
59 | 62 |
60 /** | 63 /** |
61 * The <code>PPB_NetAddress_Dev</code> interface provides operations on | 64 * The <code>PPB_NetAddress_Dev</code> interface provides operations on |
62 * network addresses. | 65 * network addresses. |
63 */ | 66 */ |
64 interface PPB_NetAddress_Dev { | 67 interface PPB_NetAddress_Dev { |
65 /** | 68 /** |
66 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv4 | 69 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv4 |
67 * address. | 70 * address. |
| 71 * |
| 72 * @param[in] instance A <code>PP_Instance</code> identifying one instance of |
| 73 * a module. |
| 74 * @param[in] ipv4_addr An IPv4 address. |
| 75 * |
| 76 * @return A <code>PP_Resource</code> representing the same address as |
| 77 * <code>ipv4_addr</code> or 0 on failure. |
68 */ | 78 */ |
69 PP_Resource CreateFromIPv4Address([in] PP_Instance instance, | 79 PP_Resource CreateFromIPv4Address([in] PP_Instance instance, |
70 [in] PP_NetAddress_IPv4_Dev ipv4_addr); | 80 [in] PP_NetAddress_IPv4_Dev ipv4_addr); |
71 | 81 |
72 /** | 82 /** |
73 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv6 | 83 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv6 |
74 * address. | 84 * address. |
| 85 * |
| 86 * @param[in] instance A <code>PP_Instance</code> identifying one instance of |
| 87 * a module. |
| 88 * @param[in] ipv6_addr An IPv6 address. |
| 89 * |
| 90 * @return A <code>PP_Resource</code> representing the same address as |
| 91 * <code>ipv6_addr</code> or 0 on failure. |
75 */ | 92 */ |
76 PP_Resource CreateFromIPv6Address([in] PP_Instance instance, | 93 PP_Resource CreateFromIPv6Address([in] PP_Instance instance, |
77 [in] PP_NetAddress_IPv6_Dev ipv6_addr); | 94 [in] PP_NetAddress_IPv6_Dev ipv6_addr); |
78 | 95 |
79 /** | 96 /** |
80 * Determines if a given resource is a network address. | 97 * Determines if a given resource is a network address. |
| 98 * |
| 99 * @param[in] resource A <code>PP_Resource</code> to check. |
| 100 * |
| 101 * @return <code>PP_TRUE</code> if the input is a |
| 102 * <code>PPB_NetAddress_Dev</code> resource; <code>PP_FALSE</code> otherwise. |
81 */ | 103 */ |
82 PP_Bool IsNetAddress([in] PP_Resource addr); | 104 PP_Bool IsNetAddress([in] PP_Resource resource); |
83 | 105 |
84 /** | 106 /** |
85 * Gets the address family. | 107 * Gets the address family. |
| 108 * |
| 109 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 110 * address. |
| 111 * |
| 112 * @return The address family on success; |
| 113 * <code>PP_NETADDRESS_FAMILY_UNSPECIFIED</code> on failure. |
86 */ | 114 */ |
87 PP_NetAddress_Family_Dev GetFamily([in] PP_Resource addr); | 115 PP_NetAddress_Family_Dev GetFamily([in] PP_Resource addr); |
88 | 116 |
89 /** | 117 /** |
90 * Returns a human-readable description of the network address. The | 118 * Returns a human-readable description of the network address. The |
91 * description is in the form of host [ ":" port ] and conforms to | 119 * description is in the form of host [ ":" port ] and conforms to |
92 * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses | 120 * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses |
93 * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). | 121 * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). |
94 * Returns an undefined var on failure. | 122 * |
| 123 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 124 * address. |
| 125 * @param[in] include_port Whether to include the port number in the |
| 126 * description. |
| 127 * |
| 128 * @return A string <code>PP_Var</code> on success; an undefined |
| 129 * <code>PP_Var</code> on failure. |
95 */ | 130 */ |
96 PP_Var DescribeAsString([in] PP_Resource addr, | 131 PP_Var DescribeAsString([in] PP_Resource addr, |
97 [in] PP_Bool include_port); | 132 [in] PP_Bool include_port); |
98 | 133 |
99 /** | 134 /** |
100 * Fills a <code>PP_NetAddress_IPv4_Dev</code> structure if the network | 135 * Fills a <code>PP_NetAddress_IPv4_Dev</code> structure if the network |
101 * address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. | 136 * address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. |
102 * Returns PP_FALSE on failure. Note that passing a network address of | 137 * Note that passing a network address of |
103 * <code>PP_NETADDRESS_FAMILY_IPV6</code> address family will fail even if the | 138 * <code>PP_NETADDRESS_FAMILY_IPV6</code> address family will fail even if the |
104 * address is an IPv4-mapped IPv6 address. | 139 * address is an IPv4-mapped IPv6 address. |
| 140 * |
| 141 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 142 * address. |
| 143 * @param[out] ipv4_addr A <code>PP_NetAddress_IPv4_Dev</code> structure to |
| 144 * store the result. |
| 145 * |
| 146 * @return A <code>PP_Bool</code> value indicating whether the operation |
| 147 * succeeded. |
105 */ | 148 */ |
106 PP_Bool DescribeAsIPv4Address([in] PP_Resource addr, | 149 PP_Bool DescribeAsIPv4Address([in] PP_Resource addr, |
107 [out] PP_NetAddress_IPv4_Dev ipv4_addr); | 150 [out] PP_NetAddress_IPv4_Dev ipv4_addr); |
108 | 151 |
109 /** | 152 /** |
110 * Fills a <code>PP_NetAddress_IPv6_Dev</code> structure if the network | 153 * Fills a <code>PP_NetAddress_IPv6_Dev</code> structure if the network |
111 * address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family. | 154 * address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family. |
112 * Returns PP_FALSE on failure. Note that passing a network address of | 155 * Note that passing a network address of |
113 * <code>PP_NETADDRESS_FAMILY_IPV4</code> address family will fail - this | 156 * <code>PP_NETADDRESS_FAMILY_IPV4</code> address family will fail - this |
114 * method doesn't map it to an IPv6 address. | 157 * method doesn't map it to an IPv6 address. |
| 158 * |
| 159 * @param[in] addr A <code>PP_Resource</code> corresponding to a network |
| 160 * address. |
| 161 * @param[out] ipv6_addr A <code>PP_NetAddress_IPv6_Dev</code> structure to |
| 162 * store the result. |
| 163 * |
| 164 * @return A <code>PP_Bool</code> value indicating whether the operation |
| 165 * succeeded. |
115 */ | 166 */ |
116 PP_Bool DescribeAsIPv6Address([in] PP_Resource addr, | 167 PP_Bool DescribeAsIPv6Address([in] PP_Resource addr, |
117 [out] PP_NetAddress_IPv6_Dev ipv6_addr); | 168 [out] PP_NetAddress_IPv6_Dev ipv6_addr); |
118 }; | 169 }; |
OLD | NEW |