summaryrefslogtreecommitdiffstats
path: root/package/qos-scripts/files/usr/bin/qos-stat
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-10 12:32:29 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-10 12:32:29 +0000
commit9c8997d54dc9df184bfcedeabf0b3c85cf5e6753 (patch)
tree46b83031a0da1b4458317413c00d13c252c72afa /package/qos-scripts/files/usr/bin/qos-stat
parenteecf5b17520f6b3b6ffb45ac7dca298d93b27501 (diff)
packages: sort network related packages into package/network/
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33688 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/qos-scripts/files/usr/bin/qos-stat')
-rwxr-xr-xpackage/qos-scripts/files/usr/bin/qos-stat67
1 files changed, 0 insertions, 67 deletions
diff --git a/package/qos-scripts/files/usr/bin/qos-stat b/package/qos-scripts/files/usr/bin/qos-stat
deleted file mode 100755
index 78d163888..000000000
--- a/package/qos-scripts/files/usr/bin/qos-stat
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2011 OpenWrt.org
-
-. /lib/functions.sh
-
-include /lib/network
-
-get_ifname() {
- local interface="$1"
- local cfgt
-
- scan_interfaces
- config_get cfgt "$interface" TYPE
- [ "$cfgt" == "interface" ] && config_get "$interface" ifname
-}
-
-config_cb() {
- config_get TYPE "$CONFIG_SECTION" TYPE
- [ "interface" == "$TYPE" ] && {
- config_get device "$CONFIG_SECTION" ifname
- [ -z "$device" ] && device="$(get_ifname ${CONFIG_SECTION})"
- config_set "$CONFIG_SECTION" device "$device"
- }
-}
-
-config_load qos
-
-print_comments() {
- echo ''
- echo '# Interface: '"$1"
- echo '# Direction: '"$2"
- echo '# Stats: '"$3"
- echo ''
-}
-
-get_device() {
- ( config_load network; scan_interfaces; config_get "$1" ifname )
-}
-
-interface_stats() {
- local interface="$1"
- local device
-
- device="$(get_device "$interface")"
- [ -z "$device" ] && config_get device "$interface" device
- config_get_bool enabled "$interface" enabled 1
- [ -z "$device" -o 1 -ne "$enabled" ] && {
- return 1
- }
- config_get_bool halfduplex "$interface" halfduplex 0
-
- if [ 1 -ne "$halfduplex" ]; then
- unset halfduplex
- print_comments "$interface" "Egress" "Start"
- tc -s class show dev "$device"
- print_comments "$interface" "Egress" "End"
- id="root"
- else
- id=""
- fi
-
- print_comments "$interface" "Ingress${halfduplex:+/Egress}" "Start"
- tc -s class show dev "$(tc filter show dev $device $id | grep mirred | sed -e 's,.*\(ifb.*\)).*,\1,')"
- print_comments "$interface" "Ingress${halfduplex:+/Egress}" "End"
-}
-
-[ -z "$1" ] && config_foreach interface_stats interface || interface_stats "$1"