1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4CHECK_TC="yes"
5
6# Can be overridden by the configuration file. See lib.sh
7TC_HIT_TIMEOUT=${TC_HIT_TIMEOUT:=1000} # ms
8
9tc_check_packets()
10{
11	local id=$1
12	local handle=$2
13	local count=$3
14
15	busywait "$TC_HIT_TIMEOUT" until_counter_is "== $count" \
16		 tc_rule_handle_stats_get "$id" "$handle" > /dev/null
17}
18
19tc_check_packets_hitting()
20{
21	local id=$1
22	local handle=$2
23
24	busywait "$TC_HIT_TIMEOUT" until_counter_is "> 0" \
25		 tc_rule_handle_stats_get "$id" "$handle" > /dev/null
26}
27