Lines Matching refs:sTun
154 ASSERT_EQ(0, sTun.init()); in SetUpTestCase()
156 ASSERT_LE(sTun.name().size(), static_cast<size_t>(IFNAMSIZ)); in SetUpTestCase()
162 sTun.destroy(); in TearDownTestCase()
177 static TunInterface sTun; member in NetdBinderTest
181 TunInterface NetdBinderTest::sTun; member in NetdBinderTest
553 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
555 mNetd->networkAddInterface(TEST_NETID2, sTun.name()).serviceSpecificErrorCode()); in TEST_F()
558 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID2, sTun.name()).isOk()); in TEST_F()
568 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
573 std::string suffix = StringPrintf("lookup %s ", sTun.name().c_str()); in TEST_F()
621 struct sockaddr_in6 server6 = { .sin6_family = AF_INET6, .sin6_addr = sTun.dstAddr() }; in fakeRemoteSocketPair()
629 struct sockaddr_in6 client6 = { .sin6_family = AF_INET6, .sin6_addr = sTun.srcAddr() }; in fakeRemoteSocketPair()
835 sTun.name(), td.addrString, td.prefixLength); in TEST_F()
845 EXPECT_TRUE(interfaceHasAddress(sTun.name(), td.addrString, td.prefixLength)); in TEST_F()
847 EXPECT_FALSE(interfaceHasAddress(sTun.name(), td.addrString, -1)); in TEST_F()
851 status = mNetd->interfaceDelAddress(sTun.name(), td.addrString, td.prefixLength); in TEST_F()
860 EXPECT_FALSE(interfaceHasAddress(sTun.name(), td.addrString, -1)); in TEST_F()
888 {-1, INetd::CONF, sTun.name().c_str(), "arp_ignore", nullptr, EAFNOSUPPORT}, in TEST_F()
889 {INetd::IPV4, -1, sTun.name().c_str(), "arp_ignore", nullptr, EINVAL}, in TEST_F()
892 {INetd::IPV4, INetd::CONF, sTun.name().c_str(), "../all/arp_ignore", nullptr, EINVAL}, in TEST_F()
925 {INetd::IPV4, INetd::CONF, sTun.name().c_str(), "arp_ignore", "1", 0}, in TEST_F()
926 {-1, INetd::CONF, sTun.name().c_str(), "arp_ignore", "1", EAFNOSUPPORT}, in TEST_F()
927 {INetd::IPV4, -1, sTun.name().c_str(), "arp_ignore", "1", EINVAL}, in TEST_F()
930 {INetd::IPV4, INetd::CONF, sTun.name().c_str(), "../all/arp_ignore", "1", EINVAL}, in TEST_F()
931 {INetd::IPV6, INetd::NEIGH, sTun.name().c_str(), "ucast_solicit", "7", 0}, in TEST_F()
954 const std::string& tun = sTun.name(); in TEST_F()
1248 const std::string clatdName = StringPrintf("clatd-%s", sTun.name().c_str()); in TEST_F()
1253 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1259 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1262 status = mNetd->clatdStart(sTun.name(), "2001:db8:cafe:f00d::/64", &clatAddress); in TEST_F()
1267 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1272 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in TEST_F()
1275 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1281 EXPECT_EQ(0, sTun.addAddress(v6.c_str(), 64)); in TEST_F()
1284 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1289 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1296 status = mNetd->clatdStop(sTun.name()); in TEST_F()
1301 status = mNetd->clatdStop(sTun.name()); in TEST_F()
1307 EXPECT_TRUE(mNetd->networkRemoveRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in TEST_F()
1308 EXPECT_EQ(0, ifc_del_address(sTun.name().c_str(), v6.c_str(), 64)); in TEST_F()
1421 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1425 binder::Status status = mNetd->ipfwdAddInterfaceForward(sTun.name(), sTun2.name()); in TEST_F()
1427 expectIpfwdRuleExists(sTun.name().c_str(), sTun2.name().c_str()); in TEST_F()
1429 status = mNetd->ipfwdRemoveInterfaceForward(sTun.name(), sTun2.name()); in TEST_F()
1431 expectIpfwdRuleNotExists(sTun.name().c_str(), sTun2.name().c_str()); in TEST_F()
1556 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1558 binder::Status status = mNetd->bandwidthSetInterfaceQuota(sTun.name(), testQuotaBytes); in TEST_F()
1560 expectBandwidthInterfaceQuotaRuleExists(sTun.name().c_str(), testQuotaBytes); in TEST_F()
1562 status = mNetd->bandwidthRemoveInterfaceQuota(sTun.name()); in TEST_F()
1564 expectBandwidthInterfaceQuotaRuleDoesNotExist(sTun.name().c_str()); in TEST_F()
1574 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1576 binder::Status status = mNetd->bandwidthSetInterfaceQuota(sTun.name(), testAlertBytes); in TEST_F()
1577 status = mNetd->bandwidthSetInterfaceAlert(sTun.name(), testAlertBytes); in TEST_F()
1579 expectBandwidthInterfaceAlertRuleExists(sTun.name().c_str(), testAlertBytes); in TEST_F()
1581 status = mNetd->bandwidthRemoveInterfaceAlert(sTun.name()); in TEST_F()
1583 expectBandwidthInterfaceAlertRuleDoesNotExist(sTun.name().c_str()); in TEST_F()
1586 status = mNetd->bandwidthRemoveInterfaceQuota(sTun.name()); in TEST_F()
1588 expectBandwidthInterfaceQuotaRuleDoesNotExist(sTun.name().c_str()); in TEST_F()
1808 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1816 mNetd->networkAddRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1818 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1819 sTun.name().c_str()); in TEST_F()
1824 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1827 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1833 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1836 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1844 mNetd->networkAddRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1847 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1848 sTun.name().c_str()); in TEST_F()
1854 status = mNetd->networkRemoveRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1857 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1858 sTun.name().c_str()); in TEST_F()
1867 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1871 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1878 status = mNetd->networkRemoveLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, in TEST_F()
1882 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1892 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1896 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1903 status = mNetd->networkRemoveLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, in TEST_F()
1907 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1920 parcel.ifName = sTun.name(); in TEST_F()
1927 expectNetworkRouteExistsWithMtu(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1928 std::to_string(parcel.mtu), sTun.name().c_str()); in TEST_F()
1938 expectNetworkRouteExistsWithMtu(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1939 std::to_string(parcel.mtu), sTun.name().c_str()); in TEST_F()
1948 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1949 sTun.name().c_str()); in TEST_F()
1962 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1971 expectNetworkDefaultIpRuleExists(sTun.name().c_str()); in TEST_F()
1984 expectNetworkPermissionIpRuleExists(sTun.name().c_str(), INetd::PERMISSION_SYSTEM); in TEST_F()
1985 expectNetworkPermissionIptablesRuleExists(sTun.name().c_str(), INetd::PERMISSION_SYSTEM); in TEST_F()
1989 expectNetworkPermissionIpRuleExists(sTun.name().c_str(), INetd::PERMISSION_NONE); in TEST_F()
1990 expectNetworkPermissionIptablesRuleExists(sTun.name().c_str(), INetd::PERMISSION_NONE); in TEST_F()
2116 binder::Status status = mNetd->tetherInterfaceAdd(sTun.name()); in TEST_F()
2118 expectTetherInterfaceConfigureForIPv6Router(sTun.name()); in TEST_F()
2123 expectTetherInterfaceExists(ifList, sTun.name()); in TEST_F()
2125 status = mNetd->tetherInterfaceRemove(sTun.name()); in TEST_F()
2127 expectTetherInterfaceConfigureForIPv6Client(sTun.name()); in TEST_F()
2131 expectTetherInterfaceNotExists(ifList, sTun.name()); in TEST_F()
2137 "fe80::1%" + sTun.name()}; in TEST_F()
2475 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_ALLOW); in TEST_F()
2482 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_ALLOW); in TEST_F()
2484 expectFirewallInterfaceRuleAllowExists(sTun.name()); in TEST_F()
2486 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_DENY); in TEST_F()
2488 expectFireWallInterfaceRuleAllowDoesNotExist(sTun.name()); in TEST_F()
2801 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2803 binder::Status status = mNetd->interfaceGetCfg(sTun.name(), &interfaceCfgResult); in TEST_F()
2805 expectCurrentInterfaceConfigurationEquals(sTun.name(), interfaceCfgResult); in TEST_F()
2820 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2823 auto interfaceCfg = makeInterfaceCfgParcel(sTun.name(), testAddr, testPrefixLength, downFlags); in TEST_F()
2829 interfaceCfg = makeInterfaceCfgParcel(sTun.name(), testAddr, testPrefixLength, upFlags); in TEST_F()
2832 status = mNetd->interfaceClearAddrs(sTun.name()); in TEST_F()
2841 binder::Status status = mNetd->interfaceSetIPv6PrivacyExtensions(sTun.name(), true); in TEST_F()
2843 expectInterfaceIPv6PrivacyExtensions(sTun.name(), true); in TEST_F()
2846 status = mNetd->interfaceSetIPv6PrivacyExtensions(sTun.name(), false); in TEST_F()
2848 expectInterfaceIPv6PrivacyExtensions(sTun.name(), false); in TEST_F()
2858 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2860 auto interfaceCfg = makeInterfaceCfgParcel(sTun.name(), testAddr, testPrefixLength, noFlags); in TEST_F()
2865 status = mNetd->interfaceClearAddrs(sTun.name()); in TEST_F()
2867 expectInterfaceNoAddr(sTun.name()); in TEST_F()
2876 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2879 binder::Status status = mNetd->interfaceSetEnableIPv6(sTun.name(), false); in TEST_F()
2881 expectInterfaceEnableIPv6(sTun.name(), false); in TEST_F()
2884 status = mNetd->interfaceSetEnableIPv6(sTun.name(), true); in TEST_F()
2886 expectInterfaceEnableIPv6(sTun.name(), true); in TEST_F()
2897 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2899 binder::Status status = mNetd->interfaceSetMtu(sTun.name(), testMtu); in TEST_F()
2901 expectInterfaceMtu(sTun.name(), testMtu); in TEST_F()
2993 binder::Status status = mNetd->tetherAddForward(sTun.name(), sTun2.name()); in TEST_F()
2995 expectNatEnable(sTun.name(), sTun2.name()); in TEST_F()
2997 status = mNetd->tetherRemoveForward(sTun.name(), sTun2.name()); in TEST_F()
3076 std::string oldTunName = sTun.name(); in TEST_F()
3095 sTun.destroy(); in TEST_F()
3097 sTun.init(newTunName); in TEST_F()
3109 sTun.destroy(); in TEST_F()
3110 sTun.init(); in TEST_F()
3124 {StringPrintf("ndc network interface add %d %s", TEST_NETID1, sTun.name().c_str()), in TEST_F()
3126 {StringPrintf("ndc network interface remove %d %s", TEST_NETID1, sTun.name().c_str()), in TEST_F()
3128 {StringPrintf("ndc network interface add %d %s", TEST_NETID2, sTun.name().c_str()), in TEST_F()
3135 {"ndc ipfwd enable " + sTun.name(), in TEST_F()
3137 {"ndc ipfwd disable " + sTun.name(), in TEST_F()
3141 {"ndc ipfwd add " + sTun.name() + " " + sTun2.name(), in TEST_F()
3143 {"ndc ipfwd remove " + sTun.name() + " " + sTun2.name(), in TEST_F()
3185 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3189 StringPrintf("ndc network route add %d %s %s %s", TEST_NETID1, sTun.name().c_str(), in TEST_F()
3193 sTun.name().c_str(), td.testDest, td.testNextHop); in TEST_F()
3199 expectNetworkRouteExists(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
3200 sTun.name().c_str()); in TEST_F()
3204 expectNetworkRouteDoesNotExist(td.ipVersion, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
3205 sTun.name().c_str()); in TEST_F()
3268 sTun.destroy(); in createVpnNetworkWithUid()
3269 sTun.init(); in createVpnNetworkWithUid()
3275 EXPECT_TRUE(mNetd->networkAddInterface(fallthroughNetId, sTun.name()).isOk()); in createVpnNetworkWithUid()
3285 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in createVpnNetworkWithUid()
3443 expectVpnFallthroughWorks(mNetd.get(), false /* bypassable */, TEST_UID1, sTun, sTun2); in TEST_F()
3450 expectVpnFallthroughWorks(mNetd.get(), true /* bypassable */, TEST_UID1, sTun, sTun2); in TEST_F()
3485 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3486 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "2001:db8::/32", "").isOk()); in TEST_F()
3676 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3677 int fd1 = sTun.getFdForTesting(); in TEST_F()
3701 status = mNetd->tetherAddForward(tap.name(), sTun.name()); in TEST_F()
3703 status = mNetd->ipfwdAddInterfaceForward(tap.name(), sTun.name()); in TEST_F()
3710 TetherOffloadRuleParcel rule = makeTetherOffloadRule(sTun.ifindex(), tap.ifindex(), dstAddr, in TEST_F()
3718 status = mNetd->tetherOffloadSetInterfaceQuota(sTun.ifindex(), sizeof(pkt) * 2 - 1); in TEST_F()
3740 EXPECT_TRUE(mNetd->tetherOffloadGetAndClearStats(sTun.ifindex(), &tetherStats).isOk()); in TEST_F()
3746 EXPECT_EQ(sTun.ifindex(), tetherStats.ifIndex); in TEST_F()
3748 EXPECT_TRUE(mNetd->ipfwdRemoveInterfaceForward(tap.name(), sTun.name()).isOk()); in TEST_F()
3749 EXPECT_TRUE(mNetd->tetherRemoveForward(tap.name(), sTun.name()).isOk()); in TEST_F()
3754 EXPECT_TRUE(mNetd->networkRemoveInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()