• Home
  • Raw
  • Download

Lines Matching refs:binary

433 static int bandwidthDataSaverEnabled(const char *binary) {  in bandwidthDataSaverEnabled()  argument
434 std::vector<std::string> lines = listIptablesRule(binary, "bw_data_saver"); in bandwidthDataSaverEnabled()
456 size_t minSize = (std::string(binary) == IPTABLES_PATH) ? 3 : 9; in bandwidthDataSaverEnabled()
977 for (const auto& binary : { IPTABLES_PATH, IP6TABLES_PATH }) { in expectNoTestCounterRules()
978 std::string command = StringPrintf("%s -w -nvL tetherctrl_counters", binary); in expectNoTestCounterRules()
1069 static std::vector<std::string> listIptablesRuleByTable(const char* binary, const char* table, in listIptablesRuleByTable() argument
1071 std::string command = StringPrintf("%s -t %s -w -n -v -L %s", binary, table, chainName); in listIptablesRuleByTable()
1076 bool iptablesIdleTimerInterfaceRuleExists(const char* binary, const char* chainName, in iptablesIdleTimerInterfaceRuleExists() argument
1079 std::vector<std::string> rules = listIptablesRuleByTable(binary, table, chainName); in iptablesIdleTimerInterfaceRuleExists()
1094 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectIdletimerInterfaceRuleExists()
1095 EXPECT_TRUE(iptablesIdleTimerInterfaceRuleExists(binary, IDLETIMER_RAW_PREROUTING, ifname, in expectIdletimerInterfaceRuleExists()
1097 EXPECT_TRUE(iptablesIdleTimerInterfaceRuleExists(binary, IDLETIMER_MANGLE_POSTROUTING, in expectIdletimerInterfaceRuleExists()
1106 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectIdletimerInterfaceRuleNotExists()
1107 EXPECT_FALSE(iptablesIdleTimerInterfaceRuleExists(binary, IDLETIMER_RAW_PREROUTING, ifname, in expectIdletimerInterfaceRuleNotExists()
1109 EXPECT_FALSE(iptablesIdleTimerInterfaceRuleExists(binary, IDLETIMER_MANGLE_POSTROUTING, in expectIdletimerInterfaceRuleNotExists()
1149 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectStrictSetUidAccept()
1150 EXPECT_FALSE(iptablesRuleExists(binary, STRICT_OUTPUT, uidRule)); in expectStrictSetUidAccept()
1151 EXPECT_FALSE(iptablesRuleExists(binary, STRICT_CLEAR_CAUGHT, uidRule)); in expectStrictSetUidAccept()
1152 EXPECT_EQ(0, iptablesRuleLineLength(binary, perUidChain.c_str())); in expectStrictSetUidAccept()
1160 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectStrictSetUidLog()
1161 EXPECT_TRUE(iptablesRuleExists(binary, STRICT_OUTPUT, uidRule)); in expectStrictSetUidLog()
1162 EXPECT_TRUE(iptablesRuleExists(binary, STRICT_CLEAR_CAUGHT, uidRule)); in expectStrictSetUidLog()
1163 EXPECT_TRUE(iptablesRuleExists(binary, perUidChain.c_str(), logRule)); in expectStrictSetUidLog()
1171 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectStrictSetUidReject()
1172 EXPECT_TRUE(iptablesRuleExists(binary, STRICT_OUTPUT, uidRule)); in expectStrictSetUidReject()
1173 EXPECT_TRUE(iptablesRuleExists(binary, STRICT_CLEAR_CAUGHT, uidRule)); in expectStrictSetUidReject()
1174 EXPECT_TRUE(iptablesRuleExists(binary, perUidChain.c_str(), rejectRule)); in expectStrictSetUidReject()
1445 bool iptablesTargetsExists(const char* binary, int expectedCount, const char* table, in iptablesTargetsExists() argument
1448 std::vector<std::string> rules = listIptablesRuleByTable(binary, table, chainName); in iptablesTargetsExists()
1474 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectBandwidthInterfaceQuotaRuleExists()
1475 EXPECT_TRUE(iptablesTargetsExists(binary, 1, FILTER_TABLE, BANDWIDTH_INPUT, ifname, in expectBandwidthInterfaceQuotaRuleExists()
1477 EXPECT_TRUE(iptablesTargetsExists(binary, 1, FILTER_TABLE, BANDWIDTH_OUTPUT, ifname, in expectBandwidthInterfaceQuotaRuleExists()
1479 EXPECT_TRUE(iptablesTargetsExists(binary, 2, FILTER_TABLE, BANDWIDTH_FORWARD, ifname, in expectBandwidthInterfaceQuotaRuleExists()
1481 EXPECT_TRUE(iptablesRuleExists(binary, BANDWIDTH_COSTLY_IF.c_str(), BANDWIDTH_NAUGHTY)); in expectBandwidthInterfaceQuotaRuleExists()
1482 EXPECT_TRUE(iptablesRuleExists(binary, BANDWIDTH_COSTLY_IF.c_str(), quotaRule)); in expectBandwidthInterfaceQuotaRuleExists()
1491 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectBandwidthInterfaceQuotaRuleDoesNotExist()
1492 EXPECT_FALSE(iptablesTargetsExists(binary, 1, FILTER_TABLE, BANDWIDTH_INPUT, ifname, in expectBandwidthInterfaceQuotaRuleDoesNotExist()
1494 EXPECT_FALSE(iptablesTargetsExists(binary, 1, FILTER_TABLE, BANDWIDTH_OUTPUT, ifname, in expectBandwidthInterfaceQuotaRuleDoesNotExist()
1496 EXPECT_FALSE(iptablesTargetsExists(binary, 2, FILTER_TABLE, BANDWIDTH_FORWARD, ifname, in expectBandwidthInterfaceQuotaRuleDoesNotExist()
1498 EXPECT_FALSE(iptablesRuleExists(binary, BANDWIDTH_COSTLY_IF.c_str(), BANDWIDTH_NAUGHTY)); in expectBandwidthInterfaceQuotaRuleDoesNotExist()
1499 EXPECT_FALSE(iptablesRuleExists(binary, BANDWIDTH_COSTLY_IF.c_str(), quotaRule)); in expectBandwidthInterfaceQuotaRuleDoesNotExist()
1508 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectBandwidthInterfaceAlertRuleExists()
1509 EXPECT_TRUE(iptablesRuleExists(binary, BANDWIDTH_COSTLY_IF.c_str(), alertRule)); in expectBandwidthInterfaceAlertRuleExists()
1518 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectBandwidthInterfaceAlertRuleDoesNotExist()
1519 EXPECT_FALSE(iptablesRuleExists(binary, BANDWIDTH_COSTLY_IF.c_str(), alertRule)); in expectBandwidthInterfaceAlertRuleDoesNotExist()
1527 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectBandwidthGlobalAlertRuleExists()
1528 EXPECT_TRUE(iptablesRuleExists(binary, BANDWIDTH_ALERT, globalAlertRule)); in expectBandwidthGlobalAlertRuleExists()
1536 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectBandwidthManipulateSpecialAppRuleExists()
1537 EXPECT_TRUE(iptablesTargetsExists(binary, 1, FILTER_TABLE, chain, target, uidRule)); in expectBandwidthManipulateSpecialAppRuleExists()
1544 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectBandwidthManipulateSpecialAppRuleDoesNotExist()
1545 EXPECT_FALSE(iptablesRuleExists(binary, chain, uidRule)); in expectBandwidthManipulateSpecialAppRuleDoesNotExist()
1736 bool iptablesNetworkPermissionIptablesRuleExists(const char* binary, const char* chainName, in iptablesNetworkPermissionIptablesRuleExists() argument
1740 std::vector<std::string> rules = listIptablesRuleByTable(binary, table, chainName); in iptablesNetworkPermissionIptablesRuleExists()
1766 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectNetworkPermissionIptablesRuleExists()
1768 binary, ROUTECTRL_INPUT, ifName, networkIncomingPacketMarkRule, MANGLE_TABLE)); in expectNetworkPermissionIptablesRuleExists()
2291 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectFirewallWhitelistMode()
2292 EXPECT_TRUE(iptablesRuleExists(binary, FIREWALL_INPUT, dropRule)); in expectFirewallWhitelistMode()
2293 EXPECT_TRUE(iptablesRuleExists(binary, FIREWALL_OUTPUT, rejectRule)); in expectFirewallWhitelistMode()
2294 EXPECT_TRUE(iptablesRuleExists(binary, FIREWALL_FORWARD, rejectRule)); in expectFirewallWhitelistMode()
2299 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectFirewallBlacklistMode()
2300 EXPECT_EQ(2, iptablesRuleLineLength(binary, FIREWALL_INPUT)); in expectFirewallBlacklistMode()
2301 EXPECT_EQ(2, iptablesRuleLineLength(binary, FIREWALL_OUTPUT)); in expectFirewallBlacklistMode()
2302 EXPECT_EQ(2, iptablesRuleLineLength(binary, FIREWALL_FORWARD)); in expectFirewallBlacklistMode()
2306 bool iptablesFirewallInterfaceFirstRuleExists(const char* binary, const char* chainName, in iptablesFirewallInterfaceFirstRuleExists() argument
2309 std::vector<std::string> rules = listIptablesRuleByTable(binary, FILTER_TABLE, chainName); in iptablesFirewallInterfaceFirstRuleExists()
2326 bool iptablesFirewallInterfaceRuleExists(const char* binary, const char* chainName, in iptablesFirewallInterfaceRuleExists() argument
2329 std::vector<std::string> rules = listIptablesRuleByTable(binary, FILTER_TABLE, chainName); in iptablesFirewallInterfaceRuleExists()
2342 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectFirewallInterfaceRuleAllowExists()
2343 EXPECT_TRUE(iptablesFirewallInterfaceFirstRuleExists(binary, FIREWALL_INPUT, ifname, in expectFirewallInterfaceRuleAllowExists()
2345 EXPECT_TRUE(iptablesFirewallInterfaceFirstRuleExists(binary, FIREWALL_OUTPUT, ifname, in expectFirewallInterfaceRuleAllowExists()
2352 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectFireWallInterfaceRuleAllowDoesNotExist()
2354 iptablesFirewallInterfaceRuleExists(binary, FIREWALL_INPUT, ifname, returnRule)); in expectFireWallInterfaceRuleAllowDoesNotExist()
2356 iptablesFirewallInterfaceRuleExists(binary, FIREWALL_OUTPUT, ifname, returnRule)); in expectFireWallInterfaceRuleAllowDoesNotExist()
2360 bool iptablesFirewallUidFirstRuleExists(const char* binary, const char* chainName, in iptablesFirewallUidFirstRuleExists() argument
2363 std::vector<std::string> rules = listIptablesRuleByTable(binary, FILTER_TABLE, chainName); in iptablesFirewallUidFirstRuleExists()
2374 bool iptablesFirewallUidLastRuleExists(const char* binary, const char* chainName, in iptablesFirewallUidLastRuleExists() argument
2377 std::vector<std::string> rules = listIptablesRuleByTable(binary, FILTER_TABLE, chainName); in iptablesFirewallUidLastRuleExists()
2390 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) in expectFirewallUidFirstRuleExists()
2391 EXPECT_TRUE(iptablesFirewallUidFirstRuleExists(binary, chainName, targetReturn, uidRule)); in expectFirewallUidFirstRuleExists()
2396 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) in expectFirewallUidFirstRuleDoesNotExist()
2397 EXPECT_FALSE(iptablesFirewallUidFirstRuleExists(binary, chainName, targetReturn, uidRule)); in expectFirewallUidFirstRuleDoesNotExist()
2402 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) in expectFirewallUidLastRuleExists()
2403 EXPECT_TRUE(iptablesFirewallUidLastRuleExists(binary, chainName, targetDrop, uidRule)); in expectFirewallUidLastRuleExists()
2408 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) in expectFirewallUidLastRuleDoesNotExist()
2409 EXPECT_FALSE(iptablesFirewallUidLastRuleExists(binary, chainName, targetDrop, uidRule)); in expectFirewallUidLastRuleDoesNotExist()
2412 bool iptablesFirewallChildChainsLastRuleExists(const char* binary, const char* chainName) { in iptablesFirewallChildChainsLastRuleExists() argument
2414 listIptablesRuleByTable(binary, FILTER_TABLE, FIREWALL_INPUT); in iptablesFirewallChildChainsLastRuleExists()
2416 listIptablesRuleByTable(binary, FILTER_TABLE, FIREWALL_OUTPUT); in iptablesFirewallChildChainsLastRuleExists()
2430 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) in expectFirewallChildChainsLastRuleExists()
2431 EXPECT_TRUE(iptablesFirewallChildChainsLastRuleExists(binary, chainRule)); in expectFirewallChildChainsLastRuleExists()
2435 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectFirewallChildChainsLastRuleDoesNotExist()
2436 EXPECT_FALSE(iptablesRuleExists(binary, FIREWALL_INPUT, chainRule)); in expectFirewallChildChainsLastRuleDoesNotExist()
2437 EXPECT_FALSE(iptablesRuleExists(binary, FIREWALL_OUTPUT, chainRule)); in expectFirewallChildChainsLastRuleDoesNotExist()
2914 int iptablesCountRules(const char* binary, const char* table, const char* chainName) { in iptablesCountRules() argument
2915 return listIptablesRuleByTable(binary, table, chainName).size(); in iptablesCountRules()
2918 bool iptablesChainMatch(const char* binary, const char* table, const char* chainName, in iptablesChainMatch() argument
2920 std::vector<std::string> rules = listIptablesRuleByTable(binary, table, chainName); in iptablesChainMatch()
2966 for (const auto& binary : {IPTABLES_PATH, IP6TABLES_PATH}) { in expectNatEnable()
2967 EXPECT_TRUE(iptablesTargetsExists(binary, 2, FILTER_TABLE, TETHER_COUNTERS_CHAIN, intIf, in expectNatEnable()