OLD | NEW |
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_network_list_private.idl, | 6 /* From ppb_network_list.idl modified Mon Sep 9 11:16:26 2013. */ |
7 * modified Wed Sep 4 11:42:02 2013. | |
8 */ | |
9 | 7 |
10 #ifndef PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ | 8 #ifndef PPAPI_C_PPB_NETWORK_LIST_H_ |
11 #define PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ | 9 #define PPAPI_C_PPB_NETWORK_LIST_H_ |
12 | 10 |
13 #include "ppapi/c/pp_array_output.h" | 11 #include "ppapi/c/pp_array_output.h" |
14 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
15 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
17 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
18 #include "ppapi/c/pp_var.h" | 16 #include "ppapi/c/pp_var.h" |
19 | 17 |
20 #define PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3 "PPB_NetworkList_Private;0.3" | 18 #define PPB_NETWORKLIST_INTERFACE_1_0 "PPB_NetworkList;1.0" |
21 #define PPB_NETWORKLIST_PRIVATE_INTERFACE PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3 | 19 #define PPB_NETWORKLIST_INTERFACE PPB_NETWORKLIST_INTERFACE_1_0 |
22 | 20 |
23 /** | 21 /** |
24 * @file | 22 * @file |
25 * This file defines the <code>PPB_NetworkList_Private</code> interface. | 23 * This file defines the <code>PPB_NetworkList</code> interface. |
26 */ | 24 */ |
27 | 25 |
28 | 26 |
29 /** | 27 /** |
30 * @addtogroup Enums | 28 * @addtogroup Enums |
31 * @{ | 29 * @{ |
32 */ | 30 */ |
33 /** | 31 /** |
34 * Type of a network interface. | 32 * Type of a network interface. |
35 */ | 33 */ |
36 typedef enum { | 34 typedef enum { |
37 /** | 35 /** |
38 * Type of the network interface is not known. | 36 * Type of the network interface is not known. |
39 */ | 37 */ |
40 PP_NETWORKLIST_UNKNOWN = 0, | 38 PP_NETWORKLIST_TYPE_UNKNOWN = 0, |
41 /** | 39 /** |
42 * Wired Ethernet network. | 40 * Wired Ethernet network. |
43 */ | 41 */ |
44 PP_NETWORKLIST_ETHERNET = 1, | 42 PP_NETWORKLIST_TYPE_ETHERNET = 1, |
45 /** | 43 /** |
46 * Wireless Wi-Fi network. | 44 * Wireless Wi-Fi network. |
47 */ | 45 */ |
48 PP_NETWORKLIST_WIFI = 2, | 46 PP_NETWORKLIST_TYPE_WIFI = 2, |
49 /** | 47 /** |
50 * Cellular network (e.g. LTE). | 48 * Cellular network (e.g. LTE). |
51 */ | 49 */ |
52 PP_NETWORKLIST_CELLULAR = 3 | 50 PP_NETWORKLIST_TYPE_CELLULAR = 3 |
53 } PP_NetworkListType_Private; | 51 } PP_NetworkList_Type; |
54 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListType_Private, 4); | 52 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkList_Type, 4); |
55 | 53 |
56 /** | 54 /** |
57 * State of a network interface. | 55 * State of a network interface. |
58 */ | 56 */ |
59 typedef enum { | 57 typedef enum { |
60 /** | 58 /** |
61 * Network interface is down. | 59 * Network interface is down. |
62 */ | 60 */ |
63 PP_NETWORKLIST_DOWN = 0, | 61 PP_NETWORKLIST_STATE_DOWN = 0, |
64 /** | 62 /** |
65 * Network interface is up. | 63 * Network interface is up. |
66 */ | 64 */ |
67 PP_NETWORKLIST_UP = 1 | 65 PP_NETWORKLIST_STATE_UP = 1 |
68 } PP_NetworkListState_Private; | 66 } PP_NetworkList_State; |
69 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListState_Private, 4); | 67 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkList_State, 4); |
70 /** | 68 /** |
71 * @} | 69 * @} |
72 */ | 70 */ |
73 | 71 |
74 /** | 72 /** |
75 * @addtogroup Interfaces | 73 * @addtogroup Interfaces |
76 * @{ | 74 * @{ |
77 */ | 75 */ |
78 /** | 76 /** |
79 * The <code>PPB_NetworkList_Private</code> is used to represent a | 77 * The <code>PPB_NetworkList</code> is used to represent a list of |
80 * list of network interfaces and their configuration. The content of | 78 * network interfaces and their configuration. The content of the list |
81 * the list is immutable. The current networks configuration can be | 79 * is immutable. The current networks configuration can be received |
82 * received using the <code>PPB_NetworkMonitor_Private</code> | 80 * using the <code>PPB_NetworkMonitor</code> interface. |
83 * interface. | |
84 */ | 81 */ |
85 struct PPB_NetworkList_Private_0_3 { | 82 struct PPB_NetworkList_1_0 { |
86 /** | 83 /** |
87 * Determines if the specified <code>resource</code> is a | 84 * Determines if the specified <code>resource</code> is a |
88 * <code>NetworkList</code> object. | 85 * <code>NetworkList</code> object. |
89 * | 86 * |
90 * @param[in] resource A <code>PP_Resource</code> resource. | 87 * @param[in] resource A <code>PP_Resource</code> resource. |
91 * | 88 * |
92 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is | 89 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is |
93 * a <code>PPB_NetworkList_Private</code>, <code>PP_FALSE</code> | 90 * a <code>PPB_NetworkList</code>, <code>PP_FALSE</code> |
94 * otherwise. | 91 * otherwise. |
95 */ | 92 */ |
96 PP_Bool (*IsNetworkList)(PP_Resource resource); | 93 PP_Bool (*IsNetworkList)(PP_Resource resource); |
97 /** | 94 /** |
98 * Gets number of interfaces in the list. | 95 * Gets number of interfaces in the list. |
99 * | 96 * |
100 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 97 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
101 * network list. | 98 * network list. |
102 * | 99 * |
103 * @return Returns number of available network interfaces or 0 if | 100 * @return Returns number of available network interfaces or 0 if |
(...skipping 14 matching lines...) Expand all Loading... |
118 /** | 115 /** |
119 * Gets type of a network interface. | 116 * Gets type of a network interface. |
120 * | 117 * |
121 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 118 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
122 * network list. | 119 * network list. |
123 * @param[in] index Index of the network interface. | 120 * @param[in] index Index of the network interface. |
124 * | 121 * |
125 * @return Returns type of the network interface with the specified | 122 * @return Returns type of the network interface with the specified |
126 * <code>index</code>. | 123 * <code>index</code>. |
127 */ | 124 */ |
128 PP_NetworkListType_Private (*GetType)(PP_Resource resource, uint32_t index); | 125 PP_NetworkList_Type (*GetType)(PP_Resource resource, uint32_t index); |
129 /** | 126 /** |
130 * Gets state of a network interface. | 127 * Gets state of a network interface. |
131 * | 128 * |
132 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 129 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
133 * network list. | 130 * network list. |
134 * @param[in] index Index of the network interface. | 131 * @param[in] index Index of the network interface. |
135 * | 132 * |
136 * @return Returns current state of the network interface with the | 133 * @return Returns current state of the network interface with the |
137 * specified <code>index</code>. | 134 * specified <code>index</code>. |
138 */ | 135 */ |
139 PP_NetworkListState_Private (*GetState)(PP_Resource resource, uint32_t index); | 136 PP_NetworkList_State (*GetState)(PP_Resource resource, uint32_t index); |
140 /** | 137 /** |
141 * Gets list of IP addresses for a network interface. | 138 * Gets list of IP addresses for a network interface. |
142 * | 139 * |
143 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 140 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
144 * network list. | 141 * network list. |
145 * @param[in] index Index of the network interface. | 142 * @param[in] index Index of the network interface. |
146 * @param[in] output An output array which will receive | 143 * @param[in] output An output array which will receive |
147 * <code>PPB_NetAddress</code> resources on success. Please note that the | 144 * <code>PPB_NetAddress</code> resources on success. Please note that the |
148 * ref count of those resources has already been increased by 1 for the | 145 * ref count of those resources has already been increased by 1 for the |
149 * caller. | 146 * caller. |
(...skipping 20 matching lines...) Expand all Loading... |
170 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 167 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
171 * network list. | 168 * network list. |
172 * @param[in] index Index of the network interface. | 169 * @param[in] index Index of the network interface. |
173 * | 170 * |
174 * @return Returns MTU for the network interface with the specified | 171 * @return Returns MTU for the network interface with the specified |
175 * <code>index</code> or 0 if MTU is unknown. | 172 * <code>index</code> or 0 if MTU is unknown. |
176 */ | 173 */ |
177 uint32_t (*GetMTU)(PP_Resource resource, uint32_t index); | 174 uint32_t (*GetMTU)(PP_Resource resource, uint32_t index); |
178 }; | 175 }; |
179 | 176 |
180 typedef struct PPB_NetworkList_Private_0_3 PPB_NetworkList_Private; | 177 typedef struct PPB_NetworkList_1_0 PPB_NetworkList; |
181 /** | 178 /** |
182 * @} | 179 * @} |
183 */ | 180 */ |
184 | 181 |
185 #endif /* PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ */ | 182 #endif /* PPAPI_C_PPB_NETWORK_LIST_H_ */ |
186 | 183 |
OLD | NEW |