Lines Matching refs:uidRanges
616 std::vector<UidRangeParcel>&& uidRanges, in makeNativeUidRangeConfig() argument
620 res.uidRanges = uidRanges; in makeNativeUidRangeConfig()
658 std::vector<UidRangeParcel> uidRanges = {makeUidRangeParcel(BASE_UID + 8005, BASE_UID + 8012), in TEST_F() local
663 EXPECT_TRUE(mNetd->networkAddUidRanges(TEST_NETID1, uidRanges).isOk()); in TEST_F()
665 EXPECT_TRUE(ipRuleExistsForRange(RULE_PRIORITY_SECURE_VPN, uidRanges[0], action)); in TEST_F()
667 EXPECT_TRUE(mNetd->networkRemoveUidRanges(TEST_NETID1, uidRanges).isOk()); in TEST_F()
668 EXPECT_FALSE(ipRuleExistsForRange(RULE_PRIORITY_SECURE_VPN, uidRanges[0], action)); in TEST_F()
670 EXPECT_TRUE(mNetd->networkAddUidRanges(TEST_NETID1, uidRanges).isOk()); in TEST_F()
671 EXPECT_TRUE(ipRuleExistsForRange(RULE_PRIORITY_SECURE_VPN, uidRanges[1], action)); in TEST_F()
673 EXPECT_FALSE(ipRuleExistsForRange(RULE_PRIORITY_SECURE_VPN, uidRanges[1], action)); in TEST_F()
679 std::vector<UidRangeParcel> uidRanges = {makeUidRangeParcel(BASE_UID + 150, BASE_UID + 224), in TEST_F() local
682 for (auto const& range : uidRanges) { in TEST_F()
686 ASSERT_TRUE(mNetd->networkRejectNonSecureVpn(true, uidRanges).isOk()); in TEST_F()
687 for (auto const& range : uidRanges) { in TEST_F()
692 ASSERT_TRUE(mNetd->networkRejectNonSecureVpn(false, uidRanges).isOk()); in TEST_F()
693 for (auto const& range : uidRanges) { in TEST_F()
698 binder::Status status = mNetd->networkRejectNonSecureVpn(false, uidRanges); in TEST_F()
759 std::vector<UidRangeParcel> uidRanges = { in TEST_F() local
769 EXPECT_TRUE(mNetd->socketDestroy(uidRanges, skipUids).isOk()); in TEST_F()
773 uidRanges = { in TEST_F()
782 EXPECT_TRUE(mNetd->socketDestroy(uidRanges, skipUids).isOk()); in TEST_F()
787 EXPECT_TRUE(mNetd->socketDestroy(uidRanges, skipUids).isOk()); in TEST_F()
3978 void verifyAppUidRules(std::vector<bool>&& expectedResults, std::vector<UidRangeParcel>& uidRanges, in verifyAppUidRules() argument
3980 ASSERT_EQ(expectedResults.size(), uidRanges.size()); in verifyAppUidRules()
3983 for (unsigned long i = 0; i < uidRanges.size(); i++) { in verifyAppUidRules()
3986 uidRanges[i], action)); in verifyAppUidRules()
3989 uidRanges[i], action)); in verifyAppUidRules()
3992 uidRanges[i], action)); in verifyAppUidRules()
3996 for (unsigned long i = 0; i < uidRanges.size(); i++) { in verifyAppUidRules()
3999 uidRanges[i], action)); in verifyAppUidRules()
4002 uidRanges[i], action)); in verifyAppUidRules()
4005 uidRanges[i], action)); in verifyAppUidRules()
4012 verifyAppUidRules(move(expectedResults), uidRangeConfig.uidRanges, iface, in verifyAppUidRules()
4018 ASSERT_EQ(expectedResults.size(), uidRangeConfig.uidRanges.size()); in verifyVpnUidRules()
4027 for (unsigned long i = 0; i < uidRangeConfig.uidRanges.size(); i++) { in verifyVpnUidRules()
4029 uidRangeConfig.uidRanges[i], action)); in verifyVpnUidRules()
4032 uidRangeConfig.uidRanges[i], action)); in verifyVpnUidRules()
4035 uidRangeConfig.uidRanges[i], action, iface.c_str())); in verifyVpnUidRules()
4106 std::vector<UidRangeParcel> uidRanges = {makeUidRangeParcel(BASE_UID + 1, BASE_UID + 1), in TEST_F() local
4108 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, uidRanges).isOk()); in TEST_F()
4151 std::vector<UidRangeParcel> uidRanges = {makeUidRangeParcel(BASE_UID + 8005, BASE_UID + 8012), in TEST_F() local
4154 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, uidRanges).isOk()); in TEST_F()
4155 verifyAppUidRules({true, true} /*expectedResults*/, uidRanges, sTun.name(), in TEST_F()
4157 EXPECT_TRUE(mNetd->networkRemoveUidRanges(APP_DEFAULT_NETID, {uidRanges.at(0)}).isOk()); in TEST_F()
4158 verifyAppUidRules({false, true} /*expectedResults*/, uidRanges, sTun.name(), in TEST_F()
4160 EXPECT_TRUE(mNetd->networkRemoveUidRanges(APP_DEFAULT_NETID, {uidRanges.at(1)}).isOk()); in TEST_F()
4161 verifyAppUidRules({false, false} /*expectedResults*/, uidRanges, sTun.name(), in TEST_F()
4164 EXPECT_TRUE(mNetd->networkAddUidRanges(INetd::UNREACHABLE_NET_ID, uidRanges).isOk()); in TEST_F()
4165 verifyAppUidRules({true, true} /*expectedResults*/, uidRanges, "", in TEST_F()
4167 EXPECT_TRUE(mNetd->networkRemoveUidRanges(INetd::UNREACHABLE_NET_ID, {uidRanges.at(0)}).isOk()); in TEST_F()
4168 verifyAppUidRules({false, true} /*expectedResults*/, uidRanges, "", in TEST_F()
4170 EXPECT_TRUE(mNetd->networkRemoveUidRanges(INetd::UNREACHABLE_NET_ID, {uidRanges.at(1)}).isOk()); in TEST_F()
4171 verifyAppUidRules({false, false} /*expectedResults*/, uidRanges, "", in TEST_F()
4533 uidRangeConfig.uidRanges = {makeUidRangeParcel(BASE_UID + 1, BASE_UID + 1), in TEST_F()
4672 uidRangeConfig1.uidRanges = {makeUidRangeParcel(TEST_UID3, TEST_UID3)}; in TEST_F()
4675 uidRangeConfig1.uidRanges = {makeUidRangeParcel(TEST_UID5, TEST_UID5)}; in TEST_F()
4683 uidRangeConfig2.uidRanges = {makeUidRangeParcel(TEST_UID4, TEST_UID4), in TEST_F()