diff options
author | Sreeram Ramachandran <sreeram@google.com> | 2014-07-11 16:27:02 -0700 |
---|---|---|
committer | Sreeram Ramachandran <sreeram@google.com> | 2014-07-11 16:27:02 -0700 |
commit | a69d9472ac48d4e09f049fb740e60b7217e03861 (patch) | |
tree | 40f5ac5b38453441311390ade90498a919fed46e /include/NetdClient.h | |
parent | 335f2936156ca7b3b4d0a64446dc7545492f0476 (diff) | |
download | android_system_netd-a69d9472ac48d4e09f049fb740e60b7217e03861.tar.gz android_system_netd-a69d9472ac48d4e09f049fb740e60b7217e03861.tar.bz2 android_system_netd-a69d9472ac48d4e09f049fb740e60b7217e03861.zip |
Introduce a SELECT_FOR_USER fwmarkd command.
This lets SYSTEM apps mark a socket with the network that would apply to an
arbitrary UID. I.e., either the VPN that applies to that user, or the default
network, if there's no such VPN.
This command will be used by system apps that proxy stuff for a user, so that
they can route the same way that user would have. Examples of such system apps
are the DnsProxyListener, MediaServer and DownloadManager.
The "explicit" bit is NOT set, so that if the user's VPN is a split tunnel, the
route lookup will fall-through to the default network as desired.
The "protect" bit is set, so that the socket bypasses any VPN applicable to the
system app itself. Note that even if the uid being proxied for is also subject
to the same VPN, this still works because the relevant rule doesn't care about
the protected bit (see modifyVpnSystemPermissionRule() in RouteController.cpp).
Change-Id: I4d501e5214b127f4ae9eaeb7befb1751cd102308
Diffstat (limited to 'include/NetdClient.h')
-rw-r--r-- | include/NetdClient.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/NetdClient.h b/include/NetdClient.h index 742902fe..71529a34 100644 --- a/include/NetdClient.h +++ b/include/NetdClient.h @@ -19,6 +19,7 @@ #include <stdbool.h> #include <sys/cdefs.h> +#include <sys/types.h> __BEGIN_DECLS @@ -34,6 +35,8 @@ int setNetworkForResolv(unsigned netId); int protectFromVpn(int socketFd); +int setNetworkForUser(uid_t uid, int socketFd); + __END_DECLS #endif // NETD_INCLUDE_NETD_CLIENT_H |