Lines Matching refs:ifName
1350 std::string ipRoutePrefix(const std::string& ifName, const std::string& dst, in ipRoutePrefix() argument
1375 prefixString += " dev " + ifName; in ipRoutePrefix()
1434 std::vector<std::string> ipRouteSubstrings(const std::string& ifName, const std::string& dst, in ipRouteSubstrings() argument
1438 routeSubstrings.push_back(ipRoutePrefix(ifName, dst, nextHop)); in ipRouteSubstrings()
1450 void expectNetworkRouteDoesNotExistWithMtu(const char* ipVersion, const std::string& ifName, in expectNetworkRouteDoesNotExistWithMtu() argument
1453 std::vector<std::string> routeSubstrings = ipRouteSubstrings(ifName, dst, nextHop, mtu); in expectNetworkRouteDoesNotExistWithMtu()
1458 void expectNetworkRouteExistsWithMtu(const char* ipVersion, const std::string& ifName, in expectNetworkRouteExistsWithMtu() argument
1461 std::vector<std::string> routeSubstrings = ipRouteSubstrings(ifName, dst, nextHop, mtu); in expectNetworkRouteExistsWithMtu()
1467 void expectVpnLocalExclusionRuleExists(const std::string& ifName, bool expectExists) { in expectVpnLocalExclusionRuleExists() argument
1468 std::string tableName = std::string(ifName + "_local"); in expectVpnLocalExclusionRuleExists()
1478 void expectNetworkRouteExists(const char* ipVersion, const std::string& ifName, in expectNetworkRouteExists() argument
1481 expectNetworkRouteExistsWithMtu(ipVersion, ifName, dst, nextHop, "", table); in expectNetworkRouteExists()
1484 void expectNetworkRouteDoesNotExist(const char* ipVersion, const std::string& ifName, in expectNetworkRouteDoesNotExist() argument
1487 expectNetworkRouteDoesNotExistWithMtu(ipVersion, ifName, dst, nextHop, "", table); in expectNetworkRouteDoesNotExist()
1490 void expectNetworkDefaultIpRuleExists(const char* ifName) { in expectNetworkDefaultIpRuleExists() argument
1493 RULE_PRIORITY_DEFAULT_NETWORK, ifName); in expectNetworkDefaultIpRuleExists()
1509 void expectNetworkPermissionIpRuleExists(const char* ifName, int permission) { in expectNetworkPermissionIpRuleExists() argument
1515 RULE_PRIORITY_EXPLICIT_NETWORK, ifName); in expectNetworkPermissionIpRuleExists()
1520 RULE_PRIORITY_EXPLICIT_NETWORK, ifName); in expectNetworkPermissionIpRuleExists()
1525 RULE_PRIORITY_EXPLICIT_NETWORK, ifName); in expectNetworkPermissionIpRuleExists()
1550 void expectNetworkPermissionIptablesRuleExists(const char* ifName, int permission) { in expectNetworkPermissionIptablesRuleExists() argument
1567 binary, ROUTECTRL_INPUT, ifName, networkIncomingPacketMarkRule, MANGLE_TABLE)); in expectNetworkPermissionIptablesRuleExists()
2210 parcel.ifName = sTun.name(); in TEST_F()
2262 parcel.ifName = sTun.name(); in TEST_F()
2369 int getTetherAcceptIPv6Ra(const std::string& ifName) { in getTetherAcceptIPv6Ra() argument
2370 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/accept_ra", ifName.c_str()); in getTetherAcceptIPv6Ra()
2374 bool getTetherAcceptIPv6Dad(const std::string& ifName) { in getTetherAcceptIPv6Dad() argument
2375 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/accept_dad", ifName.c_str()); in getTetherAcceptIPv6Dad()
2379 int getTetherIPv6DadTransmits(const std::string& ifName) { in getTetherIPv6DadTransmits() argument
2380 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/dad_transmits", ifName.c_str()); in getTetherIPv6DadTransmits()
2384 bool getTetherEnableIPv6(const std::string& ifName) { in getTetherEnableIPv6() argument
2385 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/disable_ipv6", ifName.c_str()); in getTetherEnableIPv6()
2390 bool interfaceListContains(const std::vector<std::string>& ifList, const std::string& ifName) { in interfaceListContains() argument
2392 if (iface == ifName) { in interfaceListContains()
2399 void expectTetherInterfaceConfigureForIPv6Router(const std::string& ifName) { in expectTetherInterfaceConfigureForIPv6Router() argument
2400 EXPECT_EQ(getTetherAcceptIPv6Ra(ifName), 0); in expectTetherInterfaceConfigureForIPv6Router()
2401 EXPECT_FALSE(getTetherAcceptIPv6Dad(ifName)); in expectTetherInterfaceConfigureForIPv6Router()
2402 EXPECT_EQ(getTetherIPv6DadTransmits(ifName), 0); in expectTetherInterfaceConfigureForIPv6Router()
2403 EXPECT_TRUE(getTetherEnableIPv6(ifName)); in expectTetherInterfaceConfigureForIPv6Router()
2406 void expectTetherInterfaceConfigureForIPv6Client(const std::string& ifName) { in expectTetherInterfaceConfigureForIPv6Client() argument
2407 EXPECT_EQ(getTetherAcceptIPv6Ra(ifName), 2); in expectTetherInterfaceConfigureForIPv6Client()
2408 EXPECT_TRUE(getTetherAcceptIPv6Dad(ifName)); in expectTetherInterfaceConfigureForIPv6Client()
2409 EXPECT_EQ(getTetherIPv6DadTransmits(ifName), 1); in expectTetherInterfaceConfigureForIPv6Client()
2410 EXPECT_FALSE(getTetherEnableIPv6(ifName)); in expectTetherInterfaceConfigureForIPv6Client()
2414 const std::string& ifName) { in expectTetherInterfaceExists() argument
2415 EXPECT_TRUE(interfaceListContains(ifList, ifName)); in expectTetherInterfaceExists()
2419 const std::string& ifName) { in expectTetherInterfaceNotExists() argument
2420 EXPECT_FALSE(interfaceListContains(ifList, ifName)); in expectTetherInterfaceNotExists()
2788 android::netdutils::StatusOr<ifreq> ioctlByIfName(const std::string& ifName, unsigned long flag) { in ioctlByIfName() argument
2794 strlcpy(ifr.ifr_name, ifName.c_str(), IFNAMSIZ); in ioctlByIfName()
2799 std::string getInterfaceHwAddr(const std::string& ifName) { in getInterfaceHwAddr() argument
2800 auto res = ioctlByIfName(ifName, SIOCGIFHWADDR); in getInterfaceHwAddr()
2810 int getInterfaceIPv4Prefix(const std::string& ifName) { in getInterfaceIPv4Prefix() argument
2811 auto res = ioctlByIfName(ifName, SIOCGIFNETMASK); in getInterfaceIPv4Prefix()
2822 std::string getInterfaceIPv4Addr(const std::string& ifName) { in getInterfaceIPv4Addr() argument
2823 auto res = ioctlByIfName(ifName, SIOCGIFADDR); in getInterfaceIPv4Addr()
2833 std::vector<std::string> getInterfaceFlags(const std::string& ifName) { in getInterfaceFlags() argument
2834 auto res = ioctlByIfName(ifName, SIOCGIFFLAGS); in getInterfaceFlags()
2865 int getInterfaceIPv6PrivacyExtensions(const std::string& ifName) { in getInterfaceIPv6PrivacyExtensions() argument
2866 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/use_tempaddr", ifName.c_str()); in getInterfaceIPv6PrivacyExtensions()
2870 bool getInterfaceEnableIPv6(const std::string& ifName) { in getInterfaceEnableIPv6() argument
2871 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/disable_ipv6", ifName.c_str()); in getInterfaceEnableIPv6()
2877 int getInterfaceMtu(const std::string& ifName) { in getInterfaceMtu() argument
2878 std::string path = StringPrintf("/sys/class/net/%s/mtu", ifName.c_str()); in getInterfaceMtu()
2886 void expectCurrentInterfaceConfigurationEquals(const std::string& ifName, in expectCurrentInterfaceConfigurationEquals() argument
2888 EXPECT_EQ(getInterfaceIPv4Addr(ifName), interfaceCfg.ipv4Addr); in expectCurrentInterfaceConfigurationEquals()
2889 EXPECT_EQ(getInterfaceIPv4Prefix(ifName), interfaceCfg.prefixLength); in expectCurrentInterfaceConfigurationEquals()
2890 EXPECT_EQ(getInterfaceHwAddr(ifName), interfaceCfg.hwAddr); in expectCurrentInterfaceConfigurationEquals()
2891 EXPECT_EQ(getInterfaceFlags(ifName), interfaceCfg.flags); in expectCurrentInterfaceConfigurationEquals()
2895 EXPECT_EQ(getInterfaceIPv4Addr(setCfg.ifName), setCfg.ipv4Addr); in expectCurrentInterfaceConfigurationAlmostEqual()
2896 EXPECT_EQ(getInterfaceIPv4Prefix(setCfg.ifName), setCfg.prefixLength); in expectCurrentInterfaceConfigurationAlmostEqual()
2898 const auto& ifFlags = getInterfaceFlags(setCfg.ifName); in expectCurrentInterfaceConfigurationAlmostEqual()
2904 void expectInterfaceIPv6PrivacyExtensions(const std::string& ifName, bool enable) { in expectInterfaceIPv6PrivacyExtensions() argument
2905 int v6PrivacyExtensions = getInterfaceIPv6PrivacyExtensions(ifName); in expectInterfaceIPv6PrivacyExtensions()
2909 void expectInterfaceNoAddr(const std::string& ifName) { in expectInterfaceNoAddr() argument
2911 EXPECT_EQ(getInterfaceIPv4Addr(ifName), "0.0.0.0"); in expectInterfaceNoAddr()
2913 EXPECT_EQ(getInterfaceIPv4Prefix(ifName), 0); in expectInterfaceNoAddr()
2916 void expectInterfaceEnableIPv6(const std::string& ifName, bool enable) { in expectInterfaceEnableIPv6() argument
2917 int enableIPv6 = getInterfaceEnableIPv6(ifName); in expectInterfaceEnableIPv6()
2921 void expectInterfaceMtu(const std::string& ifName, const int mtu) { in expectInterfaceMtu() argument
2922 int mtuSize = getInterfaceMtu(ifName); in expectInterfaceMtu()
2926 InterfaceConfigurationParcel makeInterfaceCfgParcel(const std::string& ifName, in makeInterfaceCfgParcel() argument
2930 cfg.ifName = ifName; in makeInterfaceCfgParcel()
3630 void expectVpnFallthroughRuleExists(const std::string& ifName, int vpnNetId) { in expectVpnFallthroughRuleExists() argument
3633 RULE_PRIORITY_VPN_FALLTHROUGH, vpnNetId, ifName.c_str()); in expectVpnFallthroughRuleExists()
3830 parcel.ifName = sTun.name(); in TEST_F()