5ef6d7bde67d87f8fcc161e50def9c90b3ae77ae
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / networking_private.json
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     "namespace":"networkingPrivate",
8     "description": "none",
9     "compiler_options": {
10       "implemented_in": "chrome/browser/extensions/api/networking_private/networking_private_api.h"
11     },
12     "platforms": ["chromeos", "win", "mac"],
13     "types" : [
14       {
15         "id": "NetworkProperties",
16         "type": "object",
17         "additionalProperties": { "type": "any" }
18       },
19       {
20         "id": "ManagedNetworkProperties",
21         "type": "object",
22         "additionalProperties": { "type": "any" }
23       },
24       {
25         "id": "VerificationProperties",
26         "type": "object",
27         "properties": {
28           "certificate": {
29             "type": "string",
30             "description": "A string containing a PEM-encoded X.509 certificate for use in verifying the signed data."
31           },
32           "publicKey": {
33             "type": "string",
34             "description": "A string containing a PEM-encoded RSA public key to be used to compare with the one in signedData"
35           },
36           "nonce": {
37             "type": "string",
38             "description": "A string containing a base64-encoded random binary data for use in verifying the signed data."
39           },
40           "signedData": {
41             "type": "string",
42             "description": "A string containing the identifying data string signed by the device."
43           },
44           "deviceSerial": {
45             "type": "string",
46             "description": "A string containing the serial number of the device."
47           },
48           "deviceSsid": {
49             "type": "string",
50             "description": "A string containing the SSID of the device.  Only set if the device has already been setup once."
51           },
52           "deviceBssid": {
53             "type": "string",
54             "description": "A string containing the BSSID of the device.  Only set if the device has already been setup."
55           }
56         }
57       },
58       {
59         "id": "NetworkType",
60         "type": "string",
61         "enum": ["Ethernet", "WiFi", "Cellular"]
62       }
63     ],
64     "functions": [
65       {
66         "name": "getProperties",
67         "description": "Gets all the properties of the network with id networkGuid.  Includes all properties of the network (read-only and read/write values).",
68         "parameters": [
69           {
70             "name": "networkGuid",
71             "type": "string",
72             "description": "The unique identifier of the network to get properties from."
73           },
74           {
75             "name": "callback",
76             "type": "function",
77             "parameters": [
78               {
79                 "name": "properties",
80                 "$ref": "NetworkProperties",
81                 "description": "Results of the query for network properties."
82               }
83             ]
84           }
85         ]
86       },
87       {
88         "name": "getManagedProperties",
89         "description": "Gets the merged properties of the network with id networkGuid from the sources: User settings, shared settings, user policy, device policy and the currently active settings.",
90         "parameters": [
91           {
92             "name": "networkGuid",
93             "type": "string",
94             "description": "The unique identifier of the network to get properties from."
95           },
96           {
97             "name": "callback",
98             "type": "function",
99             "parameters": [
100               {
101                 "name": "properties",
102                 "$ref": "ManagedNetworkProperties",
103                 "description": "Results of the query for managed network properties."
104               }
105             ]
106           }
107         ]
108       },
109       {
110         "name": "getState",
111         "description": "Gets the cached read-only properties of the network with id networkGuid.  This is meant to be a higher performance function than getProperties, which requires a round trip to query the networking subsystem.  It only returns a subset of the properties returned by getProperties.",
112         "parameters": [
113           {
114             "name": "networkGuid",
115             "type": "string",
116             "description": "The unique identifier of the network to set properties on."
117           },
118           {
119             "name": "callback",
120             "type": "function",
121             "parameters": [
122               {
123                 "name": "properties",
124                 "$ref": "NetworkProperties",
125                 "description": "Results of the query for network properties."
126               }
127             ]
128           }
129         ]
130       },
131       {
132         "name": "setProperties",
133         "description": "Sets the properties of the network with id networkGuid.",
134         "parameters": [
135           {
136             "name": "networkGuid",
137             "type": "string",
138             "description": "The unique identifier of the network to set properties on."
139           },
140           {
141             "name": "properties",
142             "$ref": "NetworkProperties",
143             "description": "The properties to set on the network."
144           },
145           {
146             "name": "callback",
147             "type": "function",
148             "parameters": []
149           }
150         ]
151       },
152       {
153         "name": "createNetwork",
154         "description": "Creates a new network configuration from propeties. If a matching configured network already exists, this will fail. Otherwise returns the guid of the new network.",
155         "parameters": [
156           {
157             "name": "shared",
158             "type": "boolean",
159             "description": "If true, share this network configuration with other users."
160           },
161           {
162             "name": "properties",
163             "$ref": "NetworkProperties",
164             "description": "The properties to configure the new network with."
165           },
166           {
167             "name": "callback",
168             "type": "function",
169             "parameters": [
170               {
171                 "name": "guid",
172                 "type": "string"
173               }
174             ]
175           }
176         ]
177       },
178       {
179         "name": "getVisibleNetworks",
180         "description": "Gets the list of visible networks, and returns a list of cached, read-only network properties for each.",
181         "parameters": [
182           {
183             "name": "type",
184             "type": "string",
185             "enum": ["Ethernet", "WiFi", "Bluetooth", "Cellular", "VPN", "All"],
186             "description": "The type of networks to return."
187           },
188           {
189             "name": "callback",
190             "type": "function",
191             "optional": true,
192             "parameters": [
193               {
194                 "name": "networkList",
195                 "type": "array",
196                 "items": { "$ref": "NetworkProperties" }
197               }
198             ]
199           }
200         ]
201       },
202       {
203         "name": "getEnabledNetworkTypes",
204         "description": "Returns a list of the enabled network type.",
205         "parameters": [
206           {
207             "name": "callback",
208             "type": "function",
209             "optional": true,
210             "parameters": [
211               {
212                 "name": "networkList",
213                 "type": "array",
214                 "items": { "$ref": "NetworkType" }
215               }
216             ]
217           }
218         ]
219       },
220       {
221         "name": "enableNetworkType",
222         "description": "Enable the specified network type.",
223         "parameters": [
224           {
225             "name": "networkType",
226             "$ref": "NetworkType"
227           }
228         ]
229       },
230       {
231         "name": "disableNetworkType",
232         "description": "Disable the specified network type.",
233         "parameters": [
234           {
235             "name": "networkType",
236             "$ref": "NetworkType"
237           }
238         ]
239       },
240       {
241         "name": "requestNetworkScan",
242         "description": "Requests that the networking subsystem scan for new networks and update the list returned by getVisibleNetworks.  This is only a request: the network subsystem can choose to ignore it.  If the list is updated, then the onNetworkListChanged event will be fired.",
243         "parameters": []
244       },
245       {
246         "name": "startConnect",
247         "description": "Starts a connection to the network with networkGuid.",
248         "parameters": [
249           {
250             "name": "networkGuid",
251             "type": "string",
252             "description": "The unique identifier of the network to connect to."
253           },
254           {
255             "name": "callback",
256             "type": "function",
257             "optional": true,
258             "parameters": [],
259             "description": "A callback function that indicates that a connection has been initiated."
260           }
261         ]
262       },
263       {
264         "name": "startDisconnect",
265         "description": "Starts a disconnect from the network with networkGuid.",
266         "parameters": [
267           {
268             "name": "networkGuid",
269             "type": "string",
270             "description": "The unique identifier of the network to disconnect from."
271           },
272           {
273             "name": "callback",
274             "type": "function",
275             "optional": true,
276             "parameters": [],
277             "description": "A callback function that indicates that a disconnect has been initiated."
278           }
279         ]
280       },
281       {
282         "name": "verifyDestination",
283         "description": "Verifies that the device is a trusted device.",
284         "parameters": [
285           {
286             "name": "properties",
287             "$ref": "VerificationProperties",
288             "description": "Properties of the destination to use in verifying that it is a trusted device."
289           },
290           {
291             "name": "callback",
292             "type": "function",
293             "parameters": [
294               {
295                 "name": "verified",
296                 "type": "boolean"
297               }
298             ],
299             "description": "A callback function that indicates whether or not the device is a trusted device."
300           }
301         ]
302       },
303       {
304         "name": "verifyAndEncryptCredentials",
305         "description": "Verifies that the device is a trusted device and retrieves encrypted network credentials.",
306         "parameters": [
307           {
308             "name": "properties",
309             "$ref": "VerificationProperties",
310             "description": "Properties of the destination to use in verifying that it is a trusted device."
311           },
312           {
313             "name": "guid",
314             "type": "string",
315             "description": "A string containing the unique identifier of the network to get credentials for."
316           },
317           {
318             "name": "callback",
319             "type": "function",
320             "parameters": [
321               {
322                 "name": "credentials",
323                 "type": "string"
324               }
325             ],
326             "description": "A callback function that receives base64-encoded encrypted credential data to send to a trusted device."
327           }
328         ]
329       },
330       {
331         "name": "verifyAndEncryptData",
332         "description": "Verifies that the device is a trusted device and encrypts supplied data with device public key.",
333         "parameters": [
334           {
335             "name": "properties",
336             "$ref": "VerificationProperties",
337             "description": "Properties of the destination to use in verifying that it is a trusted device."
338           },
339           {
340             "name": "data",
341             "type": "string",
342             "description": "A string containing the base64-encoded data to encrypt."
343           },
344           {
345             "name": "callback",
346             "type": "function",
347             "parameters": [
348               {
349                 "name": "encryptedData",
350                 "type": "string"
351               }
352             ],
353             "description": "A callback function that receives base64-encoded encrypted data to send to a trusted device."
354           }
355         ]
356       },
357       {
358         "name": "setWifiTDLSEnabledState",
359         "description": "Enables TDLS for wifi traffic with a specified peer if available.",
360         "parameters": [
361           {
362             "name": "ip_or_mac_address",
363             "type": "string",
364             "description": "The IP or MAC address of the peer with which to enable a TDLS connection."
365           },
366           {
367             "name": "enabled",
368             "type": "boolean",
369             "description": "If true, enable TDLS, otherwise disable TDLS."
370           },
371           {
372             "name": "callback",
373             "type": "function",
374             "parameters": [
375               {
376                 "name": "status",
377                 "type": "string"
378               }
379             ],
380             "description": "A callback function that receives a string with an error or the current TDLS status. 'Failed' indicates that the request failed (e.g. MAC address lookup failed). 'Timeout' indicates that the lookup timed out. Otherwise a valid status is returned (see getWifiTDLSStatus)."
381           }
382         ]
383       },
384       {
385         "name": "getWifiTDLSStatus",
386         "description": "Returns the current TDLS status for the specified peer.",
387         "parameters": [
388           {
389             "name": "ip_or_mac_address",
390             "type": "string",
391             "description": "The IP or MAC address of the peer."
392           },
393           {
394             "name": "callback",
395             "type": "function",
396             "parameters": [
397               {
398                 "name": "status",
399                 "type": "string"
400               }
401             ],
402             "description": "A callback function that receives a string with the current TDLS status which can be 'Connected', 'Disabled', 'Disconnected', 'Nonexistent', or 'Unknown'"
403           }
404         ]
405       }
406     ],
407     "events": [
408       {
409         "name": "onNetworksChanged",
410         "type": "function",
411         "description": "Fired when the properties change on any of the networks.  Sends a list of identifiers for networks whose properties have changed.",
412         "parameters": [
413           {
414             "name": "changes",
415             "type": "array",
416             "items": { "type": "string" }
417           }
418         ]
419       },
420       {
421         "name": "onNetworkListChanged",
422         "type": "function",
423         "description": "Fired when the list of networks has changed.  Sends a complete list of identifiers for all the current networks.",
424         "parameters": [
425           {
426             "name": "changes",
427             "type": "array",
428             "items": { "type": "string" }
429           }
430         ]
431       }
432     ]
433   }
434 ]