• Home
  • Raw
  • Download

Lines Matching refs:mNetd

168             mNetd = android::interface_cast<INetd>(binder);  in NetdBinderTest()
173 ASSERT_NE(nullptr, mNetd.get()); in SetUp()
177 mNetd->networkDestroy(TEST_NETID1); in TearDown()
178 mNetd->networkDestroy(TEST_NETID2); in TearDown()
179 mNetd->networkDestroy(TEST_NETID3); in TearDown()
180 mNetd->networkDestroy(TEST_NETID4); in TearDown()
183 if (mStoredDefaultNetwork >= 0) mNetd->networkSetDefault(mStoredDefaultNetwork); in TearDown()
234 sp<INetd> mNetd; member in NetdBinderTest
260 mNetd->isAlive(&isAlive); in TEST_F()
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()
343 status = mNetd->ipSecAddTunnelInterface(td.deviceName, td.localAddress, td.remoteAddress, in TEST_F()
351 status = mNetd->ipSecUpdateTunnelInterface(td.deviceName, td.localAddress, td.remoteAddress, in TEST_F()
356 status = mNetd->ipSecRemoveTunnelInterface(td.deviceName); in TEST_F()
371 binder::Status res = mNetd->ipSecSetEncapSocketOwner(sockFd, 1001); in TEST_F()
414 status = mNetd->ipSecAddSecurityPolicy(0, addrFamily, direction, "127.0.0.5", in TEST_F()
424 status = mNetd->ipSecDeleteSecurityPolicy(0, addrFamily, direction, 0, 0, 0); in TEST_F()
438 status = mNetd->ipSecAddSecurityPolicy(0, addrFamily, direction, "2001:db8::f00d", in TEST_F()
448 status = mNetd->ipSecDeleteSecurityPolicy(0, addrFamily, direction, 0, 0, 0); in TEST_F()
547 ASSERT_TRUE(enableDataSaver(mNetd, false)); in TEST_F()
551 ASSERT_TRUE(enableDataSaver(mNetd, false)); in TEST_F()
554 ASSERT_TRUE(enableDataSaver(mNetd, true)); in TEST_F()
557 ASSERT_TRUE(enableDataSaver(mNetd, true)); in TEST_F()
561 ASSERT_TRUE(enableDataSaver(mNetd, false)); in TEST_F()
631 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
632 EXPECT_EQ(EEXIST, mNetd->networkCreate(config).serviceSpecificErrorCode()); in TEST_F()
636 EXPECT_EQ(EEXIST, mNetd->networkCreate(config).serviceSpecificErrorCode()); in TEST_F()
639 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
645 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
646 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID2, sTun.name()).isOk()); in TEST_F()
647 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID2).isOk()); in TEST_F()
648 EXPECT_EQ(ENONET, mNetd->networkDestroy(TEST_NETID1).serviceSpecificErrorCode()); in TEST_F()
654 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
655 EXPECT_EQ(EEXIST, mNetd->networkCreate(config).serviceSpecificErrorCode()); in TEST_F()
656 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
663 EXPECT_TRUE(mNetd->networkAddUidRanges(TEST_NETID1, uidRanges).isOk()); in TEST_F()
667 EXPECT_TRUE(mNetd->networkRemoveUidRanges(TEST_NETID1, uidRanges).isOk()); in TEST_F()
670 EXPECT_TRUE(mNetd->networkAddUidRanges(TEST_NETID1, uidRanges).isOk()); in TEST_F()
672 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
675 EXPECT_EQ(ENONET, mNetd->networkDestroy(TEST_NETID1).serviceSpecificErrorCode()); in TEST_F()
686 ASSERT_TRUE(mNetd->networkRejectNonSecureVpn(true, uidRanges).isOk()); in TEST_F()
692 ASSERT_TRUE(mNetd->networkRejectNonSecureVpn(false, uidRanges).isOk()); in TEST_F()
698 binder::Status status = mNetd->networkRejectNonSecureVpn(false, uidRanges); in TEST_F()
769 EXPECT_TRUE(mNetd->socketDestroy(uidRanges, skipUids).isOk()); 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()
801 binder::Status status = mNetd->interfaceAddAddress(sTun.name(), kLinkLocalAddress, 64); in TEST_F()
803 status = mNetd->interfaceAddAddress(sTun2.name(), kLinkLocalAddress, 64); in TEST_F()
842 status = mNetd->interfaceDelAddress(sTun2.name(), kLinkLocalAddress, 64); in TEST_F()
987 binder::Status status = mNetd->interfaceAddAddress( in TEST_F()
1004 status = mNetd->interfaceDelAddress(sTun.name(), td.addrString, td.prefixLength); in TEST_F()
1022 mNetd->setProcSysNet(INetd::IPV6, INetd::CONF, tun.name(), "disable_ipv6", "1"); in TEST_F()
1024 status = mNetd->interfaceAddAddress(tun.name(), "2001:db8::1", 64); in TEST_F()
1054 mNetd->getProcSysNet(td.ipversion, td.which, td.ifname, td.parameter, &value); in TEST_F()
1090 mNetd->setProcSysNet(td.ipversion, td.which, td.ifname, td.parameter, td.value); in TEST_F()
1111 EXPECT_TRUE(mNetd->getProcSysNet(ipversion, category, tun, parameter, &value).isOk()); in TEST_F()
1116 EXPECT_TRUE(mNetd->setProcSysNet(ipversion, category, tun, parameter, std::to_string(2 * ival)) in TEST_F()
1118 EXPECT_TRUE(mNetd->getProcSysNet(ipversion, category, tun, parameter, &value).isOk()); in TEST_F()
1121 EXPECT_TRUE(mNetd->setProcSysNet(ipversion, category, tun, parameter, std::to_string(ival)) in TEST_F()
1123 EXPECT_TRUE(mNetd->getProcSysNet(ipversion, category, tun, parameter, &value).isOk()); in TEST_F()
1199 binder::Status status = mNetd->tetherGetStats(&statsVec); in TEST_F()
1284 status = mNetd->idletimerAddInterface(td.ifname, td.timeout, td.classLabel); in TEST_F()
1288 status = mNetd->idletimerRemoveInterface(td.ifname, td.timeout, td.classLabel); in TEST_F()
1338 status = mNetd->strictUidCleartextPenalty(uid, INetd::PENALTY_POLICY_LOG); in TEST_F()
1343 status = mNetd->strictUidCleartextPenalty(uid, INetd::PENALTY_POLICY_ACCEPT); in TEST_F()
1347 status = mNetd->strictUidCleartextPenalty(uid, INetd::PENALTY_POLICY_REJECT); in TEST_F()
1352 status = mNetd->strictUidCleartextPenalty(uid, INetd::PENALTY_POLICY_ACCEPT); in TEST_F()
1357 status = mNetd->strictUidCleartextPenalty(uid, wrongPolicy); in TEST_F()
1406 status = mNetd->clatdStart(sTun.name(), nat64Prefix, &clatAddress); in TEST_F()
1413 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
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()
1464 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
1525 binder::Status status = mNetd->ipfwdGetRequesterList(&requesterList); in TEST_F()
1532 status = mNetd->ipfwdEnableForwarding("TestRequester"); in TEST_F()
1536 status = mNetd->ipfwdEnabled(&ipfwdEnabled); in TEST_F()
1541 status = mNetd->ipfwdDisableForwarding("TestRequester"); in TEST_F()
1545 status = mNetd->ipfwdEnabled(&ipfwdEnabled); in TEST_F()
1551 status = mNetd->ipfwdDisableForwarding(requester); in TEST_F()
1557 status = mNetd->ipfwdEnabled(&ipfwdEnabled); in TEST_F()
1563 status = mNetd->ipfwdEnableForwarding(requester); in TEST_F()
1569 status = mNetd->ipfwdEnabled(&ipfwdEnabled); in TEST_F()
1579 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
1580 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
1583 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
1584 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID2, sTun2.name()).isOk()); in TEST_F()
1586 binder::Status status = mNetd->ipfwdAddInterfaceForward(sTun.name(), sTun2.name()); in TEST_F()
1590 status = mNetd->ipfwdRemoveInterfaceForward(sTun.name(), sTun2.name()); in TEST_F()
1701 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
1708 status = mNetd->bandwidthRemoveInterfaceQuota(sTun.name()); in TEST_F()
1713 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
1721 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
1729 status = mNetd->bandwidthRemoveInterfaceAlert(sTun.name()); in TEST_F()
1734 status = mNetd->bandwidthRemoveInterfaceQuota(sTun.name()); in TEST_F()
1739 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
1745 binder::Status status = mNetd->bandwidthSetGlobalAlert(testAlertBytes); in TEST_F()
1750 status = mNetd->bandwidthSetGlobalAlert(testAlertBytes); in TEST_F()
1934 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
1949 EXPECT_TRUE(mNetd->networkSetPermissionForUser(INetd::PERMISSION_SYSTEM, testUids).isOk()); in TEST_F()
1951 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1958 EXPECT_TRUE(mNetd->networkClearPermissionForUser(testUids).isOk()); in TEST_F()
1960 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
1971 mNetd->networkAddRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1981 status = mNetd->networkRemoveRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop); in TEST_F()
1992 EXPECT_TRUE(mNetd->networkSetPermissionForUser(INetd::PERMISSION_SYSTEM, testUids).isOk()); in TEST_F()
1994 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2005 status = mNetd->networkRemoveLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, in TEST_F()
2017 EXPECT_TRUE(mNetd->networkClearPermissionForUser(testUids).isOk()); in TEST_F()
2019 status = mNetd->networkAddLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, td.testNextHop, in TEST_F()
2030 status = mNetd->networkRemoveLegacyRoute(TEST_NETID1, sTun.name(), td.testDest, in TEST_F()
2051 binder::Status status = mNetd->networkAddRouteParcel(TEST_NETID1, parcel); in TEST_F()
2062 status = mNetd->networkUpdateRouteParcel(TEST_NETID1, parcel); in TEST_F()
2072 status = mNetd->networkRemoveRouteParcel(TEST_NETID1, parcel); in TEST_F()
2083 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
2090 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
2091 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2094 binder::Status status = mNetd->networkGetDefault(&mStoredDefaultNetwork); in TEST_F()
2098 status = mNetd->networkSetDefault(TEST_NETID1); in TEST_F()
2102 status = mNetd->networkClearDefault(); in TEST_F()
2107 status = mNetd->networkSetDefault(mStoredDefaultNetwork); in TEST_F()
2111 status = mNetd->networkSetPermissionForNetwork(TEST_NETID1, INetd::PERMISSION_SYSTEM); in TEST_F()
2116 status = mNetd->networkSetPermissionForNetwork(TEST_NETID1, INetd::PERMISSION_NONE); in TEST_F()
2122 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
2126 binder::Status status = mNetd->networkSetProtectAllow(TEST_UID1); in TEST_F()
2129 status = mNetd->networkCanProtect(TEST_UID1, &ret); in TEST_F()
2132 status = mNetd->networkSetProtectDeny(TEST_UID1); in TEST_F()
2137 EXPECT_TRUE(mNetd->networkClearPermissionForUser({TEST_UID1}).isOk()); in TEST_F()
2139 status = mNetd->networkCanProtect(TEST_UID1, &ret); in TEST_F()
2218 binder::Status status = mNetd->tetherStartWithConfiguration(config); in TEST_F()
2228 status = mNetd->tetherIsEnabled(&tetherEnabled); in TEST_F()
2232 status = mNetd->tetherStop(); in TEST_F()
2236 status = mNetd->tetherIsEnabled(&tetherEnabled); in TEST_F()
2245 binder::Status status = mNetd->tetherInterfaceAdd(sTun.name()); in TEST_F()
2250 status = mNetd->tetherInterfaceList(&ifList); in TEST_F()
2254 status = mNetd->tetherInterfaceRemove(sTun.name()); in TEST_F()
2258 status = mNetd->tetherInterfaceList(&ifList); in TEST_F()
2268 binder::Status status = mNetd->tetherDnsSet(TEST_NETID1, testDnsAddrs); in TEST_F()
2272 status = mNetd->tetherDnsList(&dnsList); in TEST_F()
2332 mNetd->tetherStop(); in TEST_F()
2333 mNetd->tetherInterfaceRemove(tun1.name()); in TEST_F()
2334 mNetd->tetherInterfaceRemove(tun2.name()); in TEST_F()
2344 binder::Status status = mNetd->tetherStop(); in TEST_F()
2349 status = mNetd->tetherInterfaceAdd(tun1.name()); in TEST_F()
2360 status = mNetd->tetherStartWithConfiguration(config); in TEST_F()
2368 status = mNetd->tetherInterfaceList(&ifList); in TEST_F()
2384 status = mNetd->tetherInterfaceAdd(tun2.name()); in TEST_F()
2394 status = mNetd->tetherStop(); in TEST_F()
2399 status = mNetd->tetherInterfaceRemove(tun1.name()); in TEST_F()
2402 status = mNetd->tetherInterfaceRemove(tun2.name()); in TEST_F()
2487 binder::Status status = mNetd->firewallSetFirewallType(INetd::FIREWALL_ALLOWLIST); in TEST_F()
2491 status = mNetd->firewallSetFirewallType(INetd::FIREWALL_DENYLIST); in TEST_F()
2496 mNetd->firewallSetFirewallType(INetd::FIREWALL_DENYLIST); in TEST_F()
2497 status = mNetd->firewallSetFirewallType(INetd::FIREWALL_DENYLIST); in TEST_F()
2502 mNetd->firewallSetFirewallType(INetd::FIREWALL_ALLOWLIST); in TEST_F()
2503 status = mNetd->firewallSetFirewallType(INetd::FIREWALL_ALLOWLIST); in TEST_F()
2508 status = mNetd->firewallSetFirewallType(INetd::FIREWALL_DENYLIST); in TEST_F()
2515 binder::Status status = mNetd->firewallSetFirewallType(INetd::FIREWALL_DENYLIST); in TEST_F()
2518 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_ALLOW); in TEST_F()
2522 status = mNetd->firewallSetFirewallType(INetd::FIREWALL_ALLOWLIST); in TEST_F()
2525 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_ALLOW); in TEST_F()
2529 status = mNetd->firewallSetInterfaceRule(sTun.name(), INetd::FIREWALL_RULE_DENY); in TEST_F()
2534 status = mNetd->firewallSetFirewallType(INetd::FIREWALL_DENYLIST); in TEST_F()
2730 binder::Status status = mNetd->interfaceGetList(&interfaceListResult); in TEST_F()
2741 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
2750 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
2762 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
2763 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2767 binder::Status status = mNetd->interfaceSetCfg(interfaceCfg); in TEST_F()
2773 status = mNetd->interfaceSetCfg(interfaceCfg); in TEST_F()
2775 status = mNetd->interfaceClearAddrs(sTun.name()); in TEST_F()
2779 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
2784 binder::Status status = mNetd->interfaceSetIPv6PrivacyExtensions(sTun.name(), true); in TEST_F()
2789 status = mNetd->interfaceSetIPv6PrivacyExtensions(sTun.name(), false); in TEST_F()
2802 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
2803 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
2806 binder::Status status = mNetd->interfaceSetCfg(interfaceCfg); in TEST_F()
2810 status = mNetd->interfaceClearAddrs(sTun.name()); in TEST_F()
2815 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
2822 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
2831 status = mNetd->interfaceSetEnableIPv6(sTun.name(), true); in TEST_F()
2836 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
2845 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
2853 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
2942 binder::Status status = mNetd->tetherAddForward(sTun.name(), sTun2.name()); in TEST_F()
2946 status = mNetd->tetherRemoveForward(sTun.name(), sTun2.name()); in TEST_F()
2988 updateAndCheckTcpBuffer(mNetd, testRmemValue, testWmemValue); in TEST_F()
2989 updateAndCheckTcpBuffer(mNetd, rmemValue, wmemValue); in TEST_F()
3013 mNetd->trafficSetNetPermForUids(INetd::PERMISSION_INTERNET, appUids); in TEST_F()
3015 mNetd->trafficSetNetPermForUids(INetd::PERMISSION_NONE, appUids); in TEST_F()
3017 mNetd->trafficSetNetPermForUids(INetd::PERMISSION_UNINSTALLED, appUids); in TEST_F()
3029 binder::Status status = mNetd->registerUnsolicitedEventListener( in TEST_F()
3133 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
3134 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3158 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
3163 binder::Status status = mNetd->getOemNetd(&binder); in TEST_F()
3225 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in createVpnNetworkWithUid()
3226 EXPECT_TRUE(mNetd->networkAddInterface(fallthroughNetId, sTun.name()).isOk()); in createVpnNetworkWithUid()
3232 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in createVpnNetworkWithUid()
3235 EXPECT_TRUE(mNetd->networkAddUidRanges(vpnNetId, {makeUidRangeParcel(uid, uid)}).isOk()); in createVpnNetworkWithUid()
3236 EXPECT_TRUE(mNetd->networkAddInterface(vpnNetId, sTun2.name()).isOk()); in createVpnNetworkWithUid()
3239 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in createVpnNetworkWithUid()
3241 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID2, sTun2.name(), "2001:db8::/32", "").isOk()); in createVpnNetworkWithUid()
3247 ASSERT_TRUE(mNetd->networkGetDefault(&mStoredDefaultNetwork).isOk()); in createAndSetDefaultNetwork()
3251 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in createAndSetDefaultNetwork()
3252 EXPECT_TRUE(mNetd->networkAddInterface(netId, interface).isOk()); in createAndSetDefaultNetwork()
3253 EXPECT_TRUE(mNetd->networkSetDefault(netId).isOk()); in createAndSetDefaultNetwork()
3260 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in createPhysicalNetwork()
3261 EXPECT_TRUE(mNetd->networkAddInterface(netId, interface).isOk()); in createPhysicalNetwork()
3268 EXPECT_TRUE(mNetd->networkAddRoute(defaultNetId, sTun.name(), "::/0", "").isOk()); in createDefaultAndOtherPhysicalNetwork()
3271 EXPECT_TRUE(mNetd->networkAddRoute(otherNetId, sTun2.name(), "::/0", "").isOk()); in createDefaultAndOtherPhysicalNetwork()
3282 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in createVpnAndOtherPhysicalNetwork()
3283 EXPECT_TRUE(mNetd->networkAddInterface(vpnNetId, sTun3.name()).isOk()); in createVpnAndOtherPhysicalNetwork()
3284 EXPECT_TRUE(mNetd->networkAddRoute(vpnNetId, sTun3.name(), "2001:db8::/32", "").isOk()); in createVpnAndOtherPhysicalNetwork()
3295 EXPECT_TRUE(mNetd->networkAddUidRanges(appDefaultNetId, appDefaultUidRanges).isOk()); in createVpnAndAppDefaultNetworkWithUid()
3297 EXPECT_TRUE(mNetd->networkAddUidRanges(vpnNetId, vpnUidRanges).isOk()); in createVpnAndAppDefaultNetworkWithUid()
3487 ASSERT_TRUE(mNetd->networkGetDefault(&mStoredDefaultNetwork).isOk()); in TEST_F()
3488 expectVpnFallthroughWorks(mNetd.get(), false /* bypassable */, TEST_UID1, sTun, sTun2); in TEST_F()
3494 ASSERT_TRUE(mNetd->networkGetDefault(&mStoredDefaultNetwork).isOk()); in TEST_F()
3495 expectVpnFallthroughWorks(mNetd.get(), true /* bypassable */, TEST_UID1, sTun, sTun2); in TEST_F()
3523 ASSERT_TRUE(mNetd->networkGetDefault(&mStoredDefaultNetwork).isOk()); in TEST_F()
3528 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); 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()
3531 EXPECT_TRUE(mNetd->networkSetDefault(TEST_NETID1).isOk()); in TEST_F()
3534 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
3535 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID2, sTun2.name()).isOk()); in TEST_F()
3539 ASSERT_TRUE(mNetd->getFwmarkForNetwork(TEST_NETID1, &maskMarkNet1).isOk()); in TEST_F()
3548 ASSERT_TRUE(mNetd->getFwmarkForNetwork(TEST_NETID2, &maskMarkNet2).isOk()); in TEST_F()
3553 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID2).isOk()); in TEST_F()
3554 EXPECT_TRUE(mNetd->networkDestroy(TEST_NETID1).isOk()); in TEST_F()
3595 auto status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3602 status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3609 status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3616 status = mNetd->tetherOffloadRuleRemove(rule); in TEST_F()
3622 status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3625 status = mNetd->tetherOffloadRuleRemove(rule); in TEST_F()
3631 status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3635 status = mNetd->tetherOffloadRuleRemove(rule); in TEST_F()
3641 status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3647 status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3653 EXPECT_TRUE(mNetd->tetherOffloadRuleRemove(rule).isOk()); in TEST_F()
3657 EXPECT_TRUE(mNetd->tetherOffloadRuleAdd(rule).isOk()); in TEST_F()
3658 EXPECT_TRUE(mNetd->tetherOffloadRuleRemove(rule).isOk()); in TEST_F()
3741 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
3742 EXPECT_TRUE(mNetd->networkAddInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3757 binder::Status status = mNetd->networkAddInterface(INetd::LOCAL_NET_ID, tap.name()); in TEST_F()
3759 status = mNetd->tetherInterfaceAdd(tap.name()); in TEST_F()
3765 status = mNetd->networkAddRoute(INetd::LOCAL_NET_ID, tap.name(), kDownstreamPrefix, ""); 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()
3781 status = mNetd->tetherOffloadRuleAdd(rule); in TEST_F()
3787 status = mNetd->tetherOffloadSetInterfaceQuota(sTun.ifindex(), sizeof(pkt) * 2 - 1); in TEST_F()
3806 EXPECT_TRUE(mNetd->tetherOffloadRuleRemove(rule).isOk()); in TEST_F()
3809 EXPECT_TRUE(mNetd->tetherOffloadGetAndClearStats(sTun.ifindex(), &tetherStats).isOk()); 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()
3819 EXPECT_TRUE(mNetd->networkRemoveRoute(INetd::LOCAL_NET_ID, tap.name(), kDownstreamPrefix, "") in TEST_F()
3821 EXPECT_TRUE(mNetd->tetherInterfaceRemove(tap.name()).isOk()); in TEST_F()
3822 EXPECT_TRUE(mNetd->networkRemoveInterface(INetd::LOCAL_NET_ID, tap.name()).isOk()); in TEST_F()
3823 EXPECT_TRUE(mNetd->networkRemoveInterface(TEST_NETID1, sTun.name()).isOk()); in TEST_F()
3859 sp<IBinder> binder = INetd::asBinder(mNetd); in TEST_F()
3874 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
3880 EXPECT_EQ(EEXIST, mNetd->networkCreate(config).serviceSpecificErrorCode()); in TEST_F()
3887 EXPECT_TRUE(mNetd->networkAddInterface(TEST_DUMP_NETID, sTun.name()).isOk()); in TEST_F()
3896 EXPECT_TRUE(mNetd->networkAddRouteParcel(TEST_DUMP_NETID, parcel).isOk()); in TEST_F()
3904 EXPECT_TRUE(mNetd->networkDestroy(TEST_DUMP_NETID).isOk()); in TEST_F()
3939 auto status = mNetd->tetherOffloadRuleAdd(emptyRule); in TEST_F()
3946 auto status = mNetd->tetherOffloadRuleRemove(emptyRule); in TEST_F()
3953 auto status = mNetd->tetherOffloadGetStats(&tetherStatsList); in TEST_F()
3959 auto status = mNetd->tetherOffloadSetInterfaceQuota(0 /* ifIndex */, 0 /* quotaBytes */); in TEST_F()
3966 auto status = mNetd->tetherOffloadGetAndClearStats(0 /* ifIndex */, &tetherStats); in TEST_F()
4103 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
4104 EXPECT_TRUE(mNetd->networkAddInterface(APP_DEFAULT_NETID, sTun.name()).isOk()); in TEST_F()
4108 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, uidRanges).isOk()); in TEST_F()
4111 status = mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4116 status = mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4121 status = mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4126 status = mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4131 status = mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4139 status = mNetd->networkAddUidRanges(APP_DEFAULT_NETID, selfOverlappedUidRanges); in TEST_F()
4148 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
4149 EXPECT_TRUE(mNetd->networkAddInterface(APP_DEFAULT_NETID, sTun.name()).isOk()); in TEST_F()
4154 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, uidRanges).isOk()); in TEST_F()
4157 EXPECT_TRUE(mNetd->networkRemoveUidRanges(APP_DEFAULT_NETID, {uidRanges.at(0)}).isOk()); in TEST_F()
4160 EXPECT_TRUE(mNetd->networkRemoveUidRanges(APP_DEFAULT_NETID, {uidRanges.at(1)}).isOk()); in TEST_F()
4164 EXPECT_TRUE(mNetd->networkAddUidRanges(INetd::UNREACHABLE_NET_ID, uidRanges).isOk()); in TEST_F()
4167 EXPECT_TRUE(mNetd->networkRemoveUidRanges(INetd::UNREACHABLE_NET_ID, {uidRanges.at(0)}).isOk()); in TEST_F()
4170 EXPECT_TRUE(mNetd->networkRemoveUidRanges(INetd::UNREACHABLE_NET_ID, {uidRanges.at(1)}).isOk()); in TEST_F()
4192 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4199 EXPECT_TRUE(mNetd->networkRemoveUidRanges(APP_DEFAULT_NETID, in TEST_F()
4206 EXPECT_TRUE(mNetd->networkAddUidRanges(INetd::UNREACHABLE_NET_ID, in TEST_F()
4213 EXPECT_TRUE(mNetd->networkRemoveUidRanges(INetd::UNREACHABLE_NET_ID, in TEST_F()
4233 EXPECT_TRUE(mNetd->networkAddUidRanges(INetd::UNREACHABLE_NET_ID, in TEST_F()
4240 EXPECT_TRUE(mNetd->networkRemoveUidRanges(INetd::UNREACHABLE_NET_ID, in TEST_F()
4245 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4272 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4282 EXPECT_TRUE(mNetd->networkAddUidRanges(INetd::UNREACHABLE_NET_ID, in TEST_F()
4290 EXPECT_TRUE(mNetd->networkRemoveUidRanges(APP_DEFAULT_NETID, in TEST_F()
4297 EXPECT_TRUE(mNetd->networkRemoveUidRanges(INetd::UNREACHABLE_NET_ID, in TEST_F()
4310 EXPECT_TRUE(mNetd->networkAddUidRanges(APP_DEFAULT_NETID, in TEST_F()
4476 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
4477 EXPECT_TRUE(mNetd->networkDestroy(config.netId).isOk()); in TEST_F()
4482 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_F()
4487 EXPECT_EQ(EINVAL, mNetd->networkCreate(wrongConfig).serviceSpecificErrorCode()); in TEST_F()
4492 EXPECT_EQ(EINVAL, mNetd->networkCreate(wrongConfig).serviceSpecificErrorCode()); in TEST_F()
4503 binder::Status status = mNetd->networkAddUidRangesParcel(uidRangeConfig); in TEST_F()
4509 status = mNetd->networkAddUidRangesParcel(uidRangeConfig); in TEST_F()
4516 status = mNetd->networkAddUidRangesParcel(uidRangeConfig); in TEST_F()
4523 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig).isOk()); in TEST_F()
4525 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig).isOk()); in TEST_F()
4528 status = mNetd->networkAddUidRangesParcel(uidRangeConfig); in TEST_F()
4535 status = mNetd->networkAddUidRangesParcel(uidRangeConfig); in TEST_F()
4544 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID1, sTun.name(), "::/0", "").isOk()); in TEST_F()
4546 EXPECT_TRUE(mNetd->networkAddRoute(TEST_NETID2, sTun2.name(), "::/0", "").isOk()); in TEST_F()
4551 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig1).isOk()); in TEST_F()
4556 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig2).isOk()); in TEST_F()
4562 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig3).isOk()); in TEST_F()
4566 EXPECT_TRUE(mNetd->networkRemoveUidRangesParcel(uidRangeConfig1).isOk()); in TEST_F()
4570 EXPECT_TRUE(mNetd->networkRemoveUidRangesParcel(uidRangeConfig2).isOk()); in TEST_F()
4574 EXPECT_TRUE(mNetd->networkRemoveUidRangesParcel(uidRangeConfig3).isOk()); in TEST_F()
4588 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_P()
4589 EXPECT_TRUE(mNetd->networkAddInterface(VPN_NETID, sTun.name()).isOk()); in TEST_P()
4593 EXPECT_TRUE(mNetd->networkCreate(config).isOk()); in TEST_P()
4594 EXPECT_TRUE(mNetd->networkAddInterface(VPN_NETID2, sTun2.name()).isOk()); in TEST_P()
4599 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig1).isOk()); in TEST_P()
4605 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig2).isOk()); in TEST_P()
4609 EXPECT_TRUE(mNetd->networkRemoveUidRangesParcel(uidRangeConfig1).isOk()); in TEST_P()
4612 EXPECT_TRUE(mNetd->networkRemoveUidRangesParcel(uidRangeConfig2).isOk()); in TEST_P()
4658 EXPECT_TRUE(mNetd->networkAddRoute(APP_DEFAULT_2_NETID, sTun4.name(), "::/0", "").isOk()); in TEST_F()
4663 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfigVpn).isOk()); in TEST_F()
4670 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig1).isOk()); in TEST_F()
4673 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig1).isOk()); in TEST_F()
4676 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig1).isOk()); in TEST_F()
4681 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig2).isOk()); in TEST_F()
4685 EXPECT_TRUE(mNetd->networkAddUidRangesParcel(uidRangeConfig2).isOk()); in TEST_F()
4700 EXPECT_TRUE(mNetd->networkRemoveUidRangesParcel(uidRangeConfig1).isOk()); in TEST_F()