INetworkManagementService.aidl revision 4d02d001ef6e06583e858e63e48d1aebf54ba28d
1/* //device/java/android/android/os/INetworkManagementService.aidl
2**
3** Copyright 2007, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18package android.os;
19
20import android.net.InterfaceConfiguration;
21import android.net.INetworkManagementEventObserver;
22
23/**
24 * @hide
25 */
26interface INetworkManagementService
27{
28    /**
29     ** GENERAL
30     **/
31
32    /**
33     * Register an observer to receive events
34     */
35    void registerObserver(INetworkManagementEventObserver obs);
36
37    /**
38     * Unregister an observer from receiving events.
39     */
40    void unregisterObserver(INetworkManagementEventObserver obs);
41
42    /**
43     * Returns a list of currently known network interfaces
44     */
45    String[] listInterfaces();
46
47    /**
48     * Retrieves the specified interface config
49     *
50     */
51    InterfaceConfiguration getInterfaceConfig(String iface);
52
53    /**
54     * Sets the configuration of the specified interface
55     */
56    void setInterfaceConfig(String iface, in InterfaceConfiguration cfg);
57
58    /**
59     * Shuts down the service
60     */
61    void shutdown();
62
63    /**
64     ** TETHERING RELATED
65     **/
66
67
68    /**
69     * Returns true if IP forwarding is enabled
70     */
71    boolean getIpForwardingEnabled();
72
73    /**
74     * Enables/Disables IP Forwarding
75     */
76    void setIpForwardingEnabled(boolean enabled);
77
78    /**
79     * Start tethering services with the specified dhcp server range
80     */
81    void startTethering(String dhcpRangeStart, String dhcpRangeEnd);
82
83    /**
84     * Stop currently running tethering services
85     */
86    void stopTethering();
87
88    /**
89     * Returns true if tethering services are started
90     */
91    boolean isTetheringStarted();
92
93    /**
94     * Tethers the specified interface
95     */
96    void tetherInterface(String iface);
97
98    /**
99     * Untethers the specified interface
100     */
101    void untetherInterface(String iface);
102
103    /**
104     * Returns a list of currently tethered interfaces
105     */
106    String[] listTetheredInterfaces();
107
108    /**
109     * Sets the list of DNS forwarders (in order of priority)
110     */
111    void setDnsForwarders(in String[] dns);
112
113    /**
114     * Returns the list of DNS fowarders (in order of priority)
115     */
116    String[] getDnsForwarders();
117
118    /**
119     *  Enables Network Address Translation between two interfaces.
120     *  The address and netmask of the external interface is used for
121     *  the NAT'ed network.
122     */
123    void enableNat(String internalInterface, String externalInterface);
124
125    /**
126     *  Disables Network Address Translation between two interfaces.
127     */
128    void disableNat(String internalInterface, String externalInterface);
129
130    /**
131     ** PPPD
132     **/
133
134    /**
135     * Returns the list of currently known TTY devices on the system
136     */
137    String[] listTtys();
138
139    /**
140     * Attaches a PPP server daemon to the specified TTY with the specified
141     * local/remote addresses.
142     */
143    void attachPppd(String tty, String localAddr, String remoteAddr);
144
145    /**
146     * Detaches a PPP server daemon from the specified TTY.
147     */
148    void detachPppd(String tty);
149
150}
151