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"
37 ( config_load network
; scan_interfaces
; config_get
"$1" ifname
)
44 device
="$(get_device "$interface")"
45 [ -z "$device" ] && config_get device
"$interface" device
46 config_get_bool enabled
"$interface" enabled
1
47 [ -z "$device" -o 1 -ne "$enabled" ] && {
50 config_get_bool halfduplex
"$interface" halfduplex
0
52 if [ 1 -ne "$halfduplex" ]; then
54 print_comments
"$interface" "Egress" "Start"
55 tc
-s class show dev
"$device"
56 print_comments
"$interface" "Egress" "End"
62 print_comments
"$interface" "Ingress${halfduplex:+/Egress}" "Start"
63 tc
-s class show dev
"$(tc filter show dev $device $id | grep mirred | sed -e 's,.*\(ifb.*\)).*,\1,')"
64 print_comments
"$interface" "Ingress${halfduplex:+/Egress}" "End"
67 [ -z "$1" ] && config_foreach interface_stats interface || interface_stats
"$1"