Lines Matching refs:uid
205 uint32_t NetworkController::getNetworkForDnsLocked(unsigned* netId, uid_t uid) const { in getNetworkForDnsLocked()
215 if (*netId == NETID_UNSET && getVirtualNetworkForUserLocked(uid) == nullptr) { in getNetworkForDnsLocked()
222 if (checkUserNetworkAccessLocked(uid, *netId) == 0) { in getNetworkForDnsLocked()
240 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForDnsLocked()
255 unsigned NetworkController::getNetworkForUser(uid_t uid) const { in getNetworkForUser()
257 if (VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid)) { in getNetworkForUser()
277 unsigned NetworkController::getNetworkForConnectLocked(uid_t uid) const { in getNetworkForConnectLocked()
278 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in getNetworkForConnectLocked()
285 unsigned NetworkController::getNetworkForConnect(uid_t uid) const { in getNetworkForConnect()
287 return getNetworkForConnectLocked(uid); in getNetworkForConnect()
291 unsigned netId, uid_t uid, struct android_net_context* netcontext) const { in getNetworkContext() argument
299 .uid = uid, in getNetworkContext()
317 nc.app_netid = getNetworkForConnectLocked(uid); in getNetworkContext()
323 fwmark.protectedFromVpn = explicitlySelected && canProtectLocked(uid); in getNetworkContext()
324 fwmark.permission = getPermissionForUserLocked(uid); in getNetworkContext()
327 nc.dns_mark = getNetworkForDnsLocked(&(nc.dns_netid), uid); in getNetworkContext()
331 nc.app_netid, nc.app_mark, nc.dns_netid, nc.dns_mark, uid); in getNetworkContext()
538 Permission NetworkController::getPermissionForUser(uid_t uid) const { in getPermissionForUser()
540 return getPermissionForUserLocked(uid); in getPermissionForUser()
546 for (uid_t uid : uids) { in setPermissionForUsers() local
547 mUsers[uid] = permission; in setPermissionForUsers()
551 int NetworkController::checkUserNetworkAccess(uid_t uid, unsigned netId) const { in checkUserNetworkAccess() argument
553 return checkUserNetworkAccessLocked(uid, netId); in checkUserNetworkAccess()
613 const char* nexthop, bool legacy, uid_t uid, int mtu) { in addRoute() argument
614 return modifyRoute(netId, interface, destination, nexthop, ROUTE_ADD, legacy, uid, mtu); in addRoute()
618 const char* nexthop, bool legacy, uid_t uid, int mtu) { in updateRoute() argument
619 return modifyRoute(netId, interface, destination, nexthop, ROUTE_UPDATE, legacy, uid, mtu); in updateRoute()
623 const char* nexthop, bool legacy, uid_t uid) { in removeRoute() argument
624 return modifyRoute(netId, interface, destination, nexthop, ROUTE_REMOVE, legacy, uid, 0); in removeRoute()
675 bool NetworkController::canProtectLocked(uid_t uid) const { in canProtectLocked()
676 return ((getPermissionForUserLocked(uid) & PERMISSION_SYSTEM) == PERMISSION_SYSTEM) || in canProtectLocked()
677 mProtectableUsers.find(uid) != mProtectableUsers.end(); in canProtectLocked()
680 bool NetworkController::canProtect(uid_t uid) const { in canProtect()
682 return canProtectLocked(uid); in canProtect()
692 for (uid_t uid : uids) { in denyProtect() local
693 mProtectableUsers.erase(uid); in denyProtect()
753 VirtualNetwork* NetworkController::getVirtualNetworkForUserLocked(uid_t uid) const { in getVirtualNetworkForUserLocked()
757 if (virtualNetwork->appliesToUser(uid)) { in getVirtualNetworkForUserLocked()
765 Permission NetworkController::getPermissionForUserLocked(uid_t uid) const { in getPermissionForUserLocked()
766 auto iter = mUsers.find(uid); in getPermissionForUserLocked()
770 return uid < FIRST_APPLICATION_UID ? PERMISSION_SYSTEM : PERMISSION_NONE; in getPermissionForUserLocked()
773 int NetworkController::checkUserNetworkAccessLocked(uid_t uid, unsigned netId) const { in checkUserNetworkAccessLocked() argument
781 if (uid == INVALID_UID) { in checkUserNetworkAccessLocked()
784 Permission userPermission = getPermissionForUserLocked(uid); in checkUserNetworkAccessLocked()
789 return static_cast<VirtualNetwork*>(network)->appliesToUser(uid) ? 0 : -EPERM; in checkUserNetworkAccessLocked()
791 VirtualNetwork* virtualNetwork = getVirtualNetworkForUserLocked(uid); in checkUserNetworkAccessLocked()
793 mProtectableUsers.find(uid) == mProtectableUsers.end()) { in checkUserNetworkAccessLocked()
802 uid_t uid, int mtu) { in modifyRoute() argument
823 if ((getPermissionForUserLocked(uid) & PERMISSION_SYSTEM) == PERMISSION_SYSTEM) { in modifyRoute()