htb.init-v0.8.5_tos.patch 1.6 KB

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