Server API to only allow networking by VPN apps
Secure virtual networks already create rules to route all traffic into
theirselves. This depends on the secure network already existing.
API creates an ip rule at a priority level below SECURE_VPN which
can catch traffic before VPN comes up, if it is a requirement that no
traffic ever leaves without first going through VPN.
Bug: 26694104
Bug: 26354134
Change-Id: If23df0760c6eb0ad137fc26c5124e48edf23b722
diff --git a/server/RouteController.h b/server/RouteController.h
index 0694ea2..f1affe3 100644
--- a/server/RouteController.h
+++ b/server/RouteController.h
@@ -61,6 +61,11 @@
static int removeUsersFromVirtualNetwork(unsigned netId, const char* interface, bool secure,
const UidRanges& uidRanges) WARN_UNUSED_RESULT;
+ static int addUsersToRejectNonSecureNetworkRule(const UidRanges& uidRanges)
+ WARN_UNUSED_RESULT;
+ static int removeUsersFromRejectNonSecureNetworkRule(const UidRanges& uidRanges)
+ WARN_UNUSED_RESULT;
+
static int addInterfaceToDefaultNetwork(const char* interface,
Permission permission) WARN_UNUSED_RESULT;
static int removeInterfaceFromDefaultNetwork(const char* interface,