Chromium Code Reviews| Index: chrome/common/extensions/api/vpn_provider.idl |
| diff --git a/chrome/common/extensions/api/vpn_provider.idl b/chrome/common/extensions/api/vpn_provider.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..643df4109164183844b796cfbff83c87c46bf759 |
| --- /dev/null |
| +++ b/chrome/common/extensions/api/vpn_provider.idl |
| @@ -0,0 +1,90 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
not at google - send to devlin
2014/10/30 17:46:47
I saw a lot of "I will add this later..." response
kaliamoorthi
2014/10/31 10:04:55
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// Use the <code>chrome.vpnProvider</code> API to implement a VPN |
| +// client. |
| +[inline_doc] namespace vpnProvider { |
|
not at google - send to devlin
2014/10/30 17:46:47
You don't need inline_doc either.
kaliamoorthi
2014/10/31 10:04:55
Done.
|
| + // A parameters class for the vpn interface |
| + dictionary Parameters { |
| + // IP address for the VPN interface in CIDR notation. |
| + // IPv4 is currently the only supported mode. |
| + DOMString address; |
| + // Broadcast address for the VPN interface. (default: Deduced |
| + // from IP address and mask). |
| + DOMString? broadcastAddress; |
| + // MTU for the VPN interface. (default: 1500) |
| + DOMString? mtu; |
| + // Bypass network traffic to the below IPs (in CIDR notation) |
| + // from the tunnel. Typically used to bypass traffic to/from |
| + // VPN server. |
| + DOMString[] bypassTunnelForIp; |
| + // A list of search domains (default: system setting). |
| + DOMString[]? domainSearch; |
| + // A list of DNS servers in CIDR notation (default: system |
| + // setting). |
| + DOMString[]? dnsServers; |
| + }; |
| + |
| + // The enum is used by the platform to notify the client of |
| + // connection and network related status. |
| + enum PlatformMessage { |
| + connected, |
| + disconnected, |
| + underlyingNetworkDisconnected, |
| + error |
| + }; |
| + |
| + // The enum is used by the VPN client to inform the platform |
| + // of its current state. This helps provide meaningful messages |
| + // to the user. The states listed below are currently known to |
| + // the platform (Shill daemon). |
| + enum VpnConnectionState { |
| + connected, |
| + portal, |
| + online, |
| + failure |
| + }; |
| + |
| + // The callback is used by <code>setParameters, sendPacket</code> |
| + // to signal completion. The callback is called with |
| + // <code>chrome.runtime.lastError</code> set to error code if |
| + // there is an error. |
| + [inline_doc] callback CallCompleteCallback = void (); |
| + |
| + // The callback is used by createConfig to signal completion. |
| + callback ConfigCreatedCallback = void (long handle); |
| + |
| + interface Functions { |
| + // Creates a new VPN configuration. |
| + static void createConfig(DOMString name, |
| + ConfigCreatedCallback callback); |
| + |
| + // Destroys a VPN configuration created by the extension. |
| + static void destroyConfig(long handle); |
| + |
| + // Sets the parameters for a VPN configuration. This should be |
| + // called after connected is received from the platform. |
| + static void setParameters(long handle, Parameters parameters, |
| + CallCompleteCallback callback); |
| + |
| + // Injects an IP packet into the network stack of Chrome OS. |
| + static void sendPacket(long handle, ArrayBuffer data, |
| + optional CallCompleteCallback callback); |
| + |
| + // Notifies the VPN connection state to Chrome OS. |
| + static void notifyConnectionStateChanged(long handle, |
| + VpnConnectionState state); |
| + }; |
| + |
| + interface Events { |
| + // Called when a message is received from the platform for a |
| + // VPN configuration owned by the extension. |
| + static void onPlatformMessage(long handle, |
| + PlatformMessage message); |
| + |
| + // Called when an IP packet is received from the platform for a |
| + // VPN configuration owned by the extension. |
| + static void onPacketReceived(long handle, ArrayBuffer data); |
| + }; |
| +}; |