diff options
author | Chad Brubaker <cbrubaker@google.com> | 2013-06-12 13:37:30 -0700 |
---|---|---|
committer | Chad Brubaker <cbrubaker@google.com> | 2013-06-12 15:14:23 -0700 |
commit | 3277620a69b6b9f27126f0b2651ea4293731cd09 (patch) | |
tree | 46fd3228966519a68d074706a7883b107100774f /services/java/com/android/server/NetworkManagementService.java | |
parent | aa660a04a7691850bb4e418f9d17e8ea44c3d8e0 (diff) | |
download | frameworks_base-3277620a69b6b9f27126f0b2651ea4293731cd09.zip frameworks_base-3277620a69b6b9f27126f0b2651ea4293731cd09.tar.gz frameworks_base-3277620a69b6b9f27126f0b2651ea4293731cd09.tar.bz2 |
Add NetworkManagement methods for netd uid binds
Add methods to NetworkManagementService for per uid routing and DNS and
for setting up fwmark tables for interfaces.
Change-Id: Icf2c4a46f7f422660031ef73b537745922286246
Diffstat (limited to 'services/java/com/android/server/NetworkManagementService.java')
-rw-r--r-- | services/java/com/android/server/NetworkManagementService.java | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java index 1622f0f..209df04 100644 --- a/services/java/com/android/server/NetworkManagementService.java +++ b/services/java/com/android/server/NetworkManagementService.java @@ -1378,6 +1378,79 @@ public class NetworkManagementService extends INetworkManagementService.Stub } @Override + public void setUidRangeRoute(String iface, int uid_start, int uid_end) { + mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); + try { + mConnector.execute("interface", "route", + "uid", "add", iface, uid_start, uid_end); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + @Override + public void clearUidRangeRoute(String iface, int uid_start, int uid_end) { + mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); + try { + mConnector.execute("interface", "route", + "uid", "remove", iface, uid_start, uid_end); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + @Override + public void setMarkedForwarding(String iface) { + mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); + try { + mConnector.execute("interface", "route", "fwmark", "add", iface); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + @Override + public void clearMarkedForwarding(String iface) { + mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); + try { + mConnector.execute("interface", "route", "fwmark", "remove", iface); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + @Override + public void setDnsInterfaceForUidRange(String iface, int uid_start, int uid_end) { + mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); + try { + mConnector.execute("resolver", "setifaceforuidrange", iface, uid_start, uid_end); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + @Override + public void clearDnsInterfaceForUidRange(int uid_start, int uid_end) { + mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); + try { + mConnector.execute("resolver", "clearifaceforuidrange", uid_start, uid_end); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + @Override + public void clearDnsInterfaceMaps() { + mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); + try { + mConnector.execute("resolver", "clearifacemapping"); + } catch (NativeDaemonConnectorException e) { + throw e.rethrowAsParcelableException(); + } + } + + + @Override public void flushDefaultDnsCache() { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); try { |