2 # Copyright (C) 2011 OpenWrt.org
13 config_get cfgt
"$interface" TYPE
14 [ "$cfgt" == "interface" ] && config_get
"$interface" ifname
18 config_get TYPE
"$CONFIG_SECTION" TYPE
19 [ "interface" == "$TYPE" ] && {
20 config_get device
"$CONFIG_SECTION" ifname
21 [ -z "$device" ] && device
="$(get_ifname ${CONFIG_SECTION})"
22 config_set
"$CONFIG_SECTION" device
"$device"
30 echo '# Interface: '"$1"
31 echo '# Direction: '"$2"
40 config_get device
"$interface" device
41 config_get_bool enabled
"$interface" enabled
1
42 [ -z "$device" -o 1 -ne "$enabled" ] && {
45 config_get_bool halfduplex
"$interface" halfduplex
47 [ 1 -ne "$halfduplex" ] && {
49 print_comments
"$interface" "Egress" "Start"
50 tc
-s class show dev
"$device"
51 print_comments
"$interface" "Egress" "End"
54 print_comments
"$interface" "Ingress${halfduplex:+/Egress}" "Start"
55 tc
-s class show dev
"$(iptables -v -L PREROUTING -t mangle | awk '/IMQ: todev .*$/ && $6 ~ /'$device'/ {print "imq
"$12}')"
56 print_comments
"$interface" "Ingress${halfduplex:+/Egress}" "End"
59 [ -z "$1" ] && config_foreach interface_stats interface || interface_stats
"$1"