mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
Make use of the params variables limit listing filter setup
Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
This commit is contained in:
@@ -53,5 +53,9 @@ function tc_egress_list()
|
|||||||
tc_init_clsact $DEV
|
tc_init_clsact $DEV
|
||||||
tc_egress_bpf_attach $DEV $BPF_OBJ
|
tc_egress_bpf_attach $DEV $BPF_OBJ
|
||||||
|
|
||||||
info "Listing egress filter on device"
|
# Practical to list egress filters after setup.
|
||||||
tc_egress_list $DEV
|
# (It's a common mistake to have several progs loaded)
|
||||||
|
if [[ -n $LIST ]]; then
|
||||||
|
info "Listing egress filter on device"
|
||||||
|
tc_egress_list $DEV
|
||||||
|
fi
|
||||||
|
|||||||
@@ -8,17 +8,18 @@
|
|||||||
function usage() {
|
function usage() {
|
||||||
echo ""
|
echo ""
|
||||||
echo "Usage: $0 [-vfh] --dev ethX"
|
echo "Usage: $0 [-vfh] --dev ethX"
|
||||||
echo " -d | --dev : (\$DEV) Ingress interface/device (required)"
|
echo " -d | --dev : (\$DEV) Ingress interface/device (required)"
|
||||||
echo " -v | --verbose : (\$VERBOSE) verbose"
|
echo " -v | --verbose : (\$VERBOSE) verbose"
|
||||||
echo " --flush : (\$FLUSH) Only flush (remove TC drop rules)"
|
echo " --flush : (\$FLUSH) Only flush (remove TC drop rules)"
|
||||||
echo " --dry-run : (\$DRYRUN) Dry-run only (echo tc commands)"
|
echo " --dry-run : (\$DRYRUN) Dry-run only (echo tc commands)"
|
||||||
echo " -s | --stats : (\$STATS) Call TC statistics command"
|
echo " -s | --stats : (\$STATS_ONLY) Call TC statistics command"
|
||||||
|
echo " -l | --list : (\$LIST) List TC filter setup after setup"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
# Using external program "getopt" to get --long-options
|
# Using external program "getopt" to get --long-options
|
||||||
OPTIONS=$(getopt -o vfshd: \
|
OPTIONS=$(getopt -o vfshd:l \
|
||||||
--long verbose,dry-run,flush,stats,help,dev: -- "$@")
|
--long verbose,dry-run,flush,stats,list,help,dev: -- "$@")
|
||||||
if (( $? != 0 )); then
|
if (( $? != 0 )); then
|
||||||
usage
|
usage
|
||||||
err 2 "Error calling getopt"
|
err 2 "Error calling getopt"
|
||||||
@@ -52,6 +53,10 @@ while true; do
|
|||||||
export STATS_ONLY=yes
|
export STATS_ONLY=yes
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-l | --list )
|
||||||
|
export LIST=yes
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-- )
|
-- )
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user