OLD | NEW |
---|---|
(Empty) | |
1 /* Copyright (c) 2013 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 | |
6 /** | |
7 * This file defines the <code>PPB_NetAddress_Dev</code> interface. | |
8 */ | |
9 | |
10 label Chrome { | |
11 M29 = 0.1 | |
12 }; | |
13 | |
14 [assert_size(4)] | |
15 enum PP_NetAddress_Family_Dev { | |
16 /** | |
17 * The address family is unspecified. | |
18 */ | |
19 PP_NETADDRESS_FAMILY_UNSPECIFIED = 0, | |
20 /** | |
21 * The Internet Protocol version 4 (IPv4) address family. | |
22 */ | |
23 PP_NETADDRESS_FAMILY_IPV4 = 1, | |
24 /** | |
25 * The Internet Protocol version 6 (IPv6) address family. | |
26 */ | |
27 PP_NETADDRESS_FAMILY_IPV6 = 2 | |
28 }; | |
29 | |
30 /** | |
31 * The contents are expressed in network byte order. | |
bbudge
2013/06/06 19:01:10
I think it would be clearer if you say "port and a
yzshen1
2013/06/06 20:57:15
I changed it to "All members" so readers won't nee
| |
32 */ | |
33 [assert_size(8)] | |
34 struct PP_NetAddress_IPv4_Dev { | |
35 /** | |
36 * Port number. | |
37 */ | |
38 uint16_t port; | |
39 /** | |
40 * Padding that makes the structure size consistent across compilers. | |
41 */ | |
42 uint16_t unused_padding; | |
43 /** | |
44 * IP address. | |
bbudge
2013/06/06 19:01:10
IP -> IPv4 for consistency with the following enum
yzshen1
2013/06/06 20:57:15
Done.
| |
45 */ | |
46 uint8_t[4] addr; | |
47 }; | |
48 | |
49 /** | |
50 * The contents are expressed in network byte order. | |
51 */ | |
52 [assert_size(20)] | |
53 struct PP_NetAddress_IPv6_Dev { | |
54 /** | |
55 * Port number. | |
56 */ | |
57 uint16_t port; | |
58 /** | |
59 * Padding that makes the structure size consistent across compilers. | |
60 */ | |
61 uint16_t unused_padding; | |
62 /** | |
63 * IPv6 address. | |
64 */ | |
65 uint8_t[16] addr; | |
66 }; | |
67 | |
68 /** | |
69 * The <code>PPB_NetAddress_Dev</code> interface provides operations on | |
70 * network addresses. | |
71 */ | |
72 interface PPB_NetAddress_Dev { | |
73 /** | |
74 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv4 | |
75 * address. | |
76 */ | |
77 PP_Resource CreateFromIPv4Address([in] PP_Instance instance, | |
78 [in] PP_NetAddress_IPv4_Dev ipv4_addr); | |
79 | |
80 /** | |
81 * Creates a <code>PPB_NetAddress_Dev</code> resource with the specified IPv6 | |
82 * address. | |
83 */ | |
84 PP_Resource CreateFromIPv6Address([in] PP_Instance instance, | |
85 [in] PP_NetAddress_IPv6_Dev ipv6_addr); | |
86 | |
87 /** | |
88 * Determines if a given resource is a network address. | |
89 */ | |
90 PP_Bool IsNetAddress([in] PP_Resource addr); | |
91 | |
92 /** | |
93 * Gets the address family. | |
94 */ | |
95 PP_NetAddress_Family_Dev GetFamily([in] PP_Resource addr); | |
96 | |
97 /** | |
98 * Returns a human-readable description of the network address. The | |
99 * description is in the form of host [ ":" port ] and conforms to | |
100 * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses | |
101 * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). | |
102 * Returns an undefined var on failure. | |
103 */ | |
104 PP_Var DescribeAsString([in] PP_Resource addr, | |
105 [in] PP_Bool include_port); | |
106 | |
107 /** | |
108 * Fills a <code>PP_NetAddress_IPv4_Dev</code> structure if the network | |
109 * address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. | |
110 */ | |
bbudge
2013/06/06 19:01:10
Return value comment, as below.
yzshen1
2013/06/06 20:57:15
Done.
| |
111 PP_Bool DescribeAsIPv4Address([in] PP_Resource addr, | |
112 [out] PP_NetAddress_IPv4_Dev ipv4_addr); | |
113 | |
114 /** | |
115 * Fills a <code>PP_NetAddress_IPv6_Dev</code> structure if the network | |
116 * address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family. | |
117 * Returns PP_FALSE if the network address is of | |
118 * <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. This method doesn't | |
119 * map it to an IPv6 address. | |
bbudge
2013/06/06 19:01:10
Does the above method map IPv6 to IPv4? If not, pe
yzshen1
2013/06/06 20:57:15
Done.
| |
120 */ | |
121 PP_Bool DescribeAsIPv6Address([in] PP_Resource addr, | |
122 [out] PP_NetAddress_IPv6_Dev ipv6_addr); | |
123 }; | |
OLD | NEW |