Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3107)

Unified Diff: extensions/common/api/vpn_provider.idl

Issue 671163002: Add new extension API for VPN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added an optional callback to methods in the idl Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/api/schemas.gypi ('k') | extensions/common/permissions/api_permission.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/api/vpn_provider.idl
diff --git a/extensions/common/api/vpn_provider.idl b/extensions/common/api/vpn_provider.idl
new file mode 100644
index 0000000000000000000000000000000000000000..74d8a7cd7bba473b471dec523e7059fad086265b
--- /dev/null
+++ b/extensions/common/api/vpn_provider.idl
@@ -0,0 +1,96 @@
+// Copyright 2014 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.
+
+// Use the <code>chrome.vpnProvider</code> API to implement a VPN
+// client.
+namespace vpnProvider {
+ // 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.
+ // TODO(kaliamoorthi) : Document the messages
+ 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).
+ // TODO(kaliamoorthi) : Document all states
+ // TODO(kaliamoorthi) : Make failure more informative by expanding the failure
+ // conditions.
+ 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,
+ optional CallCompleteCallback callback);
+
+ // 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,
+ optional CallCompleteCallback callback);
+ };
+
+ 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);
+ };
+};
« no previous file with comments | « extensions/common/api/schemas.gypi ('k') | extensions/common/permissions/api_permission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698