diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/system/gonk/nsINetworkManager.idl | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/system/gonk/nsINetworkManager.idl')
-rw-r--r-- | dom/system/gonk/nsINetworkManager.idl | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/dom/system/gonk/nsINetworkManager.idl b/dom/system/gonk/nsINetworkManager.idl new file mode 100644 index 000000000..0da123796 --- /dev/null +++ b/dom/system/gonk/nsINetworkManager.idl @@ -0,0 +1,135 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsINetworkInfo; +interface nsINetworkInterface; + +/** + * Manage network interfaces. + */ +[scriptable, uuid(1ba9346b-53b5-4660-9dc6-58f0b258d0a6)] +interface nsINetworkManager : nsISupports +{ + /** + * Register the given network interface with the network manager. + * + * Consumers will be notified with the 'network-interface-registered' + * observer notification. + * + * Throws if there's already an interface registered with the same network id. + * + * @param network + * Network interface to register. + */ + void registerNetworkInterface(in nsINetworkInterface network); + + /** + * Update the routes and DNSes according the state of the given network. + * + * Consumers will be notified with the 'network-connection-state-changed' + * observer notification. + * + * Throws an exception if the specified network interface object isn't + * registered. + * + * @param network + * Network interface to update. + */ + void updateNetworkInterface(in nsINetworkInterface network); + + /** + * Unregister the given network interface from the network manager. + * + * Consumers will be notified with the 'network-interface-unregistered' + * observer notification. + * + * Throws an exception if the specified network interface object isn't + * registered. + * + * @param network + * Network interface to unregister. + */ + void unregisterNetworkInterface(in nsINetworkInterface network); + + /** + * Object containing all known network information, keyed by their + * network id. Network id is composed of a sub-id + '-' + network + * type. For mobile network types, sub-id is 'ril' + service id; for + * non-mobile network types, sub-id is always 'device'. + */ + readonly attribute jsval allNetworkInfo; + + /** + * Priority list of network types. An array of + * nsINetworkInterface::NETWORK_TYPE_* constants. + * + * The piror position of the type indicates the higher priority. The priority + * is used to determine route when there are multiple connected networks. + */ + attribute jsval networkTypePriorityList; + + /** + * The preferred network type. One of the + * nsINetworkInterface::NETWORK_TYPE_* constants. + * + * This attribute is used for setting default route to favor + * interfaces with given type. This can be overriden by calling + * overrideDefaultRoute(). + */ + attribute long preferredNetworkType; + + /** + * The network information of the network interface handling all network + * traffic. + * + * When this changes, the 'network-active-changed' observer + * notification is dispatched. + */ + readonly attribute nsINetworkInfo activeNetworkInfo; + + /** + * Override the default behaviour for preferredNetworkType and route + * all network traffic through the the specified interface. + * + * Consumers can observe changes to the active network by subscribing to + * the 'network-active-changed' observer notification. + * + * @param network + * Network to route all network traffic to. If this is null, + * a previous override is canceled. + */ + long overrideActive(in nsINetworkInterface network); + + /** + * Add host route to the specified network into routing table. + * + * @param network + * The network information for the host to be routed to. + * @param host + * The host to be added. + * The host will be resolved in advance if it's not an ip-address. + * + * @return a Promise + * resolved if added; rejected, otherwise. + */ + jsval addHostRoute(in nsINetworkInfo network, + in DOMString host); + + /** + * Remove host route to the specified network from routing table. + * + * @param network + * The network information for the routing to be removed from. + * @param host + * The host routed to the network. + * The host will be resolved in advance if it's not an ip-address. + * + * @return a Promise + * resolved if removed; rejected, otherwise. + */ + jsval removeHostRoute(in nsINetworkInfo network, + in DOMString host); +}; |