summaryrefslogtreecommitdiffstats
path: root/extensions/common/api/networking_private.json
blob: 5d221283c932c4ae61e95661215da17f7c6c0a79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace":"networkingPrivate",
    "description": "none",
    "compiler_options": {
      "implemented_in": "extensions/browser/api/networking_private/networking_private_api.h"
    },
    "platforms": ["chromeos", "win", "mac", "linux"],
    "types" : [
      {
        "id": "NetworkProperties",
        "type": "object",
        "additionalProperties": { "type": "any" }
      },
      {
        "id": "ManagedNetworkProperties",
        "type": "object",
        "additionalProperties": { "type": "any" }
      },
      {
        "id": "VerificationProperties",
        "type": "object",
        "properties": {
          "certificate": {
            "type": "string",
            "description": "A string containing a PEM-encoded (including the \"BEGIN CERTIFICATE\" header and \"END CERTIFICATE\" footer) X.509 certificate for use in verifying the signed data."
          },
          "intermediateCertificates": {
            "type": "array",
            "items": { "type": "string" },
            "optional": true,
            "description": "An array of PEM-encoded X.509 intermediate certificate authority certificates. Each PEM-encoded certificate is expected to have the \"BEGIN CERTIFICATE\" header and \"END CERTIFICATE\" footer."
          },
          "publicKey": {
            "type": "string",
            "description": "A string containing a Base64-encoded RSAPublicKey ASN.1 structure, representing the public key to be used by verifyAndEncryptCredentials and verifyAndEncryptData methods."
          },
          "nonce": {
            "type": "string",
            "description": "A string containing a base64-encoded random binary data for use in verifying the signed data."
          },
          "signedData": {
            "type": "string",
            "description": "A string containing the identifying data string signed by the device."
          },
          "deviceSerial": {
            "type": "string",
            "description": "A string containing the serial number of the device."
          },
          "deviceSsid": {
            "type": "string",
            "description": "A string containing the SSID of the device.  Only set if the device has already been setup once."
          },
          "deviceBssid": {
            "type": "string",
            "description": "A string containing the BSSID of the device.  Only set if the device has already been setup."
          }
        }
      },
      {
        "id": "NetworkType",
        "type": "string",
        "enum": ["All", "Bluetooth", "Cellular", "Ethernet", "VPN", "Wireless", "WiFi", "Wimax"]
      },
      {
        "id": "CaptivePortalStatus",
        "type": "string",
        "enum": ["Unknown", "Offline", "Online", "Portal", "ProxyAuthRequired"]
      }
    ],
    "functions": [
      {
        "name": "getProperties",
        "description": "Gets all the properties of the network with id networkGuid.  Includes all properties of the network (read-only and read/write values).",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string",
            "description": "The unique identifier of the network to get properties from."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "properties",
                "$ref": "NetworkProperties",
                "description": "Results of the query for network properties."
              }
            ]
          }
        ]
      },
      {
        "name": "getManagedProperties",
        "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.",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string",
            "description": "The unique identifier of the network to get properties from."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "properties",
                "$ref": "ManagedNetworkProperties",
                "description": "Results of the query for managed network properties."
              }
            ]
          }
        ]
      },
      {
        "name": "getState",
        "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.  The following properties are returned for all networks: GUID, Type, Name, WiFi.Security. Additional properties are provided for visible networks: ConnectionState, ErrorState, WiFi.SignalStrength, Cellular.NetworkTechnology, Cellular.ActivationState, Cellular.RoamingState, Cellular.OutOfCredits.",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string",
            "description": "The unique identifier of the network to set properties on."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "properties",
                "$ref": "NetworkProperties",
                "description": "Results of the query for network state properties."
              }
            ]
          }
        ]
      },
      {
        "name": "setProperties",
        "description": "Sets the properties of the network with id networkGuid.",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string",
            "description": "The unique identifier of the network to set properties on."
          },
          {
            "name": "properties",
            "$ref": "NetworkProperties",
            "description": "The properties to set on the network."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": []
          }
        ]
      },
      {
        "name": "createNetwork",
        "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.",
        "parameters": [
          {
            "name": "shared",
            "type": "boolean",
            "description": "If true, share this network configuration with other users."
          },
          {
            "name": "properties",
            "$ref": "NetworkProperties",
            "description": "The properties to configure the new network with."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "networkGuid",
                "type": "string"
              }
            ]
          }
        ]
      },
      {
        "name": "getNetworks",
        "description": "Returns a list of network objects with the same properties provided by getState. A filter is provided to specify the type of networks returned and to limit the number of networks. Networks are ordered by the system based on their priority, with connected or connecting networks listed first.",
        "parameters": [
          {
            "name": "filter",
            "type": "object",
            "properties": {
              "networkType": {
                "$ref": "NetworkType",
                "description": "The type of networks to return."
              },
              "visible": {
                "type": "boolean",
                "optional": true,
                "description": "If true, only include visible (physically connected or in-range) networks. Defaults to 'false'."
              },
              "configured": {
                "type": "boolean",
                "optional": true,
                "description": "If true, only include configured (saved) networks. Defaults to 'false'."
              },
              "limit": {
                "type": "integer",
                "optional": true,
                "description": "Maximum number of networks to return. Defaults to 1000. Use 0 for no limit."
              }
            }
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "parameters": [
              {
                "name": "networkList",
                "type": "array",
                "items": { "$ref": "NetworkProperties" }
              }
            ]
          }
        ]
      },
      {
        "name": "getVisibleNetworks",
        "deprecated": "Please use $(ref:networkingPrivate.getNetworks) with filter.visble = true.",
        "description": "Returns a list of visible network objects with the same properties provided by getState.",
        "parameters": [
          {
            "name": "networkType",
            "$ref": "NetworkType",
            "description": "The type of networks to return."
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "parameters": [
              {
                "name": "networkList",
                "type": "array",
                "items": { "$ref": "NetworkProperties" }
              }
            ]
          }
        ]
      },
      {
        "name": "getEnabledNetworkTypes",
        "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.",
        "parameters": [
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "parameters": [
              {
                "name": "enabledTypes",
                "type": "array",
                "items": { "$ref": "NetworkType" }
              }
            ]
          }
        ]
      },
      {
        "name": "enableNetworkType",
        "description": "Enable the specified network type. Note, the type might represent multiple network types (e.g. 'Wireless').",
        "parameters": [
          {
            "name": "networkType",
            "$ref": "NetworkType"
          }
        ]
      },
      {
        "name": "disableNetworkType",
        "description": "Disable the specified network type. See note for $(ref:networkingPrivate.enableNetworkType).",
        "parameters": [
          {
            "name": "networkType",
            "$ref": "NetworkType"
          }
        ]
      },
      {
        "name": "requestNetworkScan",
        "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.",
        "parameters": []
      },
      {
        "name": "startConnect",
        "description": "Starts a connection to the network with networkGuid.",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string",
            "description": "The unique identifier of the network to connect to."
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "parameters": [],
            "description": "A callback function that indicates that a connection has been initiated."
          }
        ]
      },
      {
        "name": "startDisconnect",
        "description": "Starts a disconnect from the network with networkGuid.",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string",
            "description": "The unique identifier of the network to disconnect from."
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "parameters": [],
            "description": "A callback function that indicates that a disconnect has been initiated."
          }
        ]
      },
      {
        "name": "verifyDestination",
        "description": "Verifies that the device is a trusted device.",
        "parameters": [
          {
            "name": "properties",
            "$ref": "VerificationProperties",
            "description": "Properties of the destination to use in verifying that it is a trusted device."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "verified",
                "type": "boolean"
              }
            ],
            "description": "A callback function that indicates whether or not the device is a trusted device."
          }
        ]
      },
      {
        "name": "verifyAndEncryptCredentials",
        "description": "Verifies that the device is a trusted device and retrieves encrypted network credentials.",
        "parameters": [
          {
            "name": "properties",
            "$ref": "VerificationProperties",
            "description": "Properties of the destination to use in verifying that it is a trusted device."
          },
          {
            "name": "networkGuid",
            "type": "string",
            "description": "A string containing the unique identifier of the network to get credentials for."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "credentials",
                "type": "string"
              }
            ],
            "description": "A callback function that receives base64-encoded encrypted credential data to send to a trusted device."
          }
        ]
      },
      {
        "name": "verifyAndEncryptData",
        "description": "Verifies that the device is a trusted device and encrypts supplied data with device public key.",
        "parameters": [
          {
            "name": "properties",
            "$ref": "VerificationProperties",
            "description": "Properties of the destination to use in verifying that it is a trusted device."
          },
          {
            "name": "data",
            "type": "string",
            "description": "A string containing the base64-encoded data to encrypt."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "encryptedData",
                "type": "string"
              }
            ],
            "description": "A callback function that receives base64-encoded encrypted data to send to a trusted device."
          }
        ]
      },
      {
        "name": "setWifiTDLSEnabledState",
        "description": "Enables TDLS for wifi traffic with a specified peer if available.",
        "parameters": [
          {
            "name": "ip_or_mac_address",
            "type": "string",
            "description": "The IP or MAC address of the peer with which to enable a TDLS connection."
          },
          {
            "name": "enabled",
            "type": "boolean",
            "description": "If true, enable TDLS, otherwise disable TDLS."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "status",
                "type": "string"
              }
            ],
            "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)."
          }
        ]
      },
      {
        "name": "getWifiTDLSStatus",
        "description": "Returns the current TDLS status for the specified peer.",
        "parameters": [
          {
            "name": "ip_or_mac_address",
            "type": "string",
            "description": "The IP or MAC address of the peer."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "status",
                "type": "string"
              }
            ],
            "description": "A callback function that receives a string with the current TDLS status which can be 'Connected', 'Disabled', 'Disconnected', 'Nonexistent', or 'Unknown'"
          }
        ]
      },
      {
        "name": "getCaptivePortalStatus",
        "description": "Returns captive portal status for the network matching 'guid'.",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string",
            "description": "The guid of the network to get captive portal status."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "status",
                "$ref": "CaptivePortalStatus",
                "description": "Results of the query for network captive portal status."
              }
            ]
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onNetworksChanged",
        "type": "function",
        "description": "Fired when the properties change on any of the networks.  Sends a list of identifiers for networks whose properties have changed.",
        "parameters": [
          {
            "name": "changes",
            "type": "array",
            "items": { "type": "string" }
          }
        ]
      },
      {
        "name": "onNetworkListChanged",
        "type": "function",
        "description": "Fired when the list of networks has changed.  Sends a complete list of identifiers for all the current networks.",
        "parameters": [
          {
            "name": "changes",
            "type": "array",
            "items": { "type": "string" }
          }
        ]
      },
      {
        "name": "onPortalDetectionCompleted",
        "type": "function",
        "description": "Fired when a portal detection for a network completes. Sends the guid of the network and the corresponding captive portal status.",
        "parameters": [
          {
            "name": "networkGuid",
            "type": "string"
          },
          {
            "name": "status",
            "$ref": "CaptivePortalStatus"
          }
        ]
      }
    ]
  }
]