Ignore:
Timestamp:
2011-02-21T02:33:27+01:00 (6 years ago)
Author:
nbd
Message:

qos-scripts: drop the use of IMQ, use ifb and act_connmark instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/qos-scripts/files/usr/bin/qos-stat

    r25052 r25640  
    3434}        
    3535 
     36get_device() { 
     37        ( config_load network; scan_interfaces; config_get "$1" ifname ) 
     38} 
     39 
    3640interface_stats() { 
    3741        local interface="$1" 
    3842        local device 
    3943 
    40         config_get device "$interface" device 
     44        device="$(get_device "$interface")" 
     45        [ -z "$device" ] && config_get device "$interface" device 
    4146        config_get_bool enabled "$interface" enabled 1 
    4247        [ -z "$device" -o 1 -ne "$enabled" ] && { 
    4348                return 1 
    4449        } 
    45         config_get_bool halfduplex "$interface" halfduplex 
     50        config_get_bool halfduplex "$interface" halfduplex 0 
    4651 
    47         [ 1 -ne "$halfduplex" ] && { 
     52        if [ 1 -ne "$halfduplex" ]; then 
    4853                unset halfduplex 
    4954                print_comments "$interface" "Egress" "Start" 
    5055                tc -s class show dev "$device" 
    5156                print_comments "$interface" "Egress" "End" 
    52         } 
     57                id="root" 
     58        else 
     59                id="" 
     60        fi 
    5361 
    5462        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}')" 
     63        tc -s class show dev "$(tc filter show dev $device $id | grep mirred | sed -e 's,.*\(ifb.*\)).*,\1,')" 
    5664        print_comments "$interface" "Ingress${halfduplex:+/Egress}" "End" 
    5765} 
Note: See TracChangeset for help on using the changeset viewer.