| 1 | |
| 2 | |
| 3 |
|
| 4 | CHECK_TC="yes"
|
| 5 |
|
| 6 | |
| 7 | : "${TC_HIT_TIMEOUT:=1000}" |
| 8 |
|
| 9 | tc_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 |
|
| 19 | tc_check_at_least_x_packets()
|
| 20 | {
|
| 21 | local id=$1
|
| 22 | local handle=$2
|
| 23 | local count=$3
|
| 24 |
|
| 25 | busywait "$TC_HIT_TIMEOUT" until_counter_is ">= $count" \
|
| 26 | tc_rule_handle_stats_get "$id" "$handle" > /dev/null
|
| 27 | }
|
| 28 |
|
| 29 | tc_check_packets_hitting()
|
| 30 | {
|
| 31 | local id=$1
|
| 32 | local handle=$2
|
| 33 |
|
| 34 | busywait "$TC_HIT_TIMEOUT" until_counter_is "> 0" \
|
| 35 | tc_rule_handle_stats_get "$id" "$handle" > /dev/null
|
| 36 | }
|