Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.net; |
| 18 | |
| 19 | import android.content.Context; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 20 | import android.net.NetworkInfo.DetailedState; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 21 | import android.os.Handler; |
| 22 | import android.os.IBinder; |
| 23 | import android.os.INetworkManagementService; |
| 24 | import android.os.Message; |
Robert Greenwalt | 665e1ae | 2012-08-21 19:27:00 -0700 | [diff] [blame] | 25 | import android.os.Messenger; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 26 | import android.os.RemoteException; |
| 27 | import android.os.ServiceManager; |
| 28 | import android.util.Log; |
| 29 | |
Lorenzo Colitti | df86a9f | 2013-08-20 19:51:30 +0900 | [diff] [blame] | 30 | import com.android.server.net.BaseNetworkObserver; |
| 31 | |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 32 | import java.util.concurrent.atomic.AtomicBoolean; |
| 33 | import java.util.concurrent.atomic.AtomicInteger; |
| 34 | |
| 35 | /** |
| 36 | * This class tracks the data connection associated with Ethernet |
| 37 | * This is a singleton class and an instance will be created by |
| 38 | * ConnectivityService. |
| 39 | * @hide |
| 40 | */ |
Vinit Deshapnde | 1f12cb5 | 2013-08-21 13:09:01 -0700 | [diff] [blame] | 41 | public class EthernetDataTracker extends BaseNetworkStateTracker { |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 42 | private static final String NETWORKTYPE = "ETHERNET"; |
| 43 | private static final String TAG = "Ethernet"; |
| 44 | |
| 45 | private AtomicBoolean mTeardownRequested = new AtomicBoolean(false); |
| 46 | private AtomicBoolean mPrivateDnsRouteSet = new AtomicBoolean(false); |
| 47 | private AtomicInteger mDefaultGatewayAddr = new AtomicInteger(0); |
| 48 | private AtomicBoolean mDefaultRouteSet = new AtomicBoolean(false); |
| 49 | |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 50 | private static boolean mLinkUp; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 51 | private InterfaceObserver mInterfaceObserver; |
Doug Zongker | d60ae7f | 2011-11-03 12:45:42 -0700 | [diff] [blame] | 52 | private String mHwAddr; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 53 | |
| 54 | /* For sending events to connectivity service handler */ |
| 55 | private Handler mCsHandler; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 56 | |
| 57 | private static EthernetDataTracker sInstance; |
Mike J. Chen | c96a667 | 2011-06-13 13:19:43 -0700 | [diff] [blame] | 58 | private static String sIfaceMatch = ""; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 59 | private static String mIface = ""; |
| 60 | |
Robert Greenwalt | 198bc11 | 2012-05-07 12:34:26 -0700 | [diff] [blame] | 61 | private INetworkManagementService mNMService; |
| 62 | |
Lorenzo Colitti | df86a9f | 2013-08-20 19:51:30 +0900 | [diff] [blame] | 63 | private static class InterfaceObserver extends BaseNetworkObserver { |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 64 | private EthernetDataTracker mTracker; |
| 65 | |
| 66 | InterfaceObserver(EthernetDataTracker tracker) { |
| 67 | super(); |
| 68 | mTracker = tracker; |
| 69 | } |
| 70 | |
Lorenzo Colitti | df86a9f | 2013-08-20 19:51:30 +0900 | [diff] [blame] | 71 | @Override |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 72 | public void interfaceStatusChanged(String iface, boolean up) { |
| 73 | Log.d(TAG, "Interface status changed: " + iface + (up ? "up" : "down")); |
| 74 | } |
| 75 | |
Lorenzo Colitti | df86a9f | 2013-08-20 19:51:30 +0900 | [diff] [blame] | 76 | @Override |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 77 | public void interfaceLinkStateChanged(String iface, boolean up) { |
Adam Hampson | 6a9d576 | 2012-12-05 10:29:23 -0800 | [diff] [blame] | 78 | if (mIface.equals(iface)) { |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 79 | Log.d(TAG, "Interface " + iface + " link " + (up ? "up" : "down")); |
| 80 | mLinkUp = up; |
Mike Lockwood | efeba01 | 2011-12-15 12:21:26 -0500 | [diff] [blame] | 81 | mTracker.mNetworkInfo.setIsAvailable(up); |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 82 | |
| 83 | // use DHCP |
| 84 | if (up) { |
| 85 | mTracker.reconnect(); |
| 86 | } else { |
Mike J. Chen | 4bcbefd | 2011-09-30 18:05:44 -0700 | [diff] [blame] | 87 | mTracker.disconnect(); |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 88 | } |
| 89 | } |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 90 | } |
| 91 | |
Lorenzo Colitti | df86a9f | 2013-08-20 19:51:30 +0900 | [diff] [blame] | 92 | @Override |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 93 | public void interfaceAdded(String iface) { |
| 94 | mTracker.interfaceAdded(iface); |
| 95 | } |
| 96 | |
Lorenzo Colitti | df86a9f | 2013-08-20 19:51:30 +0900 | [diff] [blame] | 97 | @Override |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 98 | public void interfaceRemoved(String iface) { |
| 99 | mTracker.interfaceRemoved(iface); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | private EthernetDataTracker() { |
| 104 | mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_ETHERNET, 0, NETWORKTYPE, ""); |
| 105 | mLinkProperties = new LinkProperties(); |
| 106 | mLinkCapabilities = new LinkCapabilities(); |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | private void interfaceAdded(String iface) { |
Mike J. Chen | c96a667 | 2011-06-13 13:19:43 -0700 | [diff] [blame] | 110 | if (!iface.matches(sIfaceMatch)) |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 111 | return; |
| 112 | |
| 113 | Log.d(TAG, "Adding " + iface); |
| 114 | |
Mike Lockwood | efeba01 | 2011-12-15 12:21:26 -0500 | [diff] [blame] | 115 | synchronized(this) { |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 116 | if(!mIface.isEmpty()) |
| 117 | return; |
| 118 | mIface = iface; |
| 119 | } |
| 120 | |
Robert Greenwalt | 198bc11 | 2012-05-07 12:34:26 -0700 | [diff] [blame] | 121 | // we don't get link status indications unless the iface is up - bring it up |
| 122 | try { |
| 123 | mNMService.setInterfaceUp(iface); |
| 124 | } catch (Exception e) { |
| 125 | Log.e(TAG, "Error upping interface " + iface + ": " + e); |
| 126 | } |
| 127 | |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 128 | mNetworkInfo.setIsAvailable(true); |
| 129 | Message msg = mCsHandler.obtainMessage(EVENT_CONFIGURATION_CHANGED, mNetworkInfo); |
| 130 | msg.sendToTarget(); |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 131 | } |
| 132 | |
Mike J. Chen | 4bcbefd | 2011-09-30 18:05:44 -0700 | [diff] [blame] | 133 | public void disconnect() { |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 134 | |
| 135 | NetworkUtils.stopDhcp(mIface); |
| 136 | |
| 137 | mLinkProperties.clear(); |
| 138 | mNetworkInfo.setIsAvailable(false); |
Doug Zongker | d60ae7f | 2011-11-03 12:45:42 -0700 | [diff] [blame] | 139 | mNetworkInfo.setDetailedState(DetailedState.DISCONNECTED, null, mHwAddr); |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 140 | |
| 141 | Message msg = mCsHandler.obtainMessage(EVENT_CONFIGURATION_CHANGED, mNetworkInfo); |
| 142 | msg.sendToTarget(); |
| 143 | |
| 144 | msg = mCsHandler.obtainMessage(EVENT_STATE_CHANGED, mNetworkInfo); |
| 145 | msg.sendToTarget(); |
| 146 | |
Mike J. Chen | 4bcbefd | 2011-09-30 18:05:44 -0700 | [diff] [blame] | 147 | IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); |
| 148 | INetworkManagementService service = INetworkManagementService.Stub.asInterface(b); |
| 149 | try { |
| 150 | service.clearInterfaceAddresses(mIface); |
| 151 | } catch (Exception e) { |
| 152 | Log.e(TAG, "Failed to clear addresses or disable ipv6" + e); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | private void interfaceRemoved(String iface) { |
| 157 | if (!iface.equals(mIface)) |
| 158 | return; |
| 159 | |
| 160 | Log.d(TAG, "Removing " + iface); |
Mike Lockwood | efeba01 | 2011-12-15 12:21:26 -0500 | [diff] [blame] | 161 | disconnect(); |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 162 | mIface = ""; |
| 163 | } |
| 164 | |
| 165 | private void runDhcp() { |
| 166 | Thread dhcpThread = new Thread(new Runnable() { |
| 167 | public void run() { |
Robert Greenwalt | 4717c26 | 2012-10-31 14:32:53 -0700 | [diff] [blame] | 168 | DhcpResults dhcpResults = new DhcpResults(); |
| 169 | if (!NetworkUtils.runDhcp(mIface, dhcpResults)) { |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 170 | Log.e(TAG, "DHCP request error:" + NetworkUtils.getDhcpError()); |
| 171 | return; |
| 172 | } |
Robert Greenwalt | 4717c26 | 2012-10-31 14:32:53 -0700 | [diff] [blame] | 173 | mLinkProperties = dhcpResults.linkProperties; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 174 | |
Peter YOON | 0c0f953 | 2013-03-11 14:53:37 +0900 | [diff] [blame] | 175 | mNetworkInfo.setIsAvailable(true); |
Doug Zongker | d60ae7f | 2011-11-03 12:45:42 -0700 | [diff] [blame] | 176 | mNetworkInfo.setDetailedState(DetailedState.CONNECTED, null, mHwAddr); |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 177 | Message msg = mCsHandler.obtainMessage(EVENT_STATE_CHANGED, mNetworkInfo); |
| 178 | msg.sendToTarget(); |
| 179 | } |
| 180 | }); |
| 181 | dhcpThread.start(); |
| 182 | } |
| 183 | |
| 184 | public static synchronized EthernetDataTracker getInstance() { |
| 185 | if (sInstance == null) sInstance = new EthernetDataTracker(); |
| 186 | return sInstance; |
| 187 | } |
| 188 | |
| 189 | public Object Clone() throws CloneNotSupportedException { |
| 190 | throw new CloneNotSupportedException(); |
| 191 | } |
| 192 | |
| 193 | public void setTeardownRequested(boolean isRequested) { |
| 194 | mTeardownRequested.set(isRequested); |
| 195 | } |
| 196 | |
| 197 | public boolean isTeardownRequested() { |
| 198 | return mTeardownRequested.get(); |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Begin monitoring connectivity |
| 203 | */ |
| 204 | public void startMonitoring(Context context, Handler target) { |
| 205 | mContext = context; |
| 206 | mCsHandler = target; |
| 207 | |
| 208 | // register for notifications from NetworkManagement Service |
| 209 | IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); |
Robert Greenwalt | 198bc11 | 2012-05-07 12:34:26 -0700 | [diff] [blame] | 210 | mNMService = INetworkManagementService.Stub.asInterface(b); |
Mike J. Chen | c96a667 | 2011-06-13 13:19:43 -0700 | [diff] [blame] | 211 | |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 212 | mInterfaceObserver = new InterfaceObserver(this); |
| 213 | |
| 214 | // enable and try to connect to an ethernet interface that |
| 215 | // already exists |
Mike J. Chen | c96a667 | 2011-06-13 13:19:43 -0700 | [diff] [blame] | 216 | sIfaceMatch = context.getResources().getString( |
| 217 | com.android.internal.R.string.config_ethernet_iface_regex); |
| 218 | try { |
Robert Greenwalt | 198bc11 | 2012-05-07 12:34:26 -0700 | [diff] [blame] | 219 | final String[] ifaces = mNMService.listInterfaces(); |
Mike J. Chen | c96a667 | 2011-06-13 13:19:43 -0700 | [diff] [blame] | 220 | for (String iface : ifaces) { |
| 221 | if (iface.matches(sIfaceMatch)) { |
| 222 | mIface = iface; |
Robert Greenwalt | 198bc11 | 2012-05-07 12:34:26 -0700 | [diff] [blame] | 223 | mNMService.setInterfaceUp(iface); |
| 224 | InterfaceConfiguration config = mNMService.getInterfaceConfig(iface); |
Vishal Mahaveer | b6b72f5 | 2012-09-11 16:41:16 -0500 | [diff] [blame] | 225 | mLinkUp = config.hasFlag("up"); |
Doug Zongker | d60ae7f | 2011-11-03 12:45:42 -0700 | [diff] [blame] | 226 | if (config != null && mHwAddr == null) { |
Mike Lockwood | efeba01 | 2011-12-15 12:21:26 -0500 | [diff] [blame] | 227 | mHwAddr = config.getHardwareAddress(); |
Doug Zongker | d60ae7f | 2011-11-03 12:45:42 -0700 | [diff] [blame] | 228 | if (mHwAddr != null) { |
| 229 | mNetworkInfo.setExtraInfo(mHwAddr); |
| 230 | } |
| 231 | } |
Jason Simmons | 1d28fef | 2012-06-14 11:16:14 -0700 | [diff] [blame] | 232 | |
| 233 | // if a DHCP client had previously been started for this interface, then stop it |
| 234 | NetworkUtils.stopDhcp(mIface); |
| 235 | |
Mike J. Chen | c96a667 | 2011-06-13 13:19:43 -0700 | [diff] [blame] | 236 | reconnect(); |
| 237 | break; |
| 238 | } |
| 239 | } |
| 240 | } catch (RemoteException e) { |
| 241 | Log.e(TAG, "Could not get list of interfaces " + e); |
| 242 | } |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 243 | |
| 244 | try { |
Robert Greenwalt | 198bc11 | 2012-05-07 12:34:26 -0700 | [diff] [blame] | 245 | mNMService.registerObserver(mInterfaceObserver); |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 246 | } catch (RemoteException e) { |
| 247 | Log.e(TAG, "Could not register InterfaceObserver " + e); |
| 248 | } |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Disable connectivity to a network |
| 253 | * TODO: do away with return value after making MobileDataStateTracker async |
| 254 | */ |
| 255 | public boolean teardown() { |
| 256 | mTeardownRequested.set(true); |
| 257 | NetworkUtils.stopDhcp(mIface); |
| 258 | return true; |
| 259 | } |
| 260 | |
| 261 | /** |
| 262 | * Re-enable connectivity to a network after a {@link #teardown()}. |
| 263 | */ |
| 264 | public boolean reconnect() { |
Mike Lockwood | efeba01 | 2011-12-15 12:21:26 -0500 | [diff] [blame] | 265 | if (mLinkUp) { |
| 266 | mTeardownRequested.set(false); |
| 267 | runDhcp(); |
| 268 | } |
| 269 | return mLinkUp; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 270 | } |
| 271 | |
Irfan Sheriff | da6da09 | 2012-08-16 12:49:23 -0700 | [diff] [blame] | 272 | @Override |
Wink Saville | d747cbc | 2013-08-07 16:22:47 -0700 | [diff] [blame] | 273 | public void captivePortalCheckCompleted(boolean isCaptivePortal) { |
| 274 | // not implemented |
| 275 | } |
| 276 | |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 277 | /** |
| 278 | * Turn the wireless radio off for a network. |
| 279 | * @param turnOn {@code true} to turn the radio on, {@code false} |
| 280 | */ |
| 281 | public boolean setRadio(boolean turnOn) { |
| 282 | return true; |
| 283 | } |
| 284 | |
| 285 | /** |
| 286 | * @return true - If are we currently tethered with another device. |
| 287 | */ |
| 288 | public synchronized boolean isAvailable() { |
| 289 | return mNetworkInfo.isAvailable(); |
| 290 | } |
| 291 | |
| 292 | /** |
| 293 | * Tells the underlying networking system that the caller wants to |
| 294 | * begin using the named feature. The interpretation of {@code feature} |
| 295 | * is completely up to each networking implementation. |
| 296 | * @param feature the name of the feature to be used |
| 297 | * @param callingPid the process ID of the process that is issuing this request |
| 298 | * @param callingUid the user ID of the process that is issuing this request |
| 299 | * @return an integer value representing the outcome of the request. |
| 300 | * The interpretation of this value is specific to each networking |
| 301 | * implementation+feature combination, except that the value {@code -1} |
| 302 | * always indicates failure. |
| 303 | * TODO: needs to go away |
| 304 | */ |
| 305 | public int startUsingNetworkFeature(String feature, int callingPid, int callingUid) { |
| 306 | return -1; |
| 307 | } |
| 308 | |
| 309 | /** |
| 310 | * Tells the underlying networking system that the caller is finished |
| 311 | * using the named feature. The interpretation of {@code feature} |
| 312 | * is completely up to each networking implementation. |
| 313 | * @param feature the name of the feature that is no longer needed. |
| 314 | * @param callingPid the process ID of the process that is issuing this request |
| 315 | * @param callingUid the user ID of the process that is issuing this request |
| 316 | * @return an integer value representing the outcome of the request. |
| 317 | * The interpretation of this value is specific to each networking |
| 318 | * implementation+feature combination, except that the value {@code -1} |
| 319 | * always indicates failure. |
| 320 | * TODO: needs to go away |
| 321 | */ |
| 322 | public int stopUsingNetworkFeature(String feature, int callingPid, int callingUid) { |
| 323 | return -1; |
| 324 | } |
| 325 | |
Jeff Sharkey | 8e28b7d | 2011-08-19 02:24:24 -0700 | [diff] [blame] | 326 | @Override |
| 327 | public void setUserDataEnable(boolean enabled) { |
| 328 | Log.w(TAG, "ignoring setUserDataEnable(" + enabled + ")"); |
| 329 | } |
| 330 | |
| 331 | @Override |
| 332 | public void setPolicyDataEnable(boolean enabled) { |
| 333 | Log.w(TAG, "ignoring setPolicyDataEnable(" + enabled + ")"); |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 334 | } |
| 335 | |
| 336 | /** |
| 337 | * Check if private DNS route is set for the network |
| 338 | */ |
| 339 | public boolean isPrivateDnsRouteSet() { |
| 340 | return mPrivateDnsRouteSet.get(); |
| 341 | } |
| 342 | |
| 343 | /** |
| 344 | * Set a flag indicating private DNS route is set |
| 345 | */ |
| 346 | public void privateDnsRouteSet(boolean enabled) { |
| 347 | mPrivateDnsRouteSet.set(enabled); |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * Fetch NetworkInfo for the network |
| 352 | */ |
| 353 | public synchronized NetworkInfo getNetworkInfo() { |
| 354 | return mNetworkInfo; |
| 355 | } |
| 356 | |
| 357 | /** |
| 358 | * Fetch LinkProperties for the network |
| 359 | */ |
| 360 | public synchronized LinkProperties getLinkProperties() { |
| 361 | return new LinkProperties(mLinkProperties); |
| 362 | } |
| 363 | |
| 364 | /** |
| 365 | * A capability is an Integer/String pair, the capabilities |
| 366 | * are defined in the class LinkSocket#Key. |
| 367 | * |
| 368 | * @return a copy of this connections capabilities, may be empty but never null. |
| 369 | */ |
| 370 | public LinkCapabilities getLinkCapabilities() { |
| 371 | return new LinkCapabilities(mLinkCapabilities); |
| 372 | } |
| 373 | |
| 374 | /** |
| 375 | * Fetch default gateway address for the network |
| 376 | */ |
| 377 | public int getDefaultGatewayAddr() { |
| 378 | return mDefaultGatewayAddr.get(); |
| 379 | } |
| 380 | |
| 381 | /** |
| 382 | * Check if default route is set |
| 383 | */ |
| 384 | public boolean isDefaultRouteSet() { |
| 385 | return mDefaultRouteSet.get(); |
| 386 | } |
| 387 | |
| 388 | /** |
| 389 | * Set a flag indicating default route is set for the network |
| 390 | */ |
| 391 | public void defaultRouteSet(boolean enabled) { |
| 392 | mDefaultRouteSet.set(enabled); |
| 393 | } |
| 394 | |
| 395 | /** |
| 396 | * Return the system properties name associated with the tcp buffer sizes |
| 397 | * for this network. |
| 398 | */ |
| 399 | public String getTcpBufferSizesPropName() { |
Jianzheng Zhou | a363a10 | 2013-11-15 13:32:23 +0800 | [diff] [blame] | 400 | return "net.tcp.buffersize.ethernet"; |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 401 | } |
Robert Greenwalt | af6eddb | 2011-04-07 15:44:10 -0700 | [diff] [blame] | 402 | |
| 403 | public void setDependencyMet(boolean met) { |
| 404 | // not supported on this network |
| 405 | } |
Lorenzo Colitti | 69edd64 | 2013-03-07 11:01:12 -0800 | [diff] [blame] | 406 | |
| 407 | @Override |
| 408 | public void addStackedLink(LinkProperties link) { |
| 409 | mLinkProperties.addStackedLink(link); |
| 410 | } |
| 411 | |
| 412 | @Override |
| 413 | public void removeStackedLink(LinkProperties link) { |
| 414 | mLinkProperties.removeStackedLink(link); |
| 415 | } |
Robert Greenwalt | 665e1ae | 2012-08-21 19:27:00 -0700 | [diff] [blame] | 416 | |
| 417 | @Override |
| 418 | public void supplyMessenger(Messenger messenger) { |
| 419 | // not supported on this network |
| 420 | } |
Benoit Goby | 1997069 | 2010-12-22 14:29:40 -0800 | [diff] [blame] | 421 | } |