blob: 438ba7d83962a8e6872586357609b0351501c267 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
--- a/htb.init
+++ b/htb.init
@@ -240,6 +240,10 @@
# Maximum packet size HTB creates rate maps for. The default should
# be sufficient for most cases, it certainly is for Ethernet.
#
+# TOS=<number> optional, default "none"
+#
+# TOS field
+#
### SFQ qdisc parameters
#
# The SFQ queueing discipline is a cheap way to fairly share class bandwidth
@@ -435,6 +439,7 @@
HTB_CLASS="RATE\|CEIL\|BURST\|CBURST\|PRIO\|LEAF\|MTU"
HTB_CLASS="$HTB_CLASS\|PRIO_RULE\|PRIO_MARK\|PRIO_REALM"
HTB_CLASS="$HTB_CLASS\|LIMIT\|QUANTUM\|PERTURB"
+HTB_CLASS="$HTB_CLASS\|TOS"
#############################################################################
@@ -646,7 +651,7 @@
### Set defaults & load class
MTU=""; LEAF=none; PERTURB=10
RATE=""; BURST=""; CEIL=""; CBURST=""
- PRIO=""; LIMIT=""; QUANTUM=""
+ PRIO=""; LIMIT=""; QUANTUM=""; TOS=""
PRIO_RULE=$PRIO_RULE_DEFAULT
PRIO_MARK=$PRIO_MARK_DEFAULT
@@ -868,12 +873,19 @@
u32_d="${DPORT:+match ip dport $DPORT $DMASK}"
u32_d="${DADDR:+match ip dst $DADDR} $u32_d"
+
+ u32_tos=""
+ if [ -n "$TOS" ]; then
+ u32_tos="match ip tos $TOS 0xff"
+ fi
+
+
### Uncomment the following if you want to see parsed rules
#echo "$rule: $u32_s $u32_d"
### Attach u32 filter to the appropriate class
tc filter add dev $DEVICE parent 1:0 protocol ip \
- prio $PRIO_RULE u32 $u32_s $u32_d classid 1:$CLASS
+ prio $PRIO_RULE u32 $u32_s $u32_d $u32_tos classid 1:$CLASS
done ### rule
[ "$1" = "compile" ] && echo
|