Lines Matching refs:network
181 Network* network = getNetworkLocked(netId); in setDefaultNetwork() local
182 if (!network) { in setDefaultNetwork()
186 if (!network->isPhysical()) { in setDefaultNetwork()
190 if (int ret = static_cast<PhysicalNetwork*>(network)->addAsDefault()) { in setDefaultNetwork()
196 Network* network = getNetworkLocked(mDefaultNetId); in setDefaultNetwork() local
197 if (!network || !network->isPhysical()) { in setDefaultNetwork()
201 if (int ret = static_cast<PhysicalNetwork*>(network)->removeAsDefault()) { in setDefaultNetwork()
239 Network *network = getNetworkLocked(*netId); in getNetworkForDnsLocked() local
240 if (network && network->isVirtual() && !resolv_has_nameservers(*netId)) { in getNetworkForDnsLocked()
269 if (Network* network = getPhysicalOrUnreachableNetworkForUserLocked(uid)) { in getNetworkForUser() local
270 return network->getNetId(); in getNetworkForUser()
302 if (Network* network = getPhysicalOrUnreachableNetworkForUserLocked(uid)) { in getNetworkForConnectLocked() local
303 return network->getNetId(); in getNetworkForConnectLocked()
395 Network* network = getNetworkLocked(netId); in isVirtualNetworkLocked() local
396 return network && network->isVirtual(); in isVirtualNetworkLocked()
497 Network* network = getNetworkLocked(netId); in destroyNetwork() local
502 int ret = network->clearInterfaces(); in destroyNetwork()
505 if (int err = static_cast<PhysicalNetwork*>(network)->removeAsDefault()) { in destroyNetwork()
512 } else if (network->isVirtual()) { in destroyNetwork()
520 delete network; in destroyNetwork()
603 Network* network = getNetworkLocked(netId); in setPermissionForNetworks() local
604 if (!network) { in setPermissionForNetworks()
608 if (!network->isPhysical()) { in setPermissionForNetworks()
613 if (int ret = static_cast<PhysicalNetwork*>(network)->setPermission(permission)) { in setPermissionForNetworks()
622 int isWrongNetworkForUidRanges(unsigned netId, Network* network) { in isWrongNetworkForUidRanges() argument
623 if (!network) { in isWrongNetworkForUidRanges()
627 if (!network->canAddUsers()) { in isWrongNetworkForUidRanges()
628 ALOGE("cannot add/remove users to/from %s network %u", network->getTypeString().c_str(), in isWrongNetworkForUidRanges()
640 Network* network = getNetworkLocked(netId); in addUsersToNetwork() local
641 if (int ret = isWrongNetworkForUidRanges(netId, network)) { in addUsersToNetwork()
644 return network->addUsers(uidRanges, subPriority); in addUsersToNetwork()
650 Network* network = getNetworkLocked(netId); in removeUsersFromNetwork() local
651 if (int ret = isWrongNetworkForUidRanges(netId, network)) { in removeUsersFromNetwork()
654 return network->removeUsers(uidRanges, subPriority); in removeUsersFromNetwork()
760 Network* network = i.second; in dump() local
761 dw.println(network->toString()); in dump()
762 if (network->isPhysical()) { in dump()
764 Permission permission = reinterpret_cast<PhysicalNetwork*>(network)->getPermission(); in dump()
768 if (const auto& str = network->uidRangesToString(); !str.empty()) { in dump()
773 if (const auto& str = network->allowedUidsToString(); !str.empty()) { in dump()
827 for (const auto& [_, network] : mNetworks) { in clearAllowedUidsForAllNetworksLocked()
828 network->clearAllowedUids(); in clearAllowedUidsForAllNetworksLocked()
837 Network* network = getNetworkLocked(config.netId); in setNetworkAllowlist() local
838 if (!network) return -ENONET; in setNetworkAllowlist()
843 Network* network = getNetworkLocked(config.netId); in setNetworkAllowlist() local
844 network->setAllowedUids(UidRanges(config.uidRanges)); in setNetworkAllowlist()
851 Network* network = getNetworkLocked(netId); in isUidAllowed() local
857 return network && network->isUidAllowed(uid); in isUidAllowed()
871 for (const auto& [_, network] : mNetworks) { in getVirtualNetworkForUserLocked()
872 if (network->isVirtual() && network->appliesToUser(uid, &subPriority)) { in getVirtualNetworkForUserLocked()
873 return static_cast<VirtualNetwork*>(network); in getVirtualNetworkForUserLocked()
893 for (const auto& [netId, network] : mNetworks) { in getPhysicalOrUnreachableNetworkForUserLocked()
895 if (!network->isPhysical() && !network->isUnreachable()) continue; in getPhysicalOrUnreachableNetworkForUserLocked()
896 if (!network->appliesToUser(uid, &subPriority)) continue; in getPhysicalOrUnreachableNetworkForUserLocked()
900 bestNetwork = network; in getPhysicalOrUnreachableNetworkForUserLocked()
916 Network* network = getNetworkLocked(netId); in checkUserNetworkAccessLocked() local
917 if (!network) { in checkUserNetworkAccessLocked()
933 if (network->isVirtual()) { in checkUserNetworkAccessLocked()
934 return network->appliesToUser(uid, &subPriority) ? 0 : -EPERM; in checkUserNetworkAccessLocked()
945 if (network->isPhysical() && network->appliesToUser(uid, &subPriority)) { in checkUserNetworkAccessLocked()
949 if (network->isUnreachable()) { in checkUserNetworkAccessLocked()
950 return network->appliesToUser(uid, &subPriority) ? 0 : -EPERM; in checkUserNetworkAccessLocked()
953 if (!network->isUidAllowed(uid)) { in checkUserNetworkAccessLocked()
959 const Permission networkPermission = network->getPermission(); in checkUserNetworkAccessLocked()
1012 Network* network = getNetworkLocked(mDefaultNetId); in modifyFallthroughLocked() local
1013 if (!network) { in modifyFallthroughLocked()
1017 if (!network->isPhysical()) { in modifyFallthroughLocked()
1021 Permission permission = static_cast<PhysicalNetwork*>(network)->getPermission(); in modifyFallthroughLocked()
1022 for (const auto& physicalInterface : network->getInterfaces()) { in modifyFallthroughLocked()
1034 const auto& network = entry.second; in updateTcpSocketMonitorPolling() local
1035 if (network->isPhysical() && network->getNetId() >= MIN_NET_ID) { in updateTcpSocketMonitorPolling()