From e31f7ce72c7b3a0f736bd70c9ce4b1bf78c46be3 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Fri, 17 Feb 2012 22:07:46 +0000 Subject: Add PPB_NetworkList_Private interface. BUG=114808 Review URL: http://codereview.chromium.org/9407032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122599 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/api/private/ppb_network_list_private.idl | 160 +++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 ppapi/api/private/ppb_network_list_private.idl (limited to 'ppapi/api') diff --git a/ppapi/api/private/ppb_network_list_private.idl b/ppapi/api/private/ppb_network_list_private.idl new file mode 100644 index 0000000..bbc8990 --- /dev/null +++ b/ppapi/api/private/ppb_network_list_private.idl @@ -0,0 +1,160 @@ +/* Copyright (c) 2012 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. + */ + +/** + * This file defines the PPB_NetworkList_Private interface. + */ + +label Chrome { + M19 = 0.1 +}; + +/** + * PPB_NetworkListChanged_Callback is a callback function + * type that is used to receive notifications about changes in the + * NetworkList. + */ +typedef void PPB_NetworkListChanged_Callback([inout] mem_t user_data); + +/** + * Type of a network interface. + */ +[assert_size(4)] +enum PP_NetworkListType { + /** + * Wired Ethernet network. + */ + PP_NETWORKLIST_ETHERNET = 0, + + /** + * Wireless Wi-Fi network. + */ + PP_NETWORKLIST_WIFI = 1, + + /** + * Cellular network (e.g. LTE). + */ + PP_NETWORKLIST_CELLULAR = 2 +}; + +/** + * State of a network interface. + */ +[assert_size(4)] +enum PP_NetworkListState { + /** + * Network interface is down. + */ + PP_NETWORKLIST_DOWN = 0, + + /** + * Network interface is up. + */ + PP_NETWORKLIST_UP = 1 +}; + +/** + * The PPB_NetworkList_Private provides list of network + * interfaces and associated IP addressed. + */ +interface PPB_NetworkList_Private { + /** + * Create() creates a new NetworkList object. + * + * @param[in] instance A PP_Instance identifying one instance + * of a module. + * + * @return A PP_Resource corresponding to a NetworkList if + * successful, 0 if the instance is invalid. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if the specified resource is a + * NetworkList object. + * + * @param[in] resource A PP_Resource resource. + * + * @return Returns PP_TRUE if resource is + * a PPB_NetworkList_Private, PP_FALSE + * otherwise. + */ + PP_Bool IsNetworkList([in] PP_Resource resource); + + /** + * Updates the list with the current state of the network interfaces + * in the system. + */ + int32_t Update([in] PP_CompletionCallback callback); + + /** + * Starts change notifications. The specified callback + * will be called every time the network list changes. Every time + * the callback is called the plugin must call Update() method to + * actually receive updated list. + */ + int32_t StartNotifications([in] PP_Resource resource, + [in] PPB_NetworkListChanged_Callback callback, + [inout] mem_t user_data); + + /** + * Stops change notifications. After this method is called the + * callback specified in StartNotifications() will not + * be called anymore. + */ + int32_t StopNotifications([in] PP_Resource resource); + + /** + * @return Returns number of available network interfaces or 0 if + * the list has never been updated. + */ + uint32_t GetCount([in] PP_Resource resource); + + /** + * @return Returns name for the network interface with the specified + * index. + */ + PP_Var GetName([in] PP_Resource resource, + [in] uint32_t index); + + /** + * @return Returns type of the network interface with the specified + * index. + */ + PP_NetworkListType GetType([in] PP_Resource resource, + [in] uint32_t index); + + /** + * @return Returns current state of the network interface with the + * specified index. + */ + PP_NetworkListState GetState([in] PP_Resource resource, + [in] uint32_t index); + + /** + * @return Returns NetAddress object that contains + * address of the specified family for the network + * interface with the specified index, or 0 if the + * address is not assigned. + */ + PP_Resource GetIpAddress([in] PP_Resource resource, + [in] uint32_t index, + [in] PP_NetAddressFamily_Private family); + + /** + * @return Returns display name for the network interface with the + * specified index. + */ + PP_Var GetDisplayName([in] PP_Resource resource, + [in] uint32_t index); + + /** + * @return Returns MTU for the network interface with the specified + * index. + */ + uint32_t GetMTU([in] PP_Resource resource, + [in] uint32_t index); + +}; -- cgit v1.1