Lines Matching refs:ifName
1637 std::string ipRouteString(const std::string& ifName, const std::string& dst, in ipRouteString() argument
1645 dstString += " dev " + ifName; in ipRouteString()
1664 void expectNetworkRouteExistsWithMtu(const char* ipVersion, const std::string& ifName, in expectNetworkRouteExistsWithMtu() argument
1667 std::string routeString = ipRouteString(ifName, dst, nextHop, mtu); in expectNetworkRouteExistsWithMtu()
1668 EXPECT_TRUE(ipRouteExists(ipVersion, table, ipRouteString(ifName, dst, nextHop, mtu))) in expectNetworkRouteExistsWithMtu()
1672 void expectNetworkRouteExists(const char* ipVersion, const std::string& ifName, in expectNetworkRouteExists() argument
1675 expectNetworkRouteExistsWithMtu(ipVersion, ifName, dst, nextHop, "", table); in expectNetworkRouteExists()
1678 void expectNetworkRouteDoesNotExist(const char* ipVersion, const std::string& ifName, in expectNetworkRouteDoesNotExist() argument
1681 std::string routeString = ipRouteString(ifName, dst, nextHop, ""); in expectNetworkRouteDoesNotExist()
1682 EXPECT_FALSE(ipRouteExists(ipVersion, table, ipRouteString(ifName, dst, nextHop, ""))) in expectNetworkRouteDoesNotExist()
1696 void expectNetworkDefaultIpRuleExists(const char* ifName) { in expectNetworkDefaultIpRuleExists() argument
1698 StringPrintf("22000:\tfrom all fwmark 0x0/0xffff iif lo lookup %s", ifName); in expectNetworkDefaultIpRuleExists()
1713 void expectNetworkPermissionIpRuleExists(const char* ifName, int permission) { in expectNetworkPermissionIpRuleExists() argument
1718 "13000:\tfrom all fwmark 0x1ffdd/0x1ffff iif lo lookup %s", ifName); in expectNetworkPermissionIpRuleExists()
1722 "13000:\tfrom all fwmark 0x5ffdd/0x5ffff iif lo lookup %s", ifName); in expectNetworkPermissionIpRuleExists()
1726 "13000:\tfrom all fwmark 0xdffdd/0xdffff iif lo lookup %s", ifName); in expectNetworkPermissionIpRuleExists()
1751 void expectNetworkPermissionIptablesRuleExists(const char* ifName, int permission) { in expectNetworkPermissionIptablesRuleExists() argument
1768 binary, ROUTECTRL_INPUT, ifName, networkIncomingPacketMarkRule, MANGLE_TABLE)); in expectNetworkPermissionIptablesRuleExists()
1920 parcel.ifName = sTun.name(); in TEST_F()
2022 int getTetherAcceptIPv6Ra(const std::string& ifName) { in getTetherAcceptIPv6Ra() argument
2023 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/accept_ra", ifName.c_str()); in getTetherAcceptIPv6Ra()
2027 bool getTetherAcceptIPv6Dad(const std::string& ifName) { in getTetherAcceptIPv6Dad() argument
2028 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/accept_dad", ifName.c_str()); in getTetherAcceptIPv6Dad()
2032 int getTetherIPv6DadTransmits(const std::string& ifName) { in getTetherIPv6DadTransmits() argument
2033 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/dad_transmits", ifName.c_str()); in getTetherIPv6DadTransmits()
2037 bool getTetherEnableIPv6(const std::string& ifName) { in getTetherEnableIPv6() argument
2038 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/disable_ipv6", ifName.c_str()); in getTetherEnableIPv6()
2043 bool interfaceListContains(const std::vector<std::string>& ifList, const std::string& ifName) { in interfaceListContains() argument
2045 if (iface == ifName) { in interfaceListContains()
2052 void expectTetherInterfaceConfigureForIPv6Router(const std::string& ifName) { in expectTetherInterfaceConfigureForIPv6Router() argument
2053 EXPECT_EQ(getTetherAcceptIPv6Ra(ifName), 0); in expectTetherInterfaceConfigureForIPv6Router()
2054 EXPECT_FALSE(getTetherAcceptIPv6Dad(ifName)); in expectTetherInterfaceConfigureForIPv6Router()
2055 EXPECT_EQ(getTetherIPv6DadTransmits(ifName), 0); in expectTetherInterfaceConfigureForIPv6Router()
2056 EXPECT_TRUE(getTetherEnableIPv6(ifName)); in expectTetherInterfaceConfigureForIPv6Router()
2059 void expectTetherInterfaceConfigureForIPv6Client(const std::string& ifName) { in expectTetherInterfaceConfigureForIPv6Client() argument
2060 EXPECT_EQ(getTetherAcceptIPv6Ra(ifName), 2); in expectTetherInterfaceConfigureForIPv6Client()
2061 EXPECT_TRUE(getTetherAcceptIPv6Dad(ifName)); in expectTetherInterfaceConfigureForIPv6Client()
2062 EXPECT_EQ(getTetherIPv6DadTransmits(ifName), 1); in expectTetherInterfaceConfigureForIPv6Client()
2063 EXPECT_FALSE(getTetherEnableIPv6(ifName)); in expectTetherInterfaceConfigureForIPv6Client()
2067 const std::string& ifName) { in expectTetherInterfaceExists() argument
2068 EXPECT_TRUE(interfaceListContains(ifList, ifName)); in expectTetherInterfaceExists()
2072 const std::string& ifName) { in expectTetherInterfaceNotExists() argument
2073 EXPECT_FALSE(interfaceListContains(ifList, ifName)); in expectTetherInterfaceNotExists()
2621 android::netdutils::StatusOr<ifreq> ioctlByIfName(const std::string& ifName, unsigned long flag) { in ioctlByIfName() argument
2627 strlcpy(ifr.ifr_name, ifName.c_str(), IFNAMSIZ); in ioctlByIfName()
2632 std::string getInterfaceHwAddr(const std::string& ifName) { in getInterfaceHwAddr() argument
2633 auto res = ioctlByIfName(ifName, SIOCGIFHWADDR); in getInterfaceHwAddr()
2643 int getInterfaceIPv4Prefix(const std::string& ifName) { in getInterfaceIPv4Prefix() argument
2644 auto res = ioctlByIfName(ifName, SIOCGIFNETMASK); in getInterfaceIPv4Prefix()
2655 std::string getInterfaceIPv4Addr(const std::string& ifName) { in getInterfaceIPv4Addr() argument
2656 auto res = ioctlByIfName(ifName, SIOCGIFADDR); in getInterfaceIPv4Addr()
2666 std::vector<std::string> getInterfaceFlags(const std::string& ifName) { in getInterfaceFlags() argument
2667 auto res = ioctlByIfName(ifName, SIOCGIFFLAGS); in getInterfaceFlags()
2698 int getInterfaceIPv6PrivacyExtensions(const std::string& ifName) { in getInterfaceIPv6PrivacyExtensions() argument
2699 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/use_tempaddr", ifName.c_str()); in getInterfaceIPv6PrivacyExtensions()
2703 bool getInterfaceEnableIPv6(const std::string& ifName) { in getInterfaceEnableIPv6() argument
2704 std::string path = StringPrintf("/proc/sys/net/ipv6/conf/%s/disable_ipv6", ifName.c_str()); in getInterfaceEnableIPv6()
2710 int getInterfaceMtu(const std::string& ifName) { in getInterfaceMtu() argument
2711 std::string path = StringPrintf("/sys/class/net/%s/mtu", ifName.c_str()); in getInterfaceMtu()
2719 void expectCurrentInterfaceConfigurationEquals(const std::string& ifName, in expectCurrentInterfaceConfigurationEquals() argument
2721 EXPECT_EQ(getInterfaceIPv4Addr(ifName), interfaceCfg.ipv4Addr); in expectCurrentInterfaceConfigurationEquals()
2722 EXPECT_EQ(getInterfaceIPv4Prefix(ifName), interfaceCfg.prefixLength); in expectCurrentInterfaceConfigurationEquals()
2723 EXPECT_EQ(getInterfaceHwAddr(ifName), interfaceCfg.hwAddr); in expectCurrentInterfaceConfigurationEquals()
2724 EXPECT_EQ(getInterfaceFlags(ifName), interfaceCfg.flags); in expectCurrentInterfaceConfigurationEquals()
2728 EXPECT_EQ(getInterfaceIPv4Addr(setCfg.ifName), setCfg.ipv4Addr); in expectCurrentInterfaceConfigurationAlmostEqual()
2729 EXPECT_EQ(getInterfaceIPv4Prefix(setCfg.ifName), setCfg.prefixLength); in expectCurrentInterfaceConfigurationAlmostEqual()
2731 const auto& ifFlags = getInterfaceFlags(setCfg.ifName); in expectCurrentInterfaceConfigurationAlmostEqual()
2737 void expectInterfaceIPv6PrivacyExtensions(const std::string& ifName, bool enable) { in expectInterfaceIPv6PrivacyExtensions() argument
2738 int v6PrivacyExtensions = getInterfaceIPv6PrivacyExtensions(ifName); in expectInterfaceIPv6PrivacyExtensions()
2742 void expectInterfaceNoAddr(const std::string& ifName) { in expectInterfaceNoAddr() argument
2744 EXPECT_EQ(getInterfaceIPv4Addr(ifName), "0.0.0.0"); in expectInterfaceNoAddr()
2746 EXPECT_EQ(getInterfaceIPv4Prefix(ifName), 0); in expectInterfaceNoAddr()
2749 void expectInterfaceEnableIPv6(const std::string& ifName, bool enable) { in expectInterfaceEnableIPv6() argument
2750 int enableIPv6 = getInterfaceEnableIPv6(ifName); in expectInterfaceEnableIPv6()
2754 void expectInterfaceMtu(const std::string& ifName, const int mtu) { in expectInterfaceMtu() argument
2755 int mtuSize = getInterfaceMtu(ifName); in expectInterfaceMtu()
2759 InterfaceConfigurationParcel makeInterfaceCfgParcel(const std::string& ifName, in makeInterfaceCfgParcel() argument
2763 cfg.ifName = ifName; in makeInterfaceCfgParcel()
3351 void expectVpnFallthroughRuleExists(const std::string& ifName, int vpnNetId) { in expectVpnFallthroughRuleExists() argument
3354 RULE_PRIORITY_VPN_FALLTHROUGH, vpnNetId, ifName.c_str()); in expectVpnFallthroughRuleExists()