Implement network default set/clear.
(cherry picked from commit 4cc7df247a7ec67da3b5edfb9356077fbbf0150c)
Change-Id: Ib35d54816884c6a6ba28231c9b1f54e362d1d16a
diff --git a/NetworkController.h b/NetworkController.h
index 1063f92..e113bf5 100644
--- a/NetworkController.h
+++ b/NetworkController.h
@@ -51,7 +51,7 @@
void clearNetworkPreference();
unsigned getDefaultNetwork() const;
- void setDefaultNetwork(unsigned netId);
+ bool setDefaultNetwork(unsigned netId);
void setNetworkForPid(int pid, unsigned netId);
bool setNetworkForUidRange(int uid_start, int uid_end, unsigned netId, bool forward_dns);
bool clearNetworkForUidRange(int uid_start, int uid_end, unsigned netId);
@@ -91,6 +91,12 @@
PermissionsController* const mPermissionsController;
RouteController* const mRouteController;
+ // Maps a netId to all its interfaces.
+ //
+ // We need to know interface names to configure incoming packet marking and because routing
+ // tables are associated with interfaces and not with netIds.
+ //
+ // An interface may belong to at most one netId, but a netId may have multiple interfaces.
std::multimap<unsigned, std::string> mNetIdToInterfaces;
};