// 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": "chrome/browser/extensions/api/networking_private/networking_private_api.h" }, "platforms": ["chromeos", "win", "mac"], "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 X.509 certificate for use in verifying the signed data." }, "publicKey": { "type": "string", "description": "A string containing a PEM-encoded RSA public key to be used to compare with the one in signedData" }, "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": ["Ethernet", "WiFi", "Cellular"] }, { "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. It only returns a subset of the properties returned by getProperties.", "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 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 propeties. 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": "guid", "type": "string" } ] } ] }, { "name": "getVisibleNetworks", "description": "Returns a list of visible network objects with the following ONC properties: GUID, Type, Name, ConnectionState, ErrorState, WiFi.Security, WiFi.SignalStrength, Cellular.NetworkTechnology, Cellular.ActivationState, Cellular.RoamingState. Cellular.OutOfCredits", "parameters": [ { "name": "type", "type": "string", "enum": ["Ethernet", "WiFi", "Bluetooth", "Cellular", "VPN", "All"], "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 type.", "parameters": [ { "name": "callback", "type": "function", "optional": true, "parameters": [ { "name": "networkList", "type": "array", "items": { "$ref": "NetworkType" } } ] } ] }, { "name": "enableNetworkType", "description": "Enable the specified network type.", "parameters": [ { "name": "networkType", "$ref": "NetworkType" } ] }, { "name": "disableNetworkType", "description": "Disable the specified network type.", "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": "guid", "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 with networkGuid.", "parameters": [ { "name": "networkPath", "type": "string", "description": "The path 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 a name of the network and corresponding captive portal status.", "parameters": [ { "name": "networkPath", "type": "string" }, { "name": "status", "$ref": "CaptivePortalStatus" } ] } ] } ]