Lines Matching refs:interface
30 [[nodiscard]] int addToDefault(unsigned netId, const std::string& interface, Permission permission, in addToDefault() argument
32 if (int ret = RouteController::addInterfaceToDefaultNetwork(interface.c_str(), permission)) { in addToDefault()
33 ALOGE("failed to add interface %s to default netId %u", interface.c_str(), netId); in addToDefault()
36 if (int ret = delegate->addFallthrough(interface, permission)) { in addToDefault()
42 [[nodiscard]] int removeFromDefault(unsigned netId, const std::string& interface, in removeFromDefault() argument
44 if (int ret = RouteController::removeInterfaceFromDefaultNetwork(interface.c_str(), in removeFromDefault()
46 ALOGE("failed to remove interface %s from default netId %u", interface.c_str(), netId); in removeFromDefault()
49 if (int ret = delegate->removeFallthrough(interface, permission)) { in removeFromDefault()
86 void PhysicalNetwork::invalidateRouteCache(const std::string& interface) { in invalidateRouteCache() argument
91 (void)RouteController::addRoute(interface.c_str(), dst, "throw", RouteController::INTERFACE, in invalidateRouteCache()
93 (void) RouteController::removeRoute(interface.c_str(), dst, "throw", in invalidateRouteCache()
108 for (const std::string& interface : mInterfaces) { in setPermission() local
109 if (int ret = RouteController::modifyPhysicalNetworkPermission(mNetId, interface.c_str(), in setPermission()
112 interface.c_str(), mNetId, mPermission, permission); in setPermission()
115 invalidateRouteCache(interface); in setPermission()
118 for (const std::string& interface : mInterfaces) { in setPermission() local
119 if (int ret = addToDefault(mNetId, interface, permission, mDelegate)) { in setPermission()
122 if (int ret = removeFromDefault(mNetId, interface, mPermission, mDelegate)) { in setPermission()
139 for (const std::string& interface : mInterfaces) { in addAsDefault() local
140 if (int ret = addToDefault(mNetId, interface, mPermission, mDelegate)) { in addAsDefault()
152 for (const std::string& interface : mInterfaces) { in removeAsDefault() local
153 if (int ret = removeFromDefault(mNetId, interface, mPermission, mDelegate)) { in removeAsDefault()
166 for (const std::string& interface : mInterfaces) { in addUsers() local
167 int ret = RouteController::addUsersToPhysicalNetwork(mNetId, interface.c_str(), in addUsers()
170 ALOGE("failed to add users on interface %s of netId %u", interface.c_str(), mNetId); in addUsers()
181 for (const std::string& interface : mInterfaces) { in removeUsers() local
182 int ret = RouteController::removeUsersFromPhysicalNetwork(mNetId, interface.c_str(), in removeUsers()
185 ALOGE("failed to remove users on interface %s of netId %u", interface.c_str(), mNetId); in removeUsers()
193 int PhysicalNetwork::addInterface(const std::string& interface) { in addInterface() argument
194 if (hasInterface(interface)) { in addInterface()
197 if (int ret = RouteController::addInterfaceToPhysicalNetwork(mNetId, interface.c_str(), in addInterface()
199 ALOGE("failed to add interface %s to netId %u", interface.c_str(), mNetId); in addInterface()
203 if (int ret = addToDefault(mNetId, interface, mPermission, mDelegate)) { in addInterface()
207 mInterfaces.insert(interface); in addInterface()
211 int PhysicalNetwork::removeInterface(const std::string& interface) { in removeInterface() argument
212 if (!hasInterface(interface)) { in removeInterface()
216 if (int ret = removeFromDefault(mNetId, interface, mPermission, mDelegate)) { in removeInterface()
224 if (int ret = RouteController::removeInterfaceFromPhysicalNetwork(mNetId, interface.c_str(), in removeInterface()
226 ALOGE("failed to remove interface %s from netId %u", interface.c_str(), mNetId); in removeInterface()
229 mInterfaces.erase(interface); in removeInterface()