1. Download SQUID 2.5 STABLE source
2. Download latest TOS marking ZPH patch (currently it is: squid-2.5.STABLE7-ToS_Hit.patch)
2. Go to your favourite temporary directory and decompress the source:
tar -zxvf squid-2.5.STABLEX.tar.gz

or, for the bzip2 archive:

tar -jxvf squid-2.5.STABLEX.tar.bz2
3. Change to SQUID's source directory and apply the patch with something like:
cd squid-2.5.STABLEX
gunzip -c squid-2.5.STABLEX-ToS_Hit.patch-YYYY-MM-DD.gz | patch -p1
4. Configure, compile and install.

How to use it

Recent ZPH TOS patches have several runtime options that must be set in squid.conf. After having patched and installed SQUID, it is time to start classifying HIT packets. Here is a simple example, that sends all packets carrying TCP protocol (protocol number 6) and a TOS field of 0x10 to class 1:60. The actual class creation is irrelevant here (Check out the Linux Advanced Routing and Traffic Control for more information).


....... class creation, other filters .....

$TC filter add dev $LANDEV parent 1:0 protocol ip prio 1 u32 \
match ip protocol 0x6 0xff \
match ip tos 0x10 0xff \
flowid 1:60