Lines Matching refs:uid

125             ALOGE("Failed to delete data(uid=%u): %s\n", key, strerror(res.code()));
284 int TrafficController::tagSocket(int sockFd, uint32_t tag, uid_t uid) {
286 if (legacy_tagSocket(sockFd, tag, uid)) return -errno;
292 UidTag newKey = {.uid = (uint32_t)uid, .tag = tag};
322 int TrafficController::setCounterSet(int counterSetNum, uid_t uid) {
326 if (legacy_setCounterSet(counterSetNum, uid)) return -errno;
330 // The default counter set for all uid is 0, so deleting the current counterset for that uid
333 Status res = mUidCounterSetMap.deleteValue(uid);
342 res = mUidCounterSetMap.writeValue(uid, tmpCounterSetNum, BPF_ANY);
351 int TrafficController::deleteTagData(uint32_t tag, uid_t uid) {
354 if (legacy_deleteTagData(tag, uid)) return -errno;
358 // First we go through the cookieTagMap to delete the target uid tag combination. Or delete all
359 // the tags related to the uid if the tag is 0.
360 const auto deleteMatchedCookieEntries = [uid, tag](const uint64_t& key, const UidTag& value,
362 if (value.uid == uid && (value.tag == tag || tag == 0)) {
373 // Now we go through the Tag stats map and delete the data entry with correct uid and tag
374 // combination. Or all tag stats under that uid if the target tag is 0.
375 const auto deleteMatchedUidTagEntries = [uid, tag](const StatsKey& key,
377 if (key.uid == uid && (key.tag == tag || tag == 0)) {
383 ALOGE("Failed to delete data(uid=%u, tag=%u): %s\n", key.uid, key.tag,
393 Status res = mUidCounterSetMap.deleteValue(uid);
395 ALOGE("Failed to delete counterSet data(uid=%u, tag=%u): %s\n", uid, tag,
400 auto deleteAppUidStatsEntry = [uid](const uint32_t& key, BpfMap<uint32_t, StatsValue>& map) {
401 if (key == uid) {
406 ALOGE("Failed to delete data(uid=%u): %s", key, strerror(res.code()));
432 Status TrafficController::updateOwnerMapEntry(BpfMap<uint32_t, uint8_t>& map, uid_t uid,
434 if (uid == UID_MAP_ENABLED) {
435 return statusFromErrno(-EINVAL, "This uid is reserved for map state");
440 RETURN_IF_NOT_OK(map.writeValue(uid, flag, BPF_ANY));
442 RETURN_IF_NOT_OK(map.deleteValue(uid));
450 int TrafficController::changeUidOwnerRule(ChildChain chain, uid_t uid, FirewallRule rule,
460 res = updateOwnerMapEntry(mDozableUidMap, uid, rule, type);
463 res = updateOwnerMapEntry(mStandbyUidMap, uid, rule, type);
466 res = updateOwnerMapEntry(mPowerSaveUidMap, uid, rule, type);
473 ALOGE("change uid(%u) rule of %d failed: %s, rule: %d, type: %d", uid, chain,
494 for(auto uid : uidsToDelete) {
495 RETURN_IF_NOT_OK(map.deleteValue(uid));
498 for (auto uid : uids) {
499 RETURN_IF_NOT_OK(updateOwnerMapEntry(map, uid, rule, type));
646 dw.println("cookie=%" PRIu64 " tag=0x%x uid=%u", key, value.tag, value.uid);
667 std::string appUidStatsHeader = StringPrintf("uid rxBytes rxPackets txBytes txPackets");
692 ifname.value().name, key.tag, key.uid, key.counterSet, value.rxBytes,
740 // Print owner match uid maps