+qos_iface_add() {
+ local iface="$1"
+
+ # 77 -> download root qdisc
+ # 78 -> upload root qdisc
+ # 79 -> fwmark
+
+ tc qdisc del dev "$iface" root handle 77:
+
+ if [ "$LIMIT_UP" -gt 0 -a "$LIMIT_DOWN" -gt 0 ]; then
+ tc qdisc add dev "$iface" root handle 77: htb
+
+ # assume maximum rate of 20.000 kilobit for wlan
+ tc class add dev "$iface" parent 77: classid 77:1 htb rate 20000kbit
+
+ # set download limit and burst
+ tc class add dev "$iface" parent 77:1 classid 77:10 htb \
+ rate ${LIMIT_DOWN}kbit ceil ${LIMIT_DOWN_BURST}kbit prio 2
+
+ tc qdisc add dev "$iface" parent 77:10 handle 78: sfq perturb 10
+
+ # adding ingress can result in "File exists" if qos-scripts are active
+ silent tc qdisc add dev "$iface" ingress