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 "namespace":"networkingPrivate", | |
8 "description": "none", | |
9 "compiler_options": { | |
10 "implemented_in": "extensions/browser/api/networking_private/networking_pr
ivate_api.h" | |
11 }, | |
12 "platforms": ["chromeos", "win", "mac", "linux"], | |
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 (including the \"B
EGIN CERTIFICATE\" header and \"END CERTIFICATE\" footer) X.509 certificate for
use in verifying the signed data." | |
31 }, | |
32 "intermediateCertificates": { | |
33 "type": "array", | |
34 "items": { "type": "string" }, | |
35 "optional": true, | |
36 "description": "An array of PEM-encoded X.509 intermediate certifica
te authority certificates. Each PEM-encoded certificate is expected to have the
\"BEGIN CERTIFICATE\" header and \"END CERTIFICATE\" footer." | |
37 }, | |
38 "publicKey": { | |
39 "type": "string", | |
40 "description": "A string containing a Base64-encoded RSAPublicKey AS
N.1 structure, representing the public key to be used by verifyAndEncryptCredent
ials and verifyAndEncryptData methods." | |
41 }, | |
42 "nonce": { | |
43 "type": "string", | |
44 "description": "A string containing a base64-encoded random binary d
ata for use in verifying the signed data." | |
45 }, | |
46 "signedData": { | |
47 "type": "string", | |
48 "description": "A string containing the identifying data string sign
ed by the device." | |
49 }, | |
50 "deviceSerial": { | |
51 "type": "string", | |
52 "description": "A string containing the serial number of the device.
" | |
53 }, | |
54 "deviceSsid": { | |
55 "type": "string", | |
56 "description": "A string containing the SSID of the device. Only se
t if the device has already been setup once." | |
57 }, | |
58 "deviceBssid": { | |
59 "type": "string", | |
60 "description": "A string containing the BSSID of the device. Only s
et if the device has already been setup." | |
61 } | |
62 } | |
63 }, | |
64 { | |
65 "id": "NetworkType", | |
66 "type": "string", | |
67 "enum": ["All", "Bluetooth", "Cellular", "Ethernet", "VPN", "Wireless",
"WiFi", "Wimax"] | |
68 }, | |
69 { | |
70 "id": "CaptivePortalStatus", | |
71 "type": "string", | |
72 "enum": ["Unknown", "Offline", "Online", "Portal", "ProxyAuthRequired"] | |
73 } | |
74 ], | |
75 "functions": [ | |
76 { | |
77 "name": "getProperties", | |
78 "description": "Gets all the properties of the network with id networkGu
id. Includes all properties of the network (read-only and read/write values).", | |
79 "parameters": [ | |
80 { | |
81 "name": "networkGuid", | |
82 "type": "string", | |
83 "description": "The unique identifier of the network to get properti
es from." | |
84 }, | |
85 { | |
86 "name": "callback", | |
87 "type": "function", | |
88 "parameters": [ | |
89 { | |
90 "name": "properties", | |
91 "$ref": "NetworkProperties", | |
92 "description": "Results of the query for network properties." | |
93 } | |
94 ] | |
95 } | |
96 ] | |
97 }, | |
98 { | |
99 "name": "getManagedProperties", | |
100 "description": "Gets the merged properties of the network with id networ
kGuid from the sources: User settings, shared settings, user policy, device poli
cy and the currently active settings.", | |
101 "parameters": [ | |
102 { | |
103 "name": "networkGuid", | |
104 "type": "string", | |
105 "description": "The unique identifier of the network to get properti
es from." | |
106 }, | |
107 { | |
108 "name": "callback", | |
109 "type": "function", | |
110 "parameters": [ | |
111 { | |
112 "name": "properties", | |
113 "$ref": "ManagedNetworkProperties", | |
114 "description": "Results of the query for managed network propert
ies." | |
115 } | |
116 ] | |
117 } | |
118 ] | |
119 }, | |
120 { | |
121 "name": "getState", | |
122 "description": "Gets the cached read-only properties of the network with
id networkGuid. This is meant to be a higher performance function than getPrope
rties, which requires a round trip to query the networking subsystem. The follo
wing properties are returned for all networks: GUID, Type, Name, WiFi.Security.
Additional properties are provided for visible networks: ConnectionState, ErrorS
tate, WiFi.SignalStrength, Cellular.NetworkTechnology, Cellular.ActivationState,
Cellular.RoamingState, Cellular.OutOfCredits.", | |
123 "parameters": [ | |
124 { | |
125 "name": "networkGuid", | |
126 "type": "string", | |
127 "description": "The unique identifier of the network to set properti
es on." | |
128 }, | |
129 { | |
130 "name": "callback", | |
131 "type": "function", | |
132 "parameters": [ | |
133 { | |
134 "name": "properties", | |
135 "$ref": "NetworkProperties", | |
136 "description": "Results of the query for network state propertie
s." | |
137 } | |
138 ] | |
139 } | |
140 ] | |
141 }, | |
142 { | |
143 "name": "setProperties", | |
144 "description": "Sets the properties of the network with id networkGuid."
, | |
145 "parameters": [ | |
146 { | |
147 "name": "networkGuid", | |
148 "type": "string", | |
149 "description": "The unique identifier of the network to set properti
es on." | |
150 }, | |
151 { | |
152 "name": "properties", | |
153 "$ref": "NetworkProperties", | |
154 "description": "The properties to set on the network." | |
155 }, | |
156 { | |
157 "name": "callback", | |
158 "optional": true, | |
159 "type": "function", | |
160 "parameters": [] | |
161 } | |
162 ] | |
163 }, | |
164 { | |
165 "name": "createNetwork", | |
166 "description": "Creates a new network configuration from properties. If
a matching configured network already exists, this will fail. Otherwise returns
the guid of the new network.", | |
167 "parameters": [ | |
168 { | |
169 "name": "shared", | |
170 "type": "boolean", | |
171 "description": "If true, share this network configuration with other
users." | |
172 }, | |
173 { | |
174 "name": "properties", | |
175 "$ref": "NetworkProperties", | |
176 "description": "The properties to configure the new network with." | |
177 }, | |
178 { | |
179 "name": "callback", | |
180 "optional": true, | |
181 "type": "function", | |
182 "parameters": [ | |
183 { | |
184 "name": "networkGuid", | |
185 "type": "string" | |
186 } | |
187 ] | |
188 } | |
189 ] | |
190 }, | |
191 { | |
192 "name": "forgetNetwork", | |
193 "description": "Forgets a network configuration by clearing any configur
ed properties for the network with GUID 'networkGuid'. This may also include any
other networks with matching identifiers (e.g. WiFi SSID and Security). If no s
uch configuration exists, an error will be set and the operation will fail.", | |
194 "parameters": [ | |
195 { | |
196 "name": "networkGuid", | |
197 "type": "string", | |
198 "description": "The unique identifier of the network to forget." | |
199 }, | |
200 { | |
201 "name": "callback", | |
202 "type": "function", | |
203 "optional": true, | |
204 "parameters": [], | |
205 "description": "Called when the operation has completed." | |
206 } | |
207 ] | |
208 }, | |
209 { | |
210 "name": "getNetworks", | |
211 "description": "Returns a list of network objects with the same properti
es provided by getState. A filter is provided to specify the type of networks re
turned and to limit the number of networks. Networks are ordered by the system b
ased on their priority, with connected or connecting networks listed first.", | |
212 "parameters": [ | |
213 { | |
214 "name": "filter", | |
215 "type": "object", | |
216 "properties": { | |
217 "networkType": { | |
218 "$ref": "NetworkType", | |
219 "description": "The type of networks to return." | |
220 }, | |
221 "visible": { | |
222 "type": "boolean", | |
223 "optional": true, | |
224 "description": "If true, only include visible (physically connec
ted or in-range) networks. Defaults to 'false'." | |
225 }, | |
226 "configured": { | |
227 "type": "boolean", | |
228 "optional": true, | |
229 "description": "If true, only include configured (saved) network
s. Defaults to 'false'." | |
230 }, | |
231 "limit": { | |
232 "type": "integer", | |
233 "optional": true, | |
234 "description": "Maximum number of networks to return. Defaults t
o 1000. Use 0 for no limit." | |
235 } | |
236 } | |
237 }, | |
238 { | |
239 "name": "callback", | |
240 "type": "function", | |
241 "optional": true, | |
242 "parameters": [ | |
243 { | |
244 "name": "networkList", | |
245 "type": "array", | |
246 "items": { "$ref": "NetworkProperties" } | |
247 } | |
248 ] | |
249 } | |
250 ] | |
251 }, | |
252 { | |
253 "name": "getVisibleNetworks", | |
254 "deprecated": "Please use $(ref:networkingPrivate.getNetworks) with filt
er.visble = true.", | |
255 "description": "Returns a list of visible network objects with the same
properties provided by getState.", | |
256 "parameters": [ | |
257 { | |
258 "name": "networkType", | |
259 "$ref": "NetworkType", | |
260 "description": "The type of networks to return." | |
261 }, | |
262 { | |
263 "name": "callback", | |
264 "type": "function", | |
265 "optional": true, | |
266 "parameters": [ | |
267 { | |
268 "name": "networkList", | |
269 "type": "array", | |
270 "items": { "$ref": "NetworkProperties" } | |
271 } | |
272 ] | |
273 } | |
274 ] | |
275 }, | |
276 { | |
277 "name": "getEnabledNetworkTypes", | |
278 "description": "Returns a list of the enabled network types. Note: this
only returns discrete types that can be enabled or disabled: Cellular, Ethernet,
WiFi, Wimax.", | |
279 "parameters": [ | |
280 { | |
281 "name": "callback", | |
282 "type": "function", | |
283 "optional": true, | |
284 "parameters": [ | |
285 { | |
286 "name": "enabledTypes", | |
287 "type": "array", | |
288 "items": { "$ref": "NetworkType" } | |
289 } | |
290 ] | |
291 } | |
292 ] | |
293 }, | |
294 { | |
295 "name": "enableNetworkType", | |
296 "description": "Enable the specified network type. Note, the type might
represent multiple network types (e.g. 'Wireless').", | |
297 "parameters": [ | |
298 { | |
299 "name": "networkType", | |
300 "$ref": "NetworkType" | |
301 } | |
302 ] | |
303 }, | |
304 { | |
305 "name": "disableNetworkType", | |
306 "description": "Disable the specified network type. See note for $(ref:n
etworkingPrivate.enableNetworkType).", | |
307 "parameters": [ | |
308 { | |
309 "name": "networkType", | |
310 "$ref": "NetworkType" | |
311 } | |
312 ] | |
313 }, | |
314 { | |
315 "name": "requestNetworkScan", | |
316 "description": "Requests that the networking subsystem scan for new netw
orks 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 t
he onNetworkListChanged event will be fired.", | |
317 "parameters": [] | |
318 }, | |
319 { | |
320 "name": "startConnect", | |
321 "description": "Starts a connection to the network with networkGuid.", | |
322 "parameters": [ | |
323 { | |
324 "name": "networkGuid", | |
325 "type": "string", | |
326 "description": "The unique identifier of the network to connect to." | |
327 }, | |
328 { | |
329 "name": "callback", | |
330 "type": "function", | |
331 "optional": true, | |
332 "parameters": [], | |
333 "description": "A callback function that indicates that a connection
has been initiated." | |
334 } | |
335 ] | |
336 }, | |
337 { | |
338 "name": "startDisconnect", | |
339 "description": "Starts a disconnect from the network with networkGuid.", | |
340 "parameters": [ | |
341 { | |
342 "name": "networkGuid", | |
343 "type": "string", | |
344 "description": "The unique identifier of the network to disconnect f
rom." | |
345 }, | |
346 { | |
347 "name": "callback", | |
348 "type": "function", | |
349 "optional": true, | |
350 "parameters": [], | |
351 "description": "A callback function that indicates that a disconnect
has been initiated." | |
352 } | |
353 ] | |
354 }, | |
355 { | |
356 "name": "startActivate", | |
357 "description": "Starts activation of the Cellular network with networkGu
id.", | |
358 "parameters": [ | |
359 { | |
360 "name": "networkGuid", | |
361 "type": "string", | |
362 "description": "The unique identifier of the Cellular network to act
ivate." | |
363 }, | |
364 { | |
365 "name": "carrier", | |
366 "type": "string", | |
367 "optional": true, | |
368 "description": "Optional name of carrier to activate." | |
369 }, | |
370 { | |
371 "name": "callback", | |
372 "type": "function", | |
373 "optional": true, | |
374 "parameters": [], | |
375 "description": "A callback function that indicates that activation h
as been started." | |
376 } | |
377 ] | |
378 }, | |
379 { | |
380 "name": "verifyDestination", | |
381 "description": "Verifies that the device is a trusted device.", | |
382 "parameters": [ | |
383 { | |
384 "name": "properties", | |
385 "$ref": "VerificationProperties", | |
386 "description": "Properties of the destination to use in verifying th
at it is a trusted device." | |
387 }, | |
388 { | |
389 "name": "callback", | |
390 "type": "function", | |
391 "parameters": [ | |
392 { | |
393 "name": "verified", | |
394 "type": "boolean" | |
395 } | |
396 ], | |
397 "description": "A callback function that indicates whether or not th
e device is a trusted device." | |
398 } | |
399 ] | |
400 }, | |
401 { | |
402 "name": "verifyAndEncryptCredentials", | |
403 "description": "Verifies that the device is a trusted device and retriev
es encrypted network credentials.", | |
404 "parameters": [ | |
405 { | |
406 "name": "properties", | |
407 "$ref": "VerificationProperties", | |
408 "description": "Properties of the destination to use in verifying th
at it is a trusted device." | |
409 }, | |
410 { | |
411 "name": "networkGuid", | |
412 "type": "string", | |
413 "description": "A string containing the unique identifier of the net
work to get credentials for." | |
414 }, | |
415 { | |
416 "name": "callback", | |
417 "type": "function", | |
418 "parameters": [ | |
419 { | |
420 "name": "credentials", | |
421 "type": "string" | |
422 } | |
423 ], | |
424 "description": "A callback function that receives base64-encoded enc
rypted credential data to send to a trusted device." | |
425 } | |
426 ] | |
427 }, | |
428 { | |
429 "name": "verifyAndEncryptData", | |
430 "description": "Verifies that the device is a trusted device and encrypt
s supplied data with device public key.", | |
431 "parameters": [ | |
432 { | |
433 "name": "properties", | |
434 "$ref": "VerificationProperties", | |
435 "description": "Properties of the destination to use in verifying th
at it is a trusted device." | |
436 }, | |
437 { | |
438 "name": "data", | |
439 "type": "string", | |
440 "description": "A string containing the base64-encoded data to encry
pt." | |
441 }, | |
442 { | |
443 "name": "callback", | |
444 "type": "function", | |
445 "parameters": [ | |
446 { | |
447 "name": "encryptedData", | |
448 "type": "string" | |
449 } | |
450 ], | |
451 "description": "A callback function that receives base64-encoded enc
rypted data to send to a trusted device." | |
452 } | |
453 ] | |
454 }, | |
455 { | |
456 "name": "setWifiTDLSEnabledState", | |
457 "description": "Enables TDLS for wifi traffic with a specified peer if a
vailable.", | |
458 "parameters": [ | |
459 { | |
460 "name": "ip_or_mac_address", | |
461 "type": "string", | |
462 "description": "The IP or MAC address of the peer with which to enab
le a TDLS connection." | |
463 }, | |
464 { | |
465 "name": "enabled", | |
466 "type": "boolean", | |
467 "description": "If true, enable TDLS, otherwise disable TDLS." | |
468 }, | |
469 { | |
470 "name": "callback", | |
471 "optional": true, | |
472 "type": "function", | |
473 "parameters": [ | |
474 { | |
475 "name": "status", | |
476 "type": "string" | |
477 } | |
478 ], | |
479 "description": "A callback function that receives a string with an e
rror or the current TDLS status. 'Failed' indicates that the request failed (e.g
. MAC address lookup failed). 'Timeout' indicates that the lookup timed out. Oth
erwise a valid status is returned (see getWifiTDLSStatus)." | |
480 } | |
481 ] | |
482 }, | |
483 { | |
484 "name": "getWifiTDLSStatus", | |
485 "description": "Returns the current TDLS status for the specified peer."
, | |
486 "parameters": [ | |
487 { | |
488 "name": "ip_or_mac_address", | |
489 "type": "string", | |
490 "description": "The IP or MAC address of the peer." | |
491 }, | |
492 { | |
493 "name": "callback", | |
494 "type": "function", | |
495 "parameters": [ | |
496 { | |
497 "name": "status", | |
498 "type": "string" | |
499 } | |
500 ], | |
501 "description": "A callback function that receives a string with the
current TDLS status which can be 'Connected', 'Disabled', 'Disconnected', 'Nonex
istent', or 'Unknown'" | |
502 } | |
503 ] | |
504 }, | |
505 { | |
506 "name": "getCaptivePortalStatus", | |
507 "description": "Returns captive portal status for the network matching '
guid'.", | |
508 "parameters": [ | |
509 { | |
510 "name": "networkGuid", | |
511 "type": "string", | |
512 "description": "The guid of the network to get captive portal status
." | |
513 }, | |
514 { | |
515 "name": "callback", | |
516 "type": "function", | |
517 "parameters": [ | |
518 { | |
519 "name": "status", | |
520 "$ref": "CaptivePortalStatus", | |
521 "description": "Results of the query for network captive portal
status." | |
522 } | |
523 ] | |
524 } | |
525 ] | |
526 } | |
527 ], | |
528 "events": [ | |
529 { | |
530 "name": "onNetworksChanged", | |
531 "type": "function", | |
532 "description": "Fired when the properties change on any of the networks.
Sends a list of identifiers for networks whose properties have changed.", | |
533 "parameters": [ | |
534 { | |
535 "name": "changes", | |
536 "type": "array", | |
537 "items": { "type": "string" } | |
538 } | |
539 ] | |
540 }, | |
541 { | |
542 "name": "onNetworkListChanged", | |
543 "type": "function", | |
544 "description": "Fired when the list of networks has changed. Sends a co
mplete list of identifiers for all the current networks.", | |
545 "parameters": [ | |
546 { | |
547 "name": "changes", | |
548 "type": "array", | |
549 "items": { "type": "string" } | |
550 } | |
551 ] | |
552 }, | |
553 { | |
554 "name": "onPortalDetectionCompleted", | |
555 "type": "function", | |
556 "description": "Fired when a portal detection for a network completes. S
ends the guid of the network and the corresponding captive portal status.", | |
557 "parameters": [ | |
558 { | |
559 "name": "networkGuid", | |
560 "type": "string" | |
561 }, | |
562 { | |
563 "name": "status", | |
564 "$ref": "CaptivePortalStatus" | |
565 } | |
566 ] | |
567 } | |
568 ] | |
569 } | |
570 ] | |
OLD | NEW |