Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0
0003 
0004 CHECK_TC="yes"
0005 
0006 # Can be overridden by the configuration file. See lib.sh
0007 TC_HIT_TIMEOUT=${TC_HIT_TIMEOUT:=1000} # ms
0008 
0009 tc_check_packets()
0010 {
0011         local id=$1
0012         local handle=$2
0013         local count=$3
0014 
0015         busywait "$TC_HIT_TIMEOUT" until_counter_is "== $count" \
0016                  tc_rule_handle_stats_get "$id" "$handle" > /dev/null
0017 }
0018 
0019 tc_check_at_least_x_packets()
0020 {
0021         local id=$1
0022         local handle=$2
0023         local count=$3
0024 
0025         busywait "$TC_HIT_TIMEOUT" until_counter_is ">= $count" \
0026                  tc_rule_handle_stats_get "$id" "$handle" > /dev/null
0027 }
0028 
0029 tc_check_packets_hitting()
0030 {
0031         local id=$1
0032         local handle=$2
0033 
0034         busywait "$TC_HIT_TIMEOUT" until_counter_is "> 0" \
0035                  tc_rule_handle_stats_get "$id" "$handle" > /dev/null
0036 }