• Home
  • Raw
  • Download

Lines Matching refs:sTun

190         ASSERT_EQ(0, sTun.init());  in SetUpTestCase()
194 ASSERT_LE(sTun.name().size(), static_cast<size_t>(IFNAMSIZ)); in SetUpTestCase()
202 sTun.destroy(); in TearDownTestCase()
235 static TunInterface sTun; member in NetdBinderTest
241 TunInterface NetdBinderTest::sTun; member in NetdBinderTest
316 EXPECT_TRUE(testNetworkExistsButCannotConnect(mNetd, sTun, INetd::DUMMY_NET_ID)); in TEST_F()
317 EXPECT_TRUE(testNetworkExistsButCannotConnect(mNetd, sTun, INetd::LOCAL_NET_ID)); in TEST_F()
318 EXPECT_TRUE(testNetworkExistsButCannotConnect(mNetd, sTun, INetd::UNREACHABLE_NET_ID)); in TEST_F()
319 EXPECT_FALSE(testNetworkExistsButCannotConnect(mNetd, sTun, 77 /* not exist */)); in TEST_F()
641 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
643 mNetd->networkAddInterface(TEST_NETID2, sTun.name()).serviceSpecificErrorCode()); in TEST_F()
646 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID2, sTun.name()).isOk()); in TEST_F()
656 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
661 std::string action = StringPrintf("lookup %s ", sTun.name().c_str()); in TEST_F()
707 struct sockaddr_in6 server6 = { .sin6_family = AF_INET6, .sin6_addr = sTun.dstAddr() }; in fakeRemoteSocketPair()
715 struct sockaddr_in6 client6 = { .sin6_family = AF_INET6, .sin6_addr = sTun.srcAddr() }; in fakeRemoteSocketPair()
801 binder::Status status = mNetd->interfaceAddAddress(sTun.name(), kLinkLocalAddress, 64); in TEST_F()
817 sin6_1.sin6_scope_id = if_nametoindex(sTun.name().c_str()); in TEST_F()
988 sTun.name(), td.addrString, td.prefixLength); in TEST_F()
998 EXPECT_TRUE(interfaceHasAddress(sTun.name(), td.addrString, td.prefixLength)); in TEST_F()
1000 EXPECT_FALSE(interfaceHasAddress(sTun.name(), td.addrString, -1)); in TEST_F()
1004 status = mNetd->interfaceDelAddress(sTun.name(), td.addrString, td.prefixLength); in TEST_F()
1013 EXPECT_FALSE(interfaceHasAddress(sTun.name(), td.addrString, -1)); in TEST_F()
1041 {-1, INetd::CONF, sTun.name().c_str(), "arp_ignore", nullptr, EAFNOSUPPORT}, in TEST_F()
1042 {INetd::IPV4, -1, sTun.name().c_str(), "arp_ignore", nullptr, EINVAL}, in TEST_F()
1045 {INetd::IPV4, INetd::CONF, sTun.name().c_str(), "../all/arp_ignore", nullptr, EINVAL}, in TEST_F()
1078 {INetd::IPV4, INetd::CONF, sTun.name().c_str(), "arp_ignore", "1", 0}, in TEST_F()
1079 {-1, INetd::CONF, sTun.name().c_str(), "arp_ignore", "1", EAFNOSUPPORT}, in TEST_F()
1080 {INetd::IPV4, -1, sTun.name().c_str(), "arp_ignore", "1", EINVAL}, in TEST_F()
1083 {INetd::IPV4, INetd::CONF, sTun.name().c_str(), "../all/arp_ignore", "1", EINVAL}, in TEST_F()
1084 {INetd::IPV6, INetd::NEIGH, sTun.name().c_str(), "ucast_solicit", "7", 0}, in TEST_F()
1107 const std::string& tun = sTun.name(); in TEST_F()
1401 const std::string clatdName = StringPrintf("clatd-%s", sTun.name().c_str()); in TEST_F()
1406 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1414 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1417 status = mNetd->clatdStart(sTun.name(), "2001:db8:cafe:f00d::/64", &clatAddress); in TEST_F()
1422 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1427 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in TEST_F()
1430 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1436 EXPECT_EQ(0, sTun.addAddress(v6.c_str(), 64)); in TEST_F()
1439 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1444 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1451 status = mNetd->clatdStop(sTun.name()); in TEST_F()
1456 status = mNetd->clatdStop(sTun.name()); in TEST_F()
1462 EXPECT_TRUE(mNetd->networkRemoveRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in TEST_F()
1463 EXPECT_EQ(0, ifc_del_address(sTun.name().c_str(), v6.c_str(), 64)); in TEST_F()
1580 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1586 binder::Status status = mNetd->ipfwdAddInterfaceForward(sTun.name(), sTun2.name()); in TEST_F()
1588 expectIpfwdRuleExists(sTun.name().c_str(), sTun2.name().c_str()); in TEST_F()
1590 status = mNetd->ipfwdRemoveInterfaceForward(sTun.name(), sTun2.name()); in TEST_F()
1592 expectIpfwdRuleNotExists(sTun.name().c_str(), sTun2.name().c_str()); in TEST_F()
1702 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1704 binder::Status status = mNetd->bandwidthSetInterfaceQuota(sTun.name(), testQuotaBytes); in TEST_F()
1706 expectBandwidthInterfaceQuotaRuleExists(sTun.name().c_str(), testQuotaBytes); in TEST_F()
1708 status = mNetd->bandwidthRemoveInterfaceQuota(sTun.name()); in TEST_F()
1710 expectBandwidthInterfaceQuotaRuleDoesNotExist(sTun.name().c_str()); in TEST_F()
1722 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1724 binder::Status status = mNetd->bandwidthSetInterfaceQuota(sTun.name(), testAlertBytes); in TEST_F()
1725 status = mNetd->bandwidthSetInterfaceAlert(sTun.name(), testAlertBytes); in TEST_F()
1727 expectBandwidthInterfaceAlertRuleExists(sTun.name().c_str(), testAlertBytes); in TEST_F()
1729 status = mNetd->bandwidthRemoveInterfaceAlert(sTun.name()); in TEST_F()
1731 expectBandwidthInterfaceAlertRuleDoesNotExist(sTun.name().c_str()); in TEST_F()
1734 status = mNetd->bandwidthRemoveInterfaceQuota(sTun.name()); in TEST_F()
1736 expectBandwidthInterfaceQuotaRuleDoesNotExist(sTun.name().c_str()); in TEST_F()
1935 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1943 mNetd->networkAddRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1945 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1946 sTun.name().c_str()); in TEST_F()
1951 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1954 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1960 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1963 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1971 mNetd->networkAddRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1974 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1975 sTun.name().c_str()); in TEST_F()
1981 status = mNetd->networkRemoveRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1984 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1985 sTun.name().c_str()); in TEST_F()
1994 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1998 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2005 status = mNetd->networkRemoveLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, in TEST_F()
2009 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2019 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2023 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2030 status = mNetd->networkRemoveLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, in TEST_F()
2034 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2047 parcel.ifName = sTun.name(); in TEST_F()
2054 expectNetworkRouteExistsWithMtu(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2055 std::to_string(parcel.mtu), sTun.name().c_str()); in TEST_F()
2065 expectNetworkRouteExistsWithMtu(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2066 std::to_string(parcel.mtu), sTun.name().c_str()); in TEST_F()
2075 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2076 sTun.name().c_str()); in TEST_F()
2091 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2100 expectNetworkDefaultIpRuleExists(sTun.name().c_str()); in TEST_F()
2113 expectNetworkPermissionIpRuleExists(sTun.name().c_str(), INetd::PERMISSION_SYSTEM); in TEST_F()
2114 expectNetworkPermissionIptablesRuleExists(sTun.name().c_str(), INetd::PERMISSION_SYSTEM); in TEST_F()
2118 expectNetworkPermissionIpRuleExists(sTun.name().c_str(), INetd::PERMISSION_NONE); in TEST_F()
2119 expectNetworkPermissionIptablesRuleExists(sTun.name().c_str(), INetd::PERMISSION_NONE); in TEST_F()
2245 binder::Status status = mNetd->tetherInterfaceAdd(sTun.name()); in TEST_F()
2247 expectTetherInterfaceConfigureForIPv6Router(sTun.name()); in TEST_F()
2252 expectTetherInterfaceExists(ifList, sTun.name()); in TEST_F()
2254 status = mNetd->tetherInterfaceRemove(sTun.name()); in TEST_F()
2256 expectTetherInterfaceConfigureForIPv6Client(sTun.name()); in TEST_F()
2260 expectTetherInterfaceNotExists(ifList, sTun.name()); in TEST_F()
2266 "fe80::1%" + sTun.name()}; in TEST_F()
2518 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_ALLOW); in TEST_F()
2525 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_ALLOW); in TEST_F()
2527 expectFirewallInterfaceRuleAllowExists(sTun.name()); in TEST_F()
2529 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_DENY); in TEST_F()
2531 expectFireWallInterfaceRuleAllowDoesNotExist(sTun.name()); in TEST_F()
2742 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2744 binder::Status status = mNetd->interfaceGetCfg(sTun.name(), &interfaceCfgResult); in TEST_F()
2746 expectCurrentInterfaceConfigurationEquals(sTun.name(), interfaceCfgResult); in TEST_F()
2763 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2766 auto interfaceCfg = makeInterfaceCfgParcel(sTun.name(), testAddr, testPrefixLength, downFlags); in TEST_F()
2772 interfaceCfg = makeInterfaceCfgParcel(sTun.name(), testAddr, testPrefixLength, upFlags); in TEST_F()
2775 status = mNetd->interfaceClearAddrs(sTun.name()); in TEST_F()
2784 binder::Status status = mNetd->interfaceSetIPv6PrivacyExtensions(sTun.name(), true); in TEST_F()
2786 expectInterfaceIPv6PrivacyExtensions(sTun.name(), true); in TEST_F()
2789 status = mNetd->interfaceSetIPv6PrivacyExtensions(sTun.name(), false); in TEST_F()
2791 expectInterfaceIPv6PrivacyExtensions(sTun.name(), false); in TEST_F()
2803 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2805 auto interfaceCfg = makeInterfaceCfgParcel(sTun.name(), testAddr, testPrefixLength, noFlags); in TEST_F()
2810 status = mNetd->interfaceClearAddrs(sTun.name()); in TEST_F()
2812 expectInterfaceNoAddr(sTun.name()); in TEST_F()
2823 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2826 binder::Status status = mNetd->interfaceSetEnableIPv6(sTun.name(), false); in TEST_F()
2828 expectInterfaceEnableIPv6(sTun.name(), false); in TEST_F()
2831 status = mNetd->interfaceSetEnableIPv6(sTun.name(), true); in TEST_F()
2833 expectInterfaceEnableIPv6(sTun.name(), true); in TEST_F()
2846 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2848 binder::Status status = mNetd->interfaceSetMtu(sTun.name(), testMtu); in TEST_F()
2850 expectInterfaceMtu(sTun.name(), testMtu); in TEST_F()
2942 binder::Status status = mNetd->tetherAddForward(sTun.name(), sTun2.name()); in TEST_F()
2944 expectNatEnable(sTun.name(), sTun2.name()); in TEST_F()
2946 status = mNetd->tetherRemoveForward(sTun.name(), sTun2.name()); in TEST_F()
3023 std::string oldTunName = sTun.name(); in TEST_F()
3042 sTun.destroy(); in TEST_F()
3044 sTun.init(newTunName); in TEST_F()
3056 sTun.destroy(); in TEST_F()
3057 sTun.init(); in TEST_F()
3071 {StringPrintf("ndc network interface add %d %s", TEST_NETID1, sTun.name().c_str()), in TEST_F()
3073 {StringPrintf("ndc network interface remove %d %s", TEST_NETID1, sTun.name().c_str()), in TEST_F()
3075 {StringPrintf("ndc network interface add %d %s", TEST_NETID2, sTun.name().c_str()), in TEST_F()
3082 {"ndc ipfwd enable " + sTun.name(), in TEST_F()
3084 {"ndc ipfwd disable " + sTun.name(), in TEST_F()
3088 {"ndc ipfwd add " + sTun.name() + " " + sTun2.name(), in TEST_F()
3090 {"ndc ipfwd remove " + sTun.name() + " " + sTun2.name(), in TEST_F()
3134 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3138 StringPrintf("ndc network route add %d %s %s %s", TEST_NETID1, sTun.name().c_str(), in TEST_F()
3142 sTun.name().c_str(), td.testDest, td.testNextHop); in TEST_F()
3148 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
3149 sTun.name().c_str()); in TEST_F()
3153 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
3154 sTun.name().c_str()); in TEST_F()
3217 sTun.destroy(); in createVpnNetworkWithUid()
3218 sTun.init(); in createVpnNetworkWithUid()
3226 EXPECT_TRUE(mNetd->networkAddInterface(fallthroughNetId, sTun.name()).isOk()); in createVpnNetworkWithUid()
3239 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in createVpnNetworkWithUid()
3267 createAndSetDefaultNetwork(defaultNetId, sTun.name()); in createDefaultAndOtherPhysicalNetwork()
3268 EXPECT_TRUE(mNetd->networkAddRoute(defaultNetId, sTun.name(), "::/0", "").isOk()); in createDefaultAndOtherPhysicalNetwork()
3488 expectVpnFallthroughWorks(mNetd.get(), false /* bypassable */, TEST_UID1, sTun, sTun2); in TEST_F()
3495 expectVpnFallthroughWorks(mNetd.get(), true /* bypassable */, TEST_UID1, sTun, sTun2); in TEST_F()
3529 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3530 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "2001:db8::/32", "").isOk()); in TEST_F()
3742 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3743 int fd1 = sTun.getFdForTesting(); in TEST_F()
3744 EXPECT_TRUE(tcQdiscExists(sTun.name())); in TEST_F()
3769 status = mNetd->tetherAddForward(tap.name(), sTun.name()); in TEST_F()
3771 status = mNetd->ipfwdAddInterfaceForward(tap.name(), sTun.name()); in TEST_F()
3773 EXPECT_TRUE(tcFilterExists(sTun.name())); in TEST_F()
3779 TetherOffloadRuleParcel rule = makeTetherOffloadRule(sTun.ifindex(), tap.ifindex(), dstAddr, in TEST_F()
3787 status = mNetd->tetherOffloadSetInterfaceQuota(sTun.ifindex(), sizeof(pkt) * 2 - 1); in TEST_F()
3809 EXPECT_TRUE(mNetd->tetherOffloadGetAndClearStats(sTun.ifindex(), &tetherStats).isOk()); in TEST_F()
3815 EXPECT_EQ(sTun.ifindex(), tetherStats.ifIndex); in TEST_F()
3817 EXPECT_TRUE(mNetd->ipfwdRemoveInterfaceForward(tap.name(), sTun.name()).isOk()); in TEST_F()
3818 EXPECT_TRUE(mNetd->tetherRemoveForward(tap.name(), sTun.name()).isOk()); in TEST_F()
3823 EXPECT_TRUE(mNetd->networkRemoveInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3887 EXPECT_TRUE(mNetd->networkAddInterface(TEST_DUMP_NETID, sTun.name()).isOk()); in TEST_F()
3888 testData.push_back({StringPrintf("networkAddInterface(65123, %s)", sTun.name().c_str()), in TEST_F()
3889 StringPrintf("networkAddInterface.*65123.*%s", sTun.name().c_str())}); in TEST_F()
3892 parcel.ifName = sTun.name(); in TEST_F()
3901 sTun.name().c_str()), in TEST_F()
4104 EXPECT_TRUE(mNetd->networkAddInterface(APP_DEFAULT_NETID, sTun.name()).isOk()); in TEST_F()
4149 EXPECT_TRUE(mNetd->networkAddInterface(APP_DEFAULT_NETID, sTun.name()).isOk()); in TEST_F()
4155 verifyAppUidRules({true, true} /*expectedResults*/, uidRanges, sTun.name(), in TEST_F()
4158 verifyAppUidRules({false, true} /*expectedResults*/, uidRanges, sTun.name(), in TEST_F()
4161 verifyAppUidRules({false, false} /*expectedResults*/, uidRanges, sTun.name(), in TEST_F()
4184 int systemDefaultFd = sTun.getFdForTesting(); in TEST_F()
4222 int systemDefaultFd = sTun.getFdForTesting(); in TEST_F()
4263 int systemDefaultFd = sTun.getFdForTesting(); in TEST_F()
4336 int systemDefaultFd = sTun.getFdForTesting(); in TEST_P()
4399 expectedFd = sTun.getFdForTesting(); in TEST_P()
4459 int systemDefaultFd = sTun.getFdForTesting(); in TEST_P()
4543 createPhysicalNetwork(TEST_NETID1, sTun.name()); in TEST_F()
4544 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in TEST_F()
4552 verifyAppUidRules({true}, uidRangeConfig1, sTun.name()); in TEST_F()
4567 verifyAppUidRules({false}, uidRangeConfig1, sTun.name()); in TEST_F()
4571 verifyAppUidRules({false}, uidRangeConfig1, sTun.name()); in TEST_F()
4575 verifyAppUidRules({false}, uidRangeConfig1, sTun.name()); in TEST_F()
4589 EXPECT_TRUE(mNetd->networkAddInterface(VPN_NETID, sTun.name()).isOk()); in TEST_P()
4600 verifyVpnUidRules({true}, uidRangeConfig1, sTun.name(), isSecureVPN); in TEST_P()
4610 verifyVpnUidRules({false}, uidRangeConfig1, sTun.name(), isSecureVPN); in TEST_P()
4613 verifyVpnUidRules({false}, uidRangeConfig1, sTun.name(), isSecureVPN); in TEST_P()
4687 int systemDefaultFd = sTun.getFdForTesting(); in TEST_F()