English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Contents of /branches/freewrt_1_0/package/fwrtc/files/hotplug-fwrtc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3058 - (show annotations) (download)
Sun Jul 1 21:02:30 2007 UTC (6 years, 7 months ago) by n0-1
File size: 1565 byte(s)
integrating fwrtc also into 1.0, ok'ed by tha@

1 #!/bin/sh
2
3 TC=/usr/sbin/tc
4 CONF=/etc/fwrtc.conf
5
6 # run everything below in background to not disturb other scripts
7 (
8
9 [ -f "$CONF" ] || {
10 echo "configuration $CONF not found";
11 logger -t fwrtc "configuration $CONF not found";
12 exit 1;
13 }
14 . $CONF
15
16 # where we aren't needed
17 [ x"$DISABLE" = x"true" ] && exit 0
18 [ x"$ACTION" != x"register" ] && exit 0
19 [ x"$INTERFACE" != x"$DEV" ] && exit 0
20
21 logger -t fwrtc "Initialising QoS for device $DEV"
22
23 # first clean out old rules (if any)
24 cmd="$TC qdisc del dev $DEV"
25 $cmd root >/dev/null 2>&1
26 $cmd ingress >/dev/null 2>&1
27
28 # root qdiscs
29 cmd="$TC qdisc add dev $DEV"
30 $cmd root handle 1: htb default 20
31 $cmd handle ffff: ingress
32
33 # uplink classes
34 cmd="$TC class add dev $DEV parent"
35 $cmd 1: classid 1:1 htb rate $UP_MAX ceil $UP_MAX ${UP_BURST:+burst $UP_BURST}
36 $cmd 1:1 classid 1:10 htb rate $REAL_RATE ceil $REAL_CEIL prio 1
37 $cmd 1:1 classid 1:20 htb rate $BULK_RATE ceil $BULK_CEIL prio 2
38 $cmd 1:1 classid 1:30 htb rate $P2P_RATE ceil $P2P_CEIL prio 3
39
40 # sfq's for the above classes
41 cmd="$TC qdisc add dev $DEV parent"
42 $cmd 1:10 handle 10: sfq perturb 10
43 $cmd 1:20 handle 20: sfq perturb 10
44 $cmd 1:30 handle 30: sfq perturb 10
45
46
47 # handle iptables marks
48 cmd="$TC filter add dev $DEV parent 1: protocol ip prio 1 handle"
49 $cmd 1 fw flowid 1:10
50 $cmd 2 fw flowid 1:20
51 $cmd 3 fw flowid 1:30
52
53 # police ingress traffic
54 $TC filter add dev $DEV parent ffff:0 protocol ip prio 1 u32 \
55 match ip src 0.0.0.0/0 police rate $DOWN_MAX \
56 ${DOWN_BURST:+burst $DOWN_BURST} \
57 drop flowid ffff:1
58
59 logger -t fwrtc "finished initialisation"
60 ) &

Properties

Name Value
svn:executable *

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20