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": "getNetworks", | |
193 "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.", | |
194 "parameters": [ | |
195 { | |
196 "name": "filter", | |
197 "type": "object", | |
198 "properties": { | |
199 "networkType": { | |
200 "$ref": "NetworkType", | |
201 "description": "The type of networks to return." | |
202 }, | |
203 "visible": { | |
204 "type": "boolean", | |
205 "optional": true, | |
206 "description": "If true, only include visible (physically connec
ted or in-range) networks. Defaults to 'false'." | |
207 }, | |
208 "configured": { | |
209 "type": "boolean", | |
210 "optional": true, | |
211 "description": "If true, only include configured (saved) network
s. Defaults to 'false'." | |
212 }, | |
213 "limit": { | |
214 "type": "integer", | |
215 "optional": true, | |
216 "description": "Maximum number of networks to return. Defaults t
o 1000. Use 0 for no limit." | |
217 } | |
218 } | |
219 }, | |
220 { | |
221 "name": "callback", | |
222 "type": "function", | |
223 "optional": true, | |
224 "parameters": [ | |
225 { | |
226 "name": "networkList", | |
227 "type": "array", | |
228 "items": { "$ref": "NetworkProperties" } | |
229 } | |
230 ] | |
231 } | |
232 ] | |
233 }, | |
234 { | |
235 "name": "getVisibleNetworks", | |
236 "deprecated": "Please use $(ref:networkingPrivate.getNetworks) with filt
er.visble = true.", | |
237 "description": "Returns a list of visible network objects with the same
properties provided by getState.", | |
238 "parameters": [ | |
239 { | |
240 "name": "networkType", | |
241 "$ref": "NetworkType", | |
242 "description": "The type of networks to return." | |
243 }, | |
244 { | |
245 "name": "callback", | |
246 "type": "function", | |
247 "optional": true, | |
248 "parameters": [ | |
249 { | |
250 "name": "networkList", | |
251 "type": "array", | |
252 "items": { "$ref": "NetworkProperties" } | |
253 } | |
254 ] | |
255 } | |
256 ] | |
257 }, | |
258 { | |
259 "name": "getEnabledNetworkTypes", | |
260 "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.", | |
261 "parameters": [ | |
262 { | |
263 "name": "callback", | |
264 "type": "function", | |
265 "optional": true, | |
266 "parameters": [ | |
267 { | |
268 "name": "enabledTypes", | |
269 "type": "array", | |
270 "items": { "$ref": "NetworkType" } | |
271 } | |
272 ] | |
273 } | |
274 ] | |
275 }, | |
276 { | |
277 "name": "enableNetworkType", | |
278 "description": "Enable the specified network type. Note, the type might
represent multiple network types (e.g. 'Wireless').", | |
279 "parameters": [ | |
280 { | |
281 "name": "networkType", | |
282 "$ref": "NetworkType" | |
283 } | |
284 ] | |
285 }, | |
286 { | |
287 "name": "disableNetworkType", | |
288 "description": "Disable the specified network type. See note for $(ref:n
etworkingPrivate.enableNetworkType).", | |
289 "parameters": [ | |
290 { | |
291 "name": "networkType", | |
292 "$ref": "NetworkType" | |
293 } | |
294 ] | |
295 }, | |
296 { | |
297 "name": "requestNetworkScan", | |
298 "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.", | |
299 "parameters": [] | |
300 }, | |
301 { | |
302 "name": "startConnect", | |
303 "description": "Starts a connection to the network with networkGuid.", | |
304 "parameters": [ | |
305 { | |
306 "name": "networkGuid", | |
307 "type": "string", | |
308 "description": "The unique identifier of the network to connect to." | |
309 }, | |
310 { | |
311 "name": "callback", | |
312 "type": "function", | |
313 "optional": true, | |
314 "parameters": [], | |
315 "description": "A callback function that indicates that a connection
has been initiated." | |
316 } | |
317 ] | |
318 }, | |
319 { | |
320 "name": "startDisconnect", | |
321 "description": "Starts a disconnect from the network with networkGuid.", | |
322 "parameters": [ | |
323 { | |
324 "name": "networkGuid", | |
325 "type": "string", | |
326 "description": "The unique identifier of the network to disconnect f
rom." | |
327 }, | |
328 { | |
329 "name": "callback", | |
330 "type": "function", | |
331 "optional": true, | |
332 "parameters": [], | |
333 "description": "A callback function that indicates that a disconnect
has been initiated." | |
334 } | |
335 ] | |
336 }, | |
337 { | |
338 "name": "startActivate", | |
339 "description": "Starts activation of the Cellular network with networkGu
id.", | |
340 "parameters": [ | |
341 { | |
342 "name": "networkGuid", | |
343 "type": "string", | |
344 "description": "The unique identifier of the Cellular network to act
ivate." | |
345 }, | |
346 { | |
347 "name": "carrier", | |
348 "type": "string", | |
349 "optional": true, | |
350 "description": "Optional name of carrier to activate." | |
351 }, | |
352 { | |
353 "name": "callback", | |
354 "type": "function", | |
355 "optional": true, | |
356 "parameters": [], | |
357 "description": "A callback function that indicates that activation h
as been started." | |
358 } | |
359 ] | |
360 }, | |
361 { | |
362 "name": "verifyDestination", | |
363 "description": "Verifies that the device is a trusted device.", | |
364 "parameters": [ | |
365 { | |
366 "name": "properties", | |
367 "$ref": "VerificationProperties", | |
368 "description": "Properties of the destination to use in verifying th
at it is a trusted device." | |
369 }, | |
370 { | |
371 "name": "callback", | |
372 "type": "function", | |
373 "parameters": [ | |
374 { | |
375 "name": "verified", | |
376 "type": "boolean" | |
377 } | |
378 ], | |
379 "description": "A callback function that indicates whether or not th
e device is a trusted device." | |
380 } | |
381 ] | |
382 }, | |
383 { | |
384 "name": "verifyAndEncryptCredentials", | |
385 "description": "Verifies that the device is a trusted device and retriev
es encrypted network credentials.", | |
386 "parameters": [ | |
387 { | |
388 "name": "properties", | |
389 "$ref": "VerificationProperties", | |
390 "description": "Properties of the destination to use in verifying th
at it is a trusted device." | |
391 }, | |
392 { | |
393 "name": "networkGuid", | |
394 "type": "string", | |
395 "description": "A string containing the unique identifier of the net
work to get credentials for." | |
396 }, | |
397 { | |
398 "name": "callback", | |
399 "type": "function", | |
400 "parameters": [ | |
401 { | |
402 "name": "credentials", | |
403 "type": "string" | |
404 } | |
405 ], | |
406 "description": "A callback function that receives base64-encoded enc
rypted credential data to send to a trusted device." | |
407 } | |
408 ] | |
409 }, | |
410 { | |
411 "name": "verifyAndEncryptData", | |
412 "description": "Verifies that the device is a trusted device and encrypt
s supplied data with device public key.", | |
413 "parameters": [ | |
414 { | |
415 "name": "properties", | |
416 "$ref": "VerificationProperties", | |
417 "description": "Properties of the destination to use in verifying th
at it is a trusted device." | |
418 }, | |
419 { | |
420 "name": "data", | |
421 "type": "string", | |
422 "description": "A string containing the base64-encoded data to encry
pt." | |
423 }, | |
424 { | |
425 "name": "callback", | |
426 "type": "function", | |
427 "parameters": [ | |
428 { | |
429 "name": "encryptedData", | |
430 "type": "string" | |
431 } | |
432 ], | |
433 "description": "A callback function that receives base64-encoded enc
rypted data to send to a trusted device." | |
434 } | |
435 ] | |
436 }, | |
437 { | |
438 "name": "setWifiTDLSEnabledState", | |
439 "description": "Enables TDLS for wifi traffic with a specified peer if a
vailable.", | |
440 "parameters": [ | |
441 { | |
442 "name": "ip_or_mac_address", | |
443 "type": "string", | |
444 "description": "The IP or MAC address of the peer with which to enab
le a TDLS connection." | |
445 }, | |
446 { | |
447 "name": "enabled", | |
448 "type": "boolean", | |
449 "description": "If true, enable TDLS, otherwise disable TDLS." | |
450 }, | |
451 { | |
452 "name": "callback", | |
453 "optional": true, | |
454 "type": "function", | |
455 "parameters": [ | |
456 { | |
457 "name": "status", | |
458 "type": "string" | |
459 } | |
460 ], | |
461 "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)." | |
462 } | |
463 ] | |
464 }, | |
465 { | |
466 "name": "getWifiTDLSStatus", | |
467 "description": "Returns the current TDLS status for the specified peer."
, | |
468 "parameters": [ | |
469 { | |
470 "name": "ip_or_mac_address", | |
471 "type": "string", | |
472 "description": "The IP or MAC address of the peer." | |
473 }, | |
474 { | |
475 "name": "callback", | |
476 "type": "function", | |
477 "parameters": [ | |
478 { | |
479 "name": "status", | |
480 "type": "string" | |
481 } | |
482 ], | |
483 "description": "A callback function that receives a string with the
current TDLS status which can be 'Connected', 'Disabled', 'Disconnected', 'Nonex
istent', or 'Unknown'" | |
484 } | |
485 ] | |
486 }, | |
487 { | |
488 "name": "getCaptivePortalStatus", | |
489 "description": "Returns captive portal status for the network matching '
guid'.", | |
490 "parameters": [ | |
491 { | |
492 "name": "networkGuid", | |
493 "type": "string", | |
494 "description": "The guid of the network to get captive portal status
." | |
495 }, | |
496 { | |
497 "name": "callback", | |
498 "type": "function", | |
499 "parameters": [ | |
500 { | |
501 "name": "status", | |
502 "$ref": "CaptivePortalStatus", | |
503 "description": "Results of the query for network captive portal
status." | |
504 } | |
505 ] | |
506 } | |
507 ] | |
508 } | |
509 ], | |
510 "events": [ | |
511 { | |
512 "name": "onNetworksChanged", | |
513 "type": "function", | |
514 "description": "Fired when the properties change on any of the networks.
Sends a list of identifiers for networks whose properties have changed.", | |
515 "parameters": [ | |
516 { | |
517 "name": "changes", | |
518 "type": "array", | |
519 "items": { "type": "string" } | |
520 } | |
521 ] | |
522 }, | |
523 { | |
524 "name": "onNetworkListChanged", | |
525 "type": "function", | |
526 "description": "Fired when the list of networks has changed. Sends a co
mplete list of identifiers for all the current networks.", | |
527 "parameters": [ | |
528 { | |
529 "name": "changes", | |
530 "type": "array", | |
531 "items": { "type": "string" } | |
532 } | |
533 ] | |
534 }, | |
535 { | |
536 "name": "onPortalDetectionCompleted", | |
537 "type": "function", | |
538 "description": "Fired when a portal detection for a network completes. S
ends the guid of the network and the corresponding captive portal status.", | |
539 "parameters": [ | |
540 { | |
541 "name": "networkGuid", | |
542 "type": "string" | |
543 }, | |
544 { | |
545 "name": "status", | |
546 "$ref": "CaptivePortalStatus" | |
547 } | |
548 ] | |
549 } | |
550 ] | |
551 } | |
552 ] | |
OLD | NEW |